/* ========================================================================
   BILLION DOLLAR SAAS THEME - MASTER STYLESHEET
   Theme: Premium Indigo (#4f46e5) | Font: Inter
   ======================================================================== */

:root {
    /* --- Brand Palette --- */
    --primary: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --primary-soft: #eef2ff; /* Indigo 50 */
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);

    /* --- functional Colors --- */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;

    /* --- Neutrals --- */
    --dark: #0f172a; /* Slate 900 (Headings/Sidebar) */
    --body: #334155; /* Slate 700 (Body Text) */
    --muted: #94a3b8; /* Slate 400 (Muted Text) */
    --border: #e2e8f0; /* Slate 200 (Borders) */
    --bg-body: #f8fafc; /* Slate 50 (Page Background) */
    --bg-surface: #ffffff; /* White (Cards/Nav) */

    /* --- Dimensions --- */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-md: 0.75rem; /* 12px */
    --radius-lg: 1rem; /* 16px */
    --radius-pill: 50rem; /* Round */

    /* --- Shadows --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* --- Transitions --- */
    --transition: all 0.2s ease;
}

/* ========================================================================
   GLOBAL RESET
   ======================================================================== */
body {
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        sans-serif;
    background-color: var(--bg-body);
    color: var(--body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--dark);
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* ========================================================================
   COMPONENTS: BUTTONS & INPUTS (SHARED)
   ======================================================================== */

/* Primary Button */
.btn-primary {
    background-color: var(--primary);
    border: 1px solid transparent;
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Secondary Button */
.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--dark);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-pill);
    font-weight: 500;
}
.btn-outline-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-soft);
}

/* Inputs */
.form-control,
.form-select {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(
        --radius-md
    ); /* Standard rounded for Admin, Pill for User if override */
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--dark);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    outline: none;
}

/* ========================================================================
   ADMIN SIDEBAR (FIXED DARK THEME)
   ======================================================================== */
.modern-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--dark); /* #0f172a */
    z-index: 1040;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1e293b;
    transition: transform 0.3s ease;
}

/* Logo Area */
.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b; /* Muted Slate */
    padding: 0 1rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.nav-link {
    color: #cbd5e1; /* Light Gray for visibility on Dark BG */
    padding: 0.75rem 1rem;
    margin: 0 0.25rem 0.25rem 0.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: #94a3b8; /* Icon color */
    transition: color 0.2s;
}

/* Sidebar Hover/Active */
.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}
.nav-link:hover i {
    color: #ffffff;
}

.nav-link.active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}
.nav-link.active i {
    color: #ffffff;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========================================================================
   ADMIN MAIN LAYOUT
   ======================================================================== */
.modern-container {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    background-color: var(--bg-body);
}

/* Admin Header */
.modern-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.modern-content {
    padding: 2rem;
    flex-grow: 1;
}

.modern-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ========================================================================
   USER SIDE NAVBAR (PRESERVED)
   ======================================================================== */
.navbar-saas {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: 80px;
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
}

.nav-icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--dark);
    background: transparent;
    transition: var(--transition);
}
.nav-icon-btn:hover {
    background-color: var(--primary-soft);
    color: var(--primary);
}

.cart-badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* ========================================================================
   UTILITIES
   ======================================================================== */
.text-primary {
    color: var(--primary) !important;
}
.bg-primary {
    background-color: var(--primary) !important;
}
.bg-primary-subtle {
    background-color: var(--primary-soft) !important;
}

/* User Avatar (Admin Header) */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(79, 70, 229, 0.3);
}

/* Card Improvements */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Responsive Toggles */
.sidebar-collapsed .modern-sidebar {
    transform: translateX(-100%);
}
.sidebar-collapsed .modern-container {
    margin-left: 0;
}

/* RTL Support */
body[dir="rtl"] .modern-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid #1e293b;
}
body[dir="rtl"] .modern-container {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}
body[dir="rtl"].sidebar-collapsed .modern-sidebar {
    transform: translateX(100%);
}
body[dir="rtl"].sidebar-collapsed .modern-container {
    margin-right: 0;
}
body[dir="rtl"] .header-content {
    flex-direction: row-reverse;
}
