/*
 * ASCA Selecção — Modern Design System v2
 * Rebuilt with gradient cards, glassmorphism accents, and refined typography
 */

/* ══════════════════════════════════════
   Design Tokens
   ══════════════════════════════════════ */
:root {
    /* Brand */
    --primary:         #2563eb;
    --primary-dark:    #1d4ed8;
    --primary-light:   #3b82f6;
    --primary-xlight:  #eff6ff;
    --accent:          #7c3aed;

    /* Semantic */
    --success:         #059669;
    --success-light:   #10b981;
    --success-xlight:  #ecfdf5;
    --danger:          #dc2626;
    --danger-light:    #ef4444;
    --danger-xlight:   #fef2f2;
    --warning:         #d97706;
    --warning-light:   #f59e0b;
    --warning-xlight:  #fffbeb;
    --info:            #0284c7;
    --info-light:      #0ea5e9;
    --info-xlight:     #f0f9ff;

    /* Neutrals */
    --dark:            #0f172a;
    --dark-2:          #1e293b;
    --dark-3:          #334155;
    --secondary:       #64748b;
    --muted:           #94a3b8;
    --light:           #f1f5f9;
    --light-2:         #f8fafc;
    --white:           #ffffff;
    --border:          #e2e8f0;
    --border-light:    #f1f5f9;

    /* Layout */
    --sidebar-bg:      linear-gradient(180deg, #0f172a 0%, #1a1040 100%);
    --sidebar-w:       268px;
    --navbar-h:        64px;
    --body-bg:         #f0f4f8;

    /* Typography */
    --font-family:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Radius */
    --radius-xs:       5px;
    --radius-sm:       10px;
    --radius:          14px;
    --radius-lg:       20px;
    --radius-full:     9999px;

    /* Shadows */
    --shadow-xs:       0 1px 2px rgba(0,0,0,.05);
    --shadow-sm:       0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
    --shadow:          0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.05);
    --shadow-md:       0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
    --shadow-lg:       0 20px 25px -5px rgba(0,0,0,.09), 0 10px 10px -5px rgba(0,0,0,.04);
    --shadow-xl:       0 25px 50px -12px rgba(0,0,0,.18);
    --shadow-primary:  0 8px 24px rgba(37,99,235,.28);
    --shadow-success:  0 8px 24px rgba(5,150,105,.28);
    --shadow-danger:   0 8px 24px rgba(220,38,38,.28);
    --shadow-warning:  0 8px 24px rgba(217,119,6,.28);
    --shadow-info:     0 8px 24px rgba(2,132,199,.28);

    /* Transitions */
    --transition:      all .22s cubic-bezier(.4,0,.2,1);
    --transition-fast: all .12s cubic-bezier(.4,0,.2,1);
    --transition-slow: all .4s  cubic-bezier(.4,0,.2,1);

    /* Skeleton */
    --skeleton-bg: #e2e8f0;
}

/* ══════════════════════════════════════
   Global Reset & Base
   ══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background: var(--body-bg);
    color: var(--dark-2);
    font-size: .9rem;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════
   Navbar
   ══════════════════════════════════════ */
.bg-navbar {
    background: linear-gradient(135deg, #0f172a 0%, #1a1040 100%) !important;
    height: var(--navbar-h);
    z-index: 1040;
    border-bottom: 1px solid rgba(255,255,255,.05);
}

.navbar-brand {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.3px;
    text-decoration: none;
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-primary);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #1a1040;
}

/* User Avatar with initials */
.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
    flex-shrink: 0;
}

/* Navbar dropdowns */
.navbar .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: .5rem;
    margin-top: .5rem !important;
    min-width: 210px;
}

.navbar .dropdown-item {
    border-radius: var(--radius-sm);
    font-size: .845rem;
    padding: .5rem .85rem;
    transition: var(--transition-fast);
    font-weight: 500;
}

.navbar .dropdown-item:hover {
    background: var(--light);
    color: var(--dark);
}

.navbar .dropdown-item.text-danger:hover {
    background: var(--danger-xlight);
    color: var(--danger);
}

/* Cycle selector */
#cycleSelectorNav {
    background: rgba(255,255,255,.08) !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    color: #fff !important;
    border-radius: var(--radius-sm) !important;
    font-size: .8rem !important;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

#cycleSelectorNav:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,.1) !important;
    outline: none;
}

#cycleSelectorNav option {
    background: #1a1040;
    color: #fff;
}

/* Navbar icon buttons */
.navbar .btn-link {
    line-height: 1;
    padding: .4rem .5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.navbar .btn-link:hover {
    background: rgba(255,255,255,.08);
}

/* ══════════════════════════════════════
   Sidebar
   ══════════════════════════════════════ */
.wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: var(--navbar-h);
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(255,255,255,.04);
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.sidebar-inner {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-section-title {
    font-size: .63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,.28);
    padding: .85rem 1.1rem .3rem;
    margin-top: .5rem;
}

.sidebar-nav {
    list-style: none;
    padding: .15rem .65rem;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .75rem;
    color: rgba(255,255,255,.58);
    text-decoration: none;
    font-size: .845rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    margin-bottom: 2px;
}

.sidebar-nav li a:hover {
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.9);
    transform: translateX(3px);
}

.sidebar-nav li.active a {
    background: linear-gradient(135deg, rgba(37,99,235,.32) 0%, rgba(124,58,237,.22) 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

/* Nav icon box */
.nav-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
    background: rgba(255,255,255,.05);
    transition: var(--transition-fast);
}

.sidebar-nav li.active a .nav-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 4px 12px rgba(37,99,235,.45);
}

.sidebar-nav li a:hover .nav-icon {
    background: rgba(255,255,255,.1);
}

.sidebar-footer {
    padding: .85rem 1.1rem;
    border-top: 1px solid rgba(255,255,255,.06);
    text-align: center;
}

/* ══════════════════════════════════════
   Main Content
   ══════════════════════════════════════ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    transition: var(--transition);
    min-width: 0;
    overflow-x: hidden;
}

/* ══════════════════════════════════════
   Page Header
   ══════════════════════════════════════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: .75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    color: var(--dark);
    letter-spacing: -.3px;
}

.page-header .breadcrumb {
    font-size: .77rem;
    margin: .2rem 0 0;
}

/* ══════════════════════════════════════
   Cards (Base)
   ══════════════════════════════════════ */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--white);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Entry animation */
.fade-in {
    animation: fadeIn .4s cubic-bezier(.4,0,.2,1) both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stagger helpers */
.stagger-1 { animation-delay: .05s; }
.stagger-2 { animation-delay: .10s; }
.stagger-3 { animation-delay: .15s; }
.stagger-4 { animation-delay: .20s; }
.stagger-5 { animation-delay: .25s; }
.stagger-6 { animation-delay: .30s; }
.stagger-7 { animation-delay: .35s; }
.stagger-8 { animation-delay: .40s; }

/* ══════════════════════════════════════
   KPI Cards — Gradient Style
   ══════════════════════════════════════ */
.kpi-card {
    border: none !important;
    border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    color: #fff;
    min-height: 128px;
}

/* Decorative circles */
.kpi-card::after {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    top: -35px;
    right: -25px;
    pointer-events: none;
}

.kpi-card::before {
    content: '';
    position: absolute;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    bottom: -15px;
    right: 45px;
    pointer-events: none;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg) !important;
}

.kpi-card .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(255,255,255,.18);
    color: #fff;
    margin-bottom: .85rem;
    position: relative;
    z-index: 1;
}

.kpi-card .kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: .2rem;
    letter-spacing: -.5px;
    position: relative;
    z-index: 1;
}

.kpi-card .kpi-label {
    font-size: .775rem;
    color: rgba(255,255,255,.78);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Gradient variants */
.kpi-primary {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    box-shadow: var(--shadow-primary);
}

.kpi-success {
    background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    box-shadow: var(--shadow-success);
}

.kpi-warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: var(--shadow-warning);
}

.kpi-danger {
    background: linear-gradient(135deg, #dc2626 0%, #e11d48 100%);
    box-shadow: var(--shadow-danger);
}

.kpi-info {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    box-shadow: var(--shadow-info);
}

/* ══════════════════════════════════════
   Quick Action Cards
   ══════════════════════════════════════ */
.quick-action {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: 1rem 1.1rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--dark-2);
    border: 1px solid var(--border);
}

.quick-action:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-primary);
    color: var(--primary);
    transform: translateY(-3px);
}

.quick-action .qa-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.quick-action:hover .qa-icon {
    transform: scale(1.08);
}

/* ══════════════════════════════════════
   Table Card
   ══════════════════════════════════════ */
.table-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

.table-card:hover {
    box-shadow: var(--shadow-md);
}

.table-card .card-header {
    background: linear-gradient(135deg, var(--light) 0%, var(--white) 100%);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.table thead th {
    background: var(--light);
    font-weight: 700;
    font-size: .71rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    padding: .85rem 1rem;
}

.table td {
    vertical-align: middle;
    font-size: .865rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background-color: #f5f8ff !important;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ══════════════════════════════════════
   Badges
   ══════════════════════════════════════ */
.badge {
    font-weight: 600;
    font-size: .71rem;
    padding: .3em .72em;
    border-radius: var(--radius-full);
    letter-spacing: .2px;
}

/* ══════════════════════════════════════
   Buttons
   ══════════════════════════════════════ */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .845rem;
    transition: var(--transition);
    letter-spacing: .1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(37,99,235,.28);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
    box-shadow: 0 6px 18px rgba(37,99,235,.38);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(5,150,105,.28);
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, var(--success) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(5,150,105,.35);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(220,38,38,.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(220,38,38,.35);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%);
    border: none;
    color: #fff;
}

.btn-warning:hover {
    transform: translateY(-1px);
    color: #fff;
}

.btn-outline-secondary {
    border-color: var(--border);
    color: var(--secondary);
    border-width: 1.5px;
}

.btn-outline-secondary:hover {
    background: var(--light);
    border-color: var(--muted);
    color: var(--dark-2);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    border-width: 1.5px;
}

.btn-outline-primary:hover {
    background: var(--primary-xlight);
    transform: translateY(-1px);
}

/* ══════════════════════════════════════
   Modals
   ══════════════════════════════════════ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.5rem;
    background: linear-gradient(135deg, var(--light) 0%, var(--white) 100%);
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: .95rem;
    color: var(--dark);
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: .85rem 1.5rem;
    background: var(--light-2);
}

.modal-body {
    padding: 1.5rem;
}

/* ══════════════════════════════════════
   Forms
   ══════════════════════════════════════ */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: .865rem;
    padding: .55rem .85rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--dark-2);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    outline: none;
}

.form-control::placeholder {
    color: var(--muted);
}

.form-label {
    font-weight: 600;
    font-size: .81rem;
    color: var(--dark-3);
    margin-bottom: .4rem;
    letter-spacing: .1px;
}

.input-group-text {
    background: var(--light);
    border: 1.5px solid var(--border);
    color: var(--secondary);
    font-size: .875rem;
}

.form-text {
    font-size: .75rem;
    color: var(--muted);
}

/* ══════════════════════════════════════
   Alert Cards (Dashboard)
   ══════════════════════════════════════ */
.alert-card {
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    margin-bottom: .75rem;
    border-left: 4px solid;
    box-shadow: var(--shadow-xs);
}

.alert-card-danger {
    background: var(--danger-xlight);
    border-color: var(--danger);
    color: #991b1b;
}

.alert-card-warning {
    background: var(--warning-xlight);
    border-color: var(--warning);
    color: #92400e;
}

/* ══════════════════════════════════════
   Chart Card
   ══════════════════════════════════════ */
.chart-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: var(--transition);
}

.chart-card:hover {
    box-shadow: var(--shadow-md);
}

.chart-card h6 {
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--dark);
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ══════════════════════════════════════
   Avatar
   ══════════════════════════════════════ */
.avatar-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ══════════════════════════════════════
   Login Page
   ══════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #0f172a 0%, #1a1040 45%, #1e3a8a 100%);
    position: relative;
    overflow: hidden;
}

/* Animated radial glows */
.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,.18) 0%, transparent 70%);
    top: -200px;
    left: -100px;
    animation: glow-pulse 8s ease-in-out infinite;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124,58,237,.14) 0%, transparent 70%);
    bottom: -120px;
    right: 480px;
    animation: glow-pulse 10s ease-in-out infinite reverse;
    pointer-events: none;
}

@keyframes glow-pulse {
    0%, 100% { transform: scale(1) translate(0,0); }
    33%       { transform: scale(1.06) translate(22px,-18px); }
    66%       { transform: scale(.96) translate(-12px,12px); }
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 3rem;
    position: relative;
    z-index: 1;
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 20px 40px rgba(37,99,235,.45);
}

.login-left h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: .75rem;
    letter-spacing: -.5px;
    z-index: 1;
}

.login-left p {
    font-size: 1rem;
    opacity: .7;
    max-width: 380px;
    text-align: center;
    line-height: 1.75;
    z-index: 1;
}

.login-features {
    display: flex;
    gap: .85rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 1;
}

.login-feature-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    color: rgba(255,255,255,.65);
    background: rgba(255,255,255,.07);
    padding: .5rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(8px);
    transition: var(--transition-fast);
}

.login-feature-item:hover {
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.9);
}

.login-feature-item i {
    color: var(--primary-light);
    font-size: 1rem;
}

.login-right {
    width: 460px;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    position: relative;
    z-index: 1;
    box-shadow: -20px 0 60px rgba(0,0,0,.35);
}

.login-card {
    max-width: 360px;
    margin: 0 auto;
    width: 100%;
}

.login-card h2 {
    font-weight: 800;
    margin-bottom: .3rem;
    color: var(--dark);
    font-size: 1.75rem;
    letter-spacing: -.5px;
}

.login-card .subtitle {
    color: var(--muted);
    margin-bottom: 2rem;
    font-size: .88rem;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    padding: .75rem;
    font-size: .95rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(37,99,235,.38);
    transition: var(--transition);
    width: 100%;
}

.btn-login:hover {
    box-shadow: 0 12px 32px rgba(37,99,235,.48);
    transform: translateY(-2px);
    color: #fff;
}

/* ══════════════════════════════════════
   Scrollbar
   ══════════════════════════════════════ */
::-webkit-scrollbar          { width: 5px; height: 5px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ══════════════════════════════════════
   Toast
   ══════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: calc(var(--navbar-h) + 1rem);
    right: 1rem;
    z-index: 9999;
}

.toast {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

/* ══════════════════════════════════════
   DataTables
   ══════════════════════════════════════ */
.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid var(--border) !important;
    padding: .45rem .85rem !important;
    font-size: .845rem !important;
    transition: var(--transition);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
    outline: none;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid var(--border) !important;
    padding: .35rem .65rem !important;
    font-size: .845rem !important;
}

.dataTables_wrapper .dataTables_info {
    font-size: .78rem;
    color: var(--muted);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-xs) !important;
    font-size: .8rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(37,99,235,.32) !important;
}

/* ══════════════════════════════════════
   Nav Tabs
   ══════════════════════════════════════ */
.nav-tabs {
    border-bottom: 2px solid var(--border);
}

.nav-tabs .nav-link {
    font-weight: 600;
    font-size: .845rem;
    color: var(--secondary);
    border: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding: .65rem 1rem;
    transition: var(--transition-fast);
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    background: var(--primary-xlight);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    font-weight: 700;
    background: transparent;
    border-bottom: 2px solid var(--primary);
    margin-bottom: -2px;
}

/* ══════════════════════════════════════
   Settings Page
   ══════════════════════════════════════ */
.settings-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
    overflow: hidden;
    transition: var(--transition);
}

.settings-section:hover {
    box-shadow: var(--shadow-md);
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--light) 0%, var(--white) 100%);
}

.settings-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.settings-section-header h5 {
    font-weight: 700;
    font-size: .95rem;
    color: var(--dark);
    margin: 0;
}

.settings-section-body {
    padding: 1.25rem 1.5rem;
}

.settings-section-body .input-group-text {
    background: var(--light);
    border-color: var(--border);
    font-size: .845rem;
    color: var(--secondary);
}

.settings-section-body small.text-muted {
    font-size: .76rem;
    display: block;
    margin-top: .3rem;
}

/* Large switch */
.form-check-input.fs-4 {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

.form-check-input.fs-4:checked {
    background-color: var(--success);
    border-color: var(--success);
}

/* ══════════════════════════════════════
   Member profile / table link
   ══════════════════════════════════════ */
#membersTable a:hover strong {
    color: var(--primary) !important;
    text-decoration: underline !important;
}

/* ══════════════════════════════════════
   Sidebar backdrop
   ══════════════════════════════════════ */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1045;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(3px);
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* ══════════════════════════════════════
   Utilities
   ══════════════════════════════════════ */
.text-primary  { color: var(--primary)  !important; }
.text-success  { color: var(--success)  !important; }
.text-danger   { color: var(--danger)   !important; }
.text-warning  { color: var(--warning)  !important; }
.text-muted    { color: var(--muted)    !important; }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }
.cursor-pointer { cursor: pointer; }

.custom-option { transition: var(--transition); cursor: pointer; }
.custom-option:hover { background-color: var(--light) !important; }
.custom-option input:checked + label { color: var(--primary); }

/* ══════════════════════════════════════
   Responsive — < 992px
   ══════════════════════════════════════ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 1050;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0,0,0,.45);
    }

    .main-content { margin-left: 0; }

    .login-left  { display: none; }
    .login-right { width: 100%; }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 { font-size: 1.2rem; }
}

/* ══════════════════════════════════════
   Responsive — < 768px
   ══════════════════════════════════════ */
@media (max-width: 767.98px) {
    .container-fluid { padding-left: 1rem; padding-right: 1rem; }

    .kpi-card { padding: 1.1rem 1.25rem; min-height: 110px; }
    .kpi-card .kpi-value { font-size: 1.35rem; }
    .kpi-card .kpi-icon  { width: 40px; height: 40px; font-size: 1.1rem; }

    .quick-action { padding: .75rem 1rem; gap: .75rem; }
    .quick-action .qa-icon { width: 38px; height: 38px; font-size: 1rem; }

    .chart-wrapper { height: 220px; }

    .table-responsive { -webkit-overflow-scrolling: touch; }
    .table td, .table th { white-space: nowrap; font-size: .8rem; }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length { float: none !important; text-align: left !important; margin-bottom: .5rem; }

    .dataTables_wrapper .dataTables_filter input { width: 100% !important; margin-left: 0 !important; }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate { float: none !important; text-align: center !important; margin-top: .5rem; }

    .modal-dialog { margin: 1rem; max-width: calc(100% - 2rem); }

    .alert-card { font-size: .845rem; padding: .75rem 1rem; }

    .settings-section-header,
    .settings-section-body { padding: 1rem; }

    .settings-icon { width: 38px; height: 38px; font-size: 1.05rem; }

    .bg-navbar { height: auto; min-height: var(--navbar-h); padding: .5rem 1rem; }

    #cycleSelectorNav { min-width: 120px !important; font-size: .75rem !important; }
}

/* ══════════════════════════════════════
   Responsive — < 576px
   ══════════════════════════════════════ */
@media (max-width: 575.98px) {
    :root {
        --navbar-h: 56px;
        --sidebar-w: 250px;
    }

    .container-fluid { padding-left: .75rem; padding-right: .75rem; }
    body { font-size: .845rem; }

    .page-header h1     { font-size: 1.05rem; }
    .page-header .breadcrumb { font-size: .7rem; }

    .kpi-card { padding: 1rem; min-height: 100px; }
    .kpi-card .kpi-value { font-size: 1.2rem; }
    .kpi-card .kpi-label { font-size: .7rem; }
    .kpi-card .kpi-icon  { width: 36px; height: 36px; font-size: .95rem; }

    .quick-action { flex-direction: column; text-align: center; padding: .75rem .5rem; gap: .4rem; }
    .quick-action .qa-icon { width: 36px; height: 36px; font-size: .95rem; }
    .quick-action .fw-600  { font-size: .72rem; }

    .chart-wrapper { height: 180px; }
    .chart-card    { padding: 1rem; }
    .chart-card h6 { font-size: .82rem; }

    .table td, .table th { padding: .4rem .5rem; font-size: .77rem; }
    .table-card .card-header { padding: .75rem 1rem; }
    .table-card .card-header h6 { font-size: .82rem; }

    .badge { font-size: .68rem; padding: .25em .55em; }

    .btn    { font-size: .8rem;  padding: .4rem .75rem; }
    .btn-sm { font-size: .72rem; padding: .3rem .5rem; }

    .modal-dialog { margin: .5rem; max-width: calc(100% - 1rem); }
    .modal-header { padding: .85rem 1rem; }
    .modal-body   { padding: 1rem; }
    .modal-footer { padding: .75rem 1rem; }

    .form-control,
    .form-select { font-size: .845rem; padding: .55rem .75rem; min-height: 42px; }
    .form-label  { font-size: .78rem; }

    .toast-container { right: .5rem; left: .5rem; }
    .toast-container .toast { width: 100%; }

    .login-right { padding: 2rem 1.5rem; }
    .login-card h2 { font-size: 1.5rem; }

    .navbar-brand  { font-size: .95rem; }
    .brand-icon    { width: 30px; height: 30px; font-size: .85rem; border-radius: var(--radius-xs); }

    .alert-card    { font-size: .8rem; padding: .65rem .85rem; }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: .3rem .5rem !important;
        font-size: .72rem !important;
    }

    .nav-tabs .nav-link { font-size: .75rem; padding: .5rem .75rem; }
}
