/* GSL Admin v2 — application styles. All colours come from tokens.css. */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.45;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── App shell ─────────────────────────────────────────────── */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: var(--sidebar-text-active);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.2px;
}

.sidebar-brand .logo {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: var(--brand);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; }

.nav-section {
    margin: 14px 10px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-3);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 1px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 13px;
}

.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); text-decoration: none; }
.nav-link.active { background: var(--sidebar-active); color: var(--sidebar-text-active); }
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }

.nav-link.disabled { opacity: 0.38; cursor: default; pointer-events: none; }
.nav-link .soon {
    margin-left: auto;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 99px;
    background: var(--sidebar-hover);
    letter-spacing: 0.4px;
}

.sidebar-footer { padding: 10px; border-top: 1px solid rgba(255,255,255,0.07); }

/* ── Main column ───────────────────────────────────────────── */

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

.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar h1 { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0; }
.topbar .spacer { flex: 1; }

.content { padding: 20px 24px 32px; max-width: 1360px; width: 100%; margin: 0 auto; }

.page-head { margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.page-head p { margin: 4px 0 0; color: var(--text-3); font-size: 12.5px; }

/* ── Components ────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.card-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.card-body { padding: 14px; }
.card-body.flush { padding: 0; }

/* Stat tiles */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
}

.stat .label { font-size: 11px; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.stat .value { font-size: 20px; font-weight: 600; margin-top: 4px; line-height: 1.1; }
.stat .dot { width: 8px; height: 8px; border-radius: 99px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-3);
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table .sub { color: var(--text-3); font-size: 12px; margin-top: 1px; }
.table .num { font-variant-numeric: tabular-nums; }

.empty {
    padding: 28px 14px;
    text-align: center;
    color: var(--text-3);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}
.badge.green  { background: var(--green-soft);  color: var(--green-text); }
.badge.amber  { background: var(--amber-soft);  color: var(--amber-text); }
.badge.red    { background: var(--red-soft);    color: var(--red-text); }
.badge.blue   { background: var(--blue-soft);   color: var(--blue-text); }
.badge.violet { background: var(--violet-soft); color: var(--violet-text); }
.badge.slate  { background: var(--slate-soft);  color: var(--slate-text); }

/* Dot variant — calmer status display for dense tables */
.badge.dot { background: transparent; padding: 0; font-weight: 500; }
.badge.dot::before { content: ''; width: 7px; height: 7px; border-radius: 99px; flex-shrink: 0; }
.badge.dot.green::before  { background: var(--green); }
.badge.dot.amber::before  { background: var(--amber); }
.badge.dot.red::before    { background: var(--red); }
.badge.dot.blue::before   { background: var(--blue); }
.badge.dot.violet::before { background: var(--violet); }
.badge.dot.slate::before  { background: var(--slate); }
.badge.dot.green  { color: var(--green-text); }
.badge.dot.amber  { color: var(--amber-text); }
.badge.dot.red    { color: var(--red-text); }
.badge.dot.blue   { color: var(--blue-text); }
.badge.dot.violet { color: var(--violet-text); }
.badge.dot.slate  { color: var(--text-2); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.icon { padding: 5px; }
.btn svg { width: 16px; height: 16px; }
.btn.block { width: 100%; justify-content: center; }

/* Forms */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.input {
    width: 100%;
    font-family: var(--font);
    font-size: 13px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
}
.input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

/* Flash messages */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); font-weight: 500; margin-bottom: 14px; }
.flash.success { background: var(--green-soft); color: var(--green-text); }
.flash.error { background: var(--red-soft); color: var(--red-text); }

/* User chip / theme toggle */
.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    color: var(--text);
}
.avatar {
    width: 28px; height: 28px;
    border-radius: 99px;
    background: var(--surface-3);
    color: var(--text-2);
    display: grid;
    place-items: center;
    font-size: 11.5px;
    font-weight: 600;
}

.theme-toggle {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-2);
    border-radius: var(--radius-sm);
    width: 34px; height: 34px;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

/* Two-column dashboard area */
.grid-2 {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 12px;
    align-items: start;
}
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* Login page */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--bg);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-2);
    padding: 32px;
}
.login-card .logo-row { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.login-card h1 { font-size: 17px; margin: 0; }
.login-card .divider {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-3); font-size: 12px; margin: 18px 0;
}
.login-card .divider::before, .login-card .divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Utility */
.muted { color: var(--text-2); }
.small { font-size: 12px; }
strong { font-weight: 600; }
.field-hint { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.form-actions { position: sticky; bottom: 0; padding: 10px 0; background: var(--bg); display: flex; gap: 10px; z-index: 10; }
.mt-0 { margin-top: 0; }

/* ── Bookings ──────────────────────────────────────────────── */

.toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.toolbar .search { max-width: 340px; margin-left: auto; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-2);
}
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chip .count { opacity: 0.65; font-weight: 600; }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pager .spacer { flex: 1; }

/* Key-value lists (detail panels) */
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--text-3); font-size: 12px; font-weight: 500; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: break-word; }

/* Discussion notes */
.note { padding: 8px 0; border-bottom: 1px solid var(--border); }
.note:first-child { padding-top: 0; }
.note-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.note-body { white-space: pre-wrap; }

/* Form rows */
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }

/* Tables with inputs (edit page) */
#sessions-table td, #equipment-table td { padding: 8px 10px; }
#sessions-table .input, #equipment-table .input { min-width: 0; }

/* ── Calendar ──────────────────────────────────────────────── */

.cal { display: flex; flex-direction: column; }
.cal-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.cal-head div {
    padding: 7px 10px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-3);
}
.cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border);
}
.cal-week:last-child { border-bottom: none; }
.cal-day {
    min-height: 96px;
    padding: 6px;
    border-right: 1px solid var(--border);
    overflow: hidden;
}
.cal-day:last-child { border-right: none; }
.cal-day.dim { background: var(--surface-2); }
.cal-day.dim .cal-daynum { color: var(--text-3); }
.cal-daynum { font-size: 11.5px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; }
.cal-day.today .cal-daynum {
    display: inline-grid; place-items: center;
    width: 22px; height: 22px;
    background: var(--brand); color: #fff; border-radius: 99px;
}
.cal-event {
    display: block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 5px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-event:hover { text-decoration: none; filter: brightness(1.1); }
.cal-event .t { opacity: 0.75; font-weight: 500; margin-right: 3px; }
.cal-event.green  { background: var(--green-soft);  color: var(--green-text); }
.cal-event.amber  { background: var(--amber-soft);  color: var(--amber-text); }
.cal-event.blue   { background: var(--blue-soft);   color: var(--blue-text); }
.cal-event.violet { background: var(--violet-soft); color: var(--violet-text); }
.cal-event.slate  { background: var(--slate-soft);  color: var(--slate-text); }
.cal-more { font-size: 11px; color: var(--text-3); padding-left: 6px; }

/* ── Shifts ────────────────────────────────────────────────── */

.staff-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.staff-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 99px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    cursor: pointer;
    user-select: none;
}
.staff-check:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

.shift-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 14px 18px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.shift-detail h4 { margin: 0 0 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); }
.shift-person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
}
.shift-person:last-of-type { border-bottom: none; }
@media (max-width: 900px) { .shift-detail { grid-template-columns: 1fr; } }

/* ── SMS inbox ─────────────────────────────────────────────── */

.sms-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 16px;
    align-items: stretch;
    height: calc(100vh - var(--topbar-h) - 175px);
    min-height: 420px;
}
.sms-list { overflow-y: auto; }
.sms-convo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.sms-convo:hover { background: var(--surface-2); text-decoration: none; }
.sms-convo.active { background: var(--brand-soft); }
.sms-thread { display: flex; flex-direction: column; min-height: 0; }
.sms-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble-row { display: flex; }
.bubble-row.outbound { justify-content: flex-end; }
.bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 14px;
    background: var(--surface-3);
    white-space: pre-wrap;
    overflow-wrap: break-word;
}
.bubble-row.outbound .bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble-row.inbound .bubble { border-bottom-left-radius: 4px; }
.bubble-meta { font-size: 10.5px; opacity: 0.65; margin-top: 3px; }
.sms-compose {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
}
@media (max-width: 900px) { .sms-layout { grid-template-columns: 1fr; height: auto; } }

.input.mono, textarea.mono { font-family: var(--mono); font-size: 12.5px; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }

/* ── Attention strip (dashboard) ───────────────────────────── */

.attn-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.attn-label { font-size: 12px; color: var(--text-3); margin-right: 2px; }
.attn-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 99px;
}
.attn-chip:hover { text-decoration: none; filter: brightness(1.05); }
.attn-chip.amber { background: var(--amber-soft); color: var(--amber-text); }
.attn-chip.red   { background: var(--red-soft);   color: var(--red-text); }
.attn-chip.blue  { background: var(--blue-soft);  color: var(--blue-text); }
.pipeline { font-size: 12px; color: var(--text-3); }
.pipeline a { color: var(--text-3); }
.pipeline a:hover { color: var(--text); text-decoration: none; }
.pipeline strong { color: var(--text); font-weight: 600; }

/* ── Agenda (dashboard schedule, date-rail) ────────────────── */

.agenda { padding: 2px 0 6px; }
.agenda-group {
    display: flex;
    gap: 14px;
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
}
.agenda-group:last-child { border-bottom: none; }
.agenda-rail { width: 34px; text-align: center; flex-shrink: 0; padding-top: 1px; }
.agenda-rail .dow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-3);
}
.agenda-rail .dom { font-size: 17px; font-weight: 500; color: var(--text-2); line-height: 1.15; }
.agenda-rail.soon .dow { color: var(--amber-text); }
.agenda-rail.soon .dom { color: var(--amber-text); }
.agenda-items { flex: 1; min-width: 0; }
.agenda-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 6px;
    margin: 0 -6px;
    border-radius: var(--radius-sm);
    color: var(--text);
}
.agenda-row:hover { background: var(--surface-2); text-decoration: none; }
.agenda-time {
    width: 106px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
}
.agenda-event {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agenda-event .org { font-weight: 400; color: var(--text-3); }
.agenda-venue {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-3);
    white-space: nowrap;
}
.agenda-tech {
    width: 70px;
    flex-shrink: 0;
    text-align: right;
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
}
.agenda-tech.open { color: var(--amber-text); font-weight: 500; }
@media (max-width: 800px) {
    .agenda-venue, .agenda-tech { display: none; }
}

/* Shifts agenda extras */
.shift-offers { flex-shrink: 0; white-space: nowrap; min-width: 150px; text-align: right; }
.shift-detail-slot:not(:empty) { margin: 2px 0 6px; }
.shift-detail-slot .shift-detail { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.staff-check.on-leave { opacity: 0.7; }
.leave-mark {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 1px 6px;
    border-radius: 99px;
    background: var(--amber-soft);
    color: var(--amber-text);
}
@media (max-width: 1000px) { .shift-offers { display: none; } }

.nav-badge {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    padding: 1px 6px;
    border-radius: 99px;
    background: var(--brand);
    color: #fff;
}

.user-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.user-row:last-child { border-bottom: none; }
