/* ==========================================================================
   ARA Studio — Control Panel design system
   Brand: #1F3C71 · premium dark · operational clarity
   ========================================================================== */

:root {
    --bg: #070a10;
    --bg-2: #0b101a;
    --panel: #101622;
    --panel-2: #151c2a;
    --panel-3: #1b2433;
    --line: rgba(255, 255, 255, .09);
    --line-2: rgba(255, 255, 255, .16);
    --text: #f2f5fa;
    --muted: #a7b0c2;
    --faint: #6f7b8f;
    --brand: #1f3c71;
    --brand-2: #2e62a3;
    --brand-3: #6ea3ff;
    --green: #4fd08a;
    --amber: #f2c469;
    --red: #ff6e78;
    --shadow: 0 16px 38px rgba(0, 0, 0, .35);
    --radius: 14px;
    --radius-sm: 10px;
    --sidebar-w: 264px;
    --font: -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(31, 60, 113, .45), transparent 40%),
        radial-gradient(900px 500px at 5% 110%, rgba(46, 98, 163, .18), transparent 42%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    letter-spacing: -.01em;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 14px;
    border-right: 1px solid var(--line);
    background: rgba(7, 10, 16, .88);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 18px;
}

.brand-logo img { height: 38px; display: block; }

.brand-name { font-size: 16px; font-weight: 800; letter-spacing: .01em; }
.brand-sub { font-size: 11px; color: var(--faint); margin-top: 1px; }

.nav-group { margin-top: 12px; }

.nav-title {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
    padding: 0 12px 7px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    margin: 1px 0;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 550;
    border: 1px solid transparent;
    transition: background .12s ease, color .12s ease;
}

.nav-link:hover { background: rgba(255, 255, 255, .05); color: var(--text); }

.nav-link.active {
    background: linear-gradient(120deg, rgba(31, 60, 113, .55), rgba(46, 98, 163, .28));
    border-color: rgba(110, 163, 255, .25);
    color: #fff;
}

.nav-code {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--faint);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2px 6px;
}

.nav-link.active .nav-code { color: var(--brand-3); border-color: rgba(110, 163, 255, .3); }

.sidebar-card {
    margin-top: auto;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-card strong { font-size: 13px; }
.sidebar-card span { font-size: 11.5px; color: var(--muted); line-height: 1.45; }

/* --------------------------------------------------------------------------
   Main column + command bar
   -------------------------------------------------------------------------- */

.main { min-width: 0; padding: 0 28px 40px; }

.commandbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    margin: 0 0 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(rgba(7, 10, 16, .92), rgba(7, 10, 16, .86));
    backdrop-filter: blur(18px);
}

.commandbar .search {
    flex: 1;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
}

.commandbar .search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--text);
    font-size: 13.5px;
    padding: 0;
}

.commandbar .search .hint {
    font-size: 10.5px;
    color: var(--faint);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 6px;
}

.commandbar .spacer { flex: 1; }

.env-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--line-2);
    color: var(--muted);
}

.env-badge.prod { color: var(--green); border-color: rgba(79, 208, 138, .35); }

.admin-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 6px 5px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}

.admin-chip .who { line-height: 1.2; }
.admin-chip .who strong { display: block; font-size: 12.5px; }
.admin-chip .who span { font-size: 10.5px; color: var(--faint); }

/* --------------------------------------------------------------------------
   Page headers
   -------------------------------------------------------------------------- */

.topbar, .page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 6px 0 22px;
}

.topbar h1, .page-head h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }

.kicker, .page-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--brand-3);
    margin-bottom: 6px;
}

.sub, .subtitle, .muted { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.5; }

/* --------------------------------------------------------------------------
   Cards / panels / grid
   -------------------------------------------------------------------------- */

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1180px) {
    .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; }
    .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.card, .panel {
    background: linear-gradient(170deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel { padding: 18px; }

.card.section, .section.card { margin-top: 18px; }

.card-pad { padding: 18px; }

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}

.panel-title h2 { margin: 0; font-size: 14.5px; font-weight: 700; }

.panel-body { padding: 16px 18px; }

.panel h2 { font-size: 15px; }

/* KPI metrics */

.metric { padding: 16px 18px; }

.metric-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
}

.metric-value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }

.metric-note { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--faint);
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }

.title-cell strong { display: block; font-weight: 650; }
.title-cell span { display: block; font-size: 11.5px; color: var(--faint); margin-top: 2px; }

td.empty, .empty { color: var(--faint); text-align: center; padding: 26px 14px; font-size: 13px; }

.faint { color: var(--faint); font-size: 12px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    color: #fff;
    font-weight: 650;
    font-size: 13px;
    white-space: nowrap;
    transition: filter .12s ease, transform .05s ease;
}

.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }

.btn.secondary {
    background: rgba(255, 255, 255, .05);
    border-color: var(--line-2);
    color: var(--text);
}

.btn.secondary:hover { background: rgba(255, 255, 255, .09); }

.btn.blue { background: linear-gradient(135deg, var(--brand-3), var(--brand-2)); }

.btn.danger {
    background: rgba(255, 110, 120, .12);
    border-color: rgba(255, 110, 120, .4);
    color: var(--red);
}

.btn.small, .btn-small { padding: 6px 11px; font-size: 12px; border-radius: 8px; }

.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line-2);
    color: var(--muted);
    white-space: nowrap;
}

.badge.ok { color: var(--green); border-color: rgba(79, 208, 138, .4); background: rgba(79, 208, 138, .08); }
.badge.warn { color: var(--amber); border-color: rgba(242, 196, 105, .4); background: rgba(242, 196, 105, .08); }
.badge.bad, .badge.error { color: var(--red); border-color: rgba(255, 110, 120, .4); background: rgba(255, 110, 120, .08); }
.badge.blue { color: var(--brand-3); border-color: rgba(110, 163, 255, .4); background: rgba(110, 163, 255, .08); }

.badge.live { color: #fff; background: linear-gradient(135deg, #e5484d, #b3232f); border-color: transparent; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field { margin-bottom: 14px; }

.field label, label {
    display: block;
    font-size: 12px;
    font-weight: 650;
    color: var(--muted);
    margin-bottom: 6px;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="date"], input[type="url"], input[type="search"],
input[type="file"], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--line-2);
    background: rgba(7, 10, 16, .6);
    color: var(--text);
    font-size: 13.5px;
    outline: none;
    transition: border-color .12s ease;
}

input:focus, select:focus, textarea:focus { border-color: var(--brand-3); }

input[readonly] { color: var(--muted); }

textarea { min-height: 92px; resize: vertical; }

input[type="checkbox"] { width: auto; accent-color: var(--brand-2); }

.help { font-size: 11.5px; color: var(--faint); margin-top: 5px; line-height: 1.45; }

.ltr { direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

.form-section { margin-bottom: 26px; }

.form-section-head {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--brand-3);
    padding-bottom: 8px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Notices
   -------------------------------------------------------------------------- */

.notice {
    margin: 14px 0;
    padding: 11px 15px;
    border-radius: 10px;
    border: 1px solid rgba(79, 208, 138, .4);
    background: rgba(79, 208, 138, .09);
    color: var(--green);
    font-size: 13px;
    font-weight: 550;
}

.notice.warn { border-color: rgba(242, 196, 105, .4); background: rgba(242, 196, 105, .08); color: var(--amber); }

/* --------------------------------------------------------------------------
   Artwork previews
   -------------------------------------------------------------------------- */

.artwork-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

@media (max-width: 1100px) { .artwork-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.artwork-slot {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    padding: 12px;
}

.artwork-slot .slot-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--brand-3);
    margin-bottom: 8px;
}

.artwork-slot .preview {
    border-radius: 8px;
    background: rgba(255, 255, 255, .04) center/cover no-repeat;
    border: 1px dashed var(--line-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--faint);
    font-size: 11px;
    margin-bottom: 10px;
    overflow: hidden;
}

.artwork-slot .preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.artwork-slot .preview.portrait { aspect-ratio: 2 / 3; }
.artwork-slot .preview.landscape { aspect-ratio: 16 / 9; }

/* --------------------------------------------------------------------------
   Progress bars (upload / mediaconvert)
   -------------------------------------------------------------------------- */

.progress {
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .07);
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--brand-2), var(--brand-3));
    transition: width .3s ease;
}

/* --------------------------------------------------------------------------
   Checklist
   -------------------------------------------------------------------------- */

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

.checklist li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    font-size: 13px;
}

.checklist li:last-child { border-bottom: 0; }

.grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1400px) { .grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid.cols-6 { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Workspace tabs (Content Studio, Live Control)
   -------------------------------------------------------------------------- */

.tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
}

.tab-btn {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-weight: 650;
    font-size: 13px;
    padding: 10px 14px;
    margin-bottom: -1px;
    border-radius: 8px 8px 0 0;
    transition: color .12s ease, background .12s ease;
}

.tab-btn:hover { color: var(--text); background: rgba(255, 255, 255, .04); }

.tab-btn.active {
    color: #fff;
    border-bottom-color: var(--brand-3);
    background: linear-gradient(rgba(46, 98, 163, .16), transparent);
}

.tab-btn .count {
    font-size: 10.5px;
    color: var(--faint);
    background: rgba(255, 255, 255, .06);
    border-radius: 6px;
    padding: 1px 6px;
    margin-left: 6px;
}

.tab-pane[hidden] { display: none; }

.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid.cols-5 { grid-template-columns: 1fr; } }
