/* ============================================================
   Ideafy Admin Panel — Custom Styles
   Built on top of Bootstrap 5 + Bootstrap Icons
   ============================================================ */

:root {
    /* ── Ideafy app palette ───────────────────────────── */
    --primary:        #24a89c;   /* richer teal */
    --primary-dark:   #18877f;   /* strong hover teal */
    --secondary:      #34b7a9;   /* balanced darker accent *//* slightly muted teal */         /* lighter teal highlight                        */
    --primary-light: #0d2e2c;          /* very dark teal tint for light bg contexts     */

    /* ── Semantic colours ─────────────────────────────── */
    --success: #3dd6c8;                /* reuse teal — matches app accent               */
    --warning: #f5a623;
    --danger:  #e05555;

    /* ── Dark surface scale (matches app background) ──── */
    --dark:    #e2eaec;                /* primary text — light on dark                  */
    --dark-2:  #141c1f;                /* sidebar background                            */
    --dark-3:  #1e292d;                /* card / panel surfaces                         */

    /* ── Muted & border ───────────────────────────────── */
    --text-muted: #5a7a82;             /* subdued text                                  */
    --border:     #243038;             /* subtle dark border                            */
    --bg-light:   #111820;             /* page background — deepest dark                */

    /* ── Layout ───────────────────────────────────────── */
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius: 12px;

    /* ── Shadows (heavier on dark bg) ─────────────────── */
    --shadow:    0 1px 4px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
    --shadow-md: 0 4px 12px rgba(0,0,0,.4),  0 2px 4px rgba(0,0,0,.3);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.5), 0 4px 8px rgba(0,0,0,.35);
    --transition: all .2s ease;
}

/* ── Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--dark);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    color-scheme: dark;
}

a { text-decoration: none; }
img { max-width: 100%; }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #243038; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3dd6c8; }

/* ── Auth Pages ──────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    background: radial-gradient(ellipse at top, #0d2e2c 0%, #0c1518 60%, #080e11 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    background: #141c1f;
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    border: 1.5px solid #243038;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 2rem;
}

.auth-logo .logo-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.25rem;
}

.auth-logo .logo-text { font-size: clamp(1.15rem, 4vw, 1.4rem); font-weight: 700; color: #e2eaec; letter-spacing: .15em; }
.auth-logo .logo-badge {
    font-size: clamp(.6rem, 2vw, .65rem); font-weight: 600; letter-spacing: .05em;
    background: var(--primary-light); color: var(--primary-dark);
    padding: .15rem .5rem; border-radius: 4px; margin-left: .25rem;
}

.auth-title { font-size: clamp(1.2rem, 5vw, 1.5rem); font-weight: 700; margin-bottom: .25rem; color: #e2eaec; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 2rem; font-size: clamp(.8rem, 3vw, .9rem); }

.form-label { font-weight: 500; font-size: clamp(.8rem, 3vw, .875rem); color: #8aaab2; margin-bottom: .375rem; }

.form-control, .form-select {
    border: 1.5px solid #243038;
    border-radius: 10px;
    padding: .65rem 1rem;
    font-size: clamp(.82rem, 3vw, .875rem);
    transition: var(--transition);
    background: #0d1518;
    color: #e2eaec;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61,214,200,.12);
    background: #0d1518;
    outline: none;
}

.form-control::placeholder,
.form-select::placeholder {
    color: #3a5560;
    opacity: 1;
}

.input-group .form-control { border-right: none; }
.input-group .btn-outline-secondary {
    border: 1.5px solid #243038;
    border-left: none;
    border-radius: 0 10px 10px 0;
    background: #0d1518;
    color: #5a7a82;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border: none;
    border-radius: 10px;
    padding: .7rem 1.5rem;
    font-size: clamp(.85rem, 3vw, .9rem); font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn-primary-custom:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(61,214,200,.35); }
.btn-primary-custom:active { transform: translateY(0); }

.auth-divider { text-align: center; position: relative; margin: 1.5rem 0; }
.auth-divider::before {
    content: ''; position: absolute; top: 50%; left: 0; right: 0;
    height: 1px; background: var(--border);
}
.auth-divider span { background: #141c1f; padding: 0 1rem; color: var(--text-muted); font-size: .8rem; position: relative; }

.auth-link { color: var(--primary); font-weight: 500; }
.auth-link:hover { color: var(--primary-dark); }

/* ── Alert Styles ────────────────────────────────────── */
.alert-custom {
    border-radius: 10px; padding: .75rem 1rem;
    font-size: .875rem; display: flex; align-items: flex-start; gap: .5rem;
    margin-bottom: 1.25rem; border: none;
}
.alert-error { background: rgba(224,85,85,.12); color: #f87171; border: 1px solid rgba(224,85,85,.25); }
.alert-success { background: rgba(61,214,200,.1); color: #3dd6c8; border: 1px solid rgba(61,214,200,.2); }

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-2);
    position: fixed; top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    z-index: 1000;
    transition: transform .3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sidebar-logo { display: flex; align-items: center; gap: .75rem; }
.sidebar-logo .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1rem; flex-shrink: 0;
}
.sidebar-logo .logo-name { font-size: 1.1rem; font-weight: 700; color: #fff; }
.sidebar-logo .logo-sub { font-size: .65rem; color: var(--text-muted); letter-spacing: .05em; }

.sidebar-nav { padding: 1rem .75rem; flex: 1; }

.nav-section-label {
    font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--text-muted); padding: .75rem .5rem .375rem;
}

.nav-item { margin: .125rem 0; }

.nav-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem .875rem;
    border-radius: 9px;
    color: #94a3b8;
    font-size: .875rem; font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link i { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(61,214,200,.12); color: var(--primary); }
.nav-link.active i { color: var(--primary); }

.nav-link .badge-count {
    margin-left: auto; font-size: .65rem; padding: .15rem .45rem;
    border-radius: 4px; background: rgba(255,255,255,.1); color: #fff;
}

.sidebar-footer {
    padding: 1rem .75rem;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.admin-user-card {
    display: flex; align-items: center; gap: .75rem;
    padding: .5rem .75rem;
    border-radius: 9px;
    transition: var(--transition);
    cursor: pointer;
}
.admin-user-card:hover { background: rgba(255,255,255,.06); }

.admin-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.admin-name { font-size: .8rem; font-weight: 600; color: #fff; }
.admin-role { font-size: .7rem; color: var(--text-muted); }
/* Dedicated sidebar sign-out button */
.sidebar-signout-btn {
    display: flex; align-items: center; justify-content: center; gap: .625rem;
    width: 100%; padding: .65rem 1rem;
    margin-top: .25rem;
    border-radius: 9px;
    background: rgba(239,68,68,.1);
    border: 1.5px solid rgba(239,68,68,.2);
    color: #fca5a5;
    font-size: clamp(.8rem, 3vw, .875rem); font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}
.sidebar-signout-btn i { font-size: 1rem; }
.sidebar-signout-btn:hover {
    background: rgba(239,68,68,.22);
    border-color: rgba(239,68,68,.45);
    color: #fff;
    transform: translateX(2px);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex; flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: #141c1f;
    border-bottom: 1px solid #243038;
    display: flex; align-items: center;
    padding: 0 1.75rem;
    position: sticky; top: 0; z-index: 100;
    gap: 1rem;
}

.topbar-toggle {
    display: none;
    background: none; border: none;
    font-size: 1.25rem; color: var(--dark-3);
    cursor: pointer; padding: .25rem;
}

.topbar-title { font-size: clamp(.875rem, 3.5vw, 1rem); font-weight: 600; color: var(--dark); flex: 1; }

.topbar-actions { display: flex; align-items: center; gap: .75rem; }

.topbar-btn {
    width: 36px; height: 36px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-light); border: 1.5px solid var(--border);
    color: var(--dark-3); cursor: pointer; transition: var(--transition);
    font-size: .9rem;
}
.topbar-btn:hover { background: rgba(61,214,200,.1); border-color: var(--primary); color: var(--primary); }

.topbar-user {
    display: flex; align-items: center; gap: .5rem;
    padding: .375rem .75rem;
    background: #1a2428; border: 1.5px solid #243038;
    border-radius: 9px; cursor: pointer; transition: var(--transition);
}
.topbar-user:hover { border-color: var(--primary); }
.topbar-user .user-name { font-size: .8rem; font-weight: 600; color: #e2eaec; }
.topbar-user .mini-avatar {
    width: 26px; height: 26px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700; color: #fff;
}

/* Page Content */
.page-content { padding: 1.75rem; flex: 1; }

.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: clamp(1.1rem, 4vw, 1.35rem); font-weight: 700; margin: 0; color: #e2eaec; }
.page-header p { color: var(--text-muted); font-size: clamp(.78rem, 3vw, .875rem); margin: .25rem 0 0; }

.breadcrumb-nav { display: flex; align-items: center; gap: .375rem; font-size: clamp(.73rem, 2.5vw, .8rem); margin-bottom: .5rem; }
.breadcrumb-nav a { color: var(--text-muted); }
.breadcrumb-nav a:hover { color: var(--primary); }
.breadcrumb-nav .sep { color: var(--border); }
.breadcrumb-nav .current { color: var(--dark); font-weight: 500; }

/* ── Cards ───────────────────────────────────────────── */
.card-custom {
    background: #141c1f;
    border-radius: var(--radius);
    border: 1.5px solid #243038;
    box-shadow: var(--shadow);
}

.card-header-custom {
    padding: 1.125rem 1.25rem;
    border-bottom: 1.5px solid var(--border);
    display: flex; align-items: center; gap: .75rem;
}
.card-header-custom .card-title { font-size: clamp(.85rem, 3vw, .95rem); font-weight: 600; margin: 0; flex: 1; color: #e2eaec; }
.card-body-custom { padding: 1.25rem; }

/* ── Stat Cards ──────────────────────────────────────── */
.stat-card {
    background: #141c1f;
    border-radius: var(--radius);
    border: 1.5px solid #243038;
    padding: 1.25rem;
    display: flex; align-items: flex-start; gap: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--primary), var(--shadow-md); border-color: var(--primary); }

.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; flex-shrink: 0;
}

.stat-icon.purple { background: rgba(61,214,200,.1); color: var(--primary); }
.stat-icon.blue { background: rgba(86,224,208,.1); color: var(--secondary); }
.stat-icon.green { background: rgba(61,214,200,.1); color: var(--success); }
.stat-icon.orange { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-icon.red { background: rgba(239,68,68,.12); color: var(--danger); }
.stat-icon.teal { background: rgba(20,184,166,.12); color: #14b8a6; }
.stat-icon.pink { background: rgba(236,72,153,.12); color: #ec4899; }

.stat-value { font-size: clamp(1.3rem, 4vw, 1.65rem); font-weight: 800; color: #e2eaec; line-height: 1.2; }
.stat-label { font-size: clamp(.72rem, 2.5vw, .8rem); color: var(--text-muted); margin-top: .25rem; font-weight: 500; }
.stat-change { font-size: .75rem; margin-top: .375rem; display: flex; align-items: center; gap: .25rem; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Tables ──────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.table-custom {
    width: 100%; border-collapse: collapse;
}

.table-custom th {
    padding: .75rem 1rem;
    font-size: clamp(.68rem, 2vw, .75rem); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: #5a7a82; background: #0d1518;
    border-bottom: 1.5px solid #243038;
    white-space: nowrap;
}

.table-custom td {
    padding: .875rem 1rem;
    border-bottom: 1px solid #1a2428;
    font-size: clamp(.8rem, 2.5vw, .875rem); color: #a8c0c6;
    vertical-align: middle;
}

.table-custom tbody tr:last-child td { border-bottom: none; }
.table-custom tbody tr:hover td { background: #1a2428; }

.cell-truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Badges */
.badge-custom {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .25rem .625rem;
    border-radius: 6px; font-size: .72rem; font-weight: 600; letter-spacing: .02em;
}
.badge-success { background: rgba(61,214,200,.12); color: #3dd6c8; }
.badge-danger  { background: rgba(224,85,85,.12);  color: #f87171; }
.badge-warning { background: rgba(245,166,35,.12); color: #fbbf24; }
.badge-info    { background: rgba(86,224,208,.1);  color: #56e0d0; }
.badge-muted { background: #f1f5f9; color: #64748b; }
.badge-primary { background: rgba(61,214,200,.12); color: var(--primary); }

/* ── Search & Filter Bar ─────────────────────────────── */
.filter-bar {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap i { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .9rem; }
.search-input-wrap input {
    width: 100%; padding: .6rem 1rem .6rem 2.5rem;
    border: 1.5px solid #243038; border-radius: 9px;
    font-size: clamp(.82rem, 3vw, .875rem); background: #0d1518; color: #e2eaec; transition: var(--transition);
}
.search-input-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(61,214,200,.1); outline: none; }

.filter-select {
    padding: .6rem .875rem;
    border: 1.5px solid var(--border); border-radius: 9px;
    font-size: clamp(.82rem, 3vw, .875rem); background: #0d1518;
    color: #e2eaec; cursor: pointer; min-width: 130px;
}
.filter-select:focus { border-color: var(--primary); outline: none; }

.btn-filter {
    padding: .6rem 1.125rem;
    border-radius: 9px; border: 1.5px solid #243038;
    background: #141c1f; color: #8aaab2;
    font-size: clamp(.82rem, 3vw, .875rem); font-weight: 500;
    cursor: pointer; display: flex; align-items: center; gap: .375rem;
    transition: var(--transition);
}
.btn-filter:hover { border-color: var(--primary); color: var(--primary); background: rgba(61,214,200,.08); }

.btn-icon-sm {
    width: 30px; height: 30px; border-radius: 7px;
    border: 1.5px solid #243038; background: #1a2428;
    display: inline-flex; align-items: center; justify-content: center;
    color: #5a7a82; cursor: pointer; transition: var(--transition);
    font-size: .8rem;
}
.btn-icon-sm:hover { border-color: var(--primary); color: var(--primary); background: rgba(61,214,200,.08); }

/* ── Pagination ──────────────────────────────────────── */
.pagination-wrap {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem;
    border-top: 1.5px solid #243038;
    flex-wrap: wrap; gap: .75rem;
}

.pagination-info { font-size: .8rem; color: var(--text-muted); }

.pagination-btns { display: flex; align-items: center; gap: .375rem; }

.pg-btn {
    min-width: 32px; height: 32px; padding: 0 .5rem;
    border-radius: 7px; border: 1.5px solid #243038;
    background: #1a2428; color: #8aaab2;
    font-size: .8rem; font-weight: 500;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: rgba(61,214,200,.08); }
.pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-btn:disabled { opacity: .4; cursor: default; }

/* ── Avatar ──────────────────────────────────────────── */
.avatar {
    width: 34px; height: 34px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; border-radius: 7px; font-size: .7rem; }
.avatar-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 1.1rem; }
.avatar-xl { width: 80px; height: 80px; border-radius: 18px; font-size: 1.5rem; }

.avatar-gradient-1 { background: linear-gradient(135deg, #3dd6c8, #28b8ab); }
.avatar-gradient-2 { background: linear-gradient(135deg, #56e0d0, #3dd6c8); }
.avatar-gradient-3 { background: linear-gradient(135deg, #28b8ab, #1a8a80); }
.avatar-gradient-4 { background: linear-gradient(135deg, #f5a623, #e05555); }

/* ── Thumbnail Preview ───────────────────────────────── */
.thumb-preview {
    width: 56px; height: 38px;
    border-radius: 6px; object-fit: cover; background: var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: .7rem; overflow: hidden;
}
.thumb-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── User Profile Page ───────────────────────────────── */
.profile-hero {
    background: linear-gradient(135deg, #0d2e2c 0%, #141c1f 100%);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 2rem;
    display: flex; align-items: center; gap: 1.5rem;
    position: relative; overflow: hidden;
}
.profile-hero::before {
    content: '';
    position: absolute; right: -30px; top: -30px;
    width: 150px; height: 150px;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
}
.profile-hero::after {
    content: '';
    position: absolute; right: 60px; bottom: -50px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}

.profile-info h2 { color: #fff; font-size: 1.5rem; font-weight: 700; margin: 0; }
.profile-info p { color: rgba(255,255,255,.75); margin: .25rem 0 0; font-size: .875rem; }

.profile-body { padding: 1.5rem; border: 1.5px solid #243038; border-top: none; border-radius: 0 0 var(--radius) var(--radius); background: #141c1f; }

.info-item { margin-bottom: .875rem; }
.info-label { font-size: clamp(.68rem, 2vw, .73rem); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #3dd6c8; margin-bottom: .2rem; }
.info-value { font-size: clamp(.82rem, 3vw, .9rem); color: #e2eaec; font-weight: 500; }

/* ── Admin Profile ───────────────────────────────────── */
.profile-card-admin {
    background: #141c1f; border-radius: var(--radius); border: 1.5px solid #243038;
    overflow: hidden; box-shadow: var(--shadow);
}
.profile-cover {
    height: 120px;
    background: radial-gradient(ellipse at top, #0d2e2c 0%, #0c1518 60%, #080e11 100%);
}
.profile-card-body { padding: 0 1.5rem 1.5rem; }
.profile-avatar-wrap { margin-top: -40px; margin-bottom: 1rem; }
.profile-avatar-admin {
    width: 80px; height: 80px; border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 800; color: #fff;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
}

/* ── Chart Container ─────────────────────────────────── */
.chart-container { position: relative; }
.chart-period-btns { display: flex; gap: .375rem; }
.chart-period-btn {
    padding: .3rem .75rem;
    border-radius: 7px; font-size: .78rem; font-weight: 500;
    border: 1.5px solid #243038; background: #1a2428;
    color: #5a7a82; cursor: pointer; transition: var(--transition);
}
.chart-period-btn.active, .chart-period-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Event Type Pill ─────────────────────────────────── */
.event-pill {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .6rem; border-radius: 5px;
    font-size: .72rem; font-weight: 600;
}
.event-app_open { background: rgba(86,224,208,.1); color: #56e0d0; }
.event-app_close { background: rgba(90,122,130,.1); color: #5a7a82; }
.event-app_delete { background: rgba(224,85,85,.1); color: #f87171; }
.event-url_paste { background: rgba(61,214,200,.08); color: #3dd6c8; }
.event-download_start { background: rgba(61,214,200,.1); color: #3dd6c8; }
.event-download_complete { background: rgba(61,214,200,.14); color: #3dd6c8; }
.event-download_cancel { background: rgba(245,166,35,.1); color: #fbbf24; }
.event-download_fail { background: rgba(224,85,85,.1); color: #f87171; }
.event-limit_hit { background: rgba(245,166,35,.1); color: #f97316; }

/* ── Empty State ─────────────────────────────────────── */
.empty-state { padding: 3rem 1.5rem; text-align: center; }
.empty-state .empty-icon { font-size: 2.5rem; color: #243038; margin-bottom: 1rem; }
.empty-state h5 { font-size: 1rem; font-weight: 600; color: #8aaab2; margin-bottom: .375rem; }
.empty-state p { font-size: .85rem; color: var(--text-muted); }

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

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.visible { display: block; }
    .main-content { margin-left: 0; }
    .topbar-toggle { display: flex; }
    .topbar-user .user-name { display: none; }
}

@media (max-width: 767.98px) {
    .page-content { padding: 1rem; }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.4rem; }
    .filter-bar { gap: .5rem; }
    .topbar { padding: 0 1rem; }
}

@media (max-width: 575.98px) {
    .auth-card { padding: 1.75rem 1.25rem; background: #141c1f; }
    .page-header h1 { font-size: clamp(1rem, 4vw, 1.15rem); }
}

/* ── Utility ─────────────────────────────────────────── */
.text-primary-custom { color: var(--primary); }
.text-success-custom { color: var(--success); }
.text-danger-custom { color: var(--danger); }
.text-muted-custom { color: var(--text-muted); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.gap-8 { gap: .5rem; }
.cursor-pointer { cursor: pointer; }
.d-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.d-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.d-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 767.98px) {
    .d-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .d-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
    .d-grid-2, .d-grid-3, .d-grid-4 { grid-template-columns: 1fr; }
}