@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-deep: #0a0a14;
    --bg: #0f0f1e;
    --bg-card: rgba(22, 22, 42, 0.55);
    --sidebar: rgba(14, 14, 30, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-light: rgba(255, 255, 255, 0.14);
    --text: #ffffff;
    --muted: #9b9bb8;
    --gradient-purple: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    --gradient-orange: linear-gradient(135deg, #f97316 0%, #fbbf24 100%);
    --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-pink: linear-gradient(135deg, #db2777 0%, #f472b6 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --glow-purple: 0 8px 32px rgba(124, 58, 237, 0.25);
    --glow-orange: 0 8px 32px rgba(249, 115, 22, 0.3);
    --glow-cyan: 0 8px 32px rgba(6, 182, 212, 0.25);
    --danger: #ef4444;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ambient background */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}
body::before {
    width: 480px; height: 480px;
    background: rgba(124, 58, 237, 0.18);
    top: -120px; right: 10%;
}
body::after {
    width: 400px; height: 400px;
    background: rgba(6, 182, 212, 0.12);
    bottom: -80px; left: 20%;
}

.app {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
    width: 260px;
    background: var(--sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 1.75rem 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 0 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.logo-mark {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: var(--glow-purple);
    flex-shrink: 0;
}
.logo-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-text span {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.03em;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.75rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.25s ease;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
}
.nav-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
}
.nav-item.active {
    color: var(--text);
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: inset 0 0 20px rgba(124, 58, 237, 0.08);
}
.nav-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: background 0.25s;
}
.nav-item.active .nav-icon {
    background: var(--gradient-purple);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}
.nav-emergency.active {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}
.nav-emergency.active .nav-icon {
    background: linear-gradient(135deg, #ef4444, #f97316) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}
.nav-emergency:hover { color: #fca5a5 !important; }

.sidebar-footer {
    padding: 1rem 1.5rem 0;
    font-size: 0.72rem;
    color: var(--muted);
    border-top: 1px solid var(--glass-border);
    margin-top: 1rem;
}

/* ── Main content ── */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 20, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}
.topbar-titles {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.topbar h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.topbar-subtitle {
    font-size: 0.78rem;
    color: var(--muted);
}

.sync-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sync-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    color: var(--muted);
}
.sync-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--gradient-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: blink 2s infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

#page-content {
    padding: 1.75rem 2rem 2.5rem;
    flex: 1;
}

/* ── Glass cards ── */
.glass-card,
.stat-card,
.panel-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.35rem;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.glass-card:hover,
.stat-card:hover {
    border-color: var(--glass-border-light);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.panel-card { margin-bottom: 1.5rem; }
.panel-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.panel-card .panel-desc {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 1.1rem;
    line-height: 1.5;
}

/* ── Stats grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card--purple::before { background: var(--gradient-purple); }
.stat-card--cyan::before { background: var(--gradient-cyan); }
.stat-card--orange::before { background: var(--gradient-orange); }
.stat-card--pink::before { background: var(--gradient-pink); }
.stat-card--green::before { background: var(--gradient-green); }

.stat-card-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.stat-card--purple .stat-icon { background: rgba(124, 58, 237, 0.2); }
.stat-card--cyan .stat-icon { background: rgba(6, 182, 212, 0.2); }
.stat-card--orange .stat-icon { background: rgba(249, 115, 22, 0.2); }
.stat-card--pink .stat-icon { background: rgba(219, 39, 119, 0.2); }
.stat-card--green .stat-icon { background: rgba(16, 185, 129, 0.2); }

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}
.stat-card--purple .value { background: var(--gradient-purple); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-card--cyan .value { background: var(--gradient-cyan); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-card--orange .value { background: var(--gradient-orange); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-card--pink .value { background: var(--gradient-pink); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-card--green .value { background: var(--gradient-green); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.stat-card .label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.3rem;
    font-weight: 500;
}

/* ── Hero / feature cards ── */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
    .dashboard-row { grid-template-columns: 1fr; }
}

.hero-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25) 0%, rgba(236, 72, 153, 0.15) 100%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}
.hero-card::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2), transparent 70%);
    top: -60px; right: -40px;
    pointer-events: none;
}
.hero-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.hero-card p {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
    max-width: 90%;
}

.sync-hero-card {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(251, 191, 36, 0.1) 100%);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

/* ── Gauge ring ── */
.gauge-wrap {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.gauge-ring {
    position: relative;
    width: 80px; height: 80px;
    flex-shrink: 0;
}
.gauge-ring svg { transform: rotate(-90deg); }
.gauge-ring circle.track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 6; }
.gauge-ring circle.fill { fill: none; stroke-width: 6; stroke-linecap: round; }
.gauge-ring .gauge-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
}

/* ── Mini chart decoration ── */
.mini-chart {
    height: 48px;
    margin-top: 0.75rem;
    opacity: 0.7;
}
.mini-chart svg { width: 100%; height: 100%; }

/* ── Buttons ── */
.btn {
    padding: 0.55rem 1.15rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: var(--gradient-purple);
    color: #fff;
    box-shadow: var(--glow-purple);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 36px rgba(124, 58, 237, 0.45);
}

.btn-sync {
    background: var(--gradient-orange);
    color: #fff;
    box-shadow: var(--glow-orange);
}
.btn-sync:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 36px rgba(249, 115, 22, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border-light);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}
.btn-danger:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(239, 68, 68, 0.45);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--glass-border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--glass-border-light); }

.btn-sm { padding: 0.38rem 0.8rem; font-size: 0.8rem; border-radius: 8px; }

/* ── Toolbar & filters ── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.filter-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-pill {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.filter-pill:hover {
    color: var(--text);
    border-color: var(--glass-border-light);
    background: rgba(255, 255, 255, 0.08);
}
.filter-pill.active {
    color: #fff;
    background: var(--gradient-purple);
    border-color: transparent;
    box-shadow: var(--glow-purple);
}

.filter-select {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}
.filter-select:focus { border-color: rgba(124, 58, 237, 0.5); }

/* ── Tables ── */
.table-wrap {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 0.85rem 1.15rem;
    text-align: left;
}
th {
    background: rgba(0, 0, 0, 0.25);
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--glass-border);
}
td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(124, 58, 237, 0.06); }
td strong, td:first-child { font-weight: 500; }

/* ── Shared data tables & paging ── */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.page-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
}
.page-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.page-search {
    min-width: 220px;
    flex: 1;
    max-width: 360px;
    padding: 0.55rem 0.85rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.88rem;
}
.page-search:focus {
    outline: none;
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.data-table th,
.data-table td { padding: 0.65rem 0.9rem; vertical-align: middle; }
.data-table .col-num {
    width: 48px;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.data-table .col-count { width: 72px; text-align: center; }
.data-table .col-duration,
.data-table .col-updated { width: 100px; white-space: nowrap; font-size: 0.85rem; color: var(--muted); }
.data-table .col-status { width: 100px; }
.data-table .col-layout { max-width: 180px; }
.data-table .col-dl { width: 110px; }
.data-table .col-actions,
.data-table .actions { width: 1%; white-space: nowrap; }
.data-table .empty-row {
    text-align: center;
    color: var(--muted);
    padding: 2rem !important;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    flex-wrap: wrap;
}
.pagination-info {
    font-size: 0.85rem;
    color: var(--muted);
}
.pagination-info strong { color: var(--text); font-weight: 600; }
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.pagination-size {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--muted);
    margin-right: 0.35rem;
}
.pagination-size select {
    padding: 0.35rem 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.82rem;
    cursor: pointer;
}

/* ── Playlist page ── */
.playlist-page { display: flex; flex-direction: column; }
.playlist-table-wrap { margin-bottom: 0; }
.playlist-name { display: block; font-size: 0.9rem; margin-bottom: 0.2rem; }
.playlist-type-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.type-tag {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(124, 58, 237, 0.12);
    color: #c4b5fd;
    border: 1px solid rgba(124, 58, 237, 0.2);
}
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.4rem;
    border-radius: var(--radius-pill);
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
    font-weight: 700;
    font-size: 0.82rem;
    border: 1px solid rgba(6, 182, 212, 0.25);
}
.playlist-preview {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.playlist-row:hover td { background: rgba(124, 58, 237, 0.08); }

/* ── Content page ── */
.content-page { display: flex; flex-direction: column; gap: 0; }
.content-page .page-toolbar-left {
    flex-wrap: wrap;
    align-items: center;
}
.content-page .filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.content-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
}
.summary-chip {
    font-size: 0.82rem;
    color: var(--muted);
}
.summary-chip strong {
    color: var(--text);
    font-weight: 700;
}
.summary-chip--accent {
    color: #c4b5fd;
}
.content-table-wrap { margin-bottom: 0; }
.content-name { display: block; font-size: 0.9rem; }
.content-file,
.content-text-preview {
    display: block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    color: var(--muted);
}
.content-link {
    display: block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    color: #22d3ee;
    text-decoration: none;
}
.content-link:hover { text-decoration: underline; }
.data-table .col-type { width: 110px; }
.data-table .col-size { width: 88px; white-space: nowrap; font-size: 0.85rem; color: var(--muted); }
.content-row:hover td { background: rgba(124, 58, 237, 0.08); }

.content-name-btn {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    cursor: pointer;
    text-align: left;
}
.content-name-btn:hover .content-name { color: var(--accent); text-decoration: underline; }

.content-detail-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    cursor: pointer;
    max-width: 100%;
    text-align: left;
}
.content-detail-preview:hover .content-file,
.content-detail-link:hover { color: var(--accent); text-decoration: underline; }
.content-detail-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    cursor: pointer;
    text-align: left;
    font-size: inherit;
}
.content-thumb {
    width: 48px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
    background: rgba(0,0,0,0.25);
}
.content-thumb-video {
    width: 48px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.btn-upload.icon-btn span { pointer-events: none; }

/* ── Content preview modal ── */
.modal-preview { max-width: min(960px, 96vw); }
.modal-preview #modal-body { padding-top: 0.25rem; }
.content-preview-wrap {
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.content-preview-wrap--image,
.content-preview-wrap--video { padding: 0.5rem; }
.content-preview-media {
    max-width: 100%;
    max-height: min(60vh, 520px);
    width: auto;
    height: auto;
    display: block;
    border-radius: 6px;
    background: #000;
}
.content-preview-wrap--video .content-preview-media { width: 100%; }
.content-preview-wrap--website {
    flex-direction: column;
    align-items: stretch;
    min-height: 360px;
}
.content-preview-iframe {
    width: 100%;
    height: min(55vh, 480px);
    border: none;
    background: #fff;
}
.content-preview-hint { margin: 0.5rem 0.75rem 0.75rem; font-size: 0.78rem; }
.content-preview-wrap--text {
    min-height: 120px;
    padding: 1.25rem 0;
    overflow: hidden;
}
.content-preview-marquee-track {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}
.content-preview-marquee {
    display: inline-block;
    white-space: nowrap;
    animation: content-marquee-scroll var(--marquee-duration, 12s) linear infinite;
}
@keyframes content-marquee-scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
.content-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.content-preview-meta code {
    font-size: 0.75rem;
    word-break: break-all;
}
.content-preview-meta a { color: var(--accent); }
.btn-upload { cursor: pointer; margin: 0; }
.btn-upload input { display: none; }

/* ── Library cleanup modal ── */
.cleanup-intro {
    margin: 0 0 0.85rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
.cleanup-intro code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.85em;
}
.cleanup-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: #fecaca;
}
.cleanup-stats strong { color: #fff; }
.cleanup-table-wrap {
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}
.cleanup-table { margin: 0; }
.cleanup-file {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
}
.cleanup-more {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.cleanup-warning {
    margin: 0;
    font-size: 0.82rem;
    color: #fbbf24;
}

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.22rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-image { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-video { background: rgba(124, 58, 237, 0.2); color: #a78bfa; border: 1px solid rgba(124, 58, 237, 0.3); }
.badge-website { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-text { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-clock { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-emergency {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    animation: pulse-glow 1.5s infinite;
    border: none;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.8); }
}

.muted-text { color: var(--muted); font-size: 0.88rem; }

/* ── Playback panel ── */
.playback-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.playback-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: border-color 0.2s;
}
.playback-card:hover { border-color: rgba(6, 182, 212, 0.3); }
.playback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    gap: 1rem;
}
.playback-zones { display: flex; flex-direction: column; gap: 0.4rem; }
.playback-zone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.88rem;
    padding: 0.35rem 0;
}
.playback-zone-name { color: var(--muted); min-width: 80px; font-size: 0.8rem; }
.playback-content { font-weight: 600; }

/* ── Emergency ── */
.emergency-card {
    border-color: rgba(239, 68, 68, 0.35) !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(249, 115, 22, 0.05)) !important;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.08);
}
.emergency-active {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-sm);
}
.emergency-active-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}
.emergency-idle { font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.layout-check-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}
.layout-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    cursor: pointer;
}

/* ── Modal ── */
.modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1300;
    padding: 1rem;
}
.modal.hidden { display: none; }
.hidden { display: none !important; }
.modal-content {
    background: rgba(18, 18, 38, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius);
    width: 90%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.modal-content.modal-wide {
    max-width: 1060px;
}
.modal-header {
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-body,
#modal-body { padding: 1.35rem; }
.modal-footer {
    padding: 1rem 1.35rem;
    border-top: 1px solid var(--glass-border);
    display: flex; justify-content: flex-end; gap: 0.6rem;
}
.btn-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.btn-close:hover { color: var(--text); background: rgba(255,255,255,0.1); }

/* ── Layout editor ── */
.layout-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.layout-form .form-group { margin-bottom: 0; }

.layout-form-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.layout-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.85rem 1rem;
    align-items: end;
}
.layout-field-name input { width: 100%; }
.layout-default-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.86rem;
    color: var(--text);
    cursor: pointer;
    margin: 0;
    padding: 0.15rem 0;
}
.layout-default-check input { width: auto; margin: 0; accent-color: #7c3aed; }

.modal-content.modal-layout {
    max-width: min(1100px, 96vw);
}
.modal-layout #modal-body {
    padding-top: 0.25rem;
}

.layout-workspace {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    margin-top: 0;
}

.layout-canvas-wrap { min-width: 0; }

.layout-toolbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.layout-hint {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--muted);
}

.layout-editor {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}
.layout-editor.dragging .layout-zone { transition: none; }

.layout-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 5% 5%;
    pointer-events: none;
}

.layout-zone {
    position: absolute;
    border: 2px dashed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    font-size: 0.72rem;
    cursor: grab;
    border-radius: 4px;
    transition: box-shadow 0.15s, background 0.15s;
    box-sizing: border-box;
    padding: 0.25rem;
    text-align: center;
    overflow: hidden;
}
.layout-zone:hover { filter: brightness(1.15); }
.layout-zone.selected {
    border-style: solid;
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 4px 20px rgba(0,0,0,0.35);
    cursor: grabbing;
    z-index: 50 !important;
}
.layout-zone .zone-label { font-weight: 600; pointer-events: none; }
.layout-zone .zone-coords { font-size: 0.62rem; opacity: 0.8; pointer-events: none; }

.zone-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #7c3aed;
    border-radius: 2px;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.zone-handle-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.zone-handle-n  { top: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.zone-handle-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.zone-handle-e  { top: 50%; right: -5px; margin-top: -5px; cursor: ew-resize; }
.zone-handle-se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.zone-handle-s  { bottom: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.zone-handle-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.zone-handle-w  { top: 50%; left: -5px; margin-top: -5px; cursor: ew-resize; }

.layout-sidebar {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 440px;
    overflow-y: auto;
}
.layout-sidebar-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.zone-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.zone-tab {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--muted);
    font-size: 0.75rem;
    padding: 0.3rem 0.55rem;
    cursor: pointer;
    transition: all 0.15s;
}
.zone-tab:hover { color: var(--text); border-color: rgba(124,58,237,0.4); }
.zone-tab.active {
    background: rgba(124,58,237,0.2);
    border-color: rgba(124,58,237,0.5);
    color: #c4b5fd;
}

.zone-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.zone-prop { margin: 0; }
.zone-prop + .zone-prop { margin-top: 0; }
.zone-panel-empty {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    padding: 1rem 0.5rem;
    line-height: 1.5;
}
.zone-prop label {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}
.zone-prop input,
.zone-prop select {
    width: 100%;
    padding: 0.45rem 0.55rem;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.82rem;
}

.zone-sliders { display: flex; flex-direction: column; gap: 0.55rem; }
.zone-slider-row label {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}
.zone-slider-row label span { color: #a78bfa; font-weight: 600; }
.zone-slider-row input[type="range"] {
    width: 100%;
    accent-color: #7c3aed;
    margin-bottom: 0.2rem;
}
.zone-slider-row .zone-num {
    width: 100%;
    padding: 0.35rem 0.5rem;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.8rem;
}

body.layout-dragging { cursor: grabbing !important; }
body.layout-dragging * { cursor: grabbing !important; }

.zone-list { margin-top: 1rem; }
.zone-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
    .layout-form-grid { grid-template-columns: 1fr; }
    .layout-workspace { grid-template-columns: 1fr; }
    .layout-sidebar { max-height: none; }
}

.playlist-items { margin-top: 0.5rem; }
.playlist-items-section {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}
.playlist-items-desc { margin: 0.2rem 0 0.75rem; }
.playlist-items-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
}
.playlist-items-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.playlist-items-table thead th {
    text-align: left;
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}
.playlist-items-table tbody td {
    vertical-align: top;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.playlist-item-row:hover td {
    background: rgba(124, 58, 237, 0.05);
}
.playlist-items-empty {
    text-align: center;
    padding: 1rem !important;
    font-size: 0.82rem;
}
.playlist-items-table .pi-col-order { width: 3.25rem; }
.playlist-items-table .pi-col-type { width: 5.5rem; }
.playlist-items-table .pi-col-duration { width: 6.5rem; }
.playlist-items-table .pi-col-fit { width: 6.75rem; }
.playlist-items-table .pi-col-actions { width: 11rem; }
.pi-content-name {
    font-weight: 600;
    font-size: 0.86rem;
    margin-bottom: 0.25rem;
    color: #f3f4f6;
}
.pi-content-select { width: 100%; margin-bottom: 0.35rem; }
.pi-info { font-size: 0.76rem; line-height: 1.45; color: #9ca3af; }
.pi-info-line + .pi-info-line { margin-top: 0.15rem; }
.pi-info-url, .pi-info-text, .pi-info-file { word-break: break-all; }
.pi-warn { color: #fbbf24; }
.pi-dur-hint { display: block; margin-top: 0.2rem; font-size: 0.68rem; }
.pi-fit-na { font-size: 0.8rem; padding-top: 0.35rem; }
.pi-action-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}
.pi-action-icons .btn-sm {
    min-width: 2rem;
    padding: 0.25rem 0.35rem;
}
.playlist-props-card,
.playlist-content-edit-card {
    max-width: min(560px, 96vw);
    max-height: 90vh;
    overflow-y: auto;
}
.playlist-content-edit-card.wide-modal-body {
    max-width: min(640px, 96vw);
}
.playlist-content-edit-body .form-group { margin-bottom: 0.75rem; }
.playlist-items-empty {
    margin: 0.5rem 0 0.75rem;
    padding: 0.75rem;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}
.playlist-items-header {
    display: none;
}
.playlist-item-row select,
.playlist-item-row input[type="number"] {
    width: 100%;
    min-width: 0;
}
.playlist-item-row .pi-order,
.playlist-item-row .pi-dur {
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.pi-fit-wrap select { width: 100%; min-width: 0; font-size: 0.78rem; }
.playlist-upload-feedback {
    margin: 0.5rem 0 0;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.4;
}
.playlist-upload-feedback--ok {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.28);
}
.playlist-upload-feedback--warn {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
}
.upload-meta-overlay {
    position: fixed;
    inset: 0;
    z-index: 1450;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.upload-meta-card {
    width: min(460px, 100%);
    padding: 0 !important;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.upload-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.2rem;
    background: rgba(124, 58, 237, 0.12);
    border-bottom: 1px solid rgba(124, 58, 237, 0.22);
}
.upload-meta-step {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #c4b5fd;
}
.upload-meta-type .type-badge { margin: 0; }
.upload-meta-success {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1.1rem 1.2rem 0.35rem;
}
.upload-meta-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
    font-size: 1rem;
    font-weight: 700;
}
.upload-meta-success h3 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}
.upload-meta-sub {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.45;
}
.upload-meta-sub strong { color: #e9d5ff; font-weight: 600; }
.upload-meta-fields {
    padding: 0.65rem 1.2rem 0.25rem;
}
.upload-meta-fields .form-group { margin-bottom: 0.85rem; }
.upload-meta-fields label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}
.upload-meta-fields .input-field,
.upload-meta-fields input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
}
.upload-meta-fields .input-field:focus,
.upload-meta-fields input:focus {
    outline: none;
    border-color: rgba(124, 58, 237, 0.55);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
}
.upload-meta-video-hint {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.22);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}
.upload-meta-video-badge {
    font-size: 1.1rem;
    line-height: 1;
    margin-top: 0.1rem;
}
.upload-meta-video-hint strong {
    display: block;
    font-size: 0.9rem;
    color: #67e8f9;
    margin-bottom: 0.15rem;
}
.upload-meta-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem 1.1rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.15);
}
.playlist-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
}
.playlist-upload-panel {
    margin-top: 0.75rem;
    padding: 0.85rem;
    background: rgba(124, 58, 237, 0.08);
    border: 1px dashed rgba(124, 58, 237, 0.35);
    border-radius: var(--radius-sm);
}
.playlist-upload-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #c4b5fd;
    margin-bottom: 0.65rem;
}
.playlist-upload-fields { margin-bottom: 0.65rem; }
.playlist-upload-note { margin: 0.35rem 0 0.75rem; }
.playlist-upload-file .upload-hint { margin-top: 0.35rem; }
.upload-hint {
    margin-top: 0.35rem;
    margin-bottom: 0;
}
.upload-hint code { font-size: 0.72rem; }
.pi-upload,
.pi-inline-web,
.pi-inline-text { padding: 0.25rem 0.4rem !important; min-width: 36px; }
.playlist-inline-fields {
    padding: 0.85rem 1.2rem 0.35rem;
}
.playlist-inline-title,
.upload-meta-inline-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}
.playlist-inline-desc {
    margin: 0 0 0.85rem;
}
.playlist-inline-fields textarea.input-field {
    min-height: 4.5rem;
    resize: vertical;
}

.actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }

.empty {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--muted);
    background: var(--bg-card);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.api-key {
    font-family: 'Consolas', 'Courier New', monospace;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.25);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #c4b5fd;
}

.api-key-field {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}
.api-key-field input {
    flex: 1;
    min-width: 200px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

/* ── Guide list ── */
.guide-list {
    color: var(--muted);
    line-height: 1.9;
    padding-left: 1.25rem;
    font-size: 0.88rem;
}
.guide-list li::marker { color: #7c3aed; }
.public-view-details { margin-top: 0.55rem; }
.public-view-details.hidden { display: none; }

/* ── Display form (tambah / edit) ── */
.display-form { display: flex; flex-direction: column; gap: 0; }
.display-form-section {
    padding: 0.9rem 0 0;
    border-top: 1px solid var(--glass-border);
}
.display-form-section:first-of-type { border-top: none; padding-top: 0; }
.display-form-section--footer { padding-bottom: 0; }
.display-form-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a78bfa;
    margin: 0 0 0.65rem;
}
.display-form-section-desc {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0 0 0.65rem;
    line-height: 1.45;
}
.display-form .form-group { margin-bottom: 0.75rem; }
.display-form-section .form-group:last-child { margin-bottom: 0; }
.display-form .field-hint { margin-top: 0.35rem; margin-bottom: 0; }
.display-form-note { margin: 0; }
.display-form-section > .display-form-note:last-child { margin-bottom: 0; }
.display-form-empty { margin: 0; padding: 0.35rem 0; }

.display-layout-check-group { max-height: 220px; }
.display-layout-check {
    align-items: flex-start;
    padding: 0.35rem 0;
}
.display-layout-check span {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    line-height: 1.3;
}
.display-layout-check strong { font-size: 0.86rem; font-weight: 600; }
.display-layout-check small { color: var(--muted); font-size: 0.74rem; }

/* Searchable combobox (display layout picker) */
.searchable-select {
    position: relative;
    width: 100%;
}
.searchable-select-control {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
}
.searchable-select-input {
    flex: 1;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(15, 17, 23, 0.65);
    color: var(--text);
    font-size: 0.88rem;
}
.searchable-select-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}
.searchable-select-clear {
    flex-shrink: 0;
    width: 2.1rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.searchable-select-clear:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.searchable-select-list {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: #161b22;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.searchable-select-list.hidden { display: none; }
.searchable-select-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.searchable-select-option.hidden { display: none; }
.searchable-select-option:hover,
.searchable-select-option.selected { background: rgba(124, 58, 237, 0.15); }
.searchable-select-option strong { font-size: 0.86rem; font-weight: 600; }
.searchable-select-option small { color: var(--muted); font-size: 0.74rem; }
.searchable-select-option em { color: var(--muted); font-style: normal; font-size: 0.84rem; }
.display-layout-picker { margin-bottom: 0; }

.display-toggle-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
}
.display-toggle-check input { accent-color: #7c3aed; width: auto; margin: 0; }

.display-api-input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
}

.public-view-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}
.public-view-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.public-view-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.public-view-field code,
.public-view-field a {
    font-size: 0.78rem;
    word-break: break-all;
}
.public-view-field a { color: var(--accent); }
.public-view-regen { align-self: flex-start; }

.modal-content.modal-display { max-width: 620px; }
.modal-display #modal-body {
    padding: 1.15rem 1.35rem 1.2rem;
}
.modal-display .modal-header {
    padding: 1rem 1.35rem;
}
.modal-display .modal-footer {
    padding: 0.85rem 1.35rem;
}

.display-page { display: flex; flex-direction: column; gap: 1rem; }

.display-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.display-summary-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 0.7rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.display-summary-item .num {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}
.display-summary-item .lbl {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.display-summary-item.online .num { color: #34d399; }
.display-summary-item.offline .num { color: #94a3b8; }
.display-summary-item.warn .num { color: #fb923c; }

.display-toolbar-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
}
.display-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    min-width: 240px;
    flex-wrap: wrap;
}
.display-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.display-search {
    min-width: 220px;
    flex: 1;
    max-width: 320px;
    padding: 0.55rem 0.85rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.88rem;
}
.display-search:focus {
    outline: none;
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.display-main {
    display: grid;
    grid-template-columns: minmax(0, 65%) minmax(0, 35%);
    gap: 1rem;
    align-items: stretch;
    min-height: 0;
}
.display-table-area {
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.display-table-area .pagination-bar {
    padding: 0.55rem 0.75rem;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}
.display-empty { padding: 1.5rem 1rem; text-align: center; }

.display-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: min(520px, calc(100vh - 300px));
    flex: 1 1 auto;
}
.display-table { min-width: 760px; width: 100%; table-layout: fixed; border-collapse: collapse; }
.display-table--compact th,
.display-table--compact td {
    padding: 0.55rem 0.65rem;
    font-size: 0.84rem;
    vertical-align: middle;
    overflow: hidden;
}
.display-table--compact .col-num { width: 2.5rem; text-align: center; }
.display-table--compact .col-actions { width: 7rem; }
.display-table--compact .col-name {
    width: 32%;
    min-width: 10rem;
}
.display-table--compact .col-status { width: 4.5rem; text-align: center; }
.display-table--compact .col-platform { width: 5.5rem; text-align: center; }
.display-table--compact .col-default-layout {
    width: 18%;
    min-width: 0;
    font-size: 0.8rem;
}
.display-table--compact .col-last-connected {
    width: 9rem;
    text-align: center;
    font-size: 0.76rem;
    color: var(--muted);
    white-space: nowrap;
}
.display-table--compact th.col-name {
    color: #c4b5fd;
    font-weight: 600;
}
.display-table--compact .col-name .display-name-btn {
    width: 100%;
    max-width: 100%;
    display: block;
    text-align: left;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
}
.display-table--compact td.col-name {
    overflow: visible;
    white-space: normal;
    vertical-align: top;
}

/* ── Icon action buttons ── */
.action-icons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
}
.icon-btn {
    min-width: 2rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
}
.icon-btn.btn-danger { color: #f87171; border-color: rgba(248, 113, 113, 0.25); }
.icon-btn.btn-danger:hover { background: rgba(248, 113, 113, 0.12); }

/* ── Upload progress ── */
.upload-progress {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1400;
    width: min(360px, calc(100vw - 2rem));
}
.upload-progress-inner { padding: 0.85rem 1rem; }
.upload-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}
.upload-progress-head span:last-child {
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
}
.upload-progress-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.upload-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #7c3aed, #06b6d4);
    transition: width 0.15s ease;
}

/* ── Dashboard insights ── */
.dashboard-insights { margin-bottom: 1.25rem; }
.dashboard-insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
}
.dashboard-insight-item {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}
.dashboard-insight-item.ok { border-color: rgba(16, 185, 129, 0.25); }
.dashboard-insight-item.warn { border-color: rgba(251, 191, 36, 0.3); }
.dashboard-insight-item.danger { border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.insight-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}
.insight-value--sm { font-size: 0.95rem; font-family: monospace; }
.insight-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}
.dashboard-bandwidth { margin-bottom: 1.25rem; }
.bandwidth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
.bandwidth-card {
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.bandwidth-card--in { border-color: rgba(6, 182, 212, 0.35); }
.bandwidth-card--out { border-color: rgba(124, 58, 237, 0.35); }
.bandwidth-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}
.bandwidth-icon { font-size: 1.35rem; line-height: 1; }
.bandwidth-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}
.bandwidth-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.bandwidth-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}
.bandwidth-rate {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.bandwidth-summary {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}
.bandwidth-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 140px;
}
.bandwidth-summary-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.bandwidth-summary-item strong {
    font-size: 0.92rem;
    color: #fff;
}
.dashboard-panels-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}
.dashboard-panel-half { margin-bottom: 0; }
.dashboard-health-table th,
.dashboard-health-table td { padding: 0.45rem 0.6rem; font-size: 0.82rem; }
.dashboard-health-more { margin-top: 0.5rem; font-size: 0.8rem; }
.dashboard-health-more a { color: var(--accent); text-decoration: none; }
.text-ok { color: #34d399; }
.text-warn { color: #fbbf24; }

/* ── Layout page ── */
.layout-page .layout-table-wrap,
.playlist-page .playlist-table-wrap { margin-top: 0.75rem; }
.layout-table {
    table-layout: fixed;
    width: 100%;
}
.layout-table .col-layout-name {
    width: 34%;
    min-width: 10rem;
}
.layout-table .col-name .layout-name-text {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
}
.layout-table td.col-layout-name,
.layout-table td.col-name {
    overflow: visible;
    white-space: normal;
    vertical-align: top;
}
.layout-table th.col-layout-name {
    color: #c4b5fd;
    font-weight: 600;
}
.layout-table .layout-default-badge {
    display: inline-block;
    margin-top: 0.25rem;
}
.layout-table .col-res { width: 6.5rem; white-space: nowrap; }
.layout-table .col-updated { width: 6.5rem; }
.layout-row:hover td { background: rgba(124, 58, 237, 0.08); }
.layout-zone-hint { font-size: 0.75rem; }

/* ── Playlist verification ── */
.col-verify { width: 110px; }
.verify-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    color: inherit;
}
.verify-badge--ok { border-color: rgba(52, 211, 153, 0.35); color: #34d399; }
.verify-badge--warn { border-color: rgba(251, 191, 36, 0.4); color: #fbbf24; }
.verify-badge:hover { filter: brightness(1.1); }
.verify-summary {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.verify-summary--ok { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.25); }
.verify-summary--warn { background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.3); }
.verify-status--ok { color: #34d399; }
.verify-status--warn { color: #fbbf24; }
.verify-status--error { color: #f87171; }

/* ── Display synced files ── */
.sync-files-summary {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}
.sync-files-table-wrap {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}
.sync-files-table { margin: 0; font-size: 0.78rem; }
.sync-files-table th,
.sync-files-table td { padding: 0.35rem 0.5rem; }
.sync-file-icon { width: 1.5rem; text-align: center; }
.sync-file-row--synced .sync-file-icon { color: #34d399; }
.sync-file-row--pending .sync-file-icon { color: #fbbf24; }
.sync-file-row--missing .sync-file-icon { color: #f87171; }
.sync-file-name { font-family: monospace; font-size: 0.72rem; color: var(--text-muted); }

@media (max-width: 900px) {
    .dashboard-panels-row { grid-template-columns: 1fr; }
    .bandwidth-grid { grid-template-columns: 1fr; }
}
.display-table th.col-actions,
.display-table td.col-actions {
    width: 7.5rem;
    min-width: 7.5rem;
    max-width: 7.5rem;
    white-space: nowrap;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}
.display-table.data-table .col-actions {
    width: 7.5rem;
}
.display-table col.col-num { width: 2.5rem; }
.display-table col.col-actions { width: 7rem; }
.display-table col.col-name { width: 32%; }
.display-table col.col-status { width: 4.5rem; }
.display-table col.col-platform { width: 5.5rem; }
.display-table col.col-default-layout { width: 18%; }
.display-table col.col-last-connected { width: 9rem; }
.display-table th.col-actions { text-align: center; }
.display-table .col-actions .action-icons {
    justify-content: flex-start;
    flex-wrap: nowrap;
}
.display-table th.col-num,
.display-table td.col-num { text-align: center; }
.display-table th.col-status,
.display-table td.col-status { text-align: center; }
.display-table th.col-platform,
.display-table td.col-platform { text-align: center; }
.display-table th.col-last-connected,
.display-table td.col-last-connected { text-align: center; }
.display-table td.col-default-layout {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.display-row--selected td { background: rgba(124, 58, 237, 0.12) !important; }
.display-row--online .display-name-btn { color: #6ee7b7; font-weight: 600; }

.display-name-btn {
    background: none;
    border: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.84rem;
    padding: 0;
    cursor: pointer;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}
.display-row--online .display-name-btn:hover { color: #34d399; }
.display-table-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}
.api-key-compact {
    font-size: 0.68rem;
    color: var(--muted);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}
.display-table-layout { font-weight: 500; font-size: 0.85rem; }
.display-dl-text { font-size: 0.82rem; font-weight: 600; }
.display-dl-text.ok { color: #34d399; }
.display-dl-text.warn { color: #fb923c; }
.display-dl-bar--sm { max-width: 64px; margin: 0.2rem auto 0; }
.display-table--compact .status-pill {
    font-size: 0.68rem;
    padding: 0.15rem 0.4rem;
}
.display-table--compact .display-dl-text { font-size: 0.76rem; }

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}
.status-dot--online { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.6); }
.status-dot--offline { background: #64748b; }

.display-table-actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.btn-danger-text { color: #f87171 !important; }
.btn-danger-text:hover { background: rgba(248, 113, 113, 0.12) !important; }
.btn-block { width: 100%; justify-content: center; }

.display-expand-panel {
    padding: 1rem 1.15rem 1.1rem;
    border-top: 1px solid rgba(124, 58, 237, 0.15);
}
.display-expand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.display-expand-block h4,
.display-detail-section h4,
.display-drawer-section h4 {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.display-expand-block--wide { grid-column: 1 / -1; }
.display-expand-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--glass-border);
}

.display-info-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.display-info-list > div {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.5rem;
    font-size: 0.82rem;
}
.display-info-list dt {
    margin: 0;
    color: var(--muted);
    font-weight: 500;
}
.display-info-list dd { margin: 0; word-break: break-word; }
.display-info-list--inline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}
.display-info-list--inline > div { grid-template-columns: 1fr; gap: 0.15rem; }

.display-detail-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    max-height: calc(100vh - 260px);
    min-height: min(520px, calc(100vh - 260px));
    overflow-y: auto;
    position: sticky;
    top: 1rem;
}
.display-detail-placeholder {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.display-detail-placeholder-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.6;
}
.display-detail-placeholder p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}
.display-detail-inner { padding: 1.1rem 1.25rem; }
.display-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
}
.display-detail-head h3,
.display-detail-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #e9d5ff;
    line-height: 1.4;
    word-break: break-word;
}
.display-detail-section {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.display-detail-section:last-child { border-bottom: none; margin-bottom: 0; }
.display-detail-screenshot-wrap img,
.display-detail-screenshot {
    width: 100%;
    max-height: min(300px, 36vh);
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: #000;
}
.display-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.display-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1100;
}
.display-drawer.hidden,
.display-drawer-backdrop.hidden {
    display: none !important;
}
.display-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(480px, 100vw);
    height: 100vh;
    background: rgba(14, 14, 30, 0.98);
    border-left: 1px solid var(--glass-border);
    z-index: 1101;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
}
.display-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}
.display-drawer-header h3 { margin: 0; font-size: 1rem; }
.display-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.15rem 1.5rem;
}
.display-drawer-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.display-drawer-screenshot-area {
    margin-bottom: 1rem;
    background: #000;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    min-height: 120px;
}
.display-drawer-screenshot {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}
.display-drawer-section { margin-bottom: 1rem; }
.display-drawer-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.display-api-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.display-api-row .api-key,
.display-drawer-meta .api-key {
    font-size: 0.72rem;
    padding: 0.15rem 0.4rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    word-break: break-all;
}
.btn-xs {
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
    min-height: unset;
}

.status-pill {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.status-pill--online { background: rgba(52, 211, 153, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }

.platform-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.platform-badge--android { background: rgba(61, 220, 132, 0.15); color: #3ddc84; border: 1px solid rgba(61, 220, 132, 0.35); }
.platform-badge--windows { background: rgba(96, 165, 250, 0.15); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.35); }
.platform-badge--webos { background: rgba(167, 139, 250, 0.15); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.35); }
.platform-badge--linux { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.35); }
.platform-badge--other { background: rgba(156, 163, 175, 0.12); color: #d1d5db; border: 1px solid rgba(156, 163, 175, 0.25); }
.platform-badge--unknown { background: transparent; color: #6b7280; border: 1px dashed rgba(107, 114, 128, 0.35); }

.website-display-fields {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.website-display-intro { margin-bottom: 0.65rem; }
.checkbox-inline { display: flex; align-items: center; gap: 0.5rem; color: #d1d5db; font-size: 0.9rem; }
.status-pill--offline { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.25); }
.status-pill--sync { background: rgba(6, 182, 212, 0.12); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.25); }
.status-pill--muted { background: rgba(255, 255, 255, 0.04); color: var(--muted); border: 1px solid var(--glass-border); }

.display-layout-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.layout-chip {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(124, 58, 237, 0.25);
}
.layout-chip--muted {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border-color: var(--glass-border);
}
.layout-chip--active {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.35);
}

.display-metric-value { font-size: 0.82rem; font-weight: 600; }
.display-metric-value.ok { color: #34d399; }
.display-metric-value.warn { color: #fb923c; }
.display-dl-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin-top: 0.35rem;
    overflow: hidden;
}
.display-dl-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.display-dl-fill.ok { background: #34d399; }
.display-dl-fill.warn { background: #fb923c; }

.display-zones {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.display-zone-row {
    display: grid;
    grid-template-columns: minmax(70px, 90px) 1fr auto;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.display-zone-row:last-child { border-bottom: none; }
.display-zone-row .zone-label { color: var(--muted); font-size: 0.78rem; }
.display-zone-row .zone-content { word-break: break-word; }
.display-zone-empty { margin: 0; font-size: 0.82rem; }

/* ── Display log modal ── */
.display-log-modal { display: flex; flex-direction: column; gap: 1rem; }
.display-log-status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.display-log-updated { margin-left: auto; font-size: 0.78rem; }
.display-log-section h4 {
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.display-log-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem 1rem;
}
.display-log-table-wrap {
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.display-log-table { font-size: 0.78rem; }
.display-log-table th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.display-log-mac { font-family: ui-monospace, monospace; font-size: 0.72rem; white-space: nowrap; }
.display-log-details { max-width: 180px; word-break: break-word; }
.display-log-event { font-weight: 600; }
.display-log-row--connected .display-log-event { color: #22c55e; }
.display-log-row--disconnected .display-log-event { color: #ef4444; }
.display-log-row--heartbeat .display-log-event { color: var(--muted); }

@media (max-width: 900px) {
    .display-log-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .display-log-info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .display-main { grid-template-columns: 1fr; }
    .display-detail-panel {
        position: static;
        max-height: none;
        min-height: 0;
    }
    .display-table-wrap { max-height: min(320px, 50vh); }
}
@media (max-width: 1100px) {
    .display-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .display-summary-grid { grid-template-columns: 1fr 1fr; }
    .display-toolbar-bar { flex-direction: column; align-items: stretch; }
    .display-toolbar-left, .display-toolbar-right { width: 100%; }
    .display-search { max-width: none; }
    .display-info-list--inline { grid-template-columns: 1fr; }
    .display-table-actions .btn { padding: 0.25rem 0.45rem; font-size: 0.75rem; }
    .pagination-bar { flex-direction: column; align-items: stretch; }
    .pagination-controls { justify-content: center; }
}

.license-page { display: flex; flex-direction: column; gap: 1rem; }
.license-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
}
.license-generate-card { max-width: 720px; }
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 640px) {
    .form-row-2 { grid-template-columns: 1fr; }
}

/* ── Settings page ── */
.settings-page { max-width: 640px; }
.download-list { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.5rem; }
.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
}
.download-item:hover { border-color: rgba(124, 58, 237, 0.45); }
.download-item-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.download-item-main strong { word-break: break-all; }
.settings-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}
.settings-card h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.settings-desc { color: var(--text-muted); margin: 0 0 1.25rem; font-size: 0.9rem; }
.settings-form .form-hint {
    display: block;
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}
.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.input-with-suffix input { max-width: 120px; }
.input-suffix { color: var(--text-muted); font-size: 0.9rem; }
.form-actions { margin-top: 1.25rem; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}
.checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent, #7c3aed);
}
.sync-play-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.65rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }

.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.45;
}
.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

/* ── Schedule (Jadwal) ── */
.schedule-empty {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 0.5rem;
}
.schedule-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.schedule-empty h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }

.schedule-table-wrap { margin-top: 0.5rem; }
.schedule-table td { vertical-align: middle; }
.schedule-name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.schedule-priority-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-pill);
    background: rgba(124, 58, 237, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(124, 58, 237, 0.35);
}
.schedule-layout-chip,
.schedule-recur-chip {
    display: inline-block;
    max-width: 160px;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.25);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schedule-display-text {
    display: inline-block;
    max-width: 140px;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schedule-date-cell { font-size: 0.85rem; white-space: nowrap; }
.schedule-time-range {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.82rem;
    color: #c4b5fd;
}
.schedule-status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
}
.schedule-status--active {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.schedule-status--inactive {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    border: 1px solid var(--glass-border);
}

.schedule-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.schedule-form-hint {
    padding: 0.9rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.25);
}
.schedule-form-hint strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    color: #ddd6fe;
}
.schedule-form-hint p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--muted);
}
.schedule-form-hint em { color: #c4b5fd; font-style: normal; font-weight: 500; }

.schedule-form-section {
    padding: 1.1rem 0 0.25rem;
    border-top: 1px solid var(--glass-border);
}
.schedule-form-section:first-of-type { border-top: none; padding-top: 0; }
.schedule-form-section--footer { padding-bottom: 0.25rem; }
.schedule-form-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a78bfa;
    margin-bottom: 0.85rem;
}
.schedule-form-section-desc {
    font-size: 0.8rem;
    color: var(--muted);
    margin: -0.35rem 0 0.75rem;
}
.schedule-form-note {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0.25rem 0 0;
}
.schedule-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
}
.schedule-form .form-group { margin-bottom: 0.85rem; }
.schedule-form-section .form-group:last-child { margin-bottom: 0; }
.field-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.35;
}
.label-sub {
    font-weight: 400;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
}

.schedule-display-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    max-height: 160px;
    overflow-y: auto;
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--glass-border);
}
.schedule-display-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}
.schedule-display-check:hover { background: rgba(255, 255, 255, 0.04); }
.schedule-display-check input { flex-shrink: 0; accent-color: #7c3aed; }

/* Display Group page */
.dg-page { display: flex; flex-direction: column; gap: 0.75rem; }
.dg-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    padding: 0.85rem 1rem;
}
.dg-summary-item {
    text-align: center;
    padding: 0.5rem 0.35rem;
}
.dg-summary-item .num {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}
.dg-summary-item .lbl {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.dg-summary-item.warn .num { color: #f59e0b; }
.dg-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
}
.dg-card {
    padding: 1rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.dg-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.dg-card-title {
    margin: 0 0 0.2rem;
    font-size: 1rem;
}
.dg-card-count {
    font-size: 0.75rem;
    color: var(--muted);
}
.dg-card-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}
.dg-member-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 1.6rem;
}
.dg-chip {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    background: rgba(124, 58, 237, 0.18);
    border: 1px solid rgba(124, 58, 237, 0.28);
    color: #ddd6fe;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dg-chip--empty {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--glass-border);
    color: var(--muted);
}
.dg-chip--more {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--glass-border);
    color: var(--muted);
}
.dg-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.5rem;
}

/* Display Group form & shared pickers */
.dg-form { display: flex; flex-direction: column; gap: 1rem; }
.dg-form-section {
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--glass-border);
}
.dg-form-section-title {
    margin: 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #c4b5fd;
}
.dg-form-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}
.dg-picker-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}
.dg-picker-toolbar.compact { margin-top: 0.5rem; }
.dg-picker-toolbar .page-search { flex: 1; min-width: 160px; }
.dg-picker-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}
.dg-selected-count {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}
.dg-member-list,
.schedule-picker-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--glass-border);
}
.picker-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.picker-row:hover { background: rgba(255, 255, 255, 0.04); }
.picker-row.hidden { display: none; }
.picker-row input { flex-shrink: 0; margin-top: 0.15rem; accent-color: #7c3aed; }
.picker-row-body { min-width: 0; flex: 1; }
.picker-row-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
}
.picker-row-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.74rem;
    color: var(--muted);
    line-height: 1.35;
}
.picker-empty { margin: 0.5rem; }

/* Schedule target tabs */
.schedule-target-section { margin-top: 0.25rem; }
.schedule-target-tabs {
    display: flex;
    gap: 0.35rem;
    margin: 0.65rem 0 0.5rem;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--glass-border);
}
.schedule-target-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.schedule-target-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.schedule-target-tab.active {
    background: rgba(124, 58, 237, 0.25);
    color: #e9d5ff;
}
.schedule-target-panel { margin-top: 0.35rem; }

.display-groups-empty-page {
    text-align: center;
    padding: 2.5rem 1.5rem;
}
.display-groups-empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}
.display-groups-empty-page h3 {
    margin: 0 0 0.5rem;
}

@media (max-width: 900px) {
    .dg-summary { grid-template-columns: repeat(2, 1fr); }
    .dg-card-grid { grid-template-columns: 1fr; }
}

.schedule-day-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.schedule-day-pill {
    cursor: pointer;
}
.schedule-day-pill input { position: absolute; opacity: 0; pointer-events: none; }
.schedule-day-pill span {
    display: inline-block;
    min-width: 2.6rem;
    text-align: center;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--muted);
    transition: all 0.15s;
}
.schedule-day-pill input:checked + span {
    background: var(--gradient-purple);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.35);
}

.schedule-active-toggle { display: flex; flex-direction: column; justify-content: flex-start; }
.schedule-active-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    margin-top: 1.45rem;
}
.schedule-active-label input { accent-color: #7c3aed; width: 1rem; height: 1rem; }

.modal-body:has(.schedule-form) { padding: 1.25rem 1.5rem 1.5rem; }

@media (max-width: 640px) {
    .schedule-form-grid-2 { grid-template-columns: 1fr; }
    .schedule-active-label { margin-top: 0; }
    .schedule-display-grid { grid-template-columns: 1fr; }
}

/* ── Mobile / responsive CMS ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 199;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text);
}
.menu-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}
.app.sidebar-open .menu-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.app.sidebar-open .menu-toggle-bar:nth-child(2) { opacity: 0; }
.app.sidebar-open .menu-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
    .menu-toggle { display: flex; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(280px, 86vw);
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        box-shadow: none;
        padding-top: max(1.25rem, env(safe-area-inset-top));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .app.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 12px 0 48px rgba(0, 0, 0, 0.45);
    }

    .app.sidebar-open .sidebar-overlay { display: block; }

    .topbar {
        padding: 0.85rem 1rem;
        padding-top: max(0.85rem, env(safe-area-inset-top));
        gap: 0.65rem;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .topbar h2 {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-subtitle {
        font-size: 0.72rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sync-info {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    #page-content {
        padding: 1rem 1rem 2rem;
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .stat-card .value { font-size: 1.5rem; }

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .page-toolbar-left,
    .page-toolbar-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-search {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left { width: 100%; }

    .form-row { grid-template-columns: 1fr; }

    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: none;
        max-height: 92vh;
        border-radius: var(--radius) var(--radius) 0 0;
        margin: 0;
    }

    .modal-content.modal-wide { max-width: none; }

    .modal-footer {
        flex-wrap: wrap;
        justify-content: stretch;
        gap: 0.5rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .modal-footer .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }

    .playlist-items-table-wrap { margin-bottom: 0.75rem; }

    .playlist-items-table { min-width: 0; }

    .playlist-items-table thead { display: none; }

    .playlist-item-row {
        display: block;
        margin-bottom: 0.65rem;
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-sm);
        background: rgba(0, 0, 0, 0.2);
    }

    .playlist-item-row td {
        display: block;
        border: none;
        padding: 0.45rem 0.65rem;
    }

    .playlist-item-row td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.65rem;
        color: var(--muted);
        text-transform: uppercase;
        margin-bottom: 0.25rem;
    }

    .playlist-item-row .pi-col-order::before { content: 'Urutan'; }
    .playlist-item-row .pi-col-content::before { content: 'Konten'; }
    .playlist-item-row .pi-col-type::before { content: 'Tipe'; }
    .playlist-item-row .pi-col-duration::before { content: 'Durasi'; }
    .playlist-item-row .pi-col-fit::before { content: 'Fit'; }
    .playlist-item-row .pi-col-actions::before { content: 'Aksi'; }

    .layout-hint {
        margin-left: 0;
        width: 100%;
        margin-top: 0.35rem;
    }

    .gauge-wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    table { min-width: 560px; }

    .data-table th,
    .data-table td {
        padding: 0.55rem 0.65rem;
        font-size: 0.82rem;
    }

    .btn {
        min-height: 44px;
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }

    .btn-sm {
        min-height: 38px;
    }

    .nav-item {
        min-height: 48px;
        padding: 0.75rem 1rem;
    }

    .filter-pill {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }

    .sync-pill {
        font-size: 0.7rem;
        padding: 0.35rem 0.65rem;
    }

    .sync-pill #sync-version {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        vertical-align: bottom;
    }

    .display-summary-grid { grid-template-columns: 1fr; }

    .hero-card p { max-width: 100%; }

    .modal-footer .btn {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Auth / Login ── */
body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.18), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.12), transparent 45%),
        var(--bg);
    padding: 1.5rem;
}

.login-shell { width: 100%; max-width: 420px; }

.login-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-brand h1 {
    margin: 0;
    font-size: 1.35rem;
}

.login-brand p {
    margin: 0.15rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.login-error {
    color: #f87171;
    font-size: 0.9rem;
    margin: 0;
}

.login-hint {
    text-align: center;
    font-size: 0.82rem;
    margin: 0;
}

.btn-block { width: 100%; justify-content: center; }

.topbar-user-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.75rem;
}

.topbar-user {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-name {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.role-page { display: flex; flex-direction: column; gap: 0.75rem; }

.role-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    padding: 0.85rem 1rem;
}

.role-summary-item { text-align: center; padding: 0.5rem 0.35rem; }
.role-summary-item .num { display: block; font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.role-summary-item .lbl { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

.role-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
}

.role-search {
    flex: 1;
    min-width: 200px;
    max-width: 420px;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-size: 0.88rem;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
}

.role-card { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.65rem; }

.role-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.role-card-title-wrap { min-width: 0; }
.role-card-title { margin: 0 0 0.35rem; font-size: 1.05rem; }
.role-card-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.role-card-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

.role-badge {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.role-badge--scope { background: rgba(6, 182, 212, 0.18); color: #67e8f9; }

.role-card-desc { margin: 0; font-size: 0.86rem; color: var(--text-muted); line-height: 1.45; }

.role-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.role-stat strong { color: var(--text); }

.role-card-menu-groups {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--glass-border);
}

.role-card-menu-group { display: flex; flex-direction: column; gap: 0.3rem; }

.role-card-menu-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-card-menu-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.role-chip {
    display: inline-block;
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    background: rgba(124, 58, 237, 0.16);
    border: 1px solid rgba(124, 58, 237, 0.24);
    color: #ddd6fe;
}

.role-empty-page, .role-no-results { text-align: center; padding: 2.5rem 1.5rem; }
.role-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.role-empty-page h3 { margin: 0 0 0.5rem; }

.modal-content.modal-role { max-width: 720px; }
.modal-content.modal-role .modal-body { max-height: min(70vh, 640px); overflow-y: auto; }

.role-form { display: flex; flex-direction: column; gap: 0.85rem; }

.role-form-tabs, .role-scope-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--glass-border);
}

.role-form-tab, .role-scope-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.role-form-tab:hover, .role-scope-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.role-form-tab.active, .role-scope-tab.active { background: rgba(124, 58, 237, 0.25); color: #e9d5ff; }
.role-form-tab--disabled { opacity: 0.45; cursor: not-allowed; }

.role-form-panel { display: none; }
.role-form-panel.active { display: block; }

.role-form-section {
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--glass-border);
}

.role-form-section + .role-form-section { margin-top: 0.65rem; }

.role-form-section-title { margin: 0 0 0.65rem; font-size: 0.88rem; font-weight: 600; }

.role-all-displays-check span { display: flex; flex-direction: column; gap: 0.15rem; }

.role-menu-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.role-menu-toolbar p { margin: 0; font-size: 0.84rem; }
.role-menu-toolbar-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

.role-menu-groups { display: flex; flex-direction: column; gap: 0.55rem; }

.role-menu-group {
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid var(--glass-border);
}

.role-menu-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
}

.role-menu-group-title { display: flex; align-items: center; gap: 0.4rem; font-size: 0.84rem; font-weight: 600; }
.role-menu-group-icon { font-size: 1rem; }

.role-menu-group-count {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.role-menu-group-actions { display: flex; gap: 0.25rem; }

.role-menu-group-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.35rem 0.65rem;
}

.role-menu-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

.role-menu-item input { accent-color: #7c3aed; flex-shrink: 0; }

.role-scope-intro { margin: 0 0 0.5rem; font-size: 0.84rem; }

.role-scope-full { text-align: center; padding: 1.75rem 1.25rem; }
.role-scope-full-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.role-scope-full p { margin: 0.35rem 0; }

.role-scope-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.role-scope-toolbar .picker-search { flex: 1; min-width: 160px; }
.role-scope-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }
.role-scope-meta { margin-bottom: 0.35rem; }
.role-scope-count { font-size: 0.78rem; color: var(--text-muted); }
.role-scope-list { max-height: 220px; overflow-y: auto; }
.role-scope-panel.hidden { display: none; }

@media (max-width: 900px) {
    .role-summary { grid-template-columns: repeat(2, 1fr); }
    .role-grid { grid-template-columns: 1fr; }
    .role-menu-group-items { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
    .role-menu-group-items { grid-template-columns: 1fr; }
    .role-toolbar { flex-direction: column; align-items: stretch; }
    .role-search { max-width: none; }
}

.readonly-field {
    opacity: 0.75;
    cursor: not-allowed;
}

/* ── Audit Log ── */
.audit-page { display: flex; flex-direction: column; gap: 0.75rem; }

.audit-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    padding: 0.85rem 1rem;
}

.audit-summary-item { text-align: center; padding: 0.5rem 0.35rem; }
.audit-summary-item .num { display: block; font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.audit-summary-item .lbl { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

.audit-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
}

.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
    min-width: 260px;
}

.audit-search {
    flex: 1 1 220px;
    min-width: 180px;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-size: 0.88rem;
}

.audit-select, .audit-date {
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-size: 0.84rem;
}

.audit-toolbar-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.audit-table-wrap { padding: 0; overflow: hidden; }

.audit-table th,
.audit-table td {
    vertical-align: top;
    font-size: 0.84rem;
}

.audit-col-time { white-space: nowrap; min-width: 130px; }
.audit-time-main { display: block; font-size: 0.82rem; }

.audit-col-user {
    min-width: 120px;
}

.audit-col-user strong { display: block; }
.audit-col-user small { display: block; font-size: 0.74rem; }

.audit-col-target { min-width: 110px; }
.audit-col-target strong { display: block; }
.audit-entity-id { display: block; font-size: 0.72rem; }

.audit-col-summary { min-width: 180px; max-width: 280px; }
.audit-col-ip { white-space: nowrap; font-size: 0.78rem; color: var(--text-muted); }

.audit-pill {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text);
}

.audit-pill--create { background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
.audit-pill--update { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.35); color: #93c5fd; }
.audit-pill--delete { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.audit-pill--login { background: rgba(168, 85, 247, 0.15); border-color: rgba(168, 85, 247, 0.35); color: #d8b4fe; }
.audit-pill--upload { background: rgba(14, 165, 233, 0.15); border-color: rgba(14, 165, 233, 0.35); color: #7dd3fc; }
.audit-pill--trigger { background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.35); color: #fcd34d; }
.audit-pill--approve { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.3); color: #86efac; }
.audit-pill--reject, .audit-pill--revoke { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.audit-pill--generate, .audit-pill--command { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.3); color: #cbd5e1; }

.audit-entity-tag {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.74rem;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.22);
    color: #ddd6fe;
}

.audit-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
}

.audit-pagination-info { font-size: 0.84rem; color: var(--text-muted); }
.audit-pagination-controls { display: flex; align-items: center; gap: 0.5rem; }
.audit-page-num { font-size: 0.84rem; color: var(--text-muted); }

.audit-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.audit-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.audit-empty h3 { margin: 0 0 0.5rem; }

.audit-detail { display: flex; flex-direction: column; gap: 0.85rem; }

.audit-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem 1rem;
}

.audit-detail-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
}

.audit-detail-summary {
    margin: 0;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.audit-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.78rem;
}

.audit-detail-heading {
    margin: 0;
    font-size: 0.88rem;
}

.audit-detail-json {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--glass-border);
    font-size: 0.78rem;
    line-height: 1.45;
    overflow-x: auto;
    max-height: 320px;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 900px) {
    .audit-summary { grid-template-columns: repeat(2, 1fr); }
    .audit-detail-grid { grid-template-columns: 1fr; }
    .audit-table-wrap { overflow-x: auto; }
}

@media (max-width: 520px) {
    .audit-filters { flex-direction: column; }
    .audit-search, .audit-select, .audit-date { width: 100%; }
}
