/* =====================================================================
   ATVI NEXUS — Enterprise Performance & Arbitrage Analytics Dashboard
   Theme: Light Canvas with Midnight Indigo-Purple Sidebar & Crisp Cards
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    /* Brand Palette (ATVI Nexus & Image 1 Palette) */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
    --primary-light: #eef2ff;
    --primary-glow: rgba(79, 70, 229, 0.25);
    
    --secondary: #7c3aed;
    --secondary-light: #f5f3ff;
    --accent-gold: #f59e0b;

    /* Canvas & Surface Colors */
    --bg-body: #f3f4f9;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fafbff;

    /* Sidebar Navigation (Deep Midnight Purple from Image 1) */
    --sidebar-w: 260px;
    --sidebar-bg: #1e1948;
    --sidebar-bg-dark: #161238;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #c5bfeb;
    --sidebar-text-muted: #8c82bd;
    --sidebar-active-bg: rgba(255, 255, 255, 0.16);

    /* Borders & Dividers */
    --border: #e2e8f0;
    --border-light: #eef2f6;
    --border-subtle: #f1f5f9;
    --border-focus: #6366f1;

    /* Typography */
    --text-heading: #1e1b4b;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    /* KPI Semantics */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-text: #047857;
    --success-border: #a7f3d0;

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
    --danger-border: #fecaca;

    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-text: #b45309;

    --info: #0ea5e9;
    --info-bg: #f0f9ff;
    --info-text: #0369a1;

    /* Portfolio Category Tags */
    --cat-h5-bg: #ede9fe;
    --cat-h5-text: #5b21b6;
    --cat-h5-border: #ddd6fe;

    --cat-vd-bg: #e0f2fe;
    --cat-vd-text: #0369a1;
    --cat-vd-border: #bae6fd;

    /* Border Radii (Smooth modern curves from Image 1) */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 26px;

    /* Shadows */
    --shadow-card: 0 10px 30px rgba(30, 25, 72, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
    --shadow-card-hover: 0 16px 36px rgba(79, 70, 229, 0.08), 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-dropdown: 0 20px 45px rgba(30, 25, 72, 0.12), 0 4px 15px rgba(0, 0, 0, 0.05);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: var(--bg-body);
    color: var(--text-body);
    font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

/* ---------------- Main Layout Framework ---------------- */
.app-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-body);
}

/* ---------------- Left Sidebar (Midnight Purple) ---------------- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(22, 18, 56, 0.15);
}

.sidebar-header {
    height: 84px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
}

.sidebar-brand-img {
    height: 54px;
    max-width: 224px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
    transition: transform 0.2s ease;
}

.sidebar-brand-img:hover {
    transform: scale(1.03);
}

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

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

.nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--sidebar-text-muted);
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    color: #a397db;
    transition: color 0.2s;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-item a:hover .nav-icon {
    color: #ffffff;
}

/* Active Link matching Image 1's "Business Overview" */
.nav-item a.active {
    background: var(--sidebar-active-bg);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
}

.nav-item a.active .nav-icon {
    color: #ffffff;
}

.sidebar-footer {
    padding: 1.1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg-dark);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sidebar-text);
    padding: 0.55rem 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-sm);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---------------- Main Content Area ---------------- */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-body);
}

/* ---------------- Topbar (Crisp Light Nav) ---------------- */
.topbar {
    height: 84px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    padding: 0 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 2px 10px rgba(30, 25, 72, 0.02);
}

.mobile-toggle-btn {
    display: none;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-heading);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

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

.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.4px;
}

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

/* Search Bar (Pill shaped from Image 1) */
.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.topbar-search-input {
    background: #f1f3f9;
    border: 1px solid transparent;
    border-radius: 30px;
    padding: 0.6rem 1.2rem 0.6rem 2.6rem;
    font-size: 0.88rem;
    color: var(--text-heading);
    width: 250px;
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
}

.topbar-search-input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    width: 290px;
}

.topbar-search-input::placeholder {
    color: var(--text-dim);
}

.topbar-search .search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-dim);
    font-size: 0.95rem;
    pointer-events: none;
}

.live-badge {
    background: #ede9fe;
    border: 1px solid #ddd6fe;
    color: #5b21b6;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.45rem 0.95rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7c3aed;
    box-shadow: 0 0 8px #7c3aed;
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.35rem 0.85rem 0.35rem 0.45rem;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.user-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name-text {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-heading);
}

.logout-icon-btn {
    color: var(--danger);
    font-size: 0.9rem;
    margin-left: 0.35rem;
    transition: transform 0.2s;
}

.logout-icon-btn:hover {
    transform: scale(1.15);
}

/* ---------------- Content Body ---------------- */
.content-body {
    flex: 1;
    padding: 2.25rem;
    max-width: 1560px;
    width: 100%;
    margin: 0 auto;
}

/* ---------------- Welcome Banner (Style from Image 1) ---------------- */
.welcome-banner {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2.25rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08), transparent 70%);
    pointer-events: none;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #3730a3;
    margin-bottom: 0.35rem;
    letter-spacing: -0.5px;
}

.welcome-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    max-width: 820px;
}

/* ---------------- Controls & Filter Bar ---------------- */
.controls-bar {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.6rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
}

.segment-group {
    display: flex;
    background: #f1f3f9;
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    gap: 4px;
}

.segment-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.15rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.segment-btn:hover {
    color: var(--text-heading);
}

.segment-btn.active {
    background: #ffffff;
    color: #4338ca;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.15);
}

.controls-right-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-body);
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Buttons */
.btn-solid-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
    transition: all 0.2s ease;
}

.btn-solid-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
    color: #ffffff;
}

.btn-solid-danger {
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
    transition: all 0.2s ease;
}

.btn-solid-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.45);
    color: #ffffff;
}

.btn-outline {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-heading);
    padding: 0.75rem 1.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: var(--primary);
    color: var(--primary);
}

/* ---------------- 5 KPI Stat Cards (Image 1 Style) ---------------- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-box {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.75rem;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

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

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

.kpi-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
}

.kpi-icon-pill {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.kpi-number {
    font-size: 1.95rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.8px;
    margin-bottom: 0.75rem;
}

.kpi-comparison {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-dim);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.growth-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.growth-pill.up {
    background: var(--success-bg);
    color: var(--success-text);
}

.growth-pill.down {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.growth-pill.neutral {
    background: #f1f5f9;
    color: var(--text-dim);
}

/* ---------------- Table & Chart Panels ---------------- */
.table-panel {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
    overflow: hidden;
}

.table-panel-header {
    padding: 1.35rem 1.85rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-header-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.table-search-input {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 0.55rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-heading);
    width: 280px;
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
}

.table-search-input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Custom Table */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.custom-table thead {
    background: #f8fafc;
}

.custom-table th {
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.custom-table td {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-body);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: background 0.15s ease;
}

.custom-table tbody tr:hover {
    background: #f9faff;
}

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

/* Project Profile Cell */
.proj-profile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.proj-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.proj-avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #ede9fe;
    color: #5b21b6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.05rem;
}

.proj-name {
    font-weight: 700;
    color: var(--text-heading);
    font-size: 0.95rem;
}

.proj-link {
    font-size: 0.78rem;
    color: var(--primary);
    text-decoration: none;
}

.proj-link:hover {
    text-decoration: underline;
}

/* Badges */
.badge-cat {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-cat.H5 {
    background: var(--cat-h5-bg);
    color: var(--cat-h5-text);
    border: 1px solid var(--cat-h5-border);
}

.badge-cat.Videodownloader {
    background: var(--cat-vd-bg);
    color: var(--cat-vd-text);
    border: 1px solid var(--cat-vd-border);
}

.badge-status-pill {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
}

.badge-status-pill.active {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-status-pill.closed {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.tbl-btn {
    padding: 0.45rem 0.85rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-body);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tbl-btn:hover {
    background: #f8fafc;
    border-color: var(--primary);
    color: var(--primary);
}

/* ---------------- Modals ---------------- */
.modal-backdrop, .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 38, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-dialog, .modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-dropdown);
    overflow: hidden;
    animation: modalShow 0.25s ease-out;
}

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

.modal-head, .modal-header {
    padding: 1.35rem 1.75rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-head h3, .modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
}

.modal-close-btn, .modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: var(--text-dim);
    cursor: pointer;
}

.modal-close-btn:hover, .modal-close:hover {
    color: var(--text-heading);
}

.modal-content-area, .modal-body {
    padding: 1.75rem;
}

.field-group, .form-group {
    margin-bottom: 1.35rem;
}

.field-label, .form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.field-control, .form-input, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.92rem;
    color: var(--text-heading);
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
}

.field-control:focus, .form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.modal-foot, .modal-footer {
    padding: 1.25rem 1.75rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
}

/* Alerts */
.alert-box {
    padding: 1rem 1.35rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.alert-box.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.alert-box.error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

/* ---------------- Multi-URL Component Styles ---------------- */
.btn-add-url {
    background: #ede9fe;
    color: #4f46e5;
    border: 1px solid #ddd6fe;
    border-radius: var(--radius-xs);
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.btn-add-url:hover {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-add-url-text {
    background: transparent;
    border: none;
    color: #4f46e5;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0;
    transition: color 0.2s ease;
}

.btn-add-url-text:hover {
    color: #3730a3;
    text-decoration: underline;
}

.btn-remove-url {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #ef4444;
    border-radius: var(--radius-xs);
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-remove-url:hover {
    background: #ef4444;
    color: #ffffff;
}

.site-urls-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 280px;
}

.site-url-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.65rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    word-break: break-all;
}

.site-url-pill:hover {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.more-urls-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: help;
}

/* ---------------- Responsive Styles ---------------- */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
    .mobile-toggle-btn {
        display: inline-flex;
    }
    .topbar-search {
        display: none;
    }
}

@media (max-width: 768px) {
    .content-body {
        padding: 1.25rem;
    }
    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .controls-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .kpi-row {
        grid-template-columns: 1fr;
    }
    .segment-group {
        flex-wrap: wrap;
    }
}

/* ---------------- Site & Domain Multi-Select Dropdown ---------------- */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.btn-filter-dropdown {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.62rem 1.15rem;
    background: #ffffff;
    border: 1.5px solid #e0e7ff;
    border-radius: var(--radius-sm);
    color: var(--text-heading);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.06);
    transition: all var(--transition-fast);
}

.btn-filter-dropdown:hover {
    border-color: var(--primary);
    background: #f8fafc;
    color: var(--primary);
}

.btn-filter-dropdown.active-filter {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4338ca;
}

.dropdown-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 14px 35px rgba(30, 25, 72, 0.15);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInDown 0.18s ease-out;
}

.dropdown-menu-panel.show {
    display: flex;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-panel-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.dropdown-panel-search i {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.dropdown-panel-search input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--text-heading);
}

.dropdown-panel-quick-actions {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-panel-quick-actions .quick-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
}

.dropdown-panel-quick-actions .quick-btn:hover {
    text-decoration: underline;
}

.dropdown-panel-items {
    max-height: 250px;
    overflow-y: auto;
    padding: 0.4rem 0;
}

.site-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
    user-select: none;
}

.site-checkbox-row:hover {
    background: #f8fafc;
}

.site-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.site-checkbox-info {
    flex: 1;
    overflow: hidden;
}

.site-domain-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-proj-subtitle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.badge-mini {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

.badge-mini.H5 { background: #e0e7ff; color: #4338ca; }
.badge-mini.Videodownloader { background: #e0f2fe; color: #0369a1; }

.dropdown-panel-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
}

.btn-sm-cancel {
    padding: 0.45rem 0.9rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-sm-apply {
    padding: 0.45rem 1rem;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

/* ---------------- Active Filter Chips Bar ---------------- */
.active-filter-chips-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
    padding: 0.65rem 1.25rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-sm);
}

.chips-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #4338ca;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    background: #ffffff;
    border: 1px solid #a5b4fc;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #3730a3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.filter-chip button {
    background: none;
    border: none;
    color: #6366f1;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
}

.filter-chip button:hover {
    color: #dc2626;
}

.chip-reset-all {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 700;
    color: #4f46e5;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chip-reset-all:hover {
    text-decoration: underline;
}

/* ---------------- GST Toggle & Settings ---------------- */
.btn-gst-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-gst-toggle:hover {
    border-color: #6366f1;
    color: #4338ca;
}

.btn-gst-toggle.active {
    background: #eef2ff;
    border-color: #818cf8;
    color: #4338ca;
}

.btn-settings-currency {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    color: var(--text-heading);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-settings-currency:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f8fafc;
}
