/* ═══════════════════════════════════════════════
   LXD VPS Platform — Design System
   Premium dark-mode with glassmorphism
   ═══════════════════════════════════════════════ */

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

/* ── CSS Variables (Dark Mode - Default) ── */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-card-hover: #222838;
    --bg-sidebar: #0d1117;
    --bg-input: #1e2536;
    --bg-glass: rgba(26, 31, 46, 0.7);

    --text-primary: #e8eaf0;
    --text-secondary: #8b95a5;
    --text-muted: #5a6377;

    --accent-primary: #6366f1;
    --accent-primary-hover: #818cf8;
    --accent-secondary: #22d3ee;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    --accent-gradient-alt: linear-gradient(135deg, #06b6d4, #22d3ee);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --border-color: rgba(99, 102, 241, 0.15);
    --border-subtle: rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

    --sidebar-width: 220px;
    --topbar-height: 56px;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Light Mode Variables ── */
:root:not(.dark) {
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f3f4f6;
    --bg-sidebar: #ffffff;
    --bg-input: #f3f4f6;
    --bg-glass: rgba(255, 255, 255, 0.8);

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --border-color: rgba(99, 102, 241, 0.2);
    --border-subtle: rgba(0, 0, 0, 0.1);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

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

.icon-svg {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

a {
    color: var(--accent-primary-hover);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--accent-secondary);
}

/* ── Layout ── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand .logo-icon {
    width: 28px;
    height: 28px;
    background: var(--accent-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    box-shadow: none;
}

.sidebar-brand h1 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 10px;
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 1px;
    position: relative;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary-hover);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
}

.nav-link .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

.nav-link .badge-count {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

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

/* ── Topbar ── */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-left h2 {
    font-size: 16px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.topbar-user:hover {
    background: var(--bg-card);
    border-color: var(--border-subtle);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
}

.user-info span {
    display: block;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

.user-info small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Page Content ── */
.page-content {
    padding: 20px;
}

.page-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 2px;
    font-size: 13px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-glow);
}

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

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.15);
}

/* ── Stat Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.stat-card .stat-icon.purple { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.stat-card .stat-icon.cyan { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }
.stat-card .stat-icon.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-card .stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.stat-card .stat-icon.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Tables ── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
}

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

thead th {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

tbody td {
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

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

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-danger  { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-info    { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-secondary { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-success .badge-dot { background: #34d399; }
.badge-warning .badge-dot { background: #fbbf24; }
.badge-danger  .badge-dot { background: #f87171; }
.badge-info    .badge-dot { background: #60a5fa; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    color: white;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    background: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.btn-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.btn-warning:hover {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 16px;
}

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

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.helptext, .help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
}

.errorlist li {
    color: var(--danger);
    font-size: 12px;
    font-weight: 500;
}

/* Crispy forms overrides */
.mb-3 {
    margin-bottom: 20px !important;
}

/* ── Plan Cards ── */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 32px 28px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.plan-card.featured {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.plan-card.featured::before {
    content: 'Popular';
    position: absolute;
    top: 16px;
    right: -28px;
    background: var(--accent-gradient);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 40px;
    transform: rotate(45deg);
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.plan-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.plan-card .plan-price {
    font-size: 40px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 16px 0;
    line-height: 1;
}

.plan-card .plan-price span {
    font-size: 16px;
    font-weight: 500;
    -webkit-text-fill-color: var(--text-muted);
}

.plan-card .plan-features {
    list-style: none;
    margin: 24px 0;
    text-align: left;
}

.plan-card .plan-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.plan-card .plan-features li:last-child {
    border-bottom: none;
}

.plan-card .plan-features li .check {
    color: var(--success);
    font-weight: bold;
}

/* ── Progress / Usage Bars ── */
.usage-bar {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    margin-top: 8px;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--accent-gradient);
    transition: width 0.6s ease;
}

.usage-bar-fill.warn {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

/* ── Messages / Alerts ── */
.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.messages .message {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.messages .message.success { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.messages .message.error   { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.messages .message.warning { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.messages .message.info    { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }

/* ── Auth Pages ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.1), transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.auth-card .auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-card .auth-brand .logo-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.auth-card .auth-brand h2 {
    font-size: 22px;
    font-weight: 700;
}

.auth-card .auth-brand p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ── Ticket / Chat ── */
.ticket-thread {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
}

.ticket-reply {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

.ticket-reply.admin-reply {
    flex-direction: row-reverse;
}

.reply-bubble {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px 12px 12px 4px;
    padding: 14px 18px;
    max-width: 70%;
    font-size: 14px;
    line-height: 1.6;
}

.admin-reply .reply-bubble {
    border-radius: 12px 12px 4px 12px;
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.reply-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── Sidebar Toggle (Mobile) ── */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
}

/* ── Animations ── */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-in {
    animation: slideIn 0.4s ease;
}

/* ── Container Detail ── */
.container-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.info-item {
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.info-item .info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-item .info-value {
    font-size: 16px;
    font-weight: 600;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ── Scrollbar Styling ── */
/* Dark Mode Scrollbars (Default) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #111827;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #5a6377;
    border-radius: 4px;
    border: 2px solid #111827;
}

::-webkit-scrollbar-thumb:hover {
    background: #8b95a5;
}

/* Sidebar scrollbar - Dark Mode */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #0d1117;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #5a6377;
}

/* Light Mode Scrollbars */
:root:not(.dark) ::-webkit-scrollbar-track {
    background: #f3f4f6;
}

:root:not(.dark) ::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border: 2px solid #f3f4f6;
}

:root:not(.dark) ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

:root:not(.dark) .sidebar::-webkit-scrollbar-track {
    background: #ffffff;
}

:root:not(.dark) .sidebar::-webkit-scrollbar-thumb {
    background: #e5e7eb;
}

:root:not(.dark) .sidebar::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #5a6377 #111827;
}

:root:not(.dark) * {
    scrollbar-color: #d1d5db #f3f4f6;
}

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

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

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

    .sidebar-toggle {
        display: block;
    }

    .page-content {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .plans-grid {
        grid-template-columns: 1fr;
    }

    .container-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .topbar {
        padding: 0 16px;
    }

    .auth-card {
        margin: 16px;
        padding: 32px 24px;
    }
}

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
}

.filter-bar input[type="text"],
.filter-bar input[type="search"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.2s;
}

.filter-bar input:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-bar select {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    min-width: 140px;
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-bar .btn {
    white-space: nowrap;
}

/* ── Card Body ── */
.card-body {
    padding: 16px;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ── Usage Bar (dashboard) ── */
.usage-bar {
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

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

    .container-info-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar input[type="text"],
    .filter-bar input[type="search"] {
        min-width: unset;
        width: 100%;
    }

    .filter-bar select {
        width: 100%;
    }
}
