/* ================================================================
   Marketing AI — Admin Dashboard Styles
   Modern Dark Dashboard with Premium Design
   ================================================================ */

/* ----------------------------------------------------------------
   0. Import base design tokens from main stylesheet
   ---------------------------------------------------------------- */
:root {
    /* Primary Palette */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* Accent */
    --accent-400: #38bdf8;
    --accent-500: #0ea5e9;

    /* Emerald */
    --emerald-400: #34d399;
    --emerald-500: #10b981;

    /* Amber */
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;

    /* Rose */
    --rose-400: #fb7185;
    --rose-500: #f43f5e;

    /* Orange */
    --orange-400: #fb923c;
    --orange-500: #f97316;

    /* Neutrals */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;

    /* Surfaces */
    --bg-primary: #050a18;
    --bg-secondary: #0a1628;
    --bg-card: rgba(15, 23, 42, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-strong: rgba(255, 255, 255, 0.08);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);
    --border-focus: rgba(99, 102, 241, 0.5);

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

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--slate-200);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ----------------------------------------------------------------
   2. Dashboard Layout
   ---------------------------------------------------------------- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* ----------------------------------------------------------------
   3. Sidebar
   ---------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-600), var(--accent-500));
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slate-100);
    letter-spacing: -0.02em;
}

.sidebar-brand-sub {
    font-size: 0.65rem;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

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

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-500);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--slate-400);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.sidebar-link:hover {
    color: var(--slate-100);
    background: var(--bg-glass);
}

.sidebar-link.active {
    color: var(--primary-300);
    background: rgba(99, 102, 241, 0.1);
}

.sidebar-link .icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link .badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-300);
}

.sidebar-link .badge.badge-hot {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose-400);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--slate-500);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.sidebar-footer a:hover {
    color: var(--slate-300);
}

/* ----------------------------------------------------------------
   4. Main Content Area
   ---------------------------------------------------------------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Top Bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 0.875rem 2rem;
    background: rgba(5, 10, 24, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-glass);
    color: var(--slate-300);
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-glass-strong);
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--slate-100);
}

.topbar-subtitle {
    font-size: 0.8rem;
    color: var(--slate-500);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-search {
    position: relative;
}

.topbar-search input {
    width: 260px;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    background: var(--bg-glass);
    color: var(--slate-200);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
}

.topbar-search input::placeholder {
    color: var(--slate-500);
}

.topbar-search input:focus {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.07);
    width: 320px;
}

.topbar-search .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-500);
    font-size: 0.85rem;
    pointer-events: none;
}

.refresh-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-glass);
    color: var(--slate-400);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.refresh-btn:hover {
    background: var(--bg-glass-strong);
    color: var(--slate-200);
}

.refresh-btn.spinning {
    animation: spin 0.6s linear;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------------
   5. Content Area
   ---------------------------------------------------------------- */
.content-area {
    padding: 1.5rem 2rem;
}

/* ----------------------------------------------------------------
   6. KPI Cards
   ---------------------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.kpi-card.kpi-total::before { background: linear-gradient(90deg, var(--primary-500), var(--primary-400)); }
.kpi-card.kpi-new::before { background: linear-gradient(90deg, var(--accent-500), var(--accent-400)); }
.kpi-card.kpi-hot::before { background: linear-gradient(90deg, var(--rose-500), var(--rose-400)); }
.kpi-card.kpi-deals::before { background: linear-gradient(90deg, var(--emerald-500), var(--emerald-400)); }

.kpi-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.kpi-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.kpi-total .kpi-icon { background: rgba(99, 102, 241, 0.12); }
.kpi-new .kpi-icon { background: rgba(14, 165, 233, 0.12); }
.kpi-hot .kpi-icon { background: rgba(244, 63, 94, 0.12); }
.kpi-deals .kpi-icon { background: rgba(16, 185, 129, 0.12); }

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--slate-100);
    letter-spacing: -0.02em;
    line-height: 1;
}

.kpi-sub {
    font-size: 0.75rem;
    color: var(--slate-500);
    margin-top: 0.375rem;
}

/* ----------------------------------------------------------------
   7. Tab Navigation
   ---------------------------------------------------------------- */
.tab-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tab-nav {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    padding: 3px;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--slate-400);
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--slate-200);
}

.tab-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-300);
}

.tab-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-glass);
    color: var(--slate-400);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.filter-btn:hover {
    background: var(--bg-glass-strong);
    color: var(--slate-200);
}

/* ----------------------------------------------------------------
   8. Leads Table
   ---------------------------------------------------------------- */
.table-container {
    overflow-x: auto;
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.leads-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.leads-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.leads-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: var(--slate-300);
}

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

.leads-table tbody tr:hover {
    background: var(--bg-glass);
}

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

/* Lead Name Cell */
.lead-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lead-name .name {
    font-weight: 600;
    color: var(--slate-100);
    font-size: 0.875rem;
}

.lead-name .company {
    font-size: 0.75rem;
    color: var(--slate-500);
}

/* Score Bar */
.score-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-bar {
    width: 50px;
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
}

.score-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.score-high .score-bar-fill { background: linear-gradient(90deg, var(--emerald-500), var(--emerald-400)); }
.score-medium .score-bar-fill { background: linear-gradient(90deg, var(--amber-500), var(--amber-400)); }
.score-low .score-bar-fill { background: linear-gradient(90deg, var(--rose-500), var(--rose-400)); }

.score-value {
    font-weight: 600;
    font-size: 0.8rem;
    min-width: 28px;
}

.score-high .score-value { color: var(--emerald-400); }
.score-medium .score-value { color: var(--amber-400); }
.score-low .score-value { color: var(--rose-400); }

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-new {
    background: rgba(14, 165, 233, 0.12);
    color: var(--accent-400);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.status-contacted {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-400);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.status-survey_scheduled {
    background: rgba(251, 191, 36, 0.12);
    color: var(--amber-400);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.status-deal {
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald-400);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-reject {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose-400);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

/* Segment Badge */
.segment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.segment-retail {
    color: var(--accent-400);
}

.segment-corporate {
    color: var(--orange-400);
}

/* Location Cell */
.location-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.location-cell .kelurahan {
    font-weight: 500;
    color: var(--slate-200);
    font-size: 0.825rem;
}

.location-cell .kecamatan {
    font-size: 0.72rem;
    color: var(--slate-500);
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 0.375rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-glass);
    color: var(--slate-400);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
}

.action-btn:hover {
    background: var(--bg-glass-strong);
    color: var(--slate-200);
}

.action-btn.btn-wa:hover {
    background: rgba(37, 211, 102, 0.12);
    border-color: rgba(37, 211, 102, 0.3);
    color: #25d366;
}

.action-btn.btn-status:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary-400);
}

.action-btn.btn-delete:hover {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--rose-400);
}

/* Tooltip */
.action-btn[title]::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--slate-800);
    color: var(--slate-200);
    font-size: 0.68rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    margin-bottom: 4px;
}

.action-btn[title]:hover::after {
    opacity: 1;
}

/* ----------------------------------------------------------------
   9. Status Dropdown
   ---------------------------------------------------------------- */
.status-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 0.375rem;
    min-width: 180px;
    box-shadow: var(--shadow-xl);
    z-index: 100;
    animation: dropdownIn 0.15s ease-out;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.status-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--slate-300);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    text-align: left;
}

.status-dropdown button:hover {
    background: var(--bg-glass);
}

.status-dropdown button.current {
    color: var(--primary-300);
    background: rgba(99, 102, 241, 0.08);
}

/* ----------------------------------------------------------------
   10. Empty State
   ---------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1rem;
    color: var(--slate-300);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.85rem;
    color: var(--slate-500);
}

/* ----------------------------------------------------------------
   11. Loading Skeleton
   ---------------------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-glass) 25%,
        var(--bg-glass-strong) 50%,
        var(--bg-glass) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ----------------------------------------------------------------
   12. Lead Detail Modal
   ---------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-2xl);
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--slate-100);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-glass);
    color: var(--slate-400);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-glass-strong);
    color: var(--slate-200);
}

.modal-body {
    padding: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--slate-500);
    min-width: 120px;
}

.detail-value {
    font-size: 0.85rem;
    color: var(--slate-200);
    text-align: right;
    flex: 1;
}

.detail-summary {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    color: var(--slate-300);
    line-height: 1.6;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-glass);
    color: var(--slate-300);
    font-size: 0.825rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all var(--transition-fast);
}

.modal-btn:hover {
    background: var(--bg-glass-strong);
    color: var(--slate-100);
}

.modal-btn.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
    border-color: var(--primary-500);
    color: white;
}

.modal-btn.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
}

/* ----------------------------------------------------------------
   13. Scrollbar
   ---------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--slate-700);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-600);
}

/* ----------------------------------------------------------------
   14. Toast
   ---------------------------------------------------------------- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    color: var(--slate-200);
    animation: toastIn 0.3s ease-out;
    min-width: 250px;
}

.toast-success { border-color: rgba(16, 185, 129, 0.3); }
.toast-error { border-color: rgba(244, 63, 94, 0.3); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ----------------------------------------------------------------
   15. Responsive
   ---------------------------------------------------------------- */
@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

    .menu-toggle {
        display: flex;
    }

    .topbar {
        padding: 0.75rem 1rem;
    }

    .topbar-search input {
        width: 180px;
    }

    .topbar-search input:focus {
        width: 220px;
    }

    .content-area {
        padding: 1rem;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .tab-header {
        padding: 0.75rem 1rem;
    }

    .modal-overlay {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .tab-nav {
        flex-wrap: wrap;
    }
}

/* Sidebar mobile overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Toast Notifications Global Styles */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    color: var(--slate-100);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: toastIn 0.3s ease-out forwards;
    min-width: 300px;
    max-width: 400px;
}

.toast-success {
    border-left: 4px solid var(--emerald-500);
}

.toast-info {
    border-left: 4px solid var(--primary-500);
}

.toast-error {
    border-left: 4px solid var(--rose-500);
}

@keyframes toastIn {
    from { transform: translateX(100%) translateY(0); opacity: 0; }
    to { transform: translateX(0) translateY(0); opacity: 1; }
}
