:root {
    --bg: #07111f;
    --panel: rgba(8, 23, 41, 0.82);
    --panel-strong: rgba(11, 29, 52, 0.96);
    --line: rgba(167, 203, 255, 0.16);
    --text: #eff6ff;
    --muted: #95a9c5;
    --accent: #ff8a3d;
    --accent-soft: #ffd3a6;
    --teal: #59f0d2;
    --danger: #ff6b7a;
    --success: #39d98a;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(89, 240, 210, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 138, 61, 0.18), transparent 28%),
        linear-gradient(160deg, #020812 0%, #06172c 45%, #0a1d35 100%);
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, select { font: inherit; }

.eyebrow {
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: var(--accent-soft);
}

.muted { color: var(--muted); }

.primary-button,
.ghost-button {
    border-radius: 999px;
    padding: 0.85rem 1.3rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent), #ffb06b);
    color: #102135;
    font-weight: 700;
}

.ghost-button {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--line);
    color: var(--text);
}

.danger-button { border-color: rgba(255, 107, 122, 0.35); color: #ffd4d9; }
.primary-button:hover, .ghost-button:hover { transform: translateY(-1px); }

.alert {
    border-radius: 22px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
    border: 1px solid var(--line);
}

.alert ul { margin: 0.6rem 0 0; padding-left: 1rem; }
.success { background: rgba(57, 217, 138, 0.12); }
.error { background: rgba(255, 107, 122, 0.1); }

.admin-shell, .access-shell, .installer-shell { min-height: 100vh; }

.admin-app {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 100vh;
    align-items: start;
}

.admin-sidebar {
    padding: 2rem;
    background: rgba(3, 12, 23, 0.85);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar h1, .access-card h1, .installer-panel h1 { margin: 0; font-size: 2rem; }
.nav-stack { display: grid; gap: 0.65rem; margin: 2rem 0; }
.nav-stack a {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid transparent;
    color: var(--muted);
}
.nav-stack a.is-active, .nav-stack a:hover {
    background: rgba(89, 240, 210, 0.08);
    border-color: var(--line);
    color: var(--text);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
}

.admin-main {
    padding: 2rem;
    min-width: 0;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-header h2 { margin: 0; font-size: 2rem; }

.panel, .stat-card, .access-card, .installer-panel {
    background: var(--panel);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.panel { padding: 1.5rem; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card { padding: 1.4rem; }
.stat-card span { display: block; color: var(--muted); margin-bottom: 0.6rem; }
.stat-card strong { font-size: 2.2rem; }

.two-column-grid, .card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.mini-list article {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}
.mini-list article:last-child { border-bottom: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    text-align: left;
    padding: 1rem 0.8rem;
    border-bottom: 1px solid var(--line);
}
th { color: var(--muted); font-weight: 500; }

.table-actions, .button-row {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}
.button-row { justify-content: flex-end; margin-top: 1rem; }

.badge {
    display: inline-flex;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
}
.badge-success { background: rgba(57, 217, 138, 0.14); color: #c9ffe3; }
.badge-muted { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

.form-grid { display: grid; gap: 1rem; }
.split-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.form-section {
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 22px;
}
label { display: grid; gap: 0.45rem; }
label span { color: var(--muted); font-size: 0.95rem; }
input, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(4, 16, 29, 0.9);
    color: var(--text);
    padding: 0.92rem 1rem;
}
.checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.checkbox input { width: auto; }
.inline-check { padding-top: 1.9rem; }

.preview-image, .single-preview img, .single-preview video {
    width: min(320px, 100%);
    border-radius: 22px;
    border: 1px solid var(--line);
}

.product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-card, .media-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 1rem;
}

.profile-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.profile-avatar {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #ffb06b);
    color: #0c1a2a;
    font-size: 2rem;
    font-weight: 800;
}

.profile-copy {
    display: grid;
    gap: 0.55rem;
}

.profile-copy strong {
    font-size: 1.25rem;
}
.product-card img, .media-preview img, .media-preview video {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: 18px;
}

.access-shell, .installer-shell {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.access-card {
    width: min(520px, 100%);
    padding: 2rem;
}

.installer-grid {
    width: min(1200px, 100%);
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 1.5rem;
}
.installer-panel { padding: 2rem; }
.status-list { display: grid; gap: 1rem; margin-top: 1.5rem; }
.status-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}
.status-pass { color: #b8ffd9; }
.status-fail { color: #ffd3d8; }

.screen-shell {
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(255, 138, 61, 0.18), transparent 22%),
        radial-gradient(circle at bottom right, rgba(89, 240, 210, 0.18), transparent 28%),
        linear-gradient(135deg, #05111d 0%, #06182d 55%, #07101b 100%);
}

.screen-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.25rem;
    height: 100vh;
    padding: 1.25rem;
}

.ticker-pane, .media-pane {
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(3, 14, 25, 0.68);
    backdrop-filter: blur(16px);
    overflow: hidden;
}

.ticker-pane {
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 1.2rem;
}

.pane-header h1 {
    margin: 0;
    font-size: 2.2rem;
}

.ticker-window {
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.ticker-track { display: grid; gap: 1.6rem; }
.ticker-track.animate { animation: scroll-down 18s linear infinite; }
.ticker-stack { display: grid; gap: 1rem; }
.ticker-item {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.ticker-item img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 22px;
}
.ticker-item strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.35rem;
}
.ticker-item span {
    font-size: 1.45rem;
    color: var(--accent-soft);
}

.media-pane { position: relative; }
.media-surface, .media-slide, .media-empty { height: 100%; }
.media-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.media-slide.is-visible { opacity: 1; }
.media-slide img, .media-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-caption {
    position: absolute;
    left: 1.4rem;
    bottom: 1.4rem;
    padding: 0.85rem 1.15rem;
    border-radius: 999px;
    background: rgba(4, 14, 24, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1rem;
}
.media-empty {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 1.5rem;
}

.separate-top { margin-top: 1rem; }

@keyframes scroll-down {
    from { transform: translateY(-50%); }
    to { transform: translateY(0%); }
}

@media (max-width: 1100px) {
    .admin-app, .installer-grid, .screen-layout, .two-column-grid, .product-grid, .card-grid, .stats-grid, .split-fields {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        min-height: auto;
        position: static;
        height: auto;
    }
    .screen-shell { overflow: auto; }
    .screen-layout { height: auto; min-height: 100vh; }
    .media-pane { min-height: 60vh; }
}
