/* =====================================================
   AUTOHUB THEME — Complete Stylesheet
   ===================================================== */

:root {
    --bg-0: #0a0e14;
    --bg-1: #0f1419;
    --bg-2: #161b22;
    --bg-3: #1e252e;
    --border: #262d38;
    --border-light: #303844;

    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;

    --accent: #4a9eff;
    --accent-hover: #6bb0ff;
    --accent-glow: rgba(74, 158, 255, 0.15);

    --amber: #ffb340;
    --amber-glow: rgba(255, 179, 64, 0.15);

    --telegram: #2aabee;
    --telegram-hover: #1e96d4;

    --danger: #f85149;
    --success: #3fb950;
    --purple: #a855f7;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);

    --t-fast: 0.15s ease;
    --t: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html {
    overflow-x: clip;
}
body {
    overflow-x: clip;
    max-width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-0);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }
@keyframes spin { from{transform:rotate(0)} to{transform:rotate(360deg)} }
@keyframes slideIn { from { opacity:0; transform: translateX(-8px); } to { opacity:1; transform: translateX(0); } }
@keyframes rotateSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* =====================================================
   USER HEADER
   ===================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    display: flex; align-items: center; justify-content: center;
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.logo-mark svg { width: 20px; height: 20px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-title { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.logo-sub { font-size: 9px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; }

.main-nav { display: flex; gap: 2px; flex: 1; }
.nav-link {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--t-fast);
    white-space: nowrap;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-2); }
.nav-link.active { color: var(--text-primary); background: var(--bg-3); }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--t-fast);
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-light);
}
.btn-outline:hover { color: var(--text-primary); border-color: var(--accent); background: var(--accent-glow); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 9px;
}
.btn-ghost:hover { color: var(--danger); background: rgba(248, 81, 73, 0.1); }

.btn-telegram {
    background: var(--telegram);
    color: white;
    margin-top: 12px;
}
.btn-telegram:hover { background: var(--telegram-hover); transform: translateY(-1px); }

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(248,81,73,0.3);
}
.btn-danger-outline:hover { background: rgba(248,81,73,0.1); border-color: var(--danger); }

/* =====================================================
   SYNC WIDGET
   ===================================================== */
.sync-widget { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.sync-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sync-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    transition: all var(--t);
}
.sync-dot.syncing { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1.5s infinite; }
.sync-dot.error { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.sync-dot.success { background: var(--success); box-shadow: 0 0 8px var(--success); }

/* =====================================================
   SYNC TOAST
   ===================================================== */
.sync-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: var(--bg-1);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(150%);
    opacity: 0;
    transition: all var(--t);
    z-index: 9999;
    overflow: hidden;
}
.sync-toast.show { transform: translateY(0); opacity: 1; }
.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.toast-close { color: var(--text-tertiary); font-size: 20px; line-height: 1; padding: 0 4px; transition: color var(--t-fast); }
.toast-close:hover { color: var(--danger); }
.toast-body {
    max-height: 280px;
    overflow-y: auto;
    padding: 10px 16px;
    font-size: 11px;
    font-family: 'Monaco', 'Consolas', monospace;
    line-height: 1.7;
}
.log-line { color: var(--text-secondary); padding: 2px 0; animation: slideIn 0.3s ease; }
.log-line.log-success { color: var(--success); font-weight: 600; }
.log-line.log-error { color: var(--danger); }

/* =====================================================
   USER MENU
   ===================================================== */
.user-menu { position: relative; }
.user-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 5px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--t-fast);
    font-family: inherit;
}
.user-btn:hover { border-color: var(--accent); background: var(--bg-3); }

.user-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 11px;
    flex-shrink: 0;
}
.user-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    background: var(--bg-1);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all var(--t-fast);
    z-index: 200;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown-header { padding: 10px 12px 8px; }
.user-dropdown-name { font-weight: 700; font-size: 13px; }
.user-dropdown-role { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--t-fast);
    cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-2); color: var(--text-primary); }
.dropdown-danger { color: var(--danger); }
.dropdown-danger:hover { background: rgba(248,81,73,0.1); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* =====================================================
   NOTIFICATION BELL
   ===================================================== */
.notif-menu { position: relative; }
.notif-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--t-fast);
    position: relative;
}
.notif-btn:hover { color: var(--text-primary); border-color: var(--accent); background: var(--bg-3); }
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(248,81,73,0.5);
}
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: var(--bg-1);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all var(--t-fast);
    z-index: 200;
}
.notif-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.notif-mark-read { font-size: 11px; color: var(--accent); font-weight: 600; cursor: pointer; }
.notif-mark-read:hover { text-decoration: underline; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background var(--t-fast);
    position: relative;
}
.notif-item:hover { background: var(--bg-2); }
.notif-unread { background: rgba(74,158,255,0.04); }
.notif-item-icon { font-size: 18px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-item-msg { font-size: 11px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 3px; }
.notif-item-time { font-size: 10px; color: var(--text-tertiary); }
.notif-unread-dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}
.notif-empty { text-align: center; padding: 24px 16px; }

/* =====================================================
   TOP BANNER BAR
   ===================================================== */
.top-banner-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
}
.top-banner-bar > .top-banner:only-child { grid-column: 1 / -1; }

.top-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    transition: all var(--t-fast);
}
.top-banner-content { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.top-banner-content strong { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.top-banner-content span { font-size: 11px; color: var(--text-secondary); }
.top-banner-content b { color: var(--accent); }
.top-banner-icon { font-size: 18px; flex-shrink: 0; }

.top-banner-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    transition: all var(--t-fast);
    flex-shrink: 0;
}

.top-banner-trial { background: linear-gradient(135deg, rgba(74,158,255,0.12), rgba(168,85,247,0.08)); }
.top-banner-trial .top-banner-btn { background: var(--accent); color: white; }
.top-banner-trial .top-banner-btn:hover { background: var(--accent-hover); }

.top-banner-warning { background: linear-gradient(135deg, rgba(255,179,64,0.15), rgba(248,81,73,0.08)); }
.top-banner-warning .top-banner-content b { color: var(--amber); }
.top-banner-warning .top-banner-btn { background: var(--amber); color: #1a1000; }

.top-banner-discount {
    background: linear-gradient(135deg, rgba(255,179,64,0.2), rgba(248,81,73,0.12));
    position: relative;
    overflow: hidden;
}
.top-banner-discount .top-banner-icon { animation: bounce 2s infinite; position: relative; z-index: 1; }
.top-banner-discount .top-banner-content { position: relative; z-index: 1; }
.top-banner-discount .top-banner-content b { color: var(--amber); }
.discount-highlight { color: var(--amber); font-weight: 800; font-size: 13px; }
.top-banner-countdown { font-variant-numeric: tabular-nums; color: var(--amber); font-weight: 800; }
.top-banner-btn-discount {
    background: linear-gradient(135deg, var(--amber), #ff8c00);
    color: #1a1000;
    position: relative;
    z-index: 1;
}
.top-banner-btn-discount:hover { transform: translateY(-1px); }

@media (max-width: 768px) {
    .top-banner-bar { grid-template-columns: 1fr; }
    .top-banner { padding: 8px 12px; gap: 8px; }
    .top-banner-icon { font-size: 15px; }
    .top-banner-content strong { font-size: 11px; }
    .top-banner-content span { font-size: 10px; }
    .top-banner-btn { padding: 5px 9px; font-size: 10px; }
    .discount-highlight { font-size: 11px; }
}

/* =====================================================
   HERO (Compact)
   ===================================================== */
.hero-compact {
    padding: 22px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.hero-compact-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.hero-compact-title {
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 3px;
}
.hero-compact-sub { font-size: 12px; color: var(--text-secondary); }
.hero-compact-stats {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 12px;
    border-right: 1px solid var(--border);
}
.mini-stat:last-child { border-right: none; }
.mini-stat-value { font-size: 14px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.mini-stat-label {
    font-size: 9px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-top: 1px;
}
@media (max-width: 768px) {
    .hero-compact { padding: 14px; }
    .hero-compact-stats { width: 100%; justify-content: space-around; }
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--amber) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =====================================================
   TYPE SWITCHER
   ===================================================== */
.type-switcher-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px 0;
    display: flex;
    justify-content: center;
}
.type-switcher {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.type-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all var(--t-fast);
    white-space: nowrap;
}
.type-switch-btn:hover { background: var(--bg-2); color: var(--text-primary); }
.type-switch-btn.active {
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
}
.type-switch-btn svg { flex-shrink: 0; }
.type-count {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    font-weight: 700;
}
.type-switch-btn.active .type-count { background: rgba(255,255,255,0.25); }

@media (max-width: 600px) {
    .type-switcher-wrap { padding: 12px 14px 0; }
    .type-switch-btn { padding: 7px 12px; font-size: 12px; }
    .type-count { font-size: 9px; padding: 1px 5px; }
}

/* =====================================================
   FILTER BAR — SINGLE ROW
   ===================================================== */
.filter-wrapper {
    position: sticky;
    top: 61px;
    z-index: 50;
    padding: 12px 20px;
    background: rgba(10, 14, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.filter-bar { max-width: 1400px; margin: 0 auto; display: flex; gap: 8px; align-items: center; }

.filter-bar-single-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.filter-bar-single-row::-webkit-scrollbar { height: 5px; }
.filter-bar-single-row::-webkit-scrollbar-track { background: transparent; }
.filter-bar-single-row::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 999px; }

.filter-bar-single-row .filter-field {
    flex-shrink: 0;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    transition: all var(--t-fast);
}
.filter-bar-single-row .filter-field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.filter-bar-single-row .filter-field input,
.filter-bar-single-row .filter-field select {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 12px;
    padding: 8px 10px;
    width: 100%;
    height: 100%;
}
.filter-bar-single-row .filter-field select {
    padding-right: 26px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.filter-bar-single-row .filter-field select option { background: var(--bg-2); color: var(--text-primary); }
.filter-bar-single-row .filter-field input::placeholder { color: var(--text-tertiary); }

.filter-bar-single-row .filter-search { flex: 1 1 200px; min-width: 160px; max-width: 300px; }
.filter-bar-single-row .filter-search .field-icon {
    margin-left: 8px;
    width: 14px; height: 14px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}
.filter-bar-single-row .filter-compact { flex-shrink: 0; min-width: 100px; }
.filter-bar-single-row .filter-compact input[type="text"] { min-width: 100px; max-width: 130px; }

.filter-bar-single-row .filter-price-range { flex-shrink: 0; }
.filter-bar-single-row .filter-price-range input {
    width: 70px;
    padding: 8px 6px;
    font-size: 11px;
    text-align: center;
}
.filter-bar-single-row .filter-price-range input:first-child { border-right: 1px solid var(--border); }
.filter-bar-single-row .range-sep { color: var(--text-tertiary); font-size: 11px; padding: 0 2px; flex-shrink: 0; }

.filter-bar-single-row .filter-date-range input {
    width: 115px;
    padding: 8px 6px;
    font-size: 11px;
}
.filter-bar-single-row .filter-date-range input:first-child { border-right: 1px solid var(--border); }
.filter-bar-single-row .filter-date-range input::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
    cursor: pointer;
    opacity: 0.6;
}

.filter-bar-single-row .filter-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.filter-bar-single-row .filter-checkbox:hover { border-color: var(--border-light); color: var(--text-primary); }
.filter-bar-single-row .filter-checkbox input { accent-color: var(--accent); cursor: pointer; margin: 0; }

.filter-bar-single-row .filter-btn { flex-shrink: 0; white-space: nowrap; }
.filter-bar-single-row .filter-reset { flex-shrink: 0; padding: 8px; }

.filter-field {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
}
.filter-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.filter-field.grow { flex: 1; min-width: 200px; }
.field-icon { width: 15px; height: 15px; margin-left: 10px; color: var(--text-tertiary); flex-shrink: 0; }
.filter-field input,
.filter-field select {
    background: transparent;
    border: none;
    outline: none;
    padding: 9px 12px;
    color: var(--text-primary);
    width: 100%;
    font-size: 13px;
}
.filter-field input::placeholder { color: var(--text-tertiary); }
.filter-field select {
    padding-right: 28px;
    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='%238b949e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.filter-field select option { background: var(--bg-2); color: var(--text-primary); }

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast);
    user-select: none;
}
.filter-checkbox:hover { border-color: var(--border-light); color: var(--text-primary); }
.filter-checkbox input { accent-color: var(--accent); cursor: pointer; }

/* =====================================================
   RESULTS + CAR GRID
   ===================================================== */
.results { max-width: 1400px; margin: 0 auto; padding: 24px 20px 60px; }
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.results-title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.results-subtitle { font-size: 13px; font-weight: 500; color: var(--text-tertiary); }
.results-sort { font-size: 12px; color: var(--text-tertiary); }
.results-sort strong { color: var(--text-primary); font-weight: 600; }

.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.car-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--t);
}
.car-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}
.car-sold { opacity: 0.6; }

.card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-2);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow); }
.car-card:hover .card-media img { transform: scale(1.05); }

.no-img {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-tertiary);
    background: var(--bg-2);
    gap: 6px;
}
.no-img svg { width: 36px; height: 36px; opacity: 0.5; }
.no-img span { font-size: 11px; }

.card-badges {
    position: absolute;
    top: 10px; left: 10px;
    display: flex; gap: 4px; flex-wrap: wrap;
    z-index: 2;
}
.badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.badge-year { background: rgba(255, 179, 64, 0.9); color: #1a1000; }
.badge-trans { background: rgba(10, 14, 20, 0.8); color: white; border: 1px solid rgba(255, 255, 255, 0.15); }
.badge-sold { background: var(--danger); color: white; }
.badge-type { background: rgba(168,85,247,0.9); color: white; }

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 14, 20, 0.9) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 14px;
    opacity: 0;
    transition: opacity var(--t);
    color: white;
    font-size: 12px;
    font-weight: 600;
}
.car-card:hover .card-overlay { opacity: 1; }

.card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.card-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; color: var(--text-primary); }
.card-source {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 2px 7px;
    background: var(--bg-3);
    border-radius: 999px;
}

.card-price {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--amber);
    margin-bottom: 10px;
    line-height: 1;
}
.card-price .currency { font-size: 11px; font-weight: 600; color: var(--text-tertiary); }

.card-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-bottom: auto;
}
.spec {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
}
.spec svg { width: 12px; height: 12px; color: var(--text-tertiary); flex-shrink: 0; }

.card-posted {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-bottom: auto;
}
.feature-chip {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}
.feature-more {
    background: rgba(74,158,255,0.15);
    color: var(--accent);
    border-color: rgba(74,158,255,0.3);
    font-weight: 700;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 20px; font-size: 13px; }

/* =====================================================
   FOOTER (User)
   ===================================================== */
.site-footer {
    background: var(--bg-1);
    border-top: 1px solid var(--border);
    margin-top: 40px;
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 36px 20px 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 32px;
}
.footer-col h4 { font-size: 13px; margin-bottom: 10px; }
.footer-col a {
    display: block;
    padding: 5px 0;
    color: var(--text-secondary);
    font-size: 13px;
    transition: color var(--t-fast);
}
.footer-col a:hover { color: var(--accent); }
.footer-desc, .footer-text {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 10px;
    line-height: 1.6;
    max-width: 320px;
}
.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
}

/* =====================================================
   AUTH PAGES
   ===================================================== */
.auth-body {
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(74,158,255,0.12), transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 20%, rgba(255,179,64,0.06), transparent 60%),
        var(--bg-0);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
    width: 100%;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-card { padding: 40px 32px; display: flex; flex-direction: column; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.auth-brand-title { font-weight: 800; font-size: 15px; }
.auth-brand-sub { font-size: 9px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; }
.auth-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 4px; }
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--t-fast);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: var(--bg-1); }
.auth-submit { margin-top: 8px; padding: 12px; font-size: 14px; }
.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    font-weight: 500;
}
.auth-alert-error { background: rgba(248,81,73,0.12); color: #ff8a80; border-left: 3px solid var(--danger); }
.auth-footer { text-align: center; margin-top: 20px; font-size: 12px; color: var(--text-secondary); }
.auth-footer a { color: var(--accent); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.auth-side {
    background: linear-gradient(135deg, rgba(74,158,255,0.15), rgba(255,179,64,0.08)), var(--bg-2);
    display: flex;
    align-items: center;
    padding: 40px 32px;
    position: relative;
    overflow: hidden;
}
.auth-side-content { position: relative; z-index: 1; }
.auth-side-content h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 10px; }
.auth-side-content p { color: var(--text-secondary); font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
.auth-side-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.auth-side-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.auth-side-list svg { color: var(--success); flex-shrink: 0; }

/* =====================================================
   PRICING PAGE
   ===================================================== */
.pricing-page { max-width: 1000px; margin: 0 auto; padding: 40px 20px 60px; text-align: center; }
.pricing-alert {
    background: rgba(63,185,80,0.12);
    border: 1px solid rgba(63,185,80,0.3);
    color: #7ee787;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 500;
    font-size: 13px;
}
.pricing-header { margin-bottom: 24px; }
.pricing-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--bg-2);
    border: 1px solid var(--border-light);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.pricing-title { font-size: clamp(24px, 4vw, 36px); font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 10px; }
.pricing-subtitle { font-size: 14px; color: var(--text-secondary); }

.billing-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    margin: 24px 0 32px;
}
.billing-btn {
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.billing-btn.active { background: var(--accent); color: white; }
.billing-save { font-size: 9px; background: rgba(63,185,80,0.2); color: #7ee787; padding: 2px 6px; border-radius: 999px; font-weight: 700; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}
.pricing-card {
    position: relative;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px 22px;
    text-align: left;
    display: flex;
    flex-direction: column;
    transition: all var(--t);
}
.pricing-card:hover { border-color: var(--border-light); transform: translateY(-3px); }
.pricing-card-featured {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 20px 40px rgba(74,158,255,0.15);
    background: linear-gradient(180deg, rgba(74,158,255,0.05), transparent 40%), var(--bg-1);
}
.pricing-ribbon {
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.pricing-card-head h3 { font-size: 18px; font-weight: 800; margin-bottom: 3px; }
.pricing-card-head p { font-size: 12px; color: var(--text-tertiary); margin-bottom: 16px; }
.pricing-price { margin-bottom: 20px; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.pricing-price.hidden { display: none; }
.price-amount { font-size: 34px; font-weight: 900; letter-spacing: -0.03em; color: var(--text-primary); }
.price-currency { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.price-period { font-size: 12px; color: var(--text-tertiary); margin-left: 4px; }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; flex: 1; }
.pricing-features li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.pricing-features svg { color: var(--success); flex-shrink: 0; margin-top: 3px; }
.pricing-footer-note { margin-top: 30px; font-size: 12px; color: var(--text-tertiary); }

/* Payment method picker */
.payment-method-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 10px; }
.pm-option { cursor: pointer; display: block; }
.pm-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.pm-option-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all var(--t-fast);
    font-size: 11px;
}
.pm-option-content strong { display: block; font-size: 11px; font-weight: 700; color: var(--text-primary); }
.pm-option-content small { display: block; font-size: 9px; color: var(--text-tertiary); }
.pm-option input:checked + .pm-option-content {
    border-color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.pm-option:hover .pm-option-content { border-color: var(--border-light); }
.pm-icon { font-size: 16px; flex-shrink: 0; }
@media (max-width: 600px) { .payment-method-picker { grid-template-columns: 1fr; } }

/* =====================================================
   PAYMENT PAGE / MANUAL
   ===================================================== */
.payment-card { text-align: center; max-width: 440px; margin: 0 auto; }
.payment-icon {
    width: 54px; height: 54px;
    margin: 0 auto 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    display: flex; align-items: center; justify-content: center;
    color: white;
}
.payment-icon svg { width: 26px; height: 26px; }
.payment-summary {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin: 20px 0;
    text-align: left;
}
.payment-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; color: var(--text-secondary); }
.payment-row strong { color: var(--text-primary); font-weight: 600; }
.payment-row-total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; font-size: 15px; }
.payment-row-total strong { color: var(--amber); font-size: 18px; font-weight: 800; }
.payment-notice {
    background: rgba(255,179,64,0.1);
    border-left: 3px solid var(--amber);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: left;
    margin-bottom: 18px;
    line-height: 1.6;
}
.payment-notice code {
    background: var(--bg-3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    color: var(--accent);
}

.manual-pay-card { max-width: 520px; margin: 0 auto; text-align: left; }
.manual-pay-header { text-align: center; margin-bottom: 20px; }
.manual-icon { background: linear-gradient(135deg, #ffb340, #ff8c00) !important; }
.manual-pay-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.manual-step { display: flex; gap: 12px; align-items: flex-start; }
.manual-step-num {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 11px;
    flex-shrink: 0;
}
.manual-step strong { display: block; font-size: 12px; color: var(--text-primary); margin-bottom: 2px; }
.manual-step p { font-size: 11px; color: var(--text-secondary); margin: 0; }
.manual-phone-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    background: var(--bg-1);
    border: 1px dashed var(--border-light);
    border-radius: 8px;
    padding: 7px 11px;
}
.manual-phone-box code {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.05em;
}
.copy-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--t-fast);
}
.copy-btn:hover { background: var(--accent-hover); }
.manual-pay-form .form-group { margin-bottom: 12px; }
.image-preview img { border: 1px solid var(--border); margin-top: 10px; max-height: 180px; }
.manual-pay-success {
    text-align: center;
    padding: 20px;
    background: rgba(255,179,64,0.08);
    border: 1px solid rgba(255,179,64,0.3);
    border-radius: 12px;
    margin-bottom: 18px;
}
.manual-pay-success-icon { font-size: 36px; margin-bottom: 10px; }
.manual-pay-success h2 { font-size: 16px; margin-bottom: 5px; }
.manual-pay-success p { font-size: 12px; color: var(--text-secondary); }
.manual-pay-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
    text-align: left;
    background: var(--bg-2);
    padding: 12px;
    border-radius: 8px;
}
.manual-pay-detail { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); }
.manual-pay-detail strong { color: var(--text-primary); }
.manual-extra-instructions {
    margin-top: 8px;
    padding: 9px 11px;
    background: rgba(74, 158, 255, 0.08);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =====================================================
   COUPON BOX
   ===================================================== */
.coupon-box { max-width: 460px; margin: 0 auto 20px; }
.coupon-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-1);
    border: 1px dashed var(--border-light);
    border-radius: 12px;
    padding: 8px 12px;
    transition: all var(--t-fast);
}
.coupon-form:focus-within { border-color: var(--accent); border-style: solid; box-shadow: 0 0 0 3px var(--accent-glow); }
.coupon-icon { color: var(--text-tertiary); flex-shrink: 0; }
.coupon-form input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 6px 0;
    color: var(--text-primary);
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: inherit;
}
.coupon-form input::placeholder { text-transform: none; letter-spacing: normal; color: var(--text-tertiary); }
.coupon-message {
    margin-top: 8px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}
.coupon-success { background: rgba(63,185,80,0.12); color: #7ee787; border-left: 3px solid var(--success); }
.coupon-error { background: rgba(248,81,73,0.12); color: #ff8a80; border-left: 3px solid var(--danger); }

/* =====================================================
   DISCOUNT BANNER (pricing page)
   ===================================================== */
.discount-live-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(63,185,80,0.15), rgba(74,158,255,0.1));
    border: 1px solid rgba(63,185,80,0.4);
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.discount-pulse {
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
}
.discount-percent-input {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
}
.discount-percent-input input[type="range"] { flex: 1; accent-color: var(--accent); cursor: pointer; }
.discount-percent-value { font-size: 16px; font-weight: 800; color: var(--accent); min-width: 50px; text-align: right; }
.discount-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255,179,64,0.15), rgba(248,81,73,0.1));
    border: 1px solid rgba(255,179,64,0.4);
    border-radius: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}
.discount-banner-left { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.discount-banner-icon { font-size: 26px; animation: bounce 2s infinite; }
.discount-banner-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.discount-banner-title strong { color: var(--amber); font-size: 18px; margin-left: 4px; }
.discount-banner-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.discount-countdown { position: relative; z-index: 1; }
.countdown-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    font-weight: 700;
    margin-bottom: 5px;
    text-align: right;
}
.countdown-timer { display: flex; gap: 5px; }
.cd-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(10,14,20,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 5px 8px;
    min-width: 40px;
}
.cd-num {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.cd-label {
    font-size: 9px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-top: 3px;
}
.price-original {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    text-decoration: line-through;
    font-weight: 500;
    margin-bottom: 3px;
    opacity: 0.75;
}
.pricing-card-featured .price-original { color: rgba(255,179,64,0.6); }
@media (max-width: 600px) {
    .discount-banner { padding: 14px; gap: 12px; }
    .discount-banner-icon { font-size: 22px; }
    .discount-banner-title { font-size: 13px; }
    .discount-banner-title strong { font-size: 15px; }
    .cd-block { min-width: 34px; padding: 4px 6px; }
    .cd-num { font-size: 14px; }
}

/* =====================================================
   DASHBOARD (User)
   ===================================================== */
.dashboard-page { max-width: 1000px; margin: 0 auto; padding: 24px 20px 50px; }
.dash-welcome { margin-bottom: 20px; }
.dash-welcome h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 3px; }
.dash-welcome p { font-size: 13px; color: var(--text-secondary); }
.dash-sub-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    background: var(--bg-1);
    flex-wrap: wrap;
}
.dash-sub-trial { background: linear-gradient(135deg, rgba(74,158,255,0.08), rgba(168,85,247,0.05)); border-color: rgba(74,158,255,0.3); }
.dash-sub-active { background: linear-gradient(135deg, rgba(63,185,80,0.08), rgba(74,158,255,0.05)); border-color: rgba(63,185,80,0.3); }
.dash-sub-expired { background: linear-gradient(135deg, rgba(248,81,73,0.08), rgba(255,179,64,0.05)); border-color: rgba(248,81,73,0.3); }
.dash-sub-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 220px; }
.dash-sub-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.dash-sub-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    font-weight: 700;
    margin-bottom: 3px;
}
.dash-sub-title { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 3px; }
.dash-sub-expiry { font-size: 11px; color: var(--text-secondary); }
.dash-sub-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dash-progress { min-width: 180px; }
.dash-progress-bar { height: 6px; background: var(--bg-3); border-radius: 999px; overflow: hidden; margin-bottom: 5px; }
.dash-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #2563eb); border-radius: 999px; transition: width 0.6s ease; }
.dash-sub-active .dash-progress-fill { background: linear-gradient(90deg, var(--success), var(--accent)); }
.dash-sub-expired .dash-progress-fill { background: var(--danger); }
.dash-progress-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-tertiary); font-weight: 600; }

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.dash-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.dash-stat-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dash-icon-blue { background: rgba(74,158,255,0.15); color: var(--accent); }
.dash-icon-green { background: rgba(63,185,80,0.15); color: var(--success); }
.dash-icon-amber { background: rgba(255,179,64,0.15); color: var(--amber); }
.dash-icon-purple { background: rgba(168,85,247,0.15); color: var(--purple); }
.dash-stat-value { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); }
.dash-stat-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 2px;
}
.dash-section { margin-bottom: 24px; }
.dash-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dash-section-header h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.dash-section-count { font-size: 11px; color: var(--text-tertiary); }
.dash-payments {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.payment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--t-fast);
}
.payment-item:last-child { border-bottom: none; }
.payment-item:hover { background: var(--bg-2); }
.payment-item-icon {
    width: 32px; height: 32px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.payment-icon-completed { background: rgba(63,185,80,0.15); color: var(--success); }
.payment-icon-pending { background: rgba(255,179,64,0.15); color: var(--amber); }
.payment-icon-failed { background: rgba(248,81,73,0.15); color: var(--danger); }
.payment-item-info { flex: 1; min-width: 0; }
.payment-item-title { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.payment-item-meta { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }
.payment-item-meta code {
    background: var(--bg-3);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    color: var(--accent);
}
.payment-item-right { text-align: right; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.payment-item-amount { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.dash-account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}
.dash-account-item { padding: 8px 0; }
.dash-account-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 3px;
}
.dash-account-value { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.dash-empty {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.dash-empty-icon { font-size: 34px; margin-bottom: 10px; }
.dash-empty h3 { font-size: 15px; margin-bottom: 5px; }
.dash-empty p { color: var(--text-secondary); font-size: 12px; margin-bottom: 14px; }

@media (max-width: 768px) {
    .dashboard-page { padding: 16px 14px 32px; }
    .dash-sub-card { flex-direction: column; align-items: stretch; }
    .dash-sub-right { width: 100%; }
    .dash-sub-right .btn { width: 100%; }
    .dash-progress { width: 100%; min-width: 0; }
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
    .dash-account-grid { grid-template-columns: 1fr; }
    .payment-item { flex-wrap: wrap; }
    .payment-item-right { width: 100%; text-align: left; align-items: flex-start; padding-left: 44px; }
}

/* =====================================================
   CHANNELS / HISTORY PAGES
   ===================================================== */
.channels-page,
.history-page { max-width: 1200px; margin: 0 auto; padding: 32px 20px 60px; }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-head h1 { font-size: clamp(20px, 2.5vw, 26px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 5px; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); }
.page-head-stats { display: flex; gap: 12px; }
.head-stat {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 16px;
    text-align: center;
    min-width: 80px;
}
.head-stat-value { font-size: 18px; font-weight: 800; color: var(--accent); display: block; letter-spacing: -0.02em; }
.head-stat-label { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}
.alert-success { background: rgba(63,185,80,0.12); color: #7ee787; border-left: 3px solid var(--success); }
.alert-error { background: rgba(248,81,73,0.12); color: #ff8a80; border-left: 3px solid var(--danger); }

.add-channel-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 32px;
}
.add-channel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.add-channel-head h2 { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.add-channel-head p { font-size: 12px; color: var(--text-tertiary); }
.add-channel-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--accent-glow);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.add-channel-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { margin-bottom: 0; }
.form-group.grow { flex: 1; min-width: 200px; }
.form-hint { display: block; margin-top: 5px; font-size: 11px; color: var(--text-tertiary); }
.form-hint code {
    background: var(--bg-3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    color: var(--accent);
}

.channels-list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.channels-list-header h2 { font-size: 16px; font-weight: 700; }
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}
.channel-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    transition: all var(--t);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.channel-card:hover { border-color: var(--border-light); box-shadow: var(--shadow); }
.channel-inactive { opacity: 0.55; }
.channel-card-header { display: flex; align-items: center; gap: 10px; }
.channel-avatar {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}
.channel-info { flex: 1; min-width: 0; }
.channel-username {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channel-title {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}
.channel-status { flex-shrink: 0; }
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.status-active,
.status-success,
.status-verified,
.status-completed { background: rgba(63,185,80,0.15); color: var(--success); }
.status-inactive { background: rgba(139,148,158,0.15); color: var(--text-tertiary); }
.status-failed,
.status-rejected { background: rgba(248,81,73,0.15); color: var(--danger); }
.status-running,
.status-pending { background: rgba(255,179,64,0.15); color: var(--amber); }

.channel-type-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 10px;
    color: var(--text-tertiary);
    background: var(--bg-3);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.channel-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.channel-stat { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-secondary); }
.channel-stat svg { color: var(--text-tertiary); flex-shrink: 0; }
.channel-stat strong { color: var(--text-primary); font-weight: 700; }
.channel-meta { display: flex; flex-direction: column; gap: 5px; }
.channel-meta-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-tertiary); }
.channel-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.channel-actions .btn { flex: 1; min-width: 0; padding: 7px 9px; font-size: 11px; }

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--t-fast);
    z-index: 1000;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-1);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    transform: translateY(20px) scale(0.95);
    transition: all var(--t);
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: 14px;
}
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 9px 11px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all var(--t-fast);
}
.form-checkbox:hover { border-color: var(--border-light); }
.form-checkbox input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.form-checkbox span { font-size: 13px; color: var(--text-primary); }

/* =====================================================
   HISTORY TABLE
   ===================================================== */
.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.history-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.history-stat-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.history-stat-icon svg { width: 18px; height: 18px; }
.history-stat-label { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.history-stat-value { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }

.history-filters { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.history-filters .filter-field { min-width: 160px; }
.history-filters-spacer { flex: 1; }
.history-count { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }

.history-table-wrapper {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    overflow-x: auto;
}
.history-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.history-table th {
    background: var(--bg-2);
    padding: 12px 14px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.history-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-primary); }
.history-table tr:last-child td { border-bottom: none; }
.history-table tbody tr { transition: background var(--t-fast); }
.history-table tbody tr:hover { background: var(--bg-2); }
.table-channel { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.table-avatar {
    width: 26px; height: 26px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 11px;
    flex-shrink: 0;
}
.table-time { display: flex; flex-direction: column; gap: 2px; }
.table-time-sub { font-size: 10px; color: var(--text-tertiary); }
.badge-new {
    display: inline-block;
    padding: 2px 7px;
    background: rgba(63,185,80,0.15);
    color: var(--success);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}
.btn-icon-error {
    width: 26px; height: 26px;
    border-radius: 6px;
    background: rgba(248,81,73,0.1);
    color: var(--danger);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    border: none;
}
.btn-icon-error:hover { background: rgba(248,81,73,0.2); }
.btn-icon-edit {
    width: 26px; height: 26px;
    border-radius: 6px;
    background: rgba(74,158,255,0.1);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    border: none;
}
.btn-icon-edit:hover { background: rgba(74,158,255,0.2); }
.badge-role {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}
.badge-role-admin { background: rgba(255,179,64,0.15); color: var(--amber); }
.badge-role-user { background: rgba(139,148,158,0.15); color: var(--text-secondary); }
.badge-plan {
    display: inline-block;
    padding: 2px 9px;
    background: rgba(74,158,255,0.1);
    color: var(--accent);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
}
.error-pre {
    background: var(--bg-2);
    padding: 14px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 11px;
    color: #ff8a80;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
    max-height: 280px;
    overflow-y: auto;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.page-btn {
    padding: 7px 12px;
    border-radius: 8px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--t-fast);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-numbers { display: flex; gap: 4px; }
.page-num {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-1);
    border: 1px solid var(--border);
    transition: all var(--t-fast);
}
.page-num:hover { border-color: var(--accent); color: var(--accent); }
.page-num.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-dots { color: var(--text-tertiary); padding: 0 4px; }

/* =====================================================
   ADMIN — OVERALL LAYOUT (FIXED)
   ===================================================== */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg-0);
    font-size: 13px;
}

.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px 10px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }

.admin-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
    flex-shrink: 0;
}
.admin-logo .logo-mark { width: 32px; height: 32px; border-radius: 8px; }
.admin-logo .logo-mark svg { width: 18px; height: 18px; }
.admin-logo .logo-title { font-size: 13px; font-weight: 800; }
.admin-logo .logo-sub { font-size: 9px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; }

.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--t-fast);
}
.admin-nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.admin-nav-link:hover { background: var(--bg-2); color: var(--text-primary); }
.admin-nav-link.active { background: var(--accent-glow); color: var(--accent); font-weight: 600; }
.admin-nav-danger:hover { background: rgba(248,81,73,0.1); color: var(--danger); }
.admin-sidebar-footer { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
}

/* Main area — offset for fixed sidebar */
.admin-main {
    flex: 1;
    margin-left: 220px;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-0);
}

/* Top bar — sticky inside main, spans full width */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(10, 14, 20, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    flex-shrink: 0;
}
.admin-topbar-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 100%;
}
.admin-mobile-toggle {
    display: none;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.admin-topbar-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
}
.admin-topbar-brand { font-weight: 800; color: var(--text-primary); }
.admin-topbar-sep { color: var(--text-tertiary); }
.admin-topbar-page { color: var(--text-secondary); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Content padding */
.admin-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
    overflow-x: hidden;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.admin-header h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.admin-user { font-size: 12px; color: var(--text-secondary); }
.admin-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.admin-subtitle strong { color: var(--text-primary); }
.admin-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Admin footer */
.admin-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-1);
    padding: 14px 24px;
    flex-shrink: 0;
    margin-top: auto;
}
.admin-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-tertiary);
    flex-wrap: wrap;
    gap: 10px;
}
.admin-footer-links { display: flex; gap: 14px; }
.admin-footer-links a { color: var(--text-secondary); transition: color var(--t-fast); }
.admin-footer-links a:hover { color: var(--accent); }

/* =====================================================
   ADMIN — COMPONENTS
   ===================================================== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all var(--t-fast);
}
.stat-card:hover { border-color: var(--border-light); }
.stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card-icon svg { width: 18px; height: 18px; }
.stat-icon-blue { background: rgba(74,158,255,0.15); color: var(--accent); }
.stat-icon-green { background: rgba(63,185,80,0.15); color: var(--success); }
.stat-icon-amber { background: rgba(255,179,64,0.15); color: var(--amber); }
.stat-icon-purple { background: rgba(168,85,247,0.15); color: var(--purple); }
.stat-card-label { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat-card-value { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.stat-card-sub { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }

.admin-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.admin-info-card {
    padding: 18px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.admin-info-card h3 { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.admin-big-number { font-size: 26px; font-weight: 900; letter-spacing: -0.03em; color: var(--accent); }
.admin-big-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.info-card-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--accent); }
.info-card-header h3 { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 0; }

.admin-note {
    padding: 12px 16px;
    background: rgba(74,158,255,0.08);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.admin-note strong { color: var(--text-primary); }

.admin-link { color: var(--accent); font-size: 12px; font-weight: 600; }
.admin-link:hover { color: var(--accent-hover); text-decoration: underline; }

.admin-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}
.admin-panel {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.admin-panel-header h3 { font-size: 13px; font-weight: 700; }
.admin-empty { padding: 24px 16px; text-align: center; color: var(--text-tertiary); font-size: 12px; }
.admin-list { display: flex; flex-direction: column; }
.admin-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--t-fast);
}
.admin-list-item:last-child { border-bottom: none; }
.admin-list-item:hover { background: var(--bg-2); }
.admin-list-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    flex-shrink: 0;
}
.admin-list-info { flex: 1; min-width: 0; }
.admin-list-title {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-list-sub {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Settings */
.settings-form { display: flex; flex-direction: column; gap: 16px; }
.settings-section {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}
.settings-section-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--accent);
}
.settings-section-header h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.settings-section-header p { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.settings-grid-2 { grid-template-columns: repeat(4, 1fr); }
.settings-form textarea.form-input {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 10px;
    line-height: 1.5;
    resize: vertical;
}
.settings-actions {
    display: flex;
    justify-content: flex-end;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

/* Interval buttons */
.interval-selector { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.interval-btn {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    font-family: inherit;
}
.interval-btn:hover { border-color: var(--accent); color: var(--accent); }
.interval-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Steps */
.scheduler-steps { display: flex; flex-direction: column; gap: 12px; }
.step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.step-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    flex-shrink: 0;
}
.step strong { display: block; font-size: 12px; color: var(--text-primary); margin-bottom: 3px; }
.step p { font-size: 11px; color: var(--text-secondary); line-height: 1.6; }
.step code {
    background: var(--bg-3);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 10px;
    color: var(--accent);
}
.step kbd {
    background: var(--bg-3);
    border: 1px solid var(--border-light);
    border-radius: 3px;
    padding: 0 5px;
    font-size: 10px;
    font-family: monospace;
    color: var(--text-primary);
}

/* Admin tabs */
.mp-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-1);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
    overflow-x: auto;
    width: fit-content;
    max-width: 100%;
}
.mp-tab {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--t-fast);
    white-space: nowrap;
}
.mp-tab:hover { background: var(--bg-2); color: var(--text-primary); }
.mp-tab.active { background: var(--accent); color: white; }

/* Manual payments */
.mp-list { display: flex; flex-direction: column; gap: 14px; }
.mp-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.mp-pending { border-left: 3px solid var(--amber); }
.mp-verified { border-left: 3px solid var(--success); opacity: 0.85; }
.mp-rejected { border-left: 3px solid var(--danger); opacity: 0.6; }
.mp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
}
.mp-user { display: flex; align-items: center; gap: 10px; }
.mp-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
}
.mp-username { font-weight: 700; font-size: 13px; }
.mp-email { font-size: 11px; color: var(--text-tertiary); }
.mp-card-body { padding: 16px; }
.mp-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.mp-info { display: flex; flex-direction: column; gap: 3px; }
.mp-info-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.mp-info-value { font-size: 12px; color: var(--text-primary); }
.mp-info-value code {
    background: var(--bg-3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: var(--accent);
}
.mp-notes {
    padding: 8px 12px;
    background: var(--bg-2);
    border-left: 3px solid var(--border-light);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.mp-notes strong { color: var(--text-primary); }
.mp-receipt { margin-bottom: 14px; }
.mp-receipt-thumb {
    display: block;
    max-width: 180px;
    max-height: 130px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--t-fast);
    margin-top: 5px;
}
.mp-receipt-thumb:hover { border-color: var(--accent); }
.mp-actions-form { border-top: 1px solid var(--border); padding-top: 14px; }
.mp-actions { display: flex; gap: 8px; margin-top: 10px; }
.mp-actions .btn { flex: 1; }
.mp-verified-info { font-size: 11px; color: var(--text-tertiary); padding-top: 10px; border-top: 1px solid var(--border); }

.receipt-viewer {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    padding: 16px;
    background: var(--bg-1);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
}
.receipt-viewer img { max-width: 100%; max-height: 80vh; border-radius: 8px; display: block; }
.receipt-viewer .modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(0,0,0,0.5);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Listings manager */
.listings-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.listing-admin-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: all var(--t-fast);
}
.listing-admin-card:hover { border-color: var(--border-light); }
.listing-sold { opacity: 0.65; }
.listing-admin-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-2);
    overflow: hidden;
}
.listing-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing-badge-sold {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
}
.listing-admin-info { padding: 12px 14px; }
.listing-admin-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.listing-admin-price { color: var(--amber); font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.listing-admin-meta { display: flex; gap: 10px; font-size: 10px; color: var(--text-tertiary); }
.listing-admin-actions {
    display: flex;
    gap: 5px;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    flex-wrap: wrap;
}
.listing-admin-actions .btn { flex: 1; min-width: 60px; padding: 6px 8px; font-size: 10px; }

/* Analytics */
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 180px;
    padding: 16px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 20px;
}
.chart-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.chart-bars-inner { display: flex; align-items: flex-end; gap: 2px; width: 100%; height: 140px; }
.chart-bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.chart-bar-car { background: linear-gradient(180deg, var(--accent), #2563eb); }
.chart-bar-house { background: linear-gradient(180deg, var(--purple), #7c3aed); }
.chart-label { font-size: 8px; color: var(--text-tertiary); transform: rotate(-45deg); transform-origin: center; white-space: nowrap; }
.chart-legend { display: flex; gap: 14px; justify-content: center; margin-bottom: 14px; font-size: 11px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.dist-bar { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.dist-label { font-size: 12px; font-weight: 600; min-width: 90px; }
.dist-track { flex: 1; height: 8px; background: var(--bg-3); border-radius: 999px; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #2563eb); }
.dist-value { font-size: 12px; font-weight: 700; color: var(--text-secondary); min-width: 36px; text-align: right; }
.split-visual { display: flex; height: 36px; border-radius: 10px; overflow: hidden; margin: 14px 0; }
.split-seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; transition: flex 0.4s ease; }
.split-car { background: linear-gradient(135deg, var(--accent), #2563eb); }
.split-house { background: linear-gradient(135deg, var(--purple), #7c3aed); }

/* =====================================================
   RESPONSIVE — Tablet (≤ 900px)
   ===================================================== */
@media (max-width: 900px) {
    .auth-container { grid-template-columns: 1fr; max-width: 440px; }
    .auth-side { display: none; }
    .auth-card { padding: 28px 24px; }

    .header-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
    .main-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 3px;
    }
    .main-nav::-webkit-scrollbar { display: none; }
    .sync-widget { gap: 6px; margin-left: auto; }
    .user-name { display: none; }
    .sync-status { display: none; }

    .filter-wrapper { top: 0; position: sticky; padding: 10px 14px; }

    /* Admin tablet → drawer */
    .admin-mobile-toggle { display: flex; }
    .admin-topbar { padding: 10px 16px; }
    .admin-topbar-title { font-size: 11px; }
    .admin-main { margin-left: 0; }
    .admin-sidebar {
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-content { padding: 16px; }
    .admin-two-col { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-grid-2 { grid-template-columns: 1fr 1fr; }
}

/* =====================================================
   RESPONSIVE — Mobile (≤ 768px)
   ===================================================== */
@media (max-width: 768px) {
    body { font-size: 13px; }

    .hero-compact { padding: 14px; }
    .hero-compact-stats { width: 100%; justify-content: space-around; }

    .filter-wrapper { padding: 10px 12px; }
    .filter-bar { gap: 6px; }
    .filter-field select,
    .filter-field input { padding: 9px 11px; font-size: 12px; }
    .filter-checkbox { padding: 8px 11px; font-size: 12px; }

    .results { padding: 18px 14px 50px; }
    .results-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .results-title { font-size: 15px; }

    .car-grid { grid-template-columns: 1fr; gap: 14px; }
    .card-specs { grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .spec { font-size: 10px; flex-direction: column; align-items: flex-start; gap: 2px; }
    .spec svg { width: 11px; height: 11px; }

    .footer-inner { grid-template-columns: 1fr; gap: 20px; padding: 26px 14px 14px; }

    .pricing-page { padding: 26px 14px 50px; }
    .pricing-grid { grid-template-columns: 1fr; }
    .billing-toggle { margin: 20px 0 26px; }
    .price-amount { font-size: 28px; }
    .pricing-card { padding: 20px 18px; }

    .auth-card { padding: 24px 18px; }
    .auth-title { font-size: 20px; }

    .sync-toast { bottom: 12px; right: 12px; left: 12px; width: auto; }

    .admin-header h1 { font-size: 18px; }
    .admin-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
    .stat-card { padding: 12px; gap: 10px; }
    .stat-card-icon { width: 32px; height: 32px; }
    .stat-card-icon svg { width: 16px; height: 16px; }
    .stat-card-value { font-size: 16px; }
    .admin-big-number { font-size: 20px; }
    .settings-grid-2 { grid-template-columns: 1fr; }
    .admin-header-actions { width: 100%; }
    .admin-header-actions .btn { flex: 1; }
    .interval-btn { font-size: 10px; padding: 6px 10px; }

    /* Channels */
    .channels-page,
    .history-page { padding: 20px 14px 50px; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
    .page-head-stats { width: 100%; justify-content: flex-start; }
    .add-channel-card { padding: 16px; }
    .form-row { flex-direction: column; gap: 10px; }
    .channels-grid { grid-template-columns: 1fr; }
    .channel-actions .btn { flex: 1 1 calc(50% - 3px); font-size: 10px; padding: 7px 5px; }

    /* History table → cards */
    .history-table-wrapper { background: transparent; border: none; overflow: visible; }
    .history-table { min-width: 0; display: block; }
    .history-table thead { display: none; }
    .history-table tbody { display: flex; flex-direction: column; gap: 10px; }
    .history-table tbody tr {
        display: flex;
        flex-direction: column;
        background: var(--bg-1);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 14px;
        gap: 8px;
    }
    .history-table tbody tr:hover { background: var(--bg-1); }
    .history-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        border: none;
        font-size: 12px;
    }
    .history-table td::before {
        content: attr(data-label);
        font-size: 10px;
        color: var(--text-tertiary);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-weight: 700;
        margin-right: 10px;
    }
    .table-channel { justify-content: flex-end; }

    .history-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .history-stat-card { padding: 12px; gap: 8px; }
    .history-stat-icon { width: 32px; height: 32px; }
    .history-stat-icon svg { width: 16px; height: 16px; }
    .history-stat-value { font-size: 15px; }

    .history-filters { gap: 6px; }
    .history-filters .filter-field { flex: 1; min-width: 120px; }
    .history-filters-spacer { display: none; }
    .history-count { width: 100%; text-align: right; font-size: 11px; }

    .modal { max-width: 100%; }
}

/* =====================================================
   RESPONSIVE — Small Phones (≤ 400px)
   ===================================================== */
@media (max-width: 400px) {
    .hero-compact-title { font-size: 18px; }
    .card-price { font-size: 17px; }
    .card-title { font-size: 13px; }
    .card-source { display: none; }
    .user-btn { padding: 4px; }
}
/* =====================================================
   ADMIN — TOP NAV (Browse | Dashboard | Admin)
   ===================================================== */
.admin-topnav {
    display: flex;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.admin-topnav-link {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--t-fast);
    white-space: nowrap;
}
.admin-topnav-link:hover {
    color: var(--text-primary);
    background: var(--bg-2);
}
.admin-topnav-link.active {
    color: var(--text-primary);
    background: var(--bg-3);
}

/* Hide brand text on top bar since we have top nav now */
.admin-topbar-title { display: none; }

@media (max-width: 900px) {
    .admin-topnav { display: none; }  /* Mobile: rely on hamburger */
    .admin-topbar-title { display: flex; flex: 1; }
}
/* =====================================================
   ADMIN — LAYOUT FIXES
   ===================================================== */

/* Ensure no horizontal scrollbar ever */
html {
    overflow-x: clip;
}
body {
    overflow-x: clip;
    max-width: 100%;
}

/* Sidebar: make logo sticky, nav scrollable */
.admin-sidebar {
    overflow-y: auto;
    overflow-x: hidden;
}
.admin-logo {
    position: sticky;
    top: 0;
    background: var(--bg-1);
    z-index: 2;
}
.admin-sidebar-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-1);
    z-index: 2;
}

/* Reduce gap between sidebar and content */
.admin-main {
    padding: 0;            /* kill default padding */
}
.admin-topbar {
    padding: 10px 20px;
}
.admin-content {
    padding: 20px 24px;
}

/* Hide old topnav (removed from _header.php) */
.admin-topnav { display: none; }

/* Top bar title styling */
.admin-topbar-title {
    flex: 1;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    min-width: 0;
    color: var(--text-primary);
}
.admin-topbar-brand {
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Fix sidebar scrollbar */
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }

/* Fix admin-content overflow */
.admin-content {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

/* Mobile adjustments */
@media (max-width: 900px) {
    .admin-content { padding: 14px; }
    .admin-topbar { padding: 8px 14px; }
}

@media (max-width: 768px) {
    .admin-content { padding: 12px; }
}
/* =====================================================
   BACK TO TOP BUTTON
   ===================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4), 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.85);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.2s ease;
    z-index: 999;
    padding: 0;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    background: linear-gradient(135deg, var(--accent-hover), #3b82f6);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(74, 158, 255, 0.5), 0 6px 16px rgba(0,0,0,0.4);
}

.back-to-top:active {
    transform: translateY(-1px) scale(1);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* Mobile — smaller button, offset from edges */
@media (max-width: 768px) {
    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
    }
    .back-to-top svg {
        width: 18px;
        height: 18px;
    }
}

/* Extra small phones */
@media (max-width: 400px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 16px;
        right: 16px;
    }
}
/* =====================================================
   EDIT LISTING PAGE
   ===================================================== */
.edit-listing-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: flex-start;
}

.edit-listing-preview,
.edit-listing-details {
    padding: 20px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.edit-listing-panel-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.edit-listing-image-wrap {
    aspect-ratio: 4 / 3;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-listing-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.edit-listing-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

.edit-listing-meta {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-listing-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}
.edit-listing-meta-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

.edit-listing-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Responsive — stack on smaller screens */
@media (max-width: 900px) {
    .edit-listing-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .edit-listing-actions {
        flex-direction: column-reverse;
    }
    .edit-listing-actions .btn {
        width: 100%;
    }
}
/* =====================================================
   EDIT LISTING PAGE
   ===================================================== */
.edit-listing-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: flex-start;
}

.edit-listing-preview,
.edit-listing-details {
    padding: 20px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.edit-listing-panel-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.edit-listing-image-wrap {
    aspect-ratio: 4 / 3;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-listing-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.edit-listing-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

.edit-listing-meta {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-listing-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}
.edit-listing-meta-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Telegram section divider */
.edit-listing-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}
.edit-listing-section-divider::before,
.edit-listing-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Link preview box */
.edit-listing-link-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 6px;
    font-size: 12px;
    overflow: hidden;
}
.edit-listing-link-label {
    color: var(--text-tertiary);
    font-weight: 600;
    flex-shrink: 0;
}
.edit-listing-link-value {
    color: var(--accent);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.edit-listing-link-value:hover {
    text-decoration: underline;
}

/* Actions */
.edit-listing-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 900px) {
    .edit-listing-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .edit-listing-actions {
        flex-direction: column-reverse;
    }
    .edit-listing-actions .btn {
        width: 100%;
    }
}
/* =====================================================
   TOOLS — Badges, Cards, Split Visual
   ===================================================== */

/* Tool badge on user-facing cards */
.badge-tool-brand {
    background: rgba(255, 179, 64, 0.9);
    color: #1a1000;
    font-weight: 800;
}
.badge-tool-power {
    background: rgba(63, 185, 80, 0.9);
    color: white;
    font-weight: 800;
}

/* Tool card accent */
.tool-card .card-price {
    color: var(--amber);
}
.tool-card .card-media {
    background: linear-gradient(135deg, rgba(255,179,64,0.05), transparent);
}

/* Tool type switcher button accent */
.type-switch-btn.active[href*="type=tool"] {
    background: linear-gradient(135deg, var(--amber), #ff8c00);
}

/* Analytics split visual — tool segment */
.split-tool {
    background: linear-gradient(135deg, var(--amber), #ff8c00);
}

/* Chart bar — tools */
.chart-bar-tool {
    background: linear-gradient(180deg, var(--amber), #ff8c00);
}

/* Admin listing card — tool brand badge */
.listing-badge-brand {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 179, 64, 0.9);
    color: #1a1000;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

/* Extra info line on tool admin cards */
.listing-admin-extra {
    font-size: 10px;
    color: var(--amber);
    font-weight: 600;
    margin-top: 4px;
}

/* Type count on tool tab */
.type-switch-btn.active .type-count {
    background: rgba(255,255,255,0.25);
}

/* Tool feature chips */
.tool-card .feature-chip {
    background: rgba(255,179,64,0.1);
    border-color: rgba(255,179,64,0.3);
    color: var(--amber);
}
/* =====================================================
   TOOLS — Badges, Cards, Split Visual, Chart
   ===================================================== */

/* Tool badge on user-facing cards */
.badge-tool-brand {
    background: rgba(255, 179, 64, 0.9);
    color: #1a1000;
    font-weight: 800;
}
.badge-tool-power {
    background: rgba(63, 185, 80, 0.9);
    color: white;
    font-weight: 800;
}

/* Tool card accent */
.tool-card .card-price { color: var(--amber); }
.tool-card .card-media {
    background: linear-gradient(135deg, rgba(255,179,64,0.05), transparent);
}

/* Tool type switcher active state */
.type-switch-btn.active[href*="type=tool"] {
    background: linear-gradient(135deg, var(--amber), #ff8c00);
}

/* Analytics split visual — tool segment */
.split-tool {
    background: linear-gradient(135deg, var(--amber), #ff8c00);
}

/* Chart bar — tools */
.chart-bar-tool {
    background: linear-gradient(180deg, var(--amber), #ff8c00);
}

/* Admin listing card — tool brand badge (top-right) */
.listing-badge-brand {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 179, 64, 0.9);
    color: #1a1000;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

/* Extra info line on tool admin cards */
.listing-admin-extra {
    font-size: 10px;
    color: var(--amber);
    font-weight: 600;
    margin-top: 4px;
}

/* Tool feature chips */
.tool-card .feature-chip {
    background: rgba(255,179,64,0.1);
    border-color: rgba(255,179,64,0.3);
    color: var(--amber);
}
/* =====================================================
   MOBILE FIXES — TYPE SWITCHER + HERO + HEADER
   ===================================================== */

/* Type switcher: allow horizontal scroll instead of clipping */
@media (max-width: 600px) {
    .type-switcher-wrap {
        padding: 12px 10px 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;   /* was center — clips on overflow */
    }
    .type-switcher-wrap::-webkit-scrollbar { display: none; }

    .type-switcher {
        flex-shrink: 0;
        padding: 3px;
        gap: 3px;
    }
    .type-switch-btn {
        padding: 7px 10px;
        font-size: 11px;
        gap: 4px;
    }
    .type-switch-btn svg { width: 14px; height: 14px; }
    .type-count {
        font-size: 9px;
        padding: 1px 5px;
    }

    /* Hero: stack cleanly, don't let stats overflow */
    .hero-compact { padding: 14px 12px; }
    .hero-compact-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .hero-compact-title { font-size: 17px; }
    .hero-compact-sub { font-size: 11px; }

    .hero-compact-stats {
        width: 100%;
        justify-content: space-between;
        padding: 4px 6px;
        gap: 0;
    }
    .mini-stat { padding: 4px 6px; }
    .mini-stat-value { font-size: 12px; }
    .mini-stat-label { font-size: 8px; }

    /* Filter bar: allow horizontal scroll, don't wrap awkwardly */
    .filter-bar-single-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 6px;
    }
    .filter-bar-single-row::-webkit-scrollbar { display: none; }
    .filter-search { min-width: 160px; }
}

/* Header on small phones: shrink gaps */
@media (max-width: 480px) {
    .header-inner { gap: 8px; padding: 8px 10px; }
    .logo-text { display: none; }          /* keep only icon on tiny screens */
    .logo-mark { width: 32px; height: 32px; }
    .nav-link { padding: 6px 9px; font-size: 12px; }
    .notif-btn { width: 30px; height: 30px; }
    .user-btn { padding: 4px 6px 4px 4px; }
    .user-avatar { width: 22px; height: 22px; font-size: 10px; }
}
/* =====================================================
   ADMIN — MOBILE SIDEBAR BACKDROP
   ===================================================== */
.admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    z-index: 99;   /* below sidebar (100), above content */
}
.admin-sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 901px) {
    /* Never show backdrop on desktop */
    .admin-sidebar-backdrop { display: none !important; }
}
/* =====================================================
   MOBILE FIXES — TYPE SWITCHER + HERO + HEADER
   ===================================================== */

/* Type switcher: allow horizontal scroll instead of clipping */
@media (max-width: 640px) {
    .type-switcher-wrap {
        padding: 12px 10px 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
    }
    .type-switcher-wrap::-webkit-scrollbar { display: none; }

    .type-switcher {
        flex-shrink: 0;
        padding: 3px;
        gap: 3px;
    }
    .type-switch-btn {
        padding: 7px 10px;
        font-size: 11px;
        gap: 4px;
    }
    .type-switch-btn svg { width: 14px; height: 14px; }

    /* Icon + count only (label hidden) */
    .type-switch-btn .type-switch-label { display: none; }

    .type-count {
        font-size: 9px;
        padding: 1px 5px;
    }

    .hero-compact { padding: 14px 12px; }
    .hero-compact-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .hero-compact-title { font-size: 17px; }
    .hero-compact-sub { font-size: 11px; }

    .hero-compact-stats {
        width: 100%;
        justify-content: space-between;
        padding: 4px 6px;
        gap: 0;
    }
    .mini-stat { padding: 4px 6px; }
    .mini-stat-value { font-size: 12px; }
    .mini-stat-label { font-size: 8px; }
}

/* Filter bar: two rows on mobile */
@media (max-width: 768px) {
    .filter-wrapper { padding: 10px 12px; }

    .filter-bar-single-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "search sold"
            "extras extras";
        gap: 8px;
        overflow-x: visible;
        flex-wrap: wrap;
    }

    .filter-search {
        grid-area: search;
        min-width: 0;
        max-width: none;
    }

    .filter-bar-single-row .filter-checkbox {
        grid-area: sold;
        align-self: center;
    }

    /* Wrap remaining fields into row 2 as a horizontal scroll strip */
    .filter-bar-single-row > *:not(.filter-search):not(.filter-checkbox) {
        grid-area: auto;
    }

    /* Make everything below the search scroll horizontally inside the grid */
    .filter-bar-single-row {
        overflow: visible;
    }

    /* Give the entire row 2 its own scroll container via a pseudo */
    .filter-bar-single-row::after {
        content: '';
        grid-column: 1 / -1;
    }
}

/* Simpler approach for mobile filter bar using flex + wrap */
@media (max-width: 768px) {
    .filter-bar-single-row {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        overflow-x: visible;
    }
    .filter-bar-single-row .filter-search {
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
    }
    .filter-bar-single-row .filter-checkbox {
        flex: 0 0 auto;
        margin-left: auto;
    }
    .filter-bar-single-row > .filter-field.filter-compact,
    .filter-bar-single-row > .filter-field.filter-price-range,
    .filter-bar-single-row > .filter-field.filter-date-range,
    .filter-bar-single-row > .filter-btn,
    .filter-bar-single-row > .filter-reset {
        flex: 0 0 auto;
    }
    .filter-bar-single-row .filter-price-range input {
        width: 60px;
    }
    .filter-bar-single-row .filter-date-range input {
        width: 100px;
    }
}

/* Header on small phones */
@media (max-width: 480px) {
    .header-inner { gap: 8px; padding: 8px 10px; }
    .nav-link { padding: 6px 9px; font-size: 12px; }
    .notif-btn { width: 30px; height: 30px; }
    .user-btn { padding: 4px 6px 4px 4px; }
    .user-avatar { width: 22px; height: 22px; font-size: 10px; }
    .logo-text { display: none; }
    .logo-mark { width: 32px; height: 32px; }

    /* Hide "Just synced" pill on very small screens */
    .sync-status { display: none; }
}

/* =====================================================
   SYNC STATUS PILL + SYNC NOW (user + admin)
   ===================================================== */
.sync-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    transition: all var(--t, 0.25s ease);
    flex-shrink: 0;
}
.sync-dot.syncing { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1.5s infinite; }
.sync-dot.error { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.sync-dot.success { background: var(--success); box-shadow: 0 0 8px var(--success); }

@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }
@keyframes spin { from{transform:rotate(0)} to{transform:rotate(360deg)} }

/* =====================================================
   ADMIN — MOBILE SIDEBAR BACKDROP
   ===================================================== */
.admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    z-index: 99;
}
.admin-sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}
@media (min-width: 901px) {
    .admin-sidebar-backdrop { display: none !important; }
}
/* =====================================================
   MOBILE — HIDE TOP NAV PILLS
   ===================================================== */
@media (max-width: 768px) {
    .main-nav { display: none !important; }
    .site-header .header-inner { gap: 8px; }
    /* Push the actions block to the right edge */
    .site-header .sync-widget { margin-left: auto; }
}

@media (max-width: 480px) {
    /* Hide "Just synced" pill on small phones */
    .sync-status { display: none !important; }
}

/* =====================================================
   HERO + TYPE SWITCHER — SIDE BY SIDE
   ===================================================== */

/* The hero-compact-inner holds: hero-left, type-switcher, hero-stats */
.hero-compact-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: nowrap;
}

/* Left block (title + subtitle) grows to fill space */
.hero-compact-left {
    flex: 1 1 auto;
    min-width: 0;
}

/* The type switcher group sits in the middle / right of the hero */
.hero-compact .type-switcher {
    flex: 0 0 auto;
}

/* Stats row also flexes */
.hero-compact .hero-compact-stats {
    flex: 0 0 auto;
}

/* --- MOBILE: switcher + stats go into their own row below title --- */
@media (max-width: 900px) {
    .hero-compact-inner {
        flex-wrap: wrap;
        gap: 10px;
        align-items: flex-start;
    }
    .hero-compact-left {
        flex: 1 1 100%;
    }
    .hero-compact .type-switcher {
        flex: 0 0 auto;
        order: 2;
        overflow-x: auto;
        scrollbar-width: none;
        max-width: 100%;
    }
    .hero-compact .type-switcher::-webkit-scrollbar { display: none; }

    .hero-compact .hero-compact-stats {
        flex: 1 1 auto;
        order: 3;
        justify-content: space-around;
        width: auto;
        padding: 4px 8px;
    }
}

@media (max-width: 640px) {
    /* Icon + count only (hide "Cars"/"Houses"/"Tools" labels) */
    .type-switch-btn .type-switch-label { display: none; }
    .type-switch-btn { padding: 6px 9px; }
    .type-count { font-size: 9px; padding: 1px 5px; }

    .hero-compact .hero-compact-stats {
        flex: 1 1 100%;
        order: 3;
    }
    .mini-stat { padding: 3px 6px; }
    .mini-stat-value { font-size: 12px; }
    .mini-stat-label { font-size: 8px; }
}

/* =====================================================
   TYPE SWITCHER (base styling preserved)
   ===================================================== */
.type-switcher {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.type-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}
.type-switch-btn:hover { background: var(--bg-2); color: var(--text-primary); }
.type-switch-btn.active {
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
}
.type-switch-btn svg { flex-shrink: 0; }
.type-count {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    font-weight: 700;
}
.type-switch-btn.active .type-count { background: rgba(255,255,255,0.25); }

/* Tool active accent */
.type-switch-btn.active[href*="type=tool"] {
    background: linear-gradient(135deg, var(--amber), #ff8c00);
    color: #1a1000;
}
.type-switch-btn.active[href*="type=tool"] .type-count {
    background: rgba(0,0,0,0.15);
}

/* =====================================================
   MOBILE FILTER BAR — TWO ROWS
   ===================================================== */
@media (max-width: 768px) {
    .filter-wrapper { padding: 10px 12px; }

    .filter-bar-single-row {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        overflow-x: visible;
    }
    .filter-bar-single-row .filter-search {
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
    }
    .filter-bar-single-row .filter-checkbox {
        flex: 0 0 auto;
        margin-left: auto;
    }
    .filter-bar-single-row > .filter-field.filter-compact,
    .filter-bar-single-row > .filter-field.filter-price-range,
    .filter-bar-single-row > .filter-field.filter-date-range,
    .filter-bar-single-row > .filter-btn,
    .filter-bar-single-row > .filter-reset {
        flex: 0 0 auto;
    }
    .filter-bar-single-row .filter-price-range input { width: 60px; }
    .filter-bar-single-row .filter-date-range input  { width: 100px; }
}

/* =====================================================
   SYNC WIDGET (admin-only pill + button)
   ===================================================== */
.sync-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
.sync-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    transition: all 0.25s ease;
    flex-shrink: 0;
}
.sync-dot.syncing { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1.5s infinite; }
.sync-dot.error   { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.sync-dot.success { background: var(--success); box-shadow: 0 0 8px var(--success); }

@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }
@keyframes spin  { from{transform:rotate(0)} to{transform:rotate(360deg)} }

/* =====================================================
   ADMIN — MOBILE SIDEBAR BACKDROP
   ===================================================== */
.admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    z-index: 99;
}
.admin-sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}
@media (min-width: 901px) {
    .admin-sidebar-backdrop { display: none !important; }
}
/* =====================================================
   TYPE SWITCHER — PER-TYPE ICON COLORS
   ===================================================== */

/* Car = Blue */
.type-switch-btn[href*="type=car"] svg {
    color: #4a9eff;
    transition: color 0.15s ease;
}
.type-switch-btn[href*="type=car"].active svg {
    color: #ffffff;
}

/* House = Green */
.type-switch-btn[href*="type=house"] svg {
    color: #3fb950;
    transition: color 0.15s ease;
}
.type-switch-btn[href*="type=house"].active svg {
    color: #ffffff;
}

/* Tools = Amber (as before) */
.type-switch-btn[href*="type=tool"] svg {
    color: #ffb340;
    transition: color 0.15s ease;
}
.type-switch-btn[href*="type=tool"].active svg {
    color: #ffffff;
}

/* Computer = Purple */
.type-switch-btn[href*="type=computer"] svg {
    color: #a855f7;
    transition: color 0.15s ease;
}
.type-switch-btn[href*="type=computer"].active svg {
    color: #ffffff;
}

/* =====================================================
   MOBILE — HIDE COUNTS ON SWITCHER BUTTONS
   ===================================================== */
@media (max-width: 640px) {
    /* Hide label (already done previously — ensure it stays hidden) */
    .type-switch-btn .type-switch-label { display: none; }

    /* Hide the count badge inside the button */
    .type-switch-btn .type-count { display: none; }

    /* Slightly larger icons so they're easy to tap */
    .type-switch-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Tighten padding */
    .type-switch-btn {
        padding: 8px 12px;
        gap: 0;
    }
}

/* =====================================================
   MOBILE — HIDE TOP NAV PILLS (from previous batch)
   ===================================================== */
@media (max-width: 768px) {
    .main-nav { display: none !important; }
    .site-header .header-inner { gap: 8px; }
    .site-header .sync-widget { margin-left: auto; }
}

@media (max-width: 480px) {
    .sync-status { display: none !important; }
}

/* =====================================================
   SYNC WIDGET + PILL + TOAST (safety, in case missing)
   ===================================================== */
.sync-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
.sync-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    transition: all 0.25s ease;
    flex-shrink: 0;
}
.sync-dot.syncing { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1.5s infinite; }
.sync-dot.error   { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.sync-dot.success { background: var(--success); box-shadow: 0 0 8px var(--success); }

@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }
@keyframes spin  { from{transform:rotate(0)} to{transform:rotate(360deg)} }

.sync-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: var(--bg-1);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transform: translateY(150%);
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 9999;
    overflow: hidden;
}
.sync-toast.show { transform: translateY(0); opacity: 1; }
.toast-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--bg-2);
    border-bottom: 1px solid var(--border); font-size: 13px;
}
.toast-close { color: var(--text-tertiary); font-size: 20px; line-height: 1; padding: 0 4px; background: none; border: none; cursor: pointer; }
.toast-close:hover { color: var(--danger); }
.toast-body {
    max-height: 280px; overflow-y: auto;
    padding: 10px 16px; font-size: 11px;
    font-family: 'Monaco', 'Consolas', monospace; line-height: 1.7;
}
.log-line { color: var(--text-secondary); padding: 2px 0; }
.log-line.log-success { color: var(--success); font-weight: 600; }
.log-line.log-error   { color: var(--danger); }

/* =====================================================
   ADMIN — MOBILE SIDEBAR BACKDROP
   ===================================================== */
.admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    z-index: 99;
}
.admin-sidebar-backdrop.show { opacity: 1; visibility: visible; }
@media (min-width: 901px) {
    .admin-sidebar-backdrop { display: none !important; }
}
/* =====================================================
   HERO — SWITCHER + STATS IN ONE ROW (MOBILE)
   ===================================================== */

/* Override previous stacking rules — put them back on one row */
@media (max-width: 900px) {
    .hero-compact-inner {
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .hero-compact-left {
        flex: 1 1 100%;
        min-width: 0;
    }

    /* Force switcher + stats to sit side-by-side on one line */
    .hero-compact .type-switcher {
        flex: 0 0 auto;
        order: 2;
        max-width: none;
    }

    .hero-compact .hero-compact-stats {
        flex: 1 1 auto;
        order: 3;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 4px 8px;
        gap: 0;
        width: auto;
        white-space: nowrap;
    }
}

/* Compact everything on small phones so both groups fit in one row */
@media (max-width: 640px) {
    /* Tighter switcher */
    .hero-compact .type-switcher {
        padding: 3px;
        gap: 2px;
    }
    .hero-compact .type-switch-btn {
        padding: 6px 8px;
        gap: 0;
    }
    .hero-compact .type-switch-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Tighter stats */
    .hero-compact .mini-stat {
        padding: 2px 6px;
        border-right: 1px solid var(--border);
    }
    .hero-compact .mini-stat:last-child {
        border-right: none;
    }
    .hero-compact .mini-stat-value {
        font-size: 11px;
        font-weight: 800;
    }
    .hero-compact .mini-stat-label {
        font-size: 7px;
        letter-spacing: 0.03em;
        margin-top: 0;
    }
    .hero-compact .hero-compact-stats {
        padding: 3px 6px;
    }
}

/* Below 400px: hide the CHANNELS stat so the row never wraps */
@media (max-width: 400px) {
    .hero-compact .mini-stat:nth-child(2) {
        display: none;
    }
    .hero-compact .mini-stat {
        padding: 2px 5px;
    }
    .hero-compact .mini-stat-value {
        font-size: 10px;
    }
    .hero-compact .mini-stat-label {
        font-size: 6.5px;
    }
    .hero-compact .type-switch-btn {
        padding: 5px 7px;
    }
    .hero-compact .type-switch-btn svg {
        width: 16px;
        height: 16px;
    }
}
/* =====================================================
   HERO TITLE — SINGLE LINE, AUTO-SHRINK
   ===================================================== */

/* Prevent the title from wrapping in the hero row */
.hero-compact-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Fluid font-size: min 14px, preferred based on viewport, max 24px */
    font-size: clamp(14px, 2.4vw, 24px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    max-width: 100%;
}

/* Let the left block shrink instead of forcing wrap */
.hero-compact-left {
    min-width: 0;
    flex: 0 1 auto;      /* shrink allowed, no forced grow */
    max-width: 40%;      /* cap so switcher+stats always fit */
}

/* On tablet-ish screens, give the title a bit more room */
@media (max-width: 1200px) {
    .hero-compact-left { max-width: 34%; }
    .hero-compact-title { font-size: clamp(13px, 2.1vw, 20px); }
}

/* On smaller laptops, allow more title space but cap so switcher+stats stay on same row */
@media (max-width: 1024px) {
    .hero-compact-left { max-width: 32%; }
    .hero-compact-title { font-size: clamp(13px, 2vw, 18px); }
}

/* On tablet portrait — switcher + stats already stack via other rules; give title full width */
@media (max-width: 900px) {
    .hero-compact-left {
        max-width: 100%;
        flex: 1 1 100%;
    }
    .hero-compact-title {
        font-size: clamp(15px, 4vw, 22px);
        white-space: normal;   /* allow wrap on phones so it stays readable */
        overflow: visible;
        text-overflow: clip;
    }
}

/* Phones — keep title on its own line but readable */
@media (max-width: 640px) {
    .hero-compact-title {
        font-size: clamp(15px, 4.5vw, 19px);
        line-height: 1.2;
    }
}
/* =====================================================
   TYPE SWITCHER — PER-TYPE ACTIVE COLORS
   ===================================================== */

/* CARS — blue */
.type-switch-btn.active[href*="type=car"] {
    background: linear-gradient(135deg, #4a9eff, #2563eb);
    color: #ffffff;
}
.type-switch-btn.active[href*="type=car"] svg,
.type-switch-btn.active[href*="type=car"] .type-switch-label {
    color: #ffffff;
}
.type-switch-btn.active[href*="type=car"] .type-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* HOUSES — green */
.type-switch-btn.active[href*="type=house"] {
    background: linear-gradient(135deg, #3fb950, #2ea043);
    color: #ffffff;
}
.type-switch-btn.active[href*="type=house"] svg,
.type-switch-btn.active[href*="type=house"] .type-switch-label {
    color: #ffffff;
}
.type-switch-btn.active[href*="type=house"] .type-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* TOOLS — amber (already exists, but keeping for clarity) */
.type-switch-btn.active[href*="type=tool"] {
    background: linear-gradient(135deg, #ffb340, #ff8c00);
    color: #1a1000;
}
.type-switch-btn.active[href*="type=tool"] svg,
.type-switch-btn.active[href*="type=tool"] .type-switch-label {
    color: #1a1000;
}
.type-switch-btn.active[href*="type=tool"] .type-count {
    background: rgba(0, 0, 0, 0.15);
    color: #1a1000;
}

/* COMPUTERS — purple */
.type-switch-btn.active[href*="type=computer"] {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #ffffff;
}
.type-switch-btn.active[href*="type=computer"] svg,
.type-switch-btn.active[href*="type=computer"] .type-switch-label {
    color: #ffffff;
}
.type-switch-btn.active[href*="type=computer"] .type-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* =====================================================
   ETHIOPIA FLAG ICON (replaces "Ethiopia" text)
   ===================================================== */
.flag-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    object-fit: contain;
    border-radius: 2px;
    margin-left: 2px;
}
@media (min-width: 900px) {
    .flag-icon {
        width: 1.05em;
        height: 1.05em;
    }
}
/* =====================================================
   ADMIN TOPBAR — RIGHT-ALIGN ACTION BUTTONS
   ===================================================== */

/* The (hidden) title block becomes a spacer that pushes
   the actions block to the far right. */
.admin-topbar .admin-topbar-title {
    flex: 1 1 auto;
    display: block !important;   /* override earlier display:none */
    min-width: 0;
    visibility: hidden;           /* still no visible content */
    padding: 0;
    margin: 0;
    pointer-events: none;         /* not clickable */
}

/* Ensure actions never wrap and stay on the right */
.admin-topbar .admin-topbar-actions {
    margin-left: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* On mobile, hamburger + spacer + actions still work fine */
@media (max-width: 900px) {
    .admin-topbar .admin-topbar-title {
        flex: 1 1 auto;
        min-width: 0;
    }
}
/* =====================================================
   STICKY TOPBAR + FILTER BAR (user pages)
   ===================================================== */

/* Make sure the header is always sticky */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Filter bar sticks just below the header */
.filter-wrapper {
    position: sticky;
    top: 60px;                 /* height of .site-header — adjust if needed */
    z-index: 90;
    background: rgba(10, 14, 20, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

/* Mobile: header is shorter due to no top nav pills */
@media (max-width: 768px) {
    .filter-wrapper {
        top: 52px;             /* mobile header height */
    }
}

/* Small phones: header shrinks further */
@media (max-width: 480px) {
    .filter-wrapper {
        top: 48px;
    }
}
/* =====================================================
   STICKY TOPBAR + FILTER BAR (user pages)
   ===================================================== */

/* Header stays at top while scrolling */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Filter bar sticks just below the header */
.filter-wrapper {
    position: sticky;
    top: 60px;                   /* desktop header height */
    z-index: 90;
    background: rgba(10, 14, 20, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    /* Prevent horizontal gap when sticky */
    margin-left: 0;
    margin-right: 0;
}

/* Tablet: header is slightly shorter */
@media (max-width: 900px) {
    .filter-wrapper {
        top: 56px;
    }
}

/* Mobile: top nav pills are hidden → header shrinks */
@media (max-width: 768px) {
    .filter-wrapper {
        top: 52px;
    }
}

/* Small phones: further reduction */
@media (max-width: 480px) {
    .filter-wrapper {
        top: 48px;
    }
}

/* =====================================================
   STICKY ADMIN TOPBAR
   ===================================================== */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(10, 14, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

/* =====================================================
   BACK-TO-TOP BUTTON
   ===================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4), 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.85);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.2s ease;
    z-index: 999;
    padding: 0;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.back-to-top:hover {
    background: linear-gradient(135deg, var(--accent-hover), #3b82f6);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(74, 158, 255, 0.5), 0 6px 16px rgba(0,0,0,0.4);
}
.back-to-top:active {
    transform: translateY(-1px) scale(1);
}
.back-to-top svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
    }
    .back-to-top svg {
        width: 18px;
        height: 18px;
    }
}
@media (max-width: 400px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 16px;
        right: 16px;
    }
}
/* =====================================================
   FINAL STICKY OVERRIDES — MUST BE LAST IN THE CASCADE
   ===================================================== */

html {
    overflow-x: clip;
    /* NO overflow-y */
}
body {
    overflow-x: clip;
    max-width: 100%;
    /* NO overflow-y */
}

/* =====================================================
   USER HEADER — sticky at top
   (backdrop-filter OK here — tested working)
   ===================================================== */
.site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: var(--bg-0) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* =====================================================
   USER FILTER BAR — sticky right below header
   NO backdrop-filter — it breaks sticky on this element
   ===================================================== */
.filter-wrapper {
    position: sticky !important;
    top: 60px !important;
    z-index: 90 !important;
    background: var(--bg-0) !important;         /* solid, opaque */
    /* backdrop-filter deliberately REMOVED — it silently breaks sticky */
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

@media (max-width: 900px) {
    .filter-wrapper { top: 56px !important; }
}

@media (max-width: 768px) {
    .filter-wrapper { top: 52px !important; }
}

@media (max-width: 480px) {
    .filter-wrapper { top: 48px !important; }
}

/* =====================================================
   ADMIN TOPBAR — sticky at top
   NO backdrop-filter — same reason
   ===================================================== */
.admin-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 90 !important;
    background: var(--bg-0) !important;
    /* backdrop-filter deliberately REMOVED */
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* =====================================================
   Defensive — no overflow on sticky ancestors
   ===================================================== */
.admin-content,
.admin-main,
.results {
    overflow: visible !important;
}

/* And make sure the mobile override that sets top:0 is killed */
@media (max-width: 900px) {
    .filter-wrapper {
        top: 56px !important;
        position: sticky !important;
    }
}
/* =====================================================
   FREEZE HERO + FILTER BAR — uses JS-set CSS variables
   --header-h = actual header height (px)
   --hero-h   = actual hero height (px)
   Falls back to sensible defaults if JS hasn't run yet.
   ===================================================== */

/* The hero itself becomes sticky, right below the header */
.hero-compact {
    position: sticky !important;
    top: var(--header-h, 60px) !important;
    z-index: 85 !important;
    background: var(--bg-0) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    /* prevent the hero from being taller than the viewport */
    max-height: 50vh;
    overflow: hidden;
}

/* The filter bar sits below header + hero */
.filter-wrapper {
    position: sticky !important;
    top: calc(var(--header-h, 60px) + var(--hero-h, 100px)) !important;
    z-index: 84 !important;
    background: var(--bg-0) !important;
    /* backdrop-filter removed — it silently breaks sticky */
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Kill the old hardcoded top values from earlier in the file */
@media (max-width: 900px) {
    .filter-wrapper {
        top: calc(var(--header-h, 56px) + var(--hero-h, 100px)) !important;
        position: sticky !important;
    }
}
@media (max-width: 768px) {
    .filter-wrapper {
        top: calc(var(--header-h, 52px) + var(--hero-h, 100px)) !important;
    }
}
@media (max-width: 480px) {
    .filter-wrapper {
        top: calc(var(--header-h, 48px) + var(--hero-h, 100px)) !important;
    }
}