:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --bg-main: #f1f5f9;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-dark: rgba(15, 23, 42, 0.8);
    --border: rgba(226, 232, 240, 0.7);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --card-radius: 1.25rem;
}

/* Premium Mesh Background with 3D Perspective */
body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-main);
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.03) 0, transparent 50%),
        radial-gradient(at 50% 0%, rgba(139, 92, 246, 0.03) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.03) 0, transparent 50%);
    color: var(--primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    perspective: 2000px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Simple & Clear Sidebar */
aside {
    background: #0f172a;
    /* Slate 900 */
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 3cm;
}

.sidebar-logo-area {
    @apply px-6 py-8 mb-4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 4px 16px;
    /* Floating Effect */
    color: #94a3b8;
    /* Slate 400 */
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    /* Pill Shape */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    color: #64748b;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    transform: translateX(-4px);
    /* RTL Slide */
}

.nav-link:hover svg {
    color: #e2e8f0;
}

.nav-link.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-link.active svg {
    color: #ffffff;
}

/* Header Adjustments - White Theme */
header {
    background: white !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

#page-title {
    color: #0f172a !important;
}

/* Main Content Spacing */
#content-area {
    margin-top: 2rem;
    margin-left: 2rem;
    margin-right: 2rem;
    padding: 0;
}

/* Details Section - Full Width */
#details-section {
    margin-left: -2rem !important;
    margin-right: -2rem !important;
}

/* Card & Glass UI */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-premium);
    @apply rounded-[1.5rem] p-8;
}

/* Modern Card Styles with 3D Effects */
.card-modern {
    background: white;
    border-radius: 2.5rem;
    padding: 1.5rem;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 8px 16px rgba(0, 0, 0, 0.08),
        0 16px 32px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    transform-style: preserve-3d;
}

.card-modern:hover {
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 12px 24px rgba(0, 0, 0, 0.12),
        0 24px 48px rgba(0, 0, 0, 0.08);
    transform: translateY(-8px) translateZ(20px) rotateX(2deg);
}

.card-compact {
    @apply card-modern;
    padding: 1rem;
}

.kpi-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 3rem !important;
    @apply p-8 border border-slate-100 relative;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 20px rgba(0, 0, 0, 0.08),
        0 20px 40px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateZ(0);
    transform-style: preserve-3d;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 3rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.kpi-card:hover {
    transform: translateY(-12px) translateZ(30px) rotateX(5deg) scale(1.02);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.08),
        0 20px 40px rgba(59, 130, 246, 0.15),
        0 30px 60px rgba(0, 0, 0, 0.12),
        inset 0 2px 0 rgba(255, 255, 255, 1);
    border-color: #3b82f6;
}

.kpi-card:hover::before {
    opacity: 1;
}

/* Enhanced 3D Button Styles */
.btn-primary {
    background: linear-gradient(145deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow:
        0 2px 4px rgba(59, 130, 246, 0.2),
        0 4px 8px rgba(59, 130, 246, 0.15),
        0 8px 16px rgba(59, 130, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateZ(0);
    transform-style: preserve-3d;
}

.btn-primary:hover {
    background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-3px) translateZ(10px) scale(1.02);
    box-shadow:
        0 4px 8px rgba(59, 130, 246, 0.25),
        0 8px 16px rgba(59, 130, 246, 0.2),
        0 16px 32px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px) translateZ(5px) scale(0.98);
    box-shadow:
        0 1px 2px rgba(59, 130, 246, 0.3),
        0 2px 4px rgba(59, 130, 246, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    color: #475569;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 4px 8px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateZ(0);
}

.btn-secondary:hover {
    background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #cbd5e1;
    transform: translateY(-2px) translateZ(8px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.05);
}

.btn-secondary:active {
    transform: translateY(0) translateZ(3px);
}

.btn-ghost {
    background: transparent;
    color: #64748b;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-ghost:hover {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    color: #334155;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.813rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Loading & Empty States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #94a3b8;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* Premium 3D Inputs */
.input-premium {
    @apply w-full bg-slate-200 border border-slate-300 px-5 py-3.5 rounded-xl text-emerald-700 font-bold focus:bg-white;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.05),
        0 4px 8px rgba(0, 0, 0, 0.03),
        inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
}

.input-premium:focus {
    @apply border-blue-500;
    box-shadow:
        0 2px 4px rgba(59, 130, 246, 0.1),
        0 8px 16px rgba(59, 130, 246, 0.15),
        0 16px 32px rgba(59, 130, 246, 0.08),
        0 0 0 4px rgba(59, 130, 246, 0.1),
        inset 0 2px 4px rgba(59, 130, 246, 0.05);
    transform: translateY(-2px) translateZ(10px);
    outline: none;
}

.input-premium:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px) translateZ(5px);
}

.label-premium {
    @apply block text-xs font-black text-slate-500 mb-2 uppercase tracking-widest mr-1;
}

.btn-premium {
    @apply btn-primary relative overflow-hidden;
    background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%);
    @apply shadow-lg shadow-blue-500/30 text-white rounded-xl;
}

.btn-premium:hover {
    @apply shadow-xl shadow-blue-500/40 -translate-y-1;
}

/* Table Evolution */
.table-premium {
    @apply w-full;
    border-spacing: 0 10px;
    border-collapse: separate;
}

.table-premium thead th {
    @apply px-6 py-4 text-slate-400 font-black text-[10px] uppercase tracking-widest;
}

.table-premium tbody tr {
    @apply bg-white transition-all duration-500 hover:scale-[1.005] cursor-pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.table-premium tbody td {
    @apply px-6 py-5 first:rounded-r-2xl last:rounded-l-2xl border-y border-slate-50;
}

.table-premium tbody td:first-child {
    @apply border-r;
}

.table-premium tbody td:last-child {
    @apply border-l;
}

/* Modal Deluxe */
#recordsModal {
    backdrop-filter: blur(8px);
}

.modal-content-plus {
    @apply bg-white rounded-[2rem] shadow-[0_35px_60px_-15px_rgba(0, 0, 0, 0.2)] border border-slate-100 overflow-hidden translate-y-0 opacity-100 transition-all duration-500;
}

/* Skelton Loading */
.skeleton {
    @apply bg-slate-200 animate-pulse rounded-lg;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Section Header Decoration */
.section-marker {
    @apply w-12 h-1 bg-blue-500 rounded-full mb-4;
    box-shadow: 0 2px 10px var(--accent-glow);
}