/* eTeam broadcast desk. Separate from the public site. */

:root {
    --ink: #07090d;
    --rail: #0e131b;
    --panel: #141b24;
    --panel-2: #1b2430;
    --line: rgba(232, 238, 246, 0.1);
    --text: #e8eef6;
    --muted: #b7c2d0;
    --faint: #8b98aa;
    --amber: #f0a202;
    --amber-ink: #1c1403;
    --cyan: #7fd4e6;
    --ok: #b7f0d0;
    --ok-bg: #1c4d36;
    --danger: #ffd0cb;
    --danger-bg: #6e2c2c;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --sans: "Fira Sans", "Segoe UI", sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --display: "Yaldevi", "Fira Sans", sans-serif;
    --radius: 14px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { min-height: 100%; }

body.cms,
body.cms-auth {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
}

body.cms {
    background-image:
        radial-gradient(900px 420px at 100% -10%, rgba(127, 212, 230, 0.08), transparent 55%),
        radial-gradient(700px 380px at -10% 110%, rgba(240, 162, 2, 0.07), transparent 50%);
}

a { color: var(--cyan); }
button, a, summary { cursor: pointer; }
:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.cms-app {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
}

.cms-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px 16px 18px;
    background: var(--rail);
    border-right: 1px solid var(--line);
}

.cms-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
    text-decoration: none;
    color: var(--text);
}

.cms-brand strong {
    font-family: var(--display);
    font-size: 1.45rem;
    letter-spacing: 0.01em;
}

.cms-brand span {
    color: var(--amber);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.cms-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cms-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
}

.cms-nav a svg { flex: none; opacity: 0.85; }

.cms-nav a:hover { background: rgba(232, 238, 246, 0.05); color: var(--text); }

.cms-nav a.active {
    background: rgba(240, 162, 2, 0.14);
    color: var(--amber);
}

.cms-rail-foot {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.cms-who {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cms-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #243044;
    color: var(--cyan);
    font-weight: 700;
    font-size: 0.85rem;
    flex: none;
}

.cms-who p {
    margin: 0;
    min-width: 0;
}

.cms-who strong,
.cms-who small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cms-who small { color: var(--faint); font-size: 0.78rem; }

.cms-rail-links {
    display: flex;
    gap: 12px;
    font-size: 0.86rem;
}

.cms-rail-links a { text-decoration: none; }

.cms-signout {
    min-height: 44px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
}

.cms-signout:hover { border-color: var(--amber); color: var(--amber); }

.cms-stage {
    min-width: 0;
    padding: 22px 28px 48px;
}

.cms-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.cms-kicker {
    margin: 0 0 4px;
    color: var(--amber);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.cms-bar h1 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.1;
}

.cms-bar p {
    margin: 6px 0 0;
    max-width: 46rem;
    color: var(--muted);
}

.cms-menu {
    display: none;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-weight: 600;
}

.cms-scrim {
    display: none;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.55);
}

.cms-body { display: flex; flex-direction: column; gap: 16px; }

.cms-flash {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.cms-flash-ok { background: var(--ok-bg); color: var(--ok); }
.cms-flash-err { background: var(--danger-bg); color: var(--danger); }

.cms-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.cms-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 108px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow);
}

.cms-stat:hover { border-color: rgba(240, 162, 2, 0.45); }

.cms-stat strong {
    font-family: var(--mono);
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.cms-stat span { color: var(--muted); font-size: 0.92rem; }

.cms-stat:first-child {
    background:
        linear-gradient(160deg, rgba(240, 162, 2, 0.18), transparent 55%),
        var(--panel);
}

.cms-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 20px;
    box-shadow: var(--shadow);
}

.cms-panel h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 600;
}

.cms-note-text,
.cms-empty { color: var(--muted); margin: 0 0 14px; }

.cms-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cms-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: -1px;
}

.cms-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
}

.cms-tab span {
    min-width: 1.4rem;
    padding: 0 6px;
    border-radius: 999px;
    background: #10161e;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.75rem;
    line-height: 1.5rem;
    text-align: center;
}

.cms-tab.active {
    background: var(--panel);
    border-color: var(--line);
    color: var(--amber);
}

.cms-tab.active span {
    background: rgba(240, 162, 2, 0.16);
    color: var(--amber);
}

.cms-tab-panel { display: none; border-top-left-radius: 0; }
.cms-tab-panel.active { display: block; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }

label { color: var(--muted); font-size: 0.86rem; font-weight: 500; }

input,
textarea,
select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #0d1218;
    color: var(--text);
    font: inherit;
}

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

input::placeholder,
textarea::placeholder { color: var(--faint); }

.cms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
}

.cms-btn:hover { border-color: var(--cyan); }

.cms-btn-primary {
    background: var(--amber);
    border-color: var(--amber);
    color: var(--amber-ink);
}

.cms-btn-primary:hover { filter: brightness(1.05); }

.cms-btn-danger {
    background: transparent;
    border-color: rgba(255, 208, 203, 0.35);
    color: var(--danger);
}

.cms-btn-danger:hover { background: var(--danger-bg); }

.cms-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.cms-stack,
.cms-people { display: flex; flex-direction: column; gap: 10px; }

.cms-row {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    background: #10161e;
    border: 1px solid var(--line);
}

.item-info { flex: 1; min-width: 0; }

.cms-thumb {
    width: 84px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    background: #0d1218;
}

.item-info h4 { margin: 0 0 2px; font-size: 1rem; }
.item-info p {
    margin: 0;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-actions,
.cms-row > form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.uid-line { margin-top: 4px !important; }
.uid-line code,
.cms-table a,
.cms-order h2 {
    font-family: var(--mono);
    font-size: 0.86rem;
}

.you-badge { color: var(--amber); font-size: 0.8rem; }

.cms-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.cms-shot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    background: #10161e;
    border: 1px solid var(--line);
}

.cms-shot img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    background: #0d1218;
}

.cms-shot .caption { margin: 0; color: var(--text); }

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

.cms-table {
    width: 100%;
    border-collapse: collapse;
}

.cms-table th {
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 600;
    padding: 0 10px 10px;
}

.cms-table td {
    padding: 12px 10px;
    border-top: 1px solid var(--line);
    vertical-align: middle;
}

.cms-table tr:hover td { background: rgba(232, 238, 246, 0.03); }

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

.cms-filters input { flex: 1 1 220px; width: auto; }
.cms-filters select { width: auto; min-width: 160px; }

.cms-orders { display: flex; flex-direction: column; gap: 12px; }

.cms-order-head,
.cms-order-badges {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.cms-order h2 { margin: 0; font-size: 1rem; }
.cms-order-head p { margin: 4px 0 0; color: var(--muted); }

.cms-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.cms-meta div {
    padding: 10px 12px;
    border-radius: 10px;
    background: #10161e;
}

.cms-meta dt {
    color: var(--faint);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cms-meta dd { margin: 2px 0 0; font-weight: 600; }

.cms-order-form {
    display: grid;
    grid-template-columns: 160px auto minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.cms-order-form label { display: flex; flex-direction: column; gap: 6px; }
.cms-check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--text);
}
.cms-check input { width: 18px; min-height: 18px; }
.cms-note input { width: 100%; }
.cms-order .cms-form-actions { margin-top: 0; }

.cms-order-delete {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.cms-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cms-badge-pending { background: var(--amber); color: var(--amber-ink); }
.cms-badge-verified,
.cms-badge-in { background: var(--ok-bg); color: var(--ok); }
.cms-badge-rejected { background: var(--danger-bg); color: var(--danger); }

.cms-auth {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 28px 20px 40px;
}

.cms-auth-split {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 520px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.cms-auth-brand {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background:
        radial-gradient(420px 280px at 0% 0%, rgba(127, 212, 230, 0.2), transparent 60%),
        radial-gradient(380px 260px at 100% 100%, rgba(240, 162, 2, 0.18), transparent 55%),
        #10161e;
}

.cms-auth-brand h1 {
    margin: 8px 0 10px;
    font-family: var(--display);
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    line-height: 0.95;
}

.cms-auth-brand p:last-child {
    margin: 0;
    max-width: 26rem;
    color: var(--muted);
}

.cms-auth-card {
    padding: 36px 32px;
    background: var(--panel);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.cms-auth-card h2 { margin: 0; font-family: var(--display); font-size: 1.8rem; }

.cms-opening { margin: 0; color: var(--muted); }

body.cms-auth-pending #signInForm,
body.cms-auth-pending .cms-or,
body.cms-auth-pending #googleSignInBtn,
body.cms-auth-pending .cms-back { display: none; }

body:not(.cms-auth-pending) .cms-opening { display: none; }

.cms-auth-card form,
.cms-auth-card .form-group { display: flex; flex-direction: column; gap: 10px; }

.cms-auth-card .cms-btn { width: 100%; }

.cms-or {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    color: var(--faint);
    font-size: 0.85rem;
}

.cms-or::before,
.cms-or::after { content: ""; height: 1px; background: var(--line); }

.auth-error:empty { display: none; }
.auth-error { margin: 0; color: var(--danger); }

.cms-back { margin: 4px 0 0; font-size: 0.9rem; }
.cms-back a { text-decoration: none; }

@media (max-width: 980px) {
    .cms-order-form,
    .cms-split,
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full-width { grid-column: auto; }
    .cms-order-form .cms-form-actions { grid-column: 1; }
}

@media (max-width: 860px) {
    .cms-app { grid-template-columns: 1fr; }
    .cms-menu { display: inline-flex; }
    .cms-rail {
        position: fixed;
        z-index: 40;
        width: min(280px, 86vw);
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }
    body.cms-nav-open .cms-rail { transform: none; }
    body.cms-nav-open .cms-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 30;
    }
    .cms-stage { padding: 16px 16px 40px; }
    .cms-row { flex-direction: column; align-items: stretch; }
    .cms-auth-split { grid-template-columns: 1fr; }
    .cms-auth-brand { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
    .cms-rail { transition: none; }
}
