@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --brand:       #C8102E;
    --brand-dark:  #a50d26;
    --gold:        #F5C842;
    --bg:          #0c0c10;
    --surface:     #14141a;
    --surface2:    #1c1c26;
    --surface3:    #242430;
    --border:      rgba(255,255,255,0.07);
    --border2:     rgba(255,255,255,0.12);
    --text:        #f0f0f2;
    --muted:       #7a7a8c;
    --dim:         #4a4a5c;
    --green:       #22c55e;
    --yellow:      #f59e0b;
    --red:         #ef4444;
    --blue:        #3b82f6;
    --sidebar-w:   224px;
    --sidebar-collapsed: 56px;
    --radius:      10px;
    --font:        'DM Sans', sans-serif;
    --mobile-header: 56px;
    --bottom-nav:    60px;
}
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Top accent bar ───────────────────────────────────────── */
.top-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--gold) 100%);
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
}

/* ── Mobile header ────────────────────────────────────────── */
.mobile-header {
    display: none;
    position: fixed;
    top: 3px; left: 0; right: 0;
    height: var(--mobile-header);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 150;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.mobile-header img { height: 28px; width: auto; }
.hamburger {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hamburger:hover { background: var(--surface2); }

/* ── Sidebar overlay (mobile) ─────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 160;
}
.sidebar-overlay.open { display: block; }

/* ── Authenticated layout ─────────────────────────────────── */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    padding-top: 3px;
}

/* ── Sheet handle (mobile only) ──────────────────────────── */
.sheet-handle { display: none; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 3px);
    position: sticky;
    top: 3px;
    max-height: calc(100vh - 3px);
    overflow-y: auto;
    transition: transform 0.25s ease;
}
.sidebar-brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.nav-section {
    padding: 8px 14px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
}
.nav-links {
    list-style: none;
    padding: 4px 10px;
    flex: 1;
}
.nav-links li { margin-bottom: 2px; }
.nav-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
}
.nav-links a svg { flex-shrink: 0; opacity: 0.7; }
.nav-links a:hover  { background: var(--surface2); color: var(--gold); }
.nav-links a:hover svg { opacity: 1; color: var(--gold); }
.nav-links a.active { background: var(--surface3); color: var(--gold); border-left: 2px solid var(--gold); }
.nav-links a.active svg { opacity: 1; color: var(--gold); }
.nav-links a.nav-danger { color: var(--dim); }
.nav-links a.nav-danger:hover { color: var(--red); background: rgba(239,68,68,0.08); }
.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.footer-email {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Main content ─────────────────────────────────────────── */
.main {
    padding: 36px 40px;
    max-width: 900px;
    width: 100%;
}

/* ── Bottom nav (mobile only) ─────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 150;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    flex: 1;
    text-align: center;
    transition: color 0.12s;
}
.bottom-nav a svg { opacity: 0.6; }
.bottom-nav a.active { color: var(--gold); }
.bottom-nav a.active svg { opacity: 1; color: var(--gold); }
.bottom-nav a:hover { color: var(--text); }

/* ── Guest layout ─────────────────────────────────────────── */
.guest-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--bg);
}

/* ── Auth card ────────────────────────────────────────────── */
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    width: 100%;
    max-width: 420px;
}
.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}
.auth-title { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.auth-sub   { font-size: 14px; color: var(--muted); }
.form-footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.form-footer a { color: var(--brand); text-decoration: none; }
.btn-block { width: 100%; justify-content: center; }

/* ── Cards ────────────────────────────────────────────────── */
.card { transition: border-color 0.15s; }
.card-hover:hover { border-color: var(--gold) !important; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Quick links grid ─────────────────────────────────────── */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.quick-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.quick-card svg { color: var(--brand); opacity: 0.8; }
.quick-card:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.quick-card:hover svg { opacity: 1; }

/* ── Stats ────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.stat-num   { font-size: 28px; font-weight: 600; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Page header ──────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.page-header p  { font-size: 14px; color: var(--muted); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 6px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=search],
select, textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
input::placeholder, textarea::placeholder { color: var(--dim); }
select option { background: var(--surface2); }
textarea { resize: vertical; min-height: 100px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.15s, background 0.15s;
    white-space: nowrap;
}
.btn:hover { opacity: 0.88; }
.btn-primary   { background: var(--brand);   color: #fff; }
.btn-secondary { background: var(--surface3); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--surface2); opacity: 1; }
.btn-danger    { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); opacity: 1; }
.btn-success   { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.btn-success:hover { background: rgba(34,197,94,0.25); opacity: 1; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-green  { background: rgba(34,197,94,0.12);  color: #22c55e; }
.badge-yellow { background: rgba(245,158,11,0.12); color: #f59e0b; }
.badge-red    { background: rgba(239,68,68,0.12);  color: #ef4444; }
.badge-blue   { background: rgba(59,130,246,0.12); color: #3b82f6; }
.badge-gray   { background: rgba(255,255,255,0.06); color: var(--muted); }

/* ── Flash messages ───────────────────────────────────────── */
.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.flash-success { background: rgba(34,197,94,0.1);  color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.flash-error   { background: rgba(239,68,68,0.1);  color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.flash-info    { background: rgba(59,130,246,0.1);  color: #3b82f6; border: 1px solid rgba(59,130,246,0.2); }
.flash-warning { background: rgba(245,158,11,0.1); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Login page backdrop ──────────────────────────────────── */
.login-backdrop {
    position: fixed; inset: 0; z-index: -1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 3px;
    overflow: hidden;
    filter: grayscale(1);
    opacity: 0.18;
}
.login-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.6s ease;
}
.login-backdrop img.coloured { filter: grayscale(0); }

/* ── Dashboard grid ───────────────────────────────────────── */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.dash-card-full {
    grid-column: 1 / -1;
}
.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    transition: background 0.12s, border-color 0.12s;
}
.dash-card:hover { background: var(--surface2); border-color: var(--gold); }
.dash-card-icon {
    width: 38px; height: 38px;
    background: rgba(200,16,46,0.1);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--brand);
    flex-shrink: 0;
}
.dash-card-label { font-size: 11px; color: var(--muted); }
.dash-card-name  { font-size: 13px; font-weight: 500; }

/* ── Collapsible sidebar ──────────────────────────────────── */
.sidebar-toggle {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--surface2); color: var(--text); }

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-brand .brand-logo { transition: opacity 0.2s; }

/* Collapsed state */
.app-layout.sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed) 1fr;
}
.app-layout.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
    overflow: visible;
}
.app-layout.sidebar-collapsed .brand-logo { opacity: 0; width: 0; overflow: hidden; }
.app-layout.sidebar-collapsed .nav-section { opacity: 0; height: 0; overflow: hidden; padding: 0; }
.app-layout.sidebar-collapsed .nav-links a span.nav-label { opacity: 0; width: 0; overflow: hidden; white-space: nowrap; }
.app-layout.sidebar-collapsed .sidebar-footer { opacity: 0; height: 0; overflow: hidden; padding: 0; }
.app-layout.sidebar-collapsed .nav-links a {
    justify-content: center;
    padding: 10px;
    position: relative;
}
.app-layout.sidebar-collapsed .nav-links a svg { margin: 0; }

/* Tooltip on collapsed */
.app-layout.sidebar-collapsed .nav-links a::after {
    content: attr(data-label);
    position: absolute;
    left: calc(var(--sidebar-collapsed) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface3);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 300;
    border: 1px solid var(--border2);
    transition: opacity 0.15s;
}
.app-layout.sidebar-collapsed .nav-links a:hover::after { opacity: 1; }

/* Smooth transitions */
.app-layout { transition: grid-template-columns 0.25s ease; }
.sidebar { transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.brand-logo { transition: opacity 0.2s, width 0.25s; }
.nav-label { transition: opacity 0.2s, width 0.25s; }
.nav-section { transition: opacity 0.2s, height 0.25s, padding 0.25s; }
.sidebar-footer { transition: opacity 0.2s, height 0.25s, padding 0.25s; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Show mobile header and bottom nav */
    .mobile-header { display: flex; }
    .bottom-nav    { display: flex; }

    /* Hide desktop sidebar by default */
    .app-layout {
        grid-template-columns: 1fr;
        padding-top: calc(3px + var(--mobile-header));
    }

    /* Sidebar becomes a bottom sheet */
    .sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 80vh;
        min-height: 0;
        border-radius: 20px 20px 0 0;
        transform: translateY(110%);
        box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
        z-index: 170;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        will-change: transform;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .sidebar.open { transform: translateY(0); }

    /* Hide logo in sheet — already shown in mobile header */
    .sidebar .sidebar-brand { display: none; }

    /* Sheet drag handle */
    .sheet-handle {
        display: block;
        width: 36px;
        height: 4px;
        background: var(--border2);
        border-radius: 2px;
        margin: 12px auto 4px;
        flex-shrink: 0;
    }

    /* Larger tap targets in sheet */
    .sidebar .nav-links { padding: 2px 12px; }
    .sidebar .nav-links a { padding: 11px 14px; font-size: 15px; }
    .sidebar .nav-section { padding: 10px 14px 3px; }

    /* Main content full width with bottom nav space */
    .main {
        padding: 20px 16px calc(var(--bottom-nav) + 20px);
        max-width: 100%;
    }

    /* Stack form rows */
    .form-row { grid-template-columns: 1fr; }

    /* Stack stat grid */
    .stat-grid { grid-template-columns: repeat(2, 1fr); }

    /* Quick grid 2 cols on mobile */
    .quick-grid { grid-template-columns: repeat(2, 1fr); }

    /* Dash grid 2 cols on mobile, support card full width */
    .dash-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-card-full { grid-column: 1 / -1; }

    /* Page header smaller */
    .page-header h1 { font-size: 20px; }

    /* Auth card full width */
    .auth-card { padding: 24px 20px; }
}

@media (max-width: 400px) {
    .stat-grid  { grid-template-columns: repeat(2, 1fr); }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .bottom-nav a { font-size: 9px; padding: 8px 6px; }
}

/* ── Collapsible nav sections ─────────────────────────────── */
.nav-toggle:hover {
    color: var(--text);
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding-left: 14px;
    padding-right: 10px;
}
.nav-toggle svg {
    color: var(--dim);
}

/* ── Mobile fixes for iPhone ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Prevent any element from exceeding screen width */
    * { max-width: 100vw; }
    
    /* Force all inline grids to stack */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:repeat(2"],
    [style*="grid-template-columns: repeat(2"],
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns:repeat(4"],
    [style*="grid-template-columns: repeat(4"],
    [style*="grid-template-columns:200px 1fr"],
    [style*="grid-template-columns: 200px 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Channel guide category sidebar — compact scrollable strip when stacked */
    [style*="grid-template-columns:200px 1fr"] > :first-child,
    [style*="grid-template-columns: 200px 1fr"] > :first-child {
        position: static !important;
        max-height: 200px !important;
        overflow-y: auto !important;
    }

    /* Tables scroll horizontally */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: calc(100vw - 32px);
    }

    /* Cards full width */
    .card { width: 100%; box-sizing: border-box; }

    /* Flex rows wrap on mobile */
    [style*="display:flex"],
    [style*="display: flex"] {
        flex-wrap: wrap;
    }

    /* Stat grid single column on very small screens */
    .stat-grid { grid-template-columns: repeat(2, 1fr); }

    /* Fix wide inputs */
    input, select, textarea {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Admin subscriber two-col grid stack */
    [style*="grid-template-columns:1fr 1fr;gap:12px"] {
        grid-template-columns: 1fr !important;
    }

    /* Quick stats row — 2 cols max */
    [style*="repeat(auto-fill,minmax(160px"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Prevent overflow on page */
    body { overflow-x: hidden; }
    .main { overflow-x: hidden; }

    /* Buttons wrap nicely */
    .btn { white-space: nowrap; }

    /* Form rows full width */
    .form-group { width: 100%; }

    /* Badge wrap fix */
    [style*="display:flex;gap"] { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .dash-grid { grid-template-columns: 1fr 1fr; }
    .dash-card-full { grid-column: 1 / -1; }

    /* Stack buttons on very small screens */
    [style*="display:flex;gap:8px;flex-wrap:wrap"] {
        flex-direction: column;
    }

    /* Full width selects */
    select { width: 100%; }
}

/* ── Subscribers table mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .subscribers-table th:nth-child(2),
    .subscribers-table td:nth-child(2),
    .subscribers-table th:nth-child(4),
    .subscribers-table td:nth-child(4) {
        display: none;
    }
}

/* ── Subscribers table — mobile show name + actions only ─────────────────── */
@media (max-width: 768px) {
    .subscribers-table th:nth-child(2),
    .subscribers-table td:nth-child(2),
    .subscribers-table th:nth-child(3),
    .subscribers-table td:nth-child(3),
    .subscribers-table th:nth-child(4),
    .subscribers-table td:nth-child(4) {
        display: none !important;
    }
}

/* ── hide-mobile utility ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

/* ── Subscriber page mobile fixes ────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Force all cards to stay within viewport */
    .card { overflow: hidden; max-width: 100%; }

    /* Break long strings like machine IDs, IPs, emails */
    .card div, .card td, .card span {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Monospace text wrap */
    [style*="font-family:monospace"] {
        word-break: break-all !important;
        white-space: normal !important;
    }

    /* Plex device rows */
    [style*="display:flex;align-items:center;gap:8px;padding:8px 12px"] {
        flex-wrap: wrap;
    }

    /* table-wrap constrain */
    .table-wrap {
        max-width: calc(100vw - 40px) !important;
        overflow-x: auto !important;
    }
}

/* ── iPhone safe area (home indicator) ───────────────────────────────────── */
.bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(var(--bottom-nav) + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 768px) {
    .main {
        padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom, 0px) + 20px);
    }

    /* Larger tap targets for small buttons on mobile */
    .btn-sm {
        padding: 8px 14px;
        min-height: 36px;
    }
}

/* ── Clean touch interactions ─────────────────────────────────────────────── */
a, button, .btn, .nav-links a, .bottom-nav a, .dash-card, .quick-card {
    -webkit-tap-highlight-color: transparent;
}
