/* ============================================
   ليان - Main Styles
   Modern Design System 2026
   ============================================ */

:root {
    /* Primary Palette - Deep Rose & Warm Pink */
    --primary-50: #fff1f7;
    --primary-100: #ffe4ef;
    --primary-200: #ffc9df;
    --primary-300: #ff9ec3;
    --primary-400: #ff639f;
    --primary-500: #f43f7b;
    --primary-600: #e11d5b;
    --primary-700: #c01048;
    --primary-800: #9e0e3e;
    --primary-900: #7c0d35;

    /* Gold Accent - Warmer, deeper */
    --gold-50: #fffcf0;
    --gold-100: #fef6d0;
    --gold-200: #feeaa0;
    --gold-300: #fdd866;
    --gold-400: #f9c23a;
    --gold-500: #e5a512;
    --gold-600: #c4800a;

    /* Neutrals - Cooler, more sophisticated */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Semantic Colors */
    --success: #059669;
    --success-light: #d1fae5;
    --success-bg: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --danger-bg: #fef2f2;
    --info: #4f46e5;
    --info-light: #e0e7ff;
    --info-bg: #eef2ff;

    /* Surfaces */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #831843 0%, #9d174d 50%, #be185d 100%);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Borders */
    --border-color: #e2e8f0;
    --border-radius-sm: 8px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-full: 9999px;

    /* Shadows — more refined depth */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 24px rgba(244, 63, 123, 0.15);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 10px 20px -5px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Typography */
    --font-family: 'Cairo', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Navbar — Premium Frosted Glass
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    z-index: 100;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.navbar.hidden {
    transform: translateY(-100%);
    pointer-events: none;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    color: white;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: var(--font-size-xl);
    box-shadow: 0 4px 14px rgba(244, 63, 123, 0.3);
    transition: transform var(--transition-spring);
}

.logo-icon:hover {
    transform: scale(1.05) rotate(-2deg);
}

.brand-name {
    font-size: var(--font-size-xl);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-name {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

.role-badge.admin {
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    color: var(--primary-700);
    border-color: var(--primary-200);
}

.role-badge.manager {
    background: linear-gradient(135deg, var(--info-bg), var(--info-light));
    color: var(--info);
    border-color: #c7d2fe;
}

.role-badge.rep {
    background: linear-gradient(135deg, var(--gold-50), var(--gold-100));
    color: var(--gold-600);
    border-color: var(--gold-200);
}

/* ============================================
   Main Content
   ============================================ */
#app {
    min-height: 100vh;
    transition: opacity var(--transition);
}

#app.with-navbar {
    padding-top: 64px;
}

/* ============================================
   Toast Notifications — Refined
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}

.toast {
    padding: var(--space-3) var(--space-6);
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
    min-width: 280px;
    text-align: center;
    border: 1px solid transparent;
}

.toast.success {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
}

.toast.error {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
}

.toast.warning {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
}

.toast.info {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
}

/* ============================================
   Modal — Premium glassmorphism
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.25s ease;
    padding: var(--space-4);
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-color);
    background: var(--gray-50);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.modal-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 34px;
    height: 34px;
    border: none;
    background: white;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-6);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(16px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   Scrollbar — Minimal & clean
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.w-full {
    width: 100%;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 0 var(--space-4);
        height: 56px;
    }

    .brand-name {
        font-size: var(--font-size-base);
    }

    .user-name {
        display: none;
    }

    #app.with-navbar {
        padding-top: 56px;
    }
}