/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== DARK MODE ==================== */
.dark {
    background-color: #0B1120;
    color: #e2e8f0;
}

.dark body {
    background-color: #0B1120;
}

/* ==================== UTILITIES ==================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md-flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
    .lg-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg-col-span-2 { grid-column: span 2 / span 2; }
}

/* ==================== SPACING ==================== */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.m-4 { margin: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-auto { margin-top: auto; }
.ml-2 { margin-left: 0.5rem; }
.mr-24 { margin-right: 6rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ==================== TYPOGRAPHY ==================== */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.text-white { color: #ffffff; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-900 { color: #0f172a; }
.text-indigo-500 { color: #6366f1; }
.text-indigo-600 { color: #4f46e5; }
.text-blue-500 { color: #3b82f6; }
.text-green-500 { color: #22c55e; }
.text-green-600 { color: #16a34a; }
.text-red-500 { color: #ef4444; }
.text-amber-500 { color: #f59e0b; }
.text-amber-600 { color: #d97706; }
.text-yellow-400 { color: #facc15; }
.text-purple-600 { color: #9333ea; }

.dark .dark-text-white { color: #ffffff; }
.dark .dark-text-slate-200 { color: #e2e8f0; }
.dark .dark-text-slate-300 { color: #cbd5e1; }
.dark .dark-text-slate-400 { color: #94a3b8; }

/* ==================== BACKGROUNDS ==================== */
.bg-white { background-color: #ffffff; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-200 { background-color: #e2e8f0; }
.bg-slate-700 { background-color: #334155; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-900 { background-color: #0f172a; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-indigo-100 { background-color: #e0e7ff; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-500 { background-color: #22c55e; }
.bg-red-100 { background-color: #fee2e2; }
.bg-red-500 { background-color: #ef4444; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-purple-600 { background-color: #9333ea; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }
.bg-rose-500 { background-color: #f43f5e; }

.bg-transparent { background-color: transparent; }
.bg-opacity-10 { background-color: rgba(0, 0, 0, 0.1); }

.dark .dark-bg-slate-700 { background-color: #334155; }
.dark .dark-bg-slate-800 { background-color: #1e293b; }
.dark .dark-bg-slate-900 { background-color: #0f172a; }

/* ==================== BORDERS ==================== */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-l { border-left-width: 1px; }

.border-slate-100 { border-color: #f1f5f9; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-600 { border-color: #475569; }
.border-slate-700 { border-color: #334155; }
.border-indigo-600 { border-color: #4f46e5; }
.border-transparent { border-color: transparent; }

.dark .dark-border-slate-600 { border-color: #475569; }
.dark .dark-border-slate-700 { border-color: #334155; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* ==================== SIZING ==================== */
.w-7 { width: 1.75rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-80 { width: 20rem; }
.w-full { width: 100%; }

.h-7 { height: 1.75rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-24 { height: 6rem; }
.h-32 { height: 8rem; }
.h-80 { height: 20rem; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }

.min-h-screen { min-height: 100vh; }
.max-w-lg { max-width: 32rem; }
.max-h-60 { max-height: 15rem; }
.max-h-screen-90 { max-height: 90vh; }

/* ==================== POSITIONING ==================== */
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.sticky { position: sticky; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.left-2 { left: 0.5rem; }
.bottom-2 { bottom: 0.5rem; }
.top-3 { top: 0.75rem; }
.left-3 { left: 0.75rem; }
.-top-6 { top: -1.5rem; }
.-right-6 { right: -1.5rem; }

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* ==================== DISPLAY ==================== */
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

.shrink-0 { flex-shrink: 0; }

/* ==================== SHADOWS ==================== */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* ==================== OPACITY ==================== */
.opacity-0 { opacity: 0; }
.opacity-10 { opacity: 0.1; }
.opacity-50 { opacity: 0.5; }
.opacity-60 { opacity: 0.6; }
.opacity-70 { opacity: 0.7; }

/* ==================== TRANSITIONS ==================== */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }

/* ==================== TRANSFORMS ==================== */
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }
.rotate-3 { transform: rotate(3deg); }

/* ==================== GLASSMORPHISM ==================== */
.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* ==================== HOVER EFFECTS ==================== */
.hover-float {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-float:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.dark .hover-float:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

button:hover, .cursor-pointer:hover {
    opacity: 0.9;
}

.hover-bg-slate-50:hover { background-color: #f8fafc; }
.hover-bg-slate-100:hover { background-color: #f1f5f9; }
.hover-bg-indigo-700:hover { background-color: #4338ca; }
.hover-text-white:hover { color: #ffffff; }
.hover-text-red-500:hover { color: #ef4444; }

/* ==================== CUSTOM SCROLLBAR ==================== */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #475569;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==================== SIDEBAR TOOLTIP ==================== */
.sidebar-tooltip {
    position: absolute;
    right: 120%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background-color: #1e293b;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 50;
}

.group:hover .sidebar-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ==================== LOADING SPINNER ==================== */
.loading-spinner {
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==================== FORM INPUTS ==================== */
input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    outline: none;
    background-color: #ffffff;
    color: #1e293b;
    font-family: 'Tajawal', sans-serif;
}

input:focus, textarea:focus, select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dark input, .dark textarea, .dark select {
    background-color: #334155;
    border-color: #475569;
    color: #ffffff;
}

.dark input:focus, .dark textarea:focus, .dark select:focus {
    border-color: #6366f1;
}

/* ==================== BUTTONS ==================== */
button {
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== TABLE ==================== */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #f8fafc;
}

.dark thead {
    background-color: rgba(15, 23, 42, 0.5);
}

tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

.dark tbody tr {
    border-bottom: 1px solid #334155;
}

tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

td, th {
    padding: 0.75rem;
    text-align: right;
}

/* ==================== KANBAN ==================== */
.kanban-column-active {
    background-color: rgba(99, 102, 241, 0.1);
    border: 2px dashed #6366f1;
}

/* ==================== CURSOR ==================== */
.cursor-pointer { cursor: pointer; }
.cursor-grab { cursor: grab; }
.pointer-events-none { pointer-events: none; }

/* ==================== MISC ==================== */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whitespace-nowrap {
    white-space: nowrap;
}

.leading-none { line-height: 1; }
.leading-relaxed { line-height: 1.625; }

.tracking-tight { letter-spacing: -0.025em; }

.divide-y > * + * {
    border-top: 1px solid #f1f5f9;
}

.dark .divide-y > * + * {
    border-top: 1px solid #334155;
}

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ==================== BACKDROP ==================== */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.backdrop-blur-xl {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .mr-24 {
        margin-right: 0;
    }
}