/* ============================================================
   FOXADS 365 — Dashboard Stylesheet v6.0
   - Fixed column widths (won't shrink on re-render)
   - Toggle sidebar button
   - Created date column
   - Dark/Light mode support
   ============================================================ */

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

/* ─── DARK MODE (default) ─── */
:root {
    --font-body: 'Segoe UI Historic', 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-mono: 'Segoe UI', Helvetica, Arial, sans-serif;

    --bg-root: #0a0c10;
    --bg-surface: #12151c;
    --bg-elevated: #1a1e28;
    --bg-hover: #1f2435;
    --bg-input: #0d1015;

    --border-subtle: rgba(255,255,255,0.05);
    --border-default: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.12);

    --text-primary: #e8eaf0;
    --text-secondary: #8b8fa7;
    --text-muted: #5c6078;
    --text-brand: #60a5fa;

    --accent: #1877F2;
    --accent-hover: #0d6efd;
    --accent-subtle: rgba(24,119,242,0.12);
    --accent-glow: rgba(24,119,242,0.25);

    --orange: #f59e0b;
    --orange-bg: rgba(245,158,11,0.12);
    --orange-glow: rgba(245,158,11,0.3);

    --green: #34d399; --green-bg: rgba(52,211,153,0.1); --green-text: #6ee7b7;
    --red: #f87171; --red-bg: rgba(248,113,113,0.1); --red-text: #fca5a5;
    --yellow: #fbbf24; --yellow-bg: rgba(251,191,36,0.1); --yellow-text: #fcd34d;
    --purple: #a78bfa; --purple-bg: rgba(167,139,250,0.1);

    --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
    --transition-fast: 150ms cubic-bezier(0.4,0,0.2,1);
    --transition-base: 250ms cubic-bezier(0.4,0,0.2,1);
    
    --sidebar-width: 300px;
}

/* ─── LIGHT MODE ─── */
[data-theme="light"] {
    --bg-root: #f5f7fa;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #f0f2f5;
    --bg-input: #f5f7fa;

    --border-subtle: rgba(0,0,0,0.05);
    --border-default: rgba(0,0,0,0.1);
    --border-strong: rgba(0,0,0,0.15);

    --text-primary: #1a1d24;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-brand: #1877F2;

    --accent: #1877F2;
    --accent-hover: #0d6efd;
    --accent-subtle: rgba(24,119,242,0.1);
    --accent-glow: rgba(24,119,242,0.2);

    --green: #10b981; --green-bg: rgba(16,185,129,0.1); --green-text: #059669;
    --red: #ef4444; --red-bg: rgba(239,68,68,0.1); --red-text: #dc2626;
    --yellow: #f59e0b; --yellow-bg: rgba(245,158,11,0.1); --yellow-text: #d97706;
    --purple: #8b5cf6; --purple-bg: rgba(139,92,246,0.1);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; outline:none; }
::selection { background:var(--accent); color:#fff; }

body {
    font-family: var(--font-body);
    background: var(--bg-root);
    width: 100vw; height: 100vh;
    overflow: hidden;
    display: flex; flex-direction: column;
    color: var(--text-primary);
    font-size: 13px; line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ─── HEADER ─── */
.top-nav {
    height: 64px; flex-shrink: 0;
    background: var(--bg-surface);
    display: flex; align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-default);
    justify-content: space-between;
    z-index: 100;
    position: relative;
}
[data-theme="light"] .top-nav {
    background: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.brand {
    font-weight: 800; font-size: 15px; color: var(--text-brand);
    display: flex; align-items: center; gap: 8px; letter-spacing: -0.02em;
}
.brand img {
    height: 70px;
    object-fit: contain;
}
.brand i {
    font-size: 20px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.nav-links {
    display: flex; gap: 4px;
    background: var(--bg-elevated); padding: 5px;
    border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.nav-link {
    padding: 10px 22px; border: none; background: none;
    font-weight: 700; color: var(--text-secondary);
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: 13px; letter-spacing: 0.05em;
    text-transform: uppercase; transition: var(--transition-fast);
    font-family: var(--font-body); white-space: nowrap;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px var(--accent-glow); }

.logout-btn {
    font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: var(--radius-sm); transition: var(--transition-fast);
}
.logout-btn:hover { color: var(--red); background: var(--red-bg); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 20px;
    border: 1px solid var(--border-default);
    background: var(--bg-elevated);
    cursor: pointer;
    transition: var(--transition-fast);
}
.nav-user:hover { border-color: var(--accent); background: var(--accent-subtle); }
.nav-user img {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-avatar-ph {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.nav-user-info { display: flex; flex-direction: column; gap: 1px; }
.nav-user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.2; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-id   { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); line-height: 1.2; }

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    background: var(--accent-subtle);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: var(--transition-fast);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

.theme-toggle:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.18);
}

/* ─── MAIN ─── */
.main-container {
    height: calc(100vh - 52px);
    display: flex; flex-direction: column;
    padding: 12px; overflow: hidden;
}

.content-panel {
    background: var(--bg-surface);
    border-radius: var(--radius-lg); border: 1px solid var(--border-default);
    display: flex; flex-direction: column;
    height: 100%; overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* ─── TOOLBAR ─── */
.toolbar {
    padding: 10px 16px; 
    border-bottom: 1px solid var(--border-default);
    display: flex; align-items: center;
    flex-shrink: 0; 
    background: var(--bg-surface); 
    height: 56px;
    gap: 12px;
    position: relative;
}

.toolbar-left {
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0;
    z-index: 1;
}

.toolbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    max-width: 380px;
}

.toolbar-right {
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
    z-index: 1;
}

.toolbar-divider { 
    width: 1px; height: 24px; 
    background: var(--border-strong); 
    margin: 0 4px; 
}

/* Search Box */
.search-box-center {
    display: flex; align-items: center;
    background: var(--bg-input); 
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md); 
    padding: 0 14px;
    transition: var(--transition-fast);
    width: 100%;
}
.search-box-center:focus-within { 
    border-color: var(--accent); 
    box-shadow: 0 0 0 3px var(--accent-subtle);
    background: var(--bg-elevated);
}
.search-box-center i { color: var(--text-muted); font-size: 16px; }
.search-box-center .search-input {
    border: none; background: transparent; 
    padding: 10px 12px;
    font-size: 13px; width: 100%; 
    color: var(--text-primary); 
    font-family: var(--font-body);
}
.search-box-center .search-input::placeholder { color: var(--text-muted); }
.search-box-center kbd {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Thread / Delay controls */
.run-controls {
    display: flex; align-items: center; gap: 6px;
    margin-left: 8px;
    flex-shrink: 0;
}
.run-control-item {
    display: flex; align-items: center; gap: 5px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 5px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    white-space: nowrap;
}
.run-control-item:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-subtle);
}
.run-control-item i { color: var(--text-muted); font-size: 13px; flex-shrink:0; }
.run-control-item label { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.run-control-input {
    border: none; background: transparent;
    width: 36px; font-size: 12px; font-weight: 600;
    color: var(--text-primary); font-family: var(--font-mono);
    text-align: center; padding: 0;
}
.run-control-input::-webkit-inner-spin-button,
.run-control-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.run-control-input:focus { outline: none; }

/* toolbar-center-wrap: replaces toolbar-center as the absolutely-centered container */
.toolbar-center-wrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}
.toolbar-center-wrap .toolbar-center {
    position: static;
    transform: none;
    width: 280px;
    max-width: 280px;
}

.selected-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
}

/* Toggle Sidebar Button */
.btn-toggle-sidebar {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-default);
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-body);
    background: var(--bg-elevated);
    color: var(--text-secondary);
}
.btn-toggle-sidebar:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}
.btn-toggle-sidebar.active {
    background: var(--accent-subtle);
    color: var(--accent);
    border-color: var(--accent);
}

/* ─── BUTTONS ─── */
.btn {
    padding: 8px 14px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid transparent; cursor: pointer;
    transition: var(--transition-fast); font-family: var(--font-body);
    white-space: nowrap; line-height: 1;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 2px 10px var(--accent-glow); }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(248,113,113,0.2); }
.btn-danger:hover:not(:disabled) { background: var(--red-bg); }
.btn-green { background: #059669; color: #fff; border-color: #059669; }
.btn-green:hover:not(:disabled) { background: #10b981; box-shadow: 0 2px 10px rgba(16,185,129,0.25); }
.btn-sm { padding: 6px 12px; font-size: 11px; }

/* ─── TABLE LAYOUT ─── */
.panel-body { 
    display: flex; flex: 1; overflow: hidden; 
    position: relative; height: 100%;
    align-items: stretch;
}

.table-wrapper {
    flex: 1; 
    min-width: 0;
    height: calc(100% - 52px); 
    overflow-x: scroll;
    overflow-y: auto;
    position: relative;
    background: var(--bg-surface);
    padding-bottom: 0;
}

/* Custom scrollbar */
.table-wrapper::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrapper::-webkit-scrollbar-track { background: var(--bg-elevated); border-radius: 4px; }
.table-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 4px; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.45); }
.table-wrapper::-webkit-scrollbar-corner { background: var(--bg-elevated); }
[data-theme="light"] .table-wrapper::-webkit-scrollbar-track { background: #f0f2f5; }
[data-theme="light"] .table-wrapper::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); }
[data-theme="light"] .table-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.38); }

/* ─── DATA TABLE - FIXED WIDTHS ─── */
.data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

/* Sticky Header */
.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table thead th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    padding: 10px 10px;
    border-bottom: none;
    border-right: 1px solid var(--border-default);
    box-shadow: inset 0 -2px 0 var(--border-strong), 0 2px 4px rgba(0,0,0,0.3);
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    position: relative;
    user-select: none;
    transition: background var(--transition-fast);
}
.data-table thead th:last-child {
    border-right: none;
}

.data-table thead th:hover {
    background: var(--bg-hover);
}

.data-table thead th.sortable {
    cursor: pointer;
}

/* FIXED Column Widths - Using min-width and max-width */
.data-table th, .data-table td {
    box-sizing: border-box;
}

.col-check      { width: 36px;  min-width: 36px;  max-width: 36px;  text-align: center !important; }
.col-status     { width: 90px;  min-width: 90px;  max-width: 90px;  text-align: center !important; }
td.col-status   { overflow: visible !important; text-overflow: clip !important; white-space: nowrap !important; }
.col-type       { width: 65px;  min-width: 65px;  max-width: 65px;  text-align: center !important; }
.col-acctype    { width: 72px;  min-width: 72px;  max-width: 72px;  text-align: center !important; }
.col-name       { width: 180px; min-width: 160px; text-align: left !important; }
.col-id         { width: 150px; min-width: 150px; max-width: 160px; text-align: left !important; }
.col-bm         { width: 140px; min-width: 120px; max-width: 180px; text-align: left !important; }
.col-role       { width: 76px;  min-width: 76px;  max-width: 90px;  text-align: center !important; }
.col-admins     { width: 58px;  min-width: 58px;  max-width: 70px;  text-align: center !important; }
.col-limit      { width: 90px;  min-width: 90px;  max-width: 110px; text-align: right !important; }
.col-currency   { width: 58px;  min-width: 58px;  max-width: 65px;  text-align: center !important; }
.col-spend      { width: 90px;  min-width: 90px;  max-width: 110px; text-align: right !important; }
.col-threshold  { width: 90px;  min-width: 90px;  max-width: 110px; text-align: right !important; }
.col-balance    { width: 90px;  min-width: 90px;  max-width: 110px; text-align: right !important; }
.col-country    { width: 72px;  min-width: 72px;  max-width: 80px;  text-align: center !important; }
.col-timezone   { width: 150px; min-width: 140px; text-align: left !important; }
.col-payment    { width: 160px; min-width: 150px; text-align: left !important; }
.col-billperiod { width: 120px; min-width: 110px; text-align: center !important; }
.col-nextbill   { width: 90px;  min-width: 90px;  max-width: 100px; text-align: center !important; }
.col-ads        { width: 110px; min-width: 110px; max-width: 110px; text-align: center !important; }
.col-verify     { width: 70px;  min-width: 70px;  max-width: 70px;  text-align: center !important; }
.col-pages      { width: 55px;  min-width: 55px;  max-width: 55px;  text-align: center !important; }
.col-shared     { width: 110px; min-width: 110px; max-width: 110px; text-align: center !important; }
.col-ig         { width: 45px;  min-width: 45px;  max-width: 45px;  text-align: center !important; }
.col-ads-status { width: 90px;  min-width: 90px;  max-width: 90px;  text-align: center !important; }
.col-created    { width: 90px;  min-width: 90px;  max-width: 100px; text-align: center !important; }
.col-likes      { width: 90px;  min-width: 90px;  max-width: 90px;  text-align: right !important; }
.col-followers  { width: 90px;  min-width: 90px;  max-width: 90px;  text-align: right !important; }
.col-category   { width: 130px; min-width: 110px; max-width: 150px; text-align: left !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-log        { width: 220px; min-width: 180px; text-align: left !important; }
.bm-owner-link { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--accent); font-family: var(--font-mono); text-decoration: none; background: rgba(99,102,241,0.08); border: 1px solid rgba(24,119,242,0.2); border-radius: 5px; padding: 2px 7px; white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; transition: background 0.15s, border-color 0.15s; }
.bm-owner-link:hover { background: rgba(24,119,242,0.15); border-color: rgba(99,102,241,0.4); color: var(--accent); }
.bm-owner-link i { font-size: 10px; flex-shrink: 0; }
.page-name-link { color: var(--text-primary); text-decoration: none; font-weight: 500; transition: color 0.15s; }
.page-name-link:hover { color: var(--accent); text-decoration: underline; }

/* BM Owner cell with eye toggle */
.bm-owner-cell {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
}
.bm-owner-cell .bm-name {
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}
.bm-owner-cell .bm-id code {
    font-size: 11px;
    color: var(--text-brand);
    font-family: var(--font-mono);
    white-space: nowrap;
}
.bm-eye-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 1px 3px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    display: inline-flex;
    align-items: center;
}
.bm-eye-btn:hover {
    color: var(--accent);
    background: rgba(24,119,242,0.1);
}

/* ─── Column Resize Handle ─── */
.resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 1;
    user-select: none;
    border-right: 2px solid transparent;
    transition: border-color 0.15s;
}
.resizer:hover,
.resizer.resizing {
    border-right-color: var(--accent);
}

/* ─── Column Drag & Reorder ─── */
thead th[draggable="true"] {
    cursor: grab;
}
thead th[draggable="true"]:active {
    cursor: grabbing;
}

th.col-dragging {
    opacity: 0.4;
    background: var(--bg-hover) !important;
}

th.col-drag-over {
    background: rgba(24,119,242,0.12) !important;
    box-shadow: inset 3px 0 0 var(--accent);
    position: relative;
}
th.col-drag-over::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* Table Body */
.data-table tbody tr {
    transition: background var(--transition-fast);
}

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

.data-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-default);
    border-right: 1px solid var(--border-default);
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.data-table tbody td:last-child {
    border-right: none;
}

.empty-state { 
    padding: 0 !important;
    text-align: center !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}
td.empty-state {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}
td.empty-state > * {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
}
.empty-state-content {
    position: sticky;
    left: 0;
    width: calc(100vw - 300px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

/* Row selection */
.data-table tbody tr.row-selected {
    background: var(--accent-subtle) !important;
}
.data-table tbody tr.row-selected td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

/* Checkbox */
input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Code styling */
code {
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--bg-elevated);
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--text-brand);
    border: 1px solid var(--border-subtle);
}

/* Badges */
.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: inline-block;
    line-height: 1.3;
    text-transform: uppercase;
}
.bg-live { background: var(--green-bg); color: var(--green-text); border: 1px solid rgba(52,211,153,0.2); }
.bg-die { background: var(--red-bg); color: var(--red-text); border: 1px solid rgba(248,113,113,0.2); }
.bg-warn { background: var(--yellow-bg); color: var(--yellow-text); border: 1px solid rgba(251,191,36,0.2); }
.bg-purple { background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(167,139,250,0.2); }
.bg-gray { background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

/* Name cell with avatar */
.cell-name {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}
.cell-name img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
.cell-name .avatar-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--accent-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}
.cell-name span {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── SIDEBAR ─── */
.action-sidebar {
    width: var(--sidebar-width);
    border-left: 1px solid var(--border-default);
    background: var(--bg-root);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

/* Sidebar hidden state */
.action-sidebar.hidden {
    width: 0;
    border-left: none;
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-header i { color: var(--accent); }

/* Sidebar Actions */
.sidebar-actions {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
    text-align: left;
}

.sidebar-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.sidebar-btn i {
    font-size: 14px;
    color: var(--accent);
}

.sidebar-btn.btn-warn {
    border-color: rgba(251,191,36,0.3);
}
.sidebar-btn.btn-warn:hover {
    background: var(--yellow-bg);
    border-color: var(--yellow);
}
.sidebar-btn.btn-warn i {
    color: var(--yellow);
}

.sidebar-btn.btn-danger {
    border-color: rgba(248,113,113,0.3);
}
.sidebar-btn.btn-danger:hover {
    background: var(--red-bg);
    border-color: var(--red);
}
.sidebar-btn.btn-danger i {
    color: var(--red);
}

.sidebar-btn.btn-success {
    border-color: rgba(52,211,153,0.3);
}
.sidebar-btn.btn-success:hover {
    background: var(--green-bg);
    border-color: var(--green);
}
.sidebar-btn.btn-success i {
    color: var(--green);
}

.sidebar-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 0;
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select {
    cursor: pointer;
}

.modal-note {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

.modal-note i {
    color: var(--accent);
}

.modal-sm {
    max-width: 380px;
}

/* ─── Scan Modal ─── */
.scan-section { margin-bottom: 14px; }
.scan-section:last-child { margin-bottom: 0; }
.scan-section-title { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }

.scan-radio-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border: 1.5px solid var(--border-default); border-radius: 8px;
    margin-bottom: 6px; cursor: pointer; transition: all .15s; font-size: 13px; color: var(--text-primary);
}
.scan-radio-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.scan-radio-card.active { border-color: var(--accent); background: rgba(99,102,241,.08); }
.radio-dot {
    width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong);
    position: relative; flex-shrink: 0; transition: all .15s;
}
.scan-radio-card.active .radio-dot,
.scan-chip.active .radio-dot { border-color: var(--accent); }
.scan-radio-card.active .radio-dot::after,
.scan-chip.active .radio-dot::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px;
    border-radius: 50%; background: var(--accent);
}

.scan-radio-row { display: flex; gap: 8px; flex-wrap: wrap; }

.scan-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px; border: 1.5px solid var(--border-default); border-radius: 20px;
    cursor: pointer; font-size: 12px; color: var(--text-primary); transition: all .15s;
}
.scan-chip:hover { border-color: var(--accent); }
.scan-chip.active { border-color: var(--accent); background: rgba(99,102,241,.08); }
.scan-chip .radio-dot { width: 14px; height: 14px; }
.scan-chip.active .radio-dot::after { top: 2px; left: 2px; width: 6px; height: 6px; }

.scan-check-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px; border: 1.5px solid var(--border-default); border-radius: 20px;
    cursor: pointer; font-size: 12px; color: var(--text-primary); transition: all .15s;
}
.scan-check-chip:hover { border-color: var(--accent); }
.scan-check-chip:has(input:checked) { border-color: var(--accent); background: rgba(99,102,241,.08); }
.scan-check-chip input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

.scan-sub-input { margin-top: 6px; }
.scan-sub-input textarea,
.scan-sub-input input { font-size: 12px; }

.actions-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 12px;
}
.actions-scroll::-webkit-scrollbar { width: 6px; }
.actions-scroll::-webkit-scrollbar-track { background: var(--bg-elevated); border-radius: 10px; }
.actions-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 10px; }
.actions-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }
[data-theme="light"] .actions-scroll::-webkit-scrollbar-track { background: #f0f2f5; }
[data-theme="light"] .actions-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); }
[data-theme="light"] .actions-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.empty-sidebar {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* Action Cards */
.action-card {
    background: var(--bg-surface);
    margin: 10px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}
.action-card:hover {
    border-color: var(--border-strong);
}

/* Highlighted Action Card */
.action-card-highlight {
    border-color: var(--orange);
    background: linear-gradient(135deg, var(--orange-bg), transparent);
}
.action-card-highlight .action-title i {
    color: var(--orange) !important;
}
.action-card-highlight:hover {
    border-color: var(--orange);
    box-shadow: 0 0 15px var(--orange-glow);
}

.action-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
}
.action-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}
.action-title i {
    color: var(--accent);
    font-size: 16px;
}

.action-config {
    padding: 0 14px 14px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

/* Forms */
.form-group {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.form-group label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.form-row {
    display: flex;
    gap: 10px;
}

.form-input {
    padding: 8px 10px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 12px;
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: var(--transition-fast);
}
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; line-height: 1.5; font-family: 'Segoe UI', monospace; }

/* Searchable Select */
.ss-wrap { position: relative; }
.ss-wrap .ss-input { cursor: pointer; padding-right: 28px; }
.ss-wrap .ss-input::placeholder { color: var(--text-muted); }
.ss-wrap::after {
    content: '▾'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 10px; color: var(--text-muted); pointer-events: none;
}
.ss-dropdown {
    display: none; position: fixed; z-index: 9999;
    background: var(--bg-elevated); border: 1px solid var(--border-default);
    border-radius: 0 0 6px 6px; max-height: 200px; overflow-y: auto;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}
.ss-wrap.open .ss-dropdown { display: block; }
.ss-wrap.open .ss-input { border-radius: 6px 6px 0 0; border-color: var(--accent); }
.ss-dropdown .ss-item {
    padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--text-primary);
    display: flex; justify-content: space-between; align-items: center;
}
.ss-dropdown .ss-item:hover { background: var(--accent-subtle); }
.ss-dropdown .ss-item.active { background: var(--accent-subtle); color: var(--accent); font-weight: 600; }
.ss-dropdown .ss-group {
    padding: 4px 12px 2px; font-size: 10px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-surface);
    position: sticky; top: 0;
}
.ss-dropdown .ss-item .ss-code { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.ss-dropdown::-webkit-scrollbar { width: 5px; }
.ss-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-subtle);
}
.form-input:disabled,
.form-input[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-input-highlight {
    border-color: var(--accent) !important;
    color: var(--text-brand) !important;
    font-weight: 600;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}
select.form-input option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-hover);
    border: 1px solid var(--border-default);
    transition: var(--transition-base);
    border-radius: 34px;
}
.slider::before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    transition: var(--transition-base);
    border-radius: 50%;
}
input:checked + .slider {
    background: var(--accent);
    border-color: var(--accent);
}
input:checked + .slider::before {
    transform: translateX(16px);
    background: #fff;
}

/* ─── TOKEN & LOGS TAB ─── */
.token-logs-container,
.profile-logs-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
}

/* ─── PROFILE PAGE ─── */
/* ====== HOME PAGE ====== */
.home-page {
    display: flex; flex-direction: column; gap: 16px;
    padding: 24px; height: 100%; overflow-y: auto;
    max-width: 1100px; margin: 0 auto; width: 100%;
}

/* Banner */
.home-banner {
    background: linear-gradient(135deg, #0d47a1 0%, #1877F2 50%, #42a5f5 100%);
    border-radius: 14px; padding: 24px 28px;
    display: flex; align-items: center; gap: 20px;
    position: relative;
}
.home-banner::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.home-banner-left { display: flex; align-items: center; gap: 18px; flex: 1; position: relative; z-index: 1; }
.home-avatar-wrap {
    width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.1);
    position: relative;
}
.home-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.home-avatar-ph {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: rgba(255,255,255,0.6);
}
.home-banner-info { color: #fff; }
.home-banner-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.home-banner-uid {
    font-size: 11px; color: rgba(255,255,255,0.7); display: flex; align-items: center;
    gap: 5px; margin-bottom: 3px; font-family: var(--font-mono);
}
.home-banner-uid i { font-size: 12px; }
.home-banner-right {
    display: flex; gap: 10px; position: relative; flex-shrink: 0; z-index: 1;
}
.home-banner-meta {
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px; padding: 10px 16px; text-align: center; backdrop-filter: blur(8px);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.home-banner-meta i { font-size: 16px; color: rgba(255,255,255,0.7); }
.home-banner-meta span { font-size: 13px; font-weight: 600; color: #fff; }
.home-banner-meta small { font-size: 10px; color: rgba(255,255,255,0.6); }
.home-refresh-btn {
    align-self: flex-start;
    margin-left: 8px;
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 15px; transition: all 0.15s; flex-shrink: 0;
    position: relative; z-index: 1;
}
.home-refresh-btn:hover { background: rgba(255,255,255,0.25); }

/* Stats */
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.home-stat {
    background: var(--bg-elevated); border: 1px solid var(--border-default);
    border-radius: 12px; padding: 18px; display: flex; gap: 14px; align-items: flex-start;
    transition: var(--transition-fast);
}
.home-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.home-stat-icon {
    width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.home-stat-purple .home-stat-icon { background: rgba(24,119,242,0.12); color: #1877F2; }
.home-stat-green  .home-stat-icon { background: rgba(52,211,153,0.12);  color: #34d399; }
.home-stat-yellow .home-stat-icon { background: rgba(251,191,36,0.12);  color: #fbbf24; }
.home-stat-body { flex: 1; }
.home-stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.home-stat-num { font-size: 30px; font-weight: 700; color: var(--text-primary); line-height: 1.1; margin-bottom: 6px; }
.home-stat-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* Main grid */
.home-main { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }

/* Cards */
.home-card {
    background: var(--bg-elevated); border: 1px solid var(--border-default);
    border-radius: 12px; padding: 18px;
}
.home-left { display: flex; flex-direction: column; gap: 12px; }
.home-card-title {
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 7px; margin-bottom: 14px;
}
.home-card-title i { color: var(--accent); font-size: 15px; }

/* Quick Links */
.home-ql-grid { display: flex; flex-direction: column; gap: 8px; }
.home-ql {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none;
    transition: all 0.15s;
}
.home-ql i { font-size: 17px; }
.home-ql-purple { background: rgba(24,119,242,0.1); color: #1877F2; border: 1px solid rgba(24,119,242,0.2); }
.home-ql-green  { background: rgba(52,211,153,0.1); color: #34d399; border: 1px solid rgba(52,211,153,0.2); }
.home-ql-orange { background: rgba(245,158,11,0.1);  color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.home-ql-purple:hover { background: rgba(24,119,242,0.2); }
.home-ql-green:hover  { background: rgba(52,211,153,0.2); }
.home-ql-orange:hover { background: rgba(245,158,11,0.2); }

/* App info */
.home-app-rows { display: flex; flex-direction: column; }
.home-app-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-subtle);
}
.home-app-row:last-child { border-bottom: none; }
.home-app-row > span:first-child { color: var(--text-muted); }
.home-app-row > span:last-child { color: var(--text-primary); font-weight: 600; }
.home-badge {
    font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.home-badge-purple { background: rgba(24,119,242,0.15); color: #60a5fa; }
.home-badge-blue   { background: rgba(59,130,246,0.15);  color: #60a5fa; }

/* Changelog */
.home-changelog { height: fit-content; }
.home-cl-list { display: flex; flex-direction: column; gap: 0; }
.home-cl-item {
    display: flex; gap: 14px; padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.home-cl-item:last-child { border-bottom: none; padding-bottom: 0; }
.home-cl-ver {
    font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
    height: fit-content; flex-shrink: 0; margin-top: 2px;
}
.home-cl-purple { background: rgba(24,119,242,0.15); color: #60a5fa; }
.home-cl-blue   { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.home-cl-gray   { background: var(--bg-hover); color: var(--text-muted); }
.home-cl-content { flex: 1; }
.home-cl-date { font-size: 10px; color: var(--text-muted); margin-bottom: 6px; }
.home-cl-notes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.home-cl-notes li { font-size: 12px; color: var(--text-secondary); display: flex; align-items: flex-start; gap: 7px; line-height: 1.5; }
.home-cl-tag {
    font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 4px; flex-shrink: 0; margin-top: 2px;
}
.home-cl-tag.new { background: rgba(52,211,153,0.15); color: #34d399; }
.home-cl-tag.fix { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.home-cl-tag.imp { background: rgba(24,119,242,0.15);  color: #60a5fa; }

/* Legacy profile CSS - kept for backwards compat */
.profile-page {
    display: flex; flex-direction: column; gap: 16px;
    padding: 24px; height: 100%; overflow-y: auto;
    max-width: 840px; margin: 0 auto; width: 100%;
}
.pf-card {
    background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 10px; padding: 20px;
}
.pf-user { display: flex; align-items: center; gap: 16px; }
.pf-avatar {
    width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
    position: relative; background: var(--bg-hover); flex-shrink: 0;
}
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.pf-avatar-ph {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--text-muted);
}
.pf-detail { flex: 1; min-width: 0; }
.pf-name { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.pf-uid { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin: 2px 0 8px; }
.pf-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px; color: var(--text-secondary); }
.pf-meta span { display: flex; align-items: center; gap: 4px; }
.pf-meta i { color: var(--text-muted); font-size: 13px; }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pf-stat {
    background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 10px;
    padding: 16px; display: flex; flex-direction: column; gap: 8px;
    border-top: 3px solid transparent; transition: var(--transition-fast);
}
.pf-stat-purple { border-top-color: #1877F2; }
.pf-stat-green  { border-top-color: #34d399; }
.pf-stat-yellow { border-top-color: #fbbf24; }
.pf-stat-head { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; display: flex; align-items: center; gap: 6px; }
.pf-stat-purple .pf-stat-head i { color: #1877F2; }
.pf-stat-green  .pf-stat-head i { color: #34d399; }
.pf-stat-yellow .pf-stat-head i { color: #fbbf24; }
.pf-stat-num { font-size: 32px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.pf-stat-tags { display: flex; gap: 6px; }
.pf-tag-green, .pf-tag-red {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.pf-tag-green { background: rgba(52,211,153,0.1); color: #34d399; }
.pf-tag-red   { background: rgba(239,68,68,0.1);   color: #ef4444; }
.pf-app { display: flex; justify-content: center; }
.pf-app-box {
    background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 10px;
    padding: 16px 20px; width: 100%; max-width: 340px;
}
.pf-app-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.pf-app-title i { color: var(--accent); font-size: 15px; }
.pf-app-rows { display: flex; flex-direction: column; }
.pf-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 5px 0; border-bottom: 1px solid var(--border-subtle); }
.pf-row:last-child { border-bottom: none; }
.pf-row span:first-child { color: var(--text-muted); }
.pf-row span:last-child { color: var(--text-primary); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.pf-bottom-row { display: grid; grid-template-columns: 1fr 340px; gap: 12px; align-items: start; }
.pf-quicklinks-box { background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 10px; padding: 16px 20px; }
.pf-quicklinks { display: flex; gap: 10px; flex-wrap: wrap; }
.pf-ql-btn { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; transition: all 0.15s; flex: 1; min-width: 120px; justify-content: center; }
.pf-ql-btn i { font-size: 16px; }
.pf-ql-blue  { background: rgba(24,119,242,0.12); color: #1877F2; border: 1px solid rgba(24,119,242,0.25); }
.pf-ql-green { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.25); }
.pf-ql-orange{ background: rgba(245,158,11,0.12);  color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.pf-ql-blue:hover  { background: rgba(99,102,241,0.22); }
.pf-ql-green:hover { background: rgba(52,211,153,0.22); }
.pf-ql-orange:hover{ background: rgba(245,158,11,0.22); }
.pf-whatsnew { background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 10px; padding: 16px 20px; }
.pf-whatsnew-header { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.pf-whatsnew-header i { color: #f59e0b; font-size: 15px; }
.pf-version-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; background: rgba(24,119,242,0.15); color: var(--accent); border-radius: 20px; margin-left: auto; }
.pf-whatsnew-list { display: flex; flex-direction: column; gap: 8px; }
.pf-wn-item { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.pf-wn-tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; margin-top: 1px; }
.pf-wn-new { background: rgba(52,211,153,0.15); color: #34d399; }
.pf-wn-fix { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.pf-wn-imp { background: rgba(24,119,242,0.15);  color: #60a5fa; }

.logs-box {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.version-box {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface);
}

.box-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.box-header i {
    color: var(--accent);
}

.logs-box .logs-content {
    flex: 1;
    overflow-y: auto;
    font-size: 11px;
}

.version-content {
    padding: 12px;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.version-item:last-of-type {
    border-bottom: none;
}

.version-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.version-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.version-status {
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Responsive */
@media (max-width: 900px) {
    .pf-stats { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .pf-user { flex-wrap: wrap; }
}

/* ─── LOG COLUMN (per-row in table) ─── */
.col-log {
    min-width: 180px;
    max-width: 280px;
    width: 220px;
}

.cell-log {
    font-size: 10px;
    font-family: var(--font-mono);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
}

.cell-log .log-idle {
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 11px;
}

.row-log-entry {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    line-height: 1.4;
}
.row-log-entry i {
    flex-shrink: 0;
    font-size: 11px;
}
.row-log-success { color: var(--green); }
.row-log-success i { color: var(--green); }
.row-log-error { color: var(--red); }
.row-log-error i { color: var(--red); }
.row-log-warn { color: #f59e0b; }
.row-log-warn i { color: #f59e0b; }
.row-log-info { color: var(--text-brand); }
.row-log-info i { color: var(--text-brand); }

.logs-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    overflow: hidden;
}

.logs-header {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-surface);
}
.logs-header i {
    color: var(--accent);
    margin-right: 6px;
}

.logs-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    font-size: 11px;
    font-family: var(--font-mono);
}
.logs-content::-webkit-scrollbar { width: 6px; }
.logs-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.log-item {
    margin-bottom: 4px;
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-subtle);
    line-height: 1.5;
    word-break: break-word;
}
.log-time {
    color: var(--text-muted);
    font-size: 10px;
    flex-shrink: 0;
    min-width: 60px;
}
.log-msg { color: var(--text-secondary); }
.log-success { color: var(--green); }
.log-error { color: var(--red); }
.log-info { color: var(--text-brand); }

.btn-clear {
    border: none;
    background: var(--bg-elevated);
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-clear:hover {
    color: var(--red);
    background: var(--red-bg);
}

/* ─── OVERLAYS ─── */
.overlay-screen {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: none;
}

.auth-box {
    background: var(--bg-surface);
    width: 400px;
    padding: 40px;
    border-radius: var(--radius-xl);
    text-align: center;
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: authIn 0.2s ease;
}
@keyframes authIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-icon-circle {
    width: 60px;
    height: 60px;
    background: var(--accent-subtle);
    color: var(--accent);
    font-size: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    border: 1px solid rgba(24,119,242,0.2);
}
.auth-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.auth-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.input-group {
    position: relative;
    margin-bottom: 18px;
}
.input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}
.input-key-pro {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-mono);
    transition: var(--transition-fast);
}
.input-key-pro:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.btn-auth-pro {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-body);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.02em;
}
.btn-auth-pro:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* ─── SORTABLE HEADERS ─── */
.sort-icon {
    margin-left: 4px;
    opacity: 0.4;
    font-size: 10px;
}
th.sorted .sort-icon {
    opacity: 1;
    color: var(--accent);
}

/* Cell Links */
.cell-link {
    text-decoration: none;
    color: inherit;
    transition: opacity var(--transition-fast);
}
.cell-link:hover { opacity: 0.75; }
.cell-link code { cursor: pointer; }
.cell-link code:hover { text-decoration: underline; }

/* ─── STATS FOOTER BAR ─── */
.stats-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 20;
}

.stats-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 700;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 800;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.stat-badge.bg-live {
    background: var(--green-bg);
    color: var(--green-text);
    border-color: rgba(52,211,153,0.3);
}

.stat-badge.bg-die {
    background: var(--red-bg);
    color: var(--red-text);
    border-color: rgba(248,113,113,0.3);
}

.stat-badge.bg-selected {
    background: var(--accent-subtle);
    color: var(--accent);
    border-color: rgba(24,119,242,0.3);
}

.stat-badge.bg-warn {
    background: var(--yellow-bg);
    color: var(--yellow-text);
    border-color: rgba(251,191,36,0.3);
}

.stat-divider {
    width: 1px;
    height: 20px;
    background: var(--border-default);
    margin: 0 4px;
}

.stats-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.currency-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.currency-selector i {
    font-size: 16px;
    color: var(--accent);
}

.currency-selector select {
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: var(--transition-fast);
}

.currency-selector select:hover {
    border-color: var(--accent);
}

.currency-selector select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

/* ─── SPIN ANIMATION ─── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.ri-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
    .action-sidebar { --sidebar-width: 280px; }
    .toolbar-center { width: 260px; max-width: 260px; }
    .profile-logs-container { padding: 12px; }
}

@media (max-width: 900px) {
    .action-sidebar { display: none; }
    .btn-toggle-sidebar { display: none; }
    .nav-link { font-size: 10px; padding: 6px 10px; }
    .toolbar-center { display: none; }
    .token-logs-container,
    .profile-logs-container { flex-direction: column; padding: 10px; }
    .secret-item { min-width: 100%; }
}

/* ─── DROPDOWN FILTER ─── */
.dropdown-filter {
    position: relative;
    display: inline-block;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.dropdown-menu {
    display: none;
    position: fixed;
    min-width: 130px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    padding: 8px 0;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.live {
    background: var(--green);
}

.status-dot.die {
    background: var(--red);
}

.count-badge {
    margin-left: auto;
    background: var(--bg-hover);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 0;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: var(--transition-fast);
}

.dropdown-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

/* ─── MODAL ─── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.2s ease-out;
}

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

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--accent);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-textarea {
    width: 100%;
    height: 150px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 12px;
    resize: vertical;
    transition: var(--transition-fast);
}

.modal-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.modal-textarea::placeholder {
    color: var(--text-muted);
}

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

/* ─── Payment Method Column ─── */
.pm-cell { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; }
.pm-img { height: 14px; width: auto; border-radius: 2px; object-fit: contain; flex-shrink: 0; }
.pm-num { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--text-primary); letter-spacing: 0.3px; }
.pm-badge { display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 3px; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
.pm-paypal { background: #003087; }
.pm-status { display: inline-flex; padding: 2px 5px; border-radius: 3px; font-size: 9px; font-weight: 600; flex-shrink: 0; line-height: 1; }
.pm-active { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.25); }
.pm-verify { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.pm-expired { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.25); }
.pm-nofunds { background: rgba(168,85,247,0.15); color: #a855f7; border: 1px solid rgba(168,85,247,0.25); }
.pm-dot { color: var(--text-muted); font-size: 10px; }
.pm-extra { color: var(--text-muted); font-size: 9px; margin-left: 2px; }
.col-payment { width: 160px; min-width: 150px; max-width: 160px; text-align: left !important; }
.col-threshold { width: 90px; min-width: 90px; max-width: 90px; text-align: right !important; }

/* ─── New Columns: Type, Role, Country, Spend ─── */
.col-acctype { width: 75px; min-width: 75px; max-width: 75px; text-align: center !important; }
.col-role { width: 80px; min-width: 80px; max-width: 80px; text-align: center !important; }
.col-country { width: 60px; min-width: 60px; max-width: 60px; text-align: center !important; font-family: var(--font-mono); font-size: 11px; }
.col-spend { width: 100px; min-width: 100px; max-width: 100px; text-align: right !important; }

.type-badge { display: inline-flex; padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; line-height: 1.2; }
.type-biz { background: rgba(24,119,242,0.15); color: #60a5fa; border: 1px solid rgba(24,119,242,0.2); }
.type-personal { background: rgba(156,163,175,0.15); color: #9ca3af; border: 1px solid rgba(156,163,175,0.2); }

.role-badge { display: inline-flex; padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; line-height: 1.2; }
.role-admin { background: rgba(24,119,242,0.15); color: #60a5fa; border: 1px solid rgba(24,119,242,0.25); }
.role-adv { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.role-analyst { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.role-other { background: rgba(156,163,175,0.15); color: #9ca3af; border: 1px solid rgba(156,163,175,0.2); }

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATION SYSTEM
   ═══════════════════════════════════════════════════════ */
#toast-container {
    position: fixed;
    top: 64px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.fox-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    min-width: 300px;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.15);
    pointer-events: all;
    cursor: default;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.2s ease-out forwards;
    border: 1px solid transparent;
}

.fox-toast.toast-out {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(120%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(120%); }
}

.fox-toast.toast-success {
    background: linear-gradient(135deg, rgba(16,185,129,0.12) 0%, rgba(6,78,59,0.08) 100%);
    border-color: rgba(16,185,129,0.3);
}
.fox-toast.toast-error {
    background: linear-gradient(135deg, rgba(239,68,68,0.12) 0%, rgba(127,29,29,0.08) 100%);
    border-color: rgba(239,68,68,0.3);
}
.fox-toast.toast-warning {
    background: linear-gradient(135deg, rgba(245,158,11,0.12) 0%, rgba(120,53,15,0.08) 100%);
    border-color: rgba(245,158,11,0.3);
}
.fox-toast.toast-info {
    background: linear-gradient(135deg, rgba(24,119,242,0.12) 0%, rgba(49,46,129,0.08) 100%);
    border-color: rgba(24,119,242,0.3);
}

[data-theme="light"] .fox-toast {
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.12);
    background: #ffffff;
    color: #1a1a1a;
}
[data-theme="light"] .fox-toast.toast-success { background: #f0fdf4; border-color: rgba(16,185,129,0.5); }
[data-theme="light"] .fox-toast.toast-error   { background: #fff1f2; border-color: rgba(239,68,68,0.5); }
[data-theme="light"] .fox-toast.toast-warning { background: #fffbeb; border-color: rgba(245,158,11,0.5); }
[data-theme="light"] .fox-toast.toast-info    { background: #eff6ff; border-color: rgba(99,102,241,0.5); }

.toast-icon-wrap {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.toast-success .toast-icon-wrap { background: rgba(16,185,129,0.2);  color: #10b981; }
.toast-error   .toast-icon-wrap { background: rgba(239,68,68,0.2);   color: #ef4444; }
.toast-warning .toast-icon-wrap { background: rgba(245,158,11,0.2);  color: #f59e0b; }
.toast-info    .toast-icon-wrap { background: rgba(24,119,242,0.2);  color: #60a5fa; }

.toast-content { flex: 1; min-width: 0; padding-top: 2px; }
.toast-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 2px;
}
.toast-msg {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
    margin-top: 1px;
}
.toast-close:hover { color: var(--text-primary); background: var(--bg-hover); }

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    animation: toastProgress linear forwards;
    transform-origin: left;
}
.toast-success .toast-progress { background: #10b981; }
.toast-error   .toast-progress { background: #ef4444; }
.toast-warning .toast-progress { background: #f59e0b; }
.toast-info    .toast-progress { background: #60a5fa; }

@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ═══════════════════════════════════════════════════════
   FOXMODAL REDESIGN — Professional Dialog
   ═══════════════════════════════════════════════════════ */
.fox-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    animation: fmOverlayIn 0.15s ease;
}
@keyframes fmOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fox-modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    width: 400px;
    max-width: 92vw;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.2);
    animation: fmBoxIn 0.2s ease forwards;
    overflow: hidden;
    position: relative;
}
.fox-modal-box.fm-danger { border-top: 3px solid #ef4444; }
.fox-modal-box.fm-warning { border-top: 3px solid #f59e0b; }
.fox-modal-box.fm-info { border-top: 3px solid #60a5fa; }
.fox-modal-box.fm-success { border-top: 3px solid #10b981; }

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

.fox-modal-icon-area {
    display: flex;
    justify-content: center;
    padding: 28px 24px 12px;
}
.fox-modal-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.fm-danger  .fox-modal-icon-circle { background: rgba(239,68,68,0.15);  color: #ef4444;  box-shadow: 0 0 0 8px rgba(239,68,68,0.06); }
.fm-warning .fox-modal-icon-circle { background: rgba(245,158,11,0.15); color: #f59e0b;  box-shadow: 0 0 0 8px rgba(245,158,11,0.06); }
.fm-info    .fox-modal-icon-circle { background: rgba(24,119,242,0.15); color: #60a5fa;  box-shadow: 0 0 0 8px rgba(24,119,242,0.06); }
.fm-success .fox-modal-icon-circle { background: rgba(16,185,129,0.15); color: #10b981;  box-shadow: 0 0 0 8px rgba(16,185,129,0.06); }

.fox-modal-body {
    padding: 8px 28px 24px;
    text-align: center;
}
.fox-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}
.fox-modal-msg {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.65;
    word-break: break-word;
    text-align: center;
}
.fox-modal-msg a {
    color: #4f7cff;
    text-decoration: underline;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}
.fox-modal-msg a:hover { color: #7ca3ff; }

.fox-modal-footer {
    display: flex;
    gap: 10px;
    padding: 0 24px 24px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.fox-modal-footer .btn {
    min-width: 120px;
    padding: 10px 24px;
    font-size: 13.5px;
    border-radius: 9px;
    flex-shrink: 0;
}
.fm-close-x {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.fm-close-x:hover { color: var(--text-primary); background: var(--bg-hover); }
.admin-count { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text-primary); cursor: default; }
/* ─── COLUMN CUSTOMIZER MODAL ─── */
.col-cust-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
}
.col-cust-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    width: 360px; max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.col-cust-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);
    font-weight: 700; font-size: 15px; color: var(--text-primary);
}
.col-cust-header i { color: var(--accent); margin-right: 6px; }
.col-cust-close {
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: var(--bg-elevated); color: var(--text-secondary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 16px; transition: var(--transition-fast);
}
.col-cust-close:hover { background: var(--red-bg); color: var(--red); }
.col-cust-list {
    flex: 1; overflow-y: auto; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 4px;
}
.col-cust-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: background 0.12s;
    border: 1px solid transparent;
}
.col-cust-item:hover { background: var(--bg-hover); border-color: var(--border-subtle); }
.col-cust-item input[type=checkbox] {
    width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0;
}
.col-cust-label { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
.col-cust-drag { color: var(--text-muted); font-size: 16px; cursor: grab; }
.col-cust-footer {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    padding: 14px 20px; border-top: 1px solid var(--border-subtle);
}

/* Hide Access column in BM table */
.col-access { display: none !important; }
}
/* ─── Sidebar Close Button ─── */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.sidebar-close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ─── Panel Toggle Button ─── */
.btn-panel-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-panel-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}
/* Trạng thái mở: ẩn "Mở Panel", hiện "Đóng Panel" */
.btn-panel-toggle.active .panel-btn-open  { display: none; }
.btn-panel-toggle.active .panel-btn-close { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.btn-panel-toggle.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}
/* Trạng thái đóng: hiện "Mở Panel", ẩn "Đóng Panel" */
.btn-panel-toggle:not(.active) .panel-btn-open  { display: inline-flex; align-items: center; gap: 6px; }
.btn-panel-toggle:not(.active) .panel-btn-close { display: none; }
.btn-panel-toggle:not(.active) {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}
.btn-panel-toggle:not(.active):hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

/* ─── Sidebar Arrow Toggle Button ─── */
.sidebar-arrow-btn {
    flex-shrink: 0;
    align-self: center;
    width: 14px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-right: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: width 0.2s ease, color 0.2s, background 0.2s;
    padding: 0;
    z-index: 20;
    position: relative;
}
.sidebar-arrow-btn::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 36px;
    background: var(--border-strong);
    border-radius: 3px;
    transition: background 0.2s, height 0.2s;
}
.sidebar-arrow-btn i {
    display: none;
}
.sidebar-arrow-btn:hover {
    width: 20px;
    color: var(--accent);
    background: var(--bg-hover);
    border-color: var(--accent);
}
.sidebar-arrow-btn:hover::before {
    background: var(--accent);
    height: 44px;
}

/* Light mode */
[data-theme="light"] .sidebar-arrow-btn {
    background: #f5f7fa;
    border-color: #d0d5dd;
}
[data-theme="light"] .sidebar-arrow-btn::before {
    background: #c0c5d0;
}
[data-theme="light"] .sidebar-arrow-btn:hover {
    background: #eef2ff;
    border-color: var(--accent);
}
[data-theme="light"] .sidebar-arrow-btn:hover::before {
    background: var(--accent);
}

/* ─── DATERANGEPICKER DARK MODE ─── */
:root .daterangepicker {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    color: var(--text-primary);
}
:root .daterangepicker:before { border-bottom-color: var(--border-default); }
:root .daterangepicker:after  { border-bottom-color: var(--bg-elevated); }

/* Calendar header */
:root .daterangepicker .calendar-table {
    background: var(--bg-elevated);
    border: none;
}
:root .daterangepicker .calendar-table th,
:root .daterangepicker .calendar-table td {
    color: var(--text-primary);
}
:root .daterangepicker th.month {
    color: var(--text-primary);
    font-weight: 700;
}
:root .daterangepicker .calendar-table .prev span,
:root .daterangepicker .calendar-table .next span {
    border-color: var(--text-secondary);
}
:root .daterangepicker .calendar-table .prev:hover span,
:root .daterangepicker .calendar-table .next:hover span {
    border-color: var(--text-primary);
}

/* Day cells */
:root .daterangepicker td.available:hover,
:root .daterangepicker th.available:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
:root .daterangepicker td.off,
:root .daterangepicker td.off.in-range,
:root .daterangepicker td.off.start-date,
:root .daterangepicker td.off.end-date {
    color: var(--text-muted);
    background: transparent;
}
:root .daterangepicker td.in-range {
    background: var(--accent-subtle);
    color: var(--text-brand);
}
:root .daterangepicker td.start-date,
:root .daterangepicker td.end-date,
:root .daterangepicker td.start-date.end-date {
    background: var(--accent);
    color: #fff;
}
:root .daterangepicker td.today {
    font-weight: 700;
}
:root .daterangepicker td.disabled,
:root .daterangepicker option.disabled {
    color: var(--text-muted);
}

/* Presets sidebar */
:root .daterangepicker .ranges ul { padding: 4px 0; }
:root .daterangepicker .ranges li {
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    margin: 1px 6px;
}
:root .daterangepicker .ranges li:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
:root .daterangepicker .ranges li.active {
    background: var(--accent-subtle);
    color: var(--text-brand);
}

/* Month/Year dropdowns */
:root .daterangepicker select.monthselect,
:root .daterangepicker select.yearselect {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
}

/* Footer */
:root .daterangepicker .drp-buttons {
    border-top: 1px solid var(--border-default);
    background: var(--bg-surface);
}
:root .daterangepicker .drp-selected {
    color: var(--text-secondary);
}
:root .daterangepicker .cancelBtn {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}
:root .daterangepicker .cancelBtn:hover {
    background: var(--border-strong);
}
:root .daterangepicker .applyBtn {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
:root .daterangepicker .applyBtn:hover {
    background: var(--accent-hover);
}

/* Light mode — keep original white */
[data-theme="light"] .daterangepicker {
    background: #fff;
    border-color: #e5e7eb;
    color: #333;
}
[data-theme="light"] .daterangepicker .calendar-table { background: #fff; }
[data-theme="light"] .daterangepicker .ranges li { color: #333; }
[data-theme="light"] .daterangepicker .ranges li:hover { background: #f0f4ff; color: #1877f2; }
[data-theme="light"] .daterangepicker .ranges li.active { background: #e8f0fe; color: #1877f2; }
[data-theme="light"] .daterangepicker .drp-buttons { background: #fafafa; border-top-color: #e5e7eb; }
[data-theme="light"] .daterangepicker select.monthselect,
[data-theme="light"] .daterangepicker select.yearselect { background: #fff; color: #333; border-color: #d1d5db; }
/* ─── SOCIAL PANEL ─── */
.social-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 270px;
    border-radius: 20px;
    z-index: 50;
    overflow: hidden;
    animation: social-panel-in 0.4s cubic-bezier(.34,1.56,.64,1);
    /* Glassmorphism dark */
    background: linear-gradient(145deg, rgba(30,35,50,0.97) 0%, rgba(20,24,36,0.99) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 1px 0 rgba(255,255,255,0.1) inset;
    backdrop-filter: blur(20px);
}
[data-theme="light"] .social-panel {
    background: linear-gradient(145deg, rgba(255,255,255,0.98) 0%, rgba(245,247,252,0.98) 100%);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04) inset;
}

@keyframes social-panel-in {
    from { opacity: 0; transform: translateY(20px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Decorative top gradient bar */
.social-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #f59e0b 0%, #ef4444 35%, #0088cc 65%, #22c55e 100%);
    opacity: 0.9;
}

.social-panel-close {
    position: absolute;
    top: 11px; right: 12px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.45);
    font-size: 13px; cursor: pointer;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 2;
}
.social-panel-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    transform: rotate(90deg);
}
[data-theme="light"] .social-panel-close {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.4);
}
[data-theme="light"] .social-panel-close:hover {
    background: rgba(0,0,0,0.12);
    color: #000;
}

.social-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 11px 16px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}
[data-theme="light"] .social-panel-title { color: rgba(0,0,0,0.35); }

.social-blink-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
    display: inline-block;
    animation: social-blink 1.6s ease-in-out infinite;
}
@keyframes social-blink {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px #22c55e; }
    50%       { opacity: 0.3; box-shadow: none; }
}

.social-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px 10px 12px 10px;
}

.social-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.social-row::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}
.social-row-shop::after { background: radial-gradient(ellipse at left, rgba(245,158,11,0.12) 0%, transparent 70%); }
.social-row-yt::after   { background: radial-gradient(ellipse at left, rgba(255,0,0,0.12) 0%, transparent 70%); }
.social-row-tg::after   { background: radial-gradient(ellipse at left, rgba(0,136,204,0.12) 0%, transparent 70%); }
.social-row:hover::after { opacity: 1; }
.social-row:hover { background: rgba(255,255,255,0.05); transform: translateX(2px); }
[data-theme="light"] .social-row:hover { background: rgba(0,0,0,0.04); }

.social-row-icon {
    width: 38px; height: 38px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.social-row-shop .social-row-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 12px rgba(245,158,11,0.4);
    animation: icon-glow-shop 2.5s ease-in-out infinite;
}
.social-row-yt .social-row-icon {
    background: linear-gradient(135deg, #ff2d2d, #cc0000);
    box-shadow: 0 4px 12px rgba(255,0,0,0.4);
    animation: icon-glow-yt 2.5s ease-in-out infinite 0.6s;
}
.social-row-tg .social-row-icon {
    background: linear-gradient(135deg, #0088cc, #005f8e);
    box-shadow: 0 4px 12px rgba(0,136,204,0.4);
    animation: icon-glow-tg 2.5s ease-in-out infinite 1.2s;
}
@keyframes icon-glow-shop {
    0%,100% { box-shadow: 0 4px 12px rgba(245,158,11,0.35); }
    50%      { box-shadow: 0 4px 18px rgba(245,158,11,0.7); }
}
@keyframes icon-glow-yt {
    0%,100% { box-shadow: 0 4px 12px rgba(255,0,0,0.35); }
    50%      { box-shadow: 0 4px 18px rgba(255,0,0,0.7); }
}
@keyframes icon-glow-tg {
    0%,100% { box-shadow: 0 4px 12px rgba(0,136,204,0.35); }
    50%      { box-shadow: 0 4px 18px rgba(0,136,204,0.7); }
}

.social-row-icon img {
    width: 22px; height: 22px;
    object-fit: contain;
    filter: brightness(10);
}
[data-theme="light"] .social-row-icon img { filter: brightness(10); }

/* Shop icon keeps original colors */
.social-row-shop .social-row-icon img {
    filter: none;
    width: 26px; height: 26px;
}
/* Shop bg neutral to not clash with blue logo */
.social-row-shop .social-row-icon {
    background: linear-gradient(135deg, #1a2540, #0d1530) !important;
    box-shadow: 0 4px 12px rgba(30,100,200,0.4);
}
[data-theme="light"] .social-row-shop .social-row-icon {
    background: linear-gradient(135deg, #e8f0fe, #c8d8f8) !important;
}

.social-row-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.social-row-name {
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    line-height: 1.3;
}
[data-theme="light"] .social-row-name { color: rgba(0,0,0,0.85); }

.social-row-sub {
    font-size: 10.5px;
    color: rgba(255,255,255,0.35);
    margin-top: 1px;
}
[data-theme="light"] .social-row-sub { color: rgba(0,0,0,0.4); }

.social-row-arrow {
    font-size: 17px;
    color: rgba(255,255,255,0.2);
    transition: transform 0.2s, color 0.2s;
    flex-shrink: 0;
    position: relative; z-index: 1;
}
[data-theme="light"] .social-row-arrow { color: rgba(0,0,0,0.2); }
.social-row:hover .social-row-arrow {
    transform: translateX(3px);
    color: rgba(255,255,255,0.7);
}
[data-theme="light"] .social-row:hover .social-row-arrow { color: rgba(0,0,0,0.6); }

/* ─── NAVBAR LANGUAGE SELECTOR ─── */
.nav-lang {
    position: relative;
}

.nav-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    height: 34px;
}
.nav-lang-btn:hover {
    background: rgba(255,255,255,0.13);
    border-color: rgba(255,255,255,0.22);
}
[data-theme="light"] .nav-lang-btn {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .nav-lang-btn:hover {
    background: rgba(0,0,0,0.09);
}

#nav-lang-flag {
    display: flex;
    align-items: center;
    line-height: 1;
}
.nav-lang-btn i {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    transition: transform 0.25s;
}
[data-theme="light"] .nav-lang-btn i { color: rgba(0,0,0,0.4); }

/* Dropdown */
.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 230px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04) inset;
    z-index: 1000;
    overflow: hidden;
}
.lang-dropdown.open {
    display: flex;
    flex-direction: column;
    animation: lang-dd-in 0.2s cubic-bezier(.34,1.4,.64,1);
}
@keyframes lang-dd-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Search */
.lang-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-default);
    flex-shrink: 0;
}
.lang-search-wrap i { font-size: 13px; color: var(--text-muted); }
.lang-search-input {
    flex: 1; background: none; border: none; outline: none;
    font-size: 12px; color: var(--text-primary); font-family: var(--font-main);
}
.lang-search-input::placeholder { color: var(--text-muted); }

/* Options */
.lang-options-list {
    overflow-y: auto;
    max-height: 260px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.lang-options-list::-webkit-scrollbar { width: 4px; }
.lang-options-list::-webkit-scrollbar-track { background: transparent; }
.lang-options-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
[data-theme="light"] .lang-options-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }

.lang-option {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 8px;
    cursor: pointer; transition: background 0.12s;
}
.lang-option:hover { background: var(--accent-subtle); }
.lang-option.active { background: var(--accent-subtle); }
.lang-option.active::after {
    content: '✓'; margin-left: auto;
    font-size: 11px; color: var(--accent); font-weight: 700;
}
.lang-opt-flag { flex-shrink: 0; width: 28px; display: flex; align-items: center; justify-content: center; }
.lang-opt-name { font-size: 12.5px; font-weight: 500; color: var(--text-primary); }
.lang-option.active .lang-opt-name { color: var(--accent); font-weight: 700; }

/* ─── FLAG IMAGE ─── */
.flag-img {
    border-radius: 3px;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
#nav-lang-flag { display: flex; align-items: center; }
.lang-opt-flag { 
    flex-shrink: 0; 
    width: 28px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

/* Language divider */
.lang-divider {
    height: 1px;
    background: var(--border-default);
    margin: 4px 6px;
}

/* Flag fallback emoji */
.flag-fallback {
    font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Twemoji Mozilla",sans-serif;
    font-size: 18px;
    line-height: 1;
}

.pm-extra-hint { font-size: 9px; color: #1877f2; cursor: default; line-height: 1; margin-top: 1px; position: relative; display: inline-block; }
.pm-extra-tooltip { display: none; position: absolute; left: 0; top: 100%; z-index: 9999; background: var(--bg-card,#fff); border: 1px solid var(--border,#e0e0e0); border-radius: 6px; padding: 6px 10px; white-space: nowrap; font-size: 11px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 140px; color: var(--text-primary); }
.pm-extra-hint:hover .pm-extra-tooltip { display: block; }
