/* ------------------------------------------------------------------
 | LMJ Records — studio admin
 | ------------------------------------------------------------------ */
:root {
    --ink: #0b0b0d;
    --ink-2: #121215;
    --ink-3: #18181d;
    --ink-4: #202027;
    --paper: #f2ede3;
    --gold: #e9b44c;
    --gold-soft: #f3cd82;
    --flame: #f2542d;
    --green: #7ed6a5;
    --line: rgba(243, 239, 230, 0.12);
    --line-strong: rgba(243, 239, 230, 0.22);
    --muted: rgba(243, 239, 230, 0.62);
    --muted-2: rgba(243, 239, 230, 0.4);
    --radius: 14px;
    --display: 'Anton', 'Arial Narrow', Impact, sans-serif;
    --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

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

body.admin {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3 {
    margin: 0;
    font-weight: 600;
}

p {
    margin: 0;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

code {
    font-family: var(--mono);
    font-size: 0.82em;
    background: rgba(243, 239, 230, 0.08);
    padding: 2px 5px;
    border-radius: 4px;
}

::selection {
    background: var(--gold);
    color: var(--ink);
}

/* Layout */
.admin-shell {
    display: grid;
    grid-template-columns: 246px minmax(0, 1fr);
    min-height: 100vh;
}

.side {
    background: #08080a;
    border-right: 1px solid var(--line);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: sticky;
    top: 0;
    height: 100vh;
}

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

.side-logo {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--gold);
    color: #14100a;
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    flex: none;
}

.side-brand > span:last-child {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

.side-brand small {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-2);
    font-weight: 400;
}

.side-nav {
    display: grid;
    gap: 2px;
}

.side-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 0.9rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.side-nav a:hover {
    background: rgba(243, 239, 230, 0.05);
    color: var(--paper);
}

.side-nav a.is-active {
    background: rgba(233, 180, 76, 0.13);
    color: var(--gold);
    font-weight: 500;
}

.nav-badge {
    background: var(--flame);
    color: #fff;
    font-family: var(--mono);
    font-size: 9px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    padding: 0 5px;
}

.side-foot {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 16px;
    display: grid;
    gap: 10px;
    font-size: 0.84rem;
    color: var(--muted);
}

.side-foot a:hover,
.side-foot button:hover {
    color: var(--gold);
}

.side-foot form {
    margin: 0;
}

.side-foot button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--muted-2);
    font-size: 0.84rem;
    cursor: pointer;
    text-align: left;
}

.admin-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 36px;
    border-bottom: 1px solid var(--line);
    background: rgba(11, 11, 13, 0.9);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}

.topbar h1 {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.topbar-sub {
    color: var(--muted-2);
    font-size: 0.84rem;
    margin-top: 2px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 11px;
}

.topbar-user .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ink-4);
    border: 1px solid var(--line-strong);
    display: grid;
    place-items: center;
    font-weight: 600;
    color: var(--gold);
}

.topbar-user strong {
    display: block;
    font-size: 0.85rem;
    line-height: 1.2;
}

.topbar-user small {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.admin-content {
    padding: 30px 36px 64px;
    display: grid;
    gap: 22px;
    align-content: start;
}

/* Flash */
.admin-flash {
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--ink-3);
    font-size: 0.88rem;
}

.admin-flash-success {
    border-color: rgba(126, 214, 165, 0.45);
    color: var(--green);
    background: rgba(126, 214, 165, 0.06);
}

.admin-flash-error {
    border-color: rgba(242, 84, 45, 0.45);
    color: #ffb4a0;
    background: rgba(242, 84, 45, 0.07);
}

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

.stat-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ink-2);
    padding: 20px 22px;
}

.stat-card span {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.stat-card strong {
    display: block;
    font-size: 1.7rem;
    letter-spacing: -0.03em;
    margin: 8px 0 2px;
    line-height: 1.1;
}

.stat-card small {
    color: var(--muted-2);
    font-size: 0.78rem;
}

/* Panels */
.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ink-2);
    padding: 24px;
    min-width: 0;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-head h2 {
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.panel-link {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
}

.panel-link:hover {
    text-decoration: underline;
}

.panel-empty {
    color: var(--muted-2);
    font-size: 0.9rem;
    padding: 18px 0;
}

.panel-note {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    font-size: 0.8rem;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.admin-grid-form {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.admin-grid-3 {
    display: grid;
    grid-template-columns: 1.2fr 0.6fr 0.8fr;
    gap: 14px;
}

.admin-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

/* Mini lists */
.mini-list {
    display: grid;
    gap: 2px;
}

.mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 10px;
    border-radius: 9px;
    transition: background 0.15s ease;
}

.mini-row:hover {
    background: rgba(243, 239, 230, 0.04);
}

.mini-row.is-unread .mini-main strong::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--flame);
    margin-right: 8px;
    vertical-align: middle;
}

.mini-thumb {
    width: 38px;
    height: 38px;
    border-radius: 7px;
    object-fit: cover;
    flex: none;
}

.mini-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mini-main strong {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-main small {
    color: var(--muted-2);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.mini-meta small {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--muted-2);
}

/* Shortcuts */
.shortcut-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.shortcut {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.shortcut:hover {
    border-color: var(--line-strong);
    background: rgba(243, 239, 230, 0.035);
}

.shortcut strong {
    font-size: 0.9rem;
    font-weight: 500;
}

.shortcut span {
    color: var(--muted-2);
    font-size: 0.78rem;
}

/* Buttons */
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--paper);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.admin-btn:hover {
    border-color: var(--muted);
    background: rgba(243, 239, 230, 0.05);
}

.admin-btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: #14100a;
}

.admin-btn-gold:hover {
    background: var(--gold-soft);
    border-color: var(--gold-soft);
    color: #14100a;
}

.admin-btn-danger {
    color: #ff9d87;
    border-color: rgba(242, 84, 45, 0.4);
}

.admin-btn-danger:hover {
    background: rgba(242, 84, 45, 0.12);
    border-color: var(--flame);
}

.admin-btn-ghost {
    color: var(--muted);
}

.admin-btn-sm {
    padding: 8px 13px;
    font-size: 0.78rem;
}

.admin-btn-block {
    width: 100%;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.inline-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-2);
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    margin: 0 -6px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    min-width: 760px;
}

.data-table th {
    text-align: left;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-2);
    font-weight: 400;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: rgba(243, 239, 230, 0.025);
}

.table-beat {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.table-beat strong {
    display: block;
    font-weight: 500;
}

.table-beat small {
    color: var(--muted-2);
    font-size: 0.76rem;
}

.thumb {
    width: 42px;
    height: 42px;
    border-radius: 7px;
    object-fit: cover;
    flex: none;
}

.mono-cell {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    color: var(--muted-2);
    display: block;
    text-transform: uppercase;
}

.ta-right {
    text-align: right;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.table-input {
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 0.83rem;
    width: 100%;
    min-width: 110px;
}

.table-input-sm {
    min-width: 60px;
    width: 70px;
}

.table-input:focus {
    outline: none;
    border-color: var(--gold);
}

/* Pills */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    border: 1px solid var(--line-strong);
    color: var(--muted);
    white-space: nowrap;
}

.pill-new {
    color: #ffd28a;
    border-color: rgba(233, 180, 76, 0.45);
    background: rgba(233, 180, 76, 0.1);
}

.pill-confirmed {
    color: #a9c7ff;
    border-color: rgba(120, 160, 255, 0.4);
    background: rgba(120, 160, 255, 0.08);
}

.pill-in_studio {
    color: #ffb4a0;
    border-color: rgba(242, 84, 45, 0.45);
    background: rgba(242, 84, 45, 0.08);
}

.pill-completed {
    color: var(--green);
    border-color: rgba(126, 214, 165, 0.4);
    background: rgba(126, 214, 165, 0.07);
}

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

.pill-featured {
    color: var(--gold);
    border-color: rgba(233, 180, 76, 0.35);
    margin-left: 4px;
}

/* Forms */
.admin-form {
    display: grid;
    gap: 16px;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.admin-field > span {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.admin-field input,
.admin-field select,
.admin-field textarea {
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 11px 13px;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-field textarea {
    resize: vertical;
}

.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(233, 180, 76, 0.12);
}

.admin-field small {
    color: var(--muted-2);
    font-size: 0.76rem;
}

.admin-error {
    color: #ff9d87;
    font-size: 0.78rem;
    font-style: normal;
}

.file-preview {
    width: 78px;
    height: 78px;
    border-radius: 8px;
    object-fit: cover;
    margin-top: 8px;
    border: 1px solid var(--line);
}

.audio-preview {
    width: 100%;
    height: 34px;
    margin-top: 8px;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-top: 4px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
}

.check input {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    margin-top: 6px;
}

.tips-list {
    display: grid;
    gap: 14px;
    font-size: 0.84rem;
    color: var(--muted);
}

.tips-list strong {
    color: var(--paper);
    font-weight: 500;
}

/* Bookings */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.82rem;
    color: var(--muted);
}

.filter-tab b {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--muted-2);
}

.filter-tab:hover {
    border-color: var(--line-strong);
    color: var(--paper);
}

.filter-tab.is-active {
    background: var(--gold);
    border-color: var(--gold);
    color: #14100a;
    font-weight: 500;
}

.filter-tab.is-active b {
    color: rgba(20, 16, 10, 0.6);
}

.booking-list {
    display: grid;
    gap: 14px;
}

.booking-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ink-2);
    padding: 22px;
    scroll-margin-top: 100px;
}

.booking-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.booking-head h3 {
    font-size: 1.1rem;
    margin: 4px 0 2px;
}

.booking-head small {
    color: var(--muted-2);
    font-size: 0.8rem;
}

.booking-head small a:hover {
    color: var(--gold);
}

.booking-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr 1.2fr;
    gap: 18px;
    padding: 18px 0;
}

.booking-grid span {
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-2);
    display: block;
    margin-bottom: 4px;
}

.booking-grid strong {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
}

.booking-grid strong small {
    color: var(--muted-2);
    font-weight: 400;
}

.booking-notes {
    border-left: 2px solid var(--gold);
    padding: 4px 0 4px 14px;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 18px;
}

.booking-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

/* Messages */
.message-list {
    display: grid;
    gap: 14px;
}

.message-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ink-2);
    padding: 22px;
    scroll-margin-top: 100px;
}

.message-card.is-unread {
    border-color: rgba(233, 180, 76, 0.32);
    background: linear-gradient(160deg, rgba(233, 180, 76, 0.05), var(--ink-2) 55%);
}

.message-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.message-card h3 {
    font-size: 1rem;
    margin: 4px 0 2px;
}

.message-card h3 small {
    color: var(--muted-2);
    font-weight: 400;
    font-size: 0.85rem;
}

.message-card header small {
    color: var(--muted-2);
    font-size: 0.8rem;
}

.message-card header small a:hover {
    color: var(--gold);
}

.message-body {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 18px;
    max-width: 76ch;
}

.unread-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--flame);
    flex: none;
    margin-top: 8px;
}

/* Login */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(900px 500px at 70% -10%, rgba(233, 180, 76, 0.14), transparent 65%),
        var(--ink);
    padding: 32px 20px;
}

.login-wrap {
    width: min(100%, 420px);
    display: grid;
    gap: 22px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-brand strong {
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.login-brand small {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.login-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--ink-2);
    padding: 30px;
    display: grid;
    gap: 18px;
}

.login-card h1 {
    font-family: var(--display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 2rem;
    line-height: 1;
}

.login-sub {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: -10px;
}

.login-card form {
    display: grid;
    gap: 14px;
}

.login-note {
    color: var(--muted-2);
    font-size: 0.76rem;
    line-height: 1.6;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.login-back {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-2);
    text-align: center;
}

.login-back:hover {
    color: var(--gold);
}

/* Responsive */
@media (max-width: 1180px) {
    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .booking-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 960px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .side {
        position: static;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 18px;
        padding: 14px 18px;
        overflow-x: auto;
    }

    .side-brand {
        padding: 0;
    }

    .side-nav {
        display: flex;
        gap: 4px;
    }

    .side-nav a {
        white-space: nowrap;
        padding: 8px 11px;
    }

    .side-foot {
        margin: 0 0 0 auto;
        border: 0;
        padding: 0;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .side-foot a {
        white-space: nowrap;
    }

    .topbar {
        padding: 20px;
        position: static;
    }

    .admin-content {
        padding: 22px 20px 48px;
    }

    .admin-grid-2,
    .admin-grid-form {
        grid-template-columns: 1fr;
    }

    .admin-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .side-foot span,
    .topbar-user div {
        display: none;
    }

    .booking-head {
        flex-direction: column;
    }

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

    .shortcut-grid,
    .admin-grid-3 {
        grid-template-columns: 1fr;
    }

    .admin-content {
        padding: 18px 14px 40px;
    }
}
