:root {
    --bg-deep: #030303;
    --bg-mid: #0a120a;
    --bg-card: rgba(8, 14, 8, 0.92);
    --bg-card-hover: rgba(12, 22, 12, 0.96);
    --bg-input: rgba(0, 0, 0, 0.55);
    --border: rgba(34, 197, 94, 0.22);
    --border-strong: rgba(74, 222, 128, 0.45);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.62);
    --text-dim: rgba(255, 255, 255, 0.42);
    --green: #22c55e;
    --green-light: #4ade80;
    --green-dark: #15803d;
    --green-glow: rgba(34, 197, 94, 0.35);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.12);
    --warning: #eab308;
    --warning-bg: rgba(234, 179, 8, 0.12);
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 32px rgba(34, 197, 94, 0.08);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --sidebar-w: 280px;
    --shell-max: 100%;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(34, 197, 94, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 50%, rgba(21, 128, 61, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(34, 197, 94, 0.08) 0%, transparent 45%),
        linear-gradient(180deg, #050805 0%, #020202 45%, #000000 100%);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.012) 2px,
        rgba(255, 255, 255, 0.012) 3px
    );
    z-index: 0;
}

a { color: var(--green-light); transition: color 0.15s; }
a:hover { color: #86efac; }

.container {
    width: 100%;
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

body.has-sidebar {
    overflow: hidden;
    height: 100vh;
}

.panel-shell {
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ── App shell (sidebar + main) ── */
.app-shell {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    height: 100vh;
    background: linear-gradient(180deg, rgba(6, 12, 6, 0.98) 0%, rgba(2, 4, 2, 0.99) 100%);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.45);
    z-index: 250;
}

.sidebar__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem 0.85rem;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.65rem 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.sidebar__brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.sidebar__brand-text strong {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--text);
}

.sidebar__brand-text span {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.sidebar__group { margin-bottom: 1.1rem; }

.sidebar__group-label {
    display: block;
    padding: 0.35rem 0.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    margin: 0.15rem 0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.sidebar__link:hover {
    color: var(--text);
    background: rgba(34, 197, 94, 0.08);
    border-color: var(--border);
}

.sidebar__link.is-active {
    color: var(--green-light);
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.18) 0%, rgba(34, 197, 94, 0.06) 100%);
    border-color: var(--border-strong);
    box-shadow: inset 3px 0 0 var(--green);
}

.sidebar__link.is-danger:hover {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

.sidebar__icon {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar__footer {
    padding: 0.85rem 0.75rem 0;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.sidebar__footer-text {
    font-size: 0.68rem;
    color: var(--text-dim);
    word-break: break-all;
    line-height: 1.4;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 240;
    backdrop-filter: blur(2px);
}

.sidebar-backdrop:not([hidden]) { display: block; }

.app-main {
    flex: 1;
    min-width: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-mobile-bar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(2, 6, 2, 0.95);
    flex-shrink: 0;
}

.app-mobile-bar__title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.sidebar-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.sidebar-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--green-light);
    border-radius: 2px;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 1.75rem 2rem;
    -webkit-overflow-scrolling: touch;
}

.content-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.app-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
    font-size: 0.78rem;
    color: var(--text-dim);
}

.app-footer__sep { opacity: 0.4; }

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    box-shadow: 0 0 20px var(--green-glow);
    font-size: 0.75rem;
    font-weight: 900;
}

/* ── Admin tabs ── */
.tab-panel { display: none; animation: tabFade 0.2s ease; }
.tab-panel.is-active { display: block; }

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

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.overview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.overview-card h3 {
    margin: 0 0 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.overview-card .stat-value { margin: 0; }

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.quick-link {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
}

.quick-link:hover {
    border-color: var(--border-strong);
    background: rgba(34, 197, 94, 0.08);
    color: var(--text);
}

.quick-link strong { font-size: 0.95rem; }
.quick-link span { font-size: 0.82rem; color: var(--text-muted); }

/* ── Main (auth pages) ── */
.main-content {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - var(--topbar-h) - 72px);
    padding: 0;
}

.flash-wrap {
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: 1rem 1.25rem 0;
}

.flash-wrap .alert { margin-bottom: 0; }

/* ── Page hero ── */
.page-hero {
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.75rem;
}

.page-hero--compact { padding: 1.5rem 0 1.25rem; }

.page-title {
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 800;
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.page-desc {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
    max-width: 640px;
}

.page-header { margin-bottom: 1.5rem; }

.page-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.page-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.page-hero__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-value--sm { font-size: 1rem; }

/* ── Auth ── */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1.25rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: calc(var(--radius) + 4px);
    padding: 2.25rem;
    box-shadow: var(--shadow), var(--shadow-glow);
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-brand .logo-mark {
    width: 52px;
    height: 52px;
    font-size: 1rem;
    margin: 0 auto 1rem;
    border-radius: 14px;
}

.auth-title {
    font-size: 1.55rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover { border-color: rgba(74, 222, 128, 0.28); }

.card--accent {
    border-color: var(--border-strong);
    background: linear-gradient(160deg, rgba(12, 28, 12, 0.95) 0%, rgba(6, 10, 6, 0.95) 100%);
    box-shadow: var(--shadow), 0 0 40px rgba(34, 197, 94, 0.06);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1.05rem;
    margin: 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title-icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.15);
    color: var(--green-light);
    font-size: 1rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-green {
    background: rgba(34, 197, 94, 0.18);
    color: var(--green-light);
    border: 1px solid var(--border);
}

.badge-muted {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Stats ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    word-break: break-all;
}

.stat-value--green { color: var(--green-light); }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.72rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder { color: var(--text-dim); }

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.75rem;
    align-items: center;
}

.form-hint {
    color: var(--text-dim);
    font-size: 0.82rem;
    margin-top: 0.75rem;
    line-height: 1.5;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-light) 0%, var(--green-dark) 100%);
    color: #041004;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.25);
}

.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 22px rgba(34, 197, 94, 0.35);
    color: #020802;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
}

.btn-danger {
    background: var(--danger-bg);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fff;
}

.btn-block { width: 100%; }

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
}

/* ── Alerts ── */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fecaca;
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--border-strong);
    color: #bbf7d0;
}

.alert-warning {
    background: var(--warning-bg);
    border-color: rgba(234, 179, 8, 0.35);
    color: #fef08a;
}

.hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 1rem; }
.muted { color: var(--text-muted); }
.center { text-align: center; }

.mono {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.82rem;
    word-break: break-all;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

/* ── Info list ── */
.info-list { margin: 0; }

.info-list dt {
    color: var(--text-dim);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.85rem;
}

.info-list dt:first-child { margin-top: 0; }

.info-list dd {
    margin: 0.2rem 0 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ── Sources layout ── */
.sources-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.sources-panel--add { position: sticky; top: 1rem; }

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

.playlist-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.2s, transform 0.15s;
}

.playlist-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.playlist-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.playlist-card__name {
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
    line-height: 1.3;
}

.playlist-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.playlist-card__row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.playlist-card__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.playlist-card__value {
    font-size: 0.88rem;
    color: var(--text-muted);
    word-break: break-all;
}

.playlist-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.35rem;
}

.empty-state__text {
    margin: 0;
    font-size: 0.9rem;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
}

.data-table th {
    background: rgba(34, 197, 94, 0.08);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr:hover { background: rgba(34, 197, 94, 0.04); }

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

.actions-cell { white-space: nowrap; }

.inline-form { display: inline; }

/* ── Admin sections ── */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-toolbar a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
}

.admin-toolbar a:hover { color: var(--green-light); }

.admin-section { margin-bottom: 1.5rem; }

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    margin: 2rem 0;
}

/* ── Products ── */
.product-card .price {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0.5rem 0 1rem;
    color: var(--green-light);
}

.old-price {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.product-highlight {
    border-color: var(--border-strong);
    box-shadow: var(--shadow), 0 0 32px rgba(34, 197, 94, 0.12);
}

/* ── Modal ── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal.hidden { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    z-index: 1;
    max-height: 90vh;
    overflow-y: auto;
}

/* ── Footer ── */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 1.25rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.35);
}

.footer-brand {
    color: var(--green-light);
    font-weight: 700;
}

code {
    background: rgba(0, 0, 0, 0.45);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    color: var(--green-light);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

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

    .app-mobile-bar { display: flex; }

    .app-content { padding: 1.15rem 1rem 1.5rem; }
}

@media (max-width: 960px) {
    .sources-layout {
        grid-template-columns: 1fr;
    }

    .sources-panel--add {
        position: static;
    }
}

@media (max-width: 640px) {
    .auth-card { padding: 1.75rem 1.25rem; }

    .card { padding: 1.15rem; }

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

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

    .data-table th,
    .data-table td { padding: 0.55rem 0.65rem; font-size: 0.82rem; }
}

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