/* KickRocksMF admin. Dark theme. Same brand palette as public site. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: #050505;
    color: #ffffff;
    font-family: 'Roboto', system-ui, -apple-system, Segoe UI, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
}
a { color: #fff; text-decoration: none; }
a:hover { color: #CD3711; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 900; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; }
::selection { background: #CD3711; color: #fff; }

/* ---------- Login ---------- */

.login-shell {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #0a0a0a;
    border: 1px solid #1f1f1f;
    padding: 36px 32px;
}
.login-brand {
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: #fff;
    margin-bottom: 8px;
}
.login-brand .accent { color: #CD3711; }
.login-sub {
    font-size: 12px;
    letter-spacing: 0.2em;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 28px;
}
.login-card--center .login-logo,
.login-card--center .login-sub { text-align: center; }
.login-logo {
    display: block;
    height: 70px;
    width: auto;
    margin: 0 auto 16px;
}
.login-error {
    background: #1f0808;
    border: 1px solid #7a1e1e;
    color: #ff9c9c;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 16px;
    border-radius: 2px;
}
.field { margin-bottom: 14px; }
.field-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 6px;
}
.field-input {
    width: 100%;
    height: 52px;
    padding: 0 14px;
    background: #050505;
    border: 1px solid #2a2a2a;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    border-radius: 2px;
}
.field-input:focus { outline: none; border-color: #555; }
.field-input::placeholder { color: #444; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 22px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 0;
    border-radius: 2px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: #CD3711; color: #fff; }
.btn-primary:hover { background: #e63f14; color: #fff; }
.btn-ghost { background: transparent; color: #b6b6b6; }
.btn-ghost:hover { color: #fff; }
.btn-outline { background: transparent; color: #fff; border: 1px solid #333; }
.btn-outline:hover { border-color: #CD3711; color: #CD3711; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 11px; letter-spacing: 0.1em; }
.btn-block { width: 100%; }

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

.app-body { overflow-x: hidden; }
.app {
    --sidebar-w: 280px;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100dvh;
    transition: grid-template-columns 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}
.app.is-collapsed { grid-template-columns: 0px 1fr; }

.sidebar {
    background: #070707;
    border-right: 1px solid #1a1a1a;
    padding: 22px 0;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow: hidden;
    scrollbar-width: none;
    width: var(--sidebar-w);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sidebar::-webkit-scrollbar { display: none; }
.app.is-collapsed .sidebar { transform: translateX(-100%); }

.sidebar-brand {
    padding: 4px 22px 24px;
    display: flex;
    justify-content: center;
}
.sidebar-brand a { display: inline-block; }
.sidebar-logo {
    display: block;
    height: 44px;
    width: auto;
}

/* Right-edge tab handle (toggle + vertical drag) */
.sidebar-tab {
    position: fixed;
    top: 50%;
    left: var(--sidebar-w);
    transform: translate(-1px, -50%);
    width: 26px;
    height: 64px;
    background: #CD3711;
    border: 0;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    color: #fff;
    cursor: pointer;
    padding: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        left 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
        background-color 0.15s ease;
    user-select: none;
    touch-action: none;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.5);
}
.sidebar-tab:hover { background: #e63f14; }
.app.is-collapsed .sidebar-tab { left: 0; }
.sidebar-tab.is-dragging { cursor: grabbing; background: #e63f14; }

.sidebar-tab__chevron {
    display: block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 7px solid currentColor;
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.app:not(.is-collapsed) .sidebar-tab__chevron { transform: rotate(180deg); }
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 22px;
    color: #999;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-left: 3px solid transparent;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.sidebar-nav a:hover { color: #fff; background: #0d0d0d; }
.sidebar-nav a.is-active {
    color: #fff;
    background: #0d0d0d;
    border-left-color: #CD3711;
}
.sidebar-nav .count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    background: #7a1e1e;
    color: #ffb0b0;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 26px;
    background: #070707;
    border-bottom: 1px solid #1a1a1a;
    position: sticky;
    top: 0;
    z-index: 5;
}
.topbar__title {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fff;
}
.topbar__user {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #888;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.topbar__breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #888;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}
.topbar__breadcrumb a { color: #b6b6b6; text-decoration: none; }
.topbar__breadcrumb a:hover { color: #fff; }

.main { display: flex; flex-direction: column; min-width: 0; }
.content { padding: 26px; }
@media (max-width: 767px) { .content { padding: 18px; } }

/* ---------- Common admin UI ---------- */

.page-h1 {
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: -0.005em;
    margin-bottom: 18px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    padding: 18px 20px;
}
.stat__label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 8px;
}
.stat__num {
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.stat__num--error { color: #ff7a7a; }
.stat__num--good  { color: #7be3a1; }
.stat__num--brand { color: #CD3711; }

.card {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    padding: 22px;
    margin-bottom: 22px;
}
.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.card__title {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fff;
}

.table-wrap { overflow-x: auto; scrollbar-width: none; }
.table-wrap::-webkit-scrollbar { display: none; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.data th, table.data td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #141414;
    white-space: nowrap;
}
table.data th {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #666;
    border-bottom: 1px solid #222;
}
table.data tr:hover td { background: #0d0d0d; }
table.data a { color: #fff; }
table.data a:hover { color: #CD3711; }

.status {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: 2px;
    border: 1px solid transparent;
}
.status-submitted,
.status-chatgpt_running,
.status-chatgpt_ready,
.status-mureka_generating { background: #0e1a2b; color: #7abaff; border-color: #1f3555; }
.status-mureka_ready      { background: #0f2213; color: #7be3a1; border-color: #1f4b2d; }
.status-selected          { background: #14210f; color: #a8e07b; border-color: #2b4b1f; }
.status-purchased         { background: #201a08; color: #ffcf7a; border-color: #4b3e1f; }
.status-chatgpt_error,
.status-mureka_error      { background: #2a0e0e; color: #ff9c9c; border-color: #5a1c1c; }

/* Simplified lifecycle buckets used by the submissions list */
.status-bucket-submitted  { background: #0e1a2b; color: #7abaff; border-color: #1f3555; }
.status-bucket-cart       { background: #201a08; color: #ffcf7a; border-color: #4b3e1f; }
.status-bucket-paid       { background: #0f2213; color: #7be3a1; border-color: #1f4b2d; }
.status-bucket-failed     { background: #2a0e0e; color: #ff9c9c; border-color: #5a1c1c; }

.filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}
.filters .field-input { height: 52px; font-size: 14px; width: 100%; min-width: 0; }
.filters .field-input--tall { height: 52px; }
.btn-tall { height: 52px; padding: 0 24px; white-space: nowrap; }
.filters-clear { margin: -8px 0 18px; }

/* Admin variant of kr-select */
.kr-select--admin { width: 100%; min-width: 0; }
.kr-select--admin .kr-select__trigger {
    height: 52px;
    background: #050505;
    border-color: #2a2a2a;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
}
.kr-select--admin .kr-select__trigger:hover,
.kr-select--admin.is-open .kr-select__trigger {
    border-color: #555;
}
.kr-select--admin .kr-select__menu {
    background: #0a0a0a;
    border-color: #333;
}
.kr-select--admin .kr-select__opt {
    font-size: 14px;
    color: #ddd;
}
.kr-select--admin .kr-select__opt:hover,
.kr-select--admin .kr-select__opt.is-focused { background: #1a1a1a; color: #fff; }
.kr-select--admin .kr-select__opt.is-selected { color: #fff; font-weight: 700; }

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 4px;
    color: #666;
    font-size: 12px;
    letter-spacing: 0.06em;
}
.pager a, .pager span.disabled {
    padding: 8px 14px;
    border: 1px solid #222;
    color: #b6b6b6;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 2px;
}
.pager a:hover { border-color: #CD3711; color: #CD3711; }
.pager span.disabled { opacity: 0.4; }

.empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---------- Submission detail ---------- */

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}
@media (min-width: 900px) {
    .detail-grid { grid-template-columns: 2fr 1fr; }
}
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 20px; font-size: 13px; }
.kv dt { color: #666; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; padding-top: 4px; }
.kv dd { margin: 0; color: #fff; padding-bottom: 8px; border-bottom: 1px solid #141414; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; padding-bottom: 0; }

.lyrics-box {
    background: #050505;
    border: 1px solid #141414;
    padding: 16px 18px;
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: #e5e5e5;
    white-space: pre-wrap;
    max-height: 480px;
    overflow-y: auto;
    scrollbar-width: none;
}
.lyrics-box::-webkit-scrollbar { display: none; }

.raw-box {
    background: #050505;
    border: 1px solid #141414;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.55;
    color: #a5a5a5;
    white-space: pre-wrap;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: none;
    border-radius: 2px;
}
.raw-box::-webkit-scrollbar { display: none; }

.track-row {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #141414;
}
.track-row:last-child { border-bottom: 0; }
.track-row__num {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #666;
}
.track-row audio { width: 100%; height: 36px; filter: invert(1) hue-rotate(180deg); }
.track-row.is-selected .track-row__num { color: #CD3711; }
.track-row__dur { font-size: 12px; color: #888; font-variant-numeric: tabular-nums; }

/* Status card: match height of version-tabs strip so tops align in the two columns */
.status-card { padding: 0; }
.status-card__head {
    padding: 14px 20px;
    margin: 0;
    min-height: 80px;
    border-bottom: 2px solid transparent;
}

/* Sticky right column on submission detail. Sticks 20px below topbar. */
@media (min-width: 900px) {
    .detail-sticky {
        position: sticky;
        top: calc(52px + 22px);
        align-self: start;
        max-height: calc(100dvh - 52px - 44px);
        overflow-y: auto;
        scrollbar-width: none;
    }
    .detail-sticky::-webkit-scrollbar { display: none; }
}

/* Version tab strip. Standalone element above the ChatGPT output card. */
.version-tabs {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 14px;
}
.version-tab {
    background: #0a0a0a;
    color: #888;
    border: 1px solid #1a1a1a;
    border-bottom: 2px solid transparent;
    height: 52px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.version-tab:hover { color: #fff; background: #111; }
.version-tab.is-active {
    color: #fff;
    background: #0a0a0a;
    border-color: #1a1a1a;
    border-bottom-color: #CD3711;
}
.version-panel { display: none; }
.version-panel.is-active { display: block; }
.version-section { margin-bottom: 18px; }
.version-section:last-child { margin-bottom: 0; }
.version-section__title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 8px;
}

.error-box {
    background: #2a0e0e;
    border: 1px solid #7a1e1e;
    color: #ff9c9c;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 22px;
    border-radius: 2px;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 24px;
    margin-bottom: 26px;
}
.actions-row__form { display: inline; }
.actions-row__status { align-self: center; }

/* Detail page header row: title on left, action buttons right-justified */
.detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
}
.detail-header__title { margin: 0; }
.detail-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.detail-header__actions .actions-row__form { display: inline-flex; }

/* Error-box label (replaced inline style) */
.error-box__label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* KV note (inline custom text after enum label, replaces inline style="color:#888") */
.kv__note { color: #888; font-style: italic; }
.kv__ua   { font-size: 12px; color: #888; word-break: break-all; }
