/* MOTLogs Admin: tokens copied from the member area design system (member.css). Light by default; dark via data-theme or the OS setting. */
:root {
    --bg: #F4F5F7; --surface: #FFFFFF; --surface-2: #F0F2F4; --border: #D5D9DE; --input-bg: #F4F5F7;
    --text: #16181B; --muted: #5A616A; --cta: #D33814; --cta-text: #fff;
    --ok: #1E7A47; --ok-tint: rgba(47,191,113,.14); --bad: #B3261E; --bad-tint: rgba(239,83,80,.12);
    --overlay: rgba(0,0,0,.55); --shadow: rgba(0,0,0,.25);
    --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #0E0F11; --surface: #16181B; --surface-2: #1D2024; --border: #30353B; --input-bg: #0E0F11;
    --text: #F2F4F6; --muted: #8A919A;
    --ok: #4FD08A; --ok-tint: rgba(47,191,113,.13); --bad: #F27573; --bad-tint: rgba(239,83,80,.13);
    --shadow: rgba(0,0,0,.5);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0E0F11; --surface: #16181B; --surface-2: #1D2024; --border: #30353B; --input-bg: #0E0F11;
        --text: #F2F4F6; --muted: #8A919A;
        --ok: #4FD08A; --ok-tint: rgba(47,191,113,.13); --bad: #F27573; --bad-tint: rgba(239,83,80,.13);
        --shadow: rgba(0,0,0,.5);
        color-scheme: dark;
    }
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45; }
a { color: inherit; }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
.muted { color: var(--muted); margin: 0; }
.error { color: var(--bad); }
.ok-text { color: var(--ok); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; font-size: 1.1rem; padding: 4px 10px 14px; }
.brand span { color: var(--cta); }
.nav-group { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: var(--muted); padding: 16px 10px 4px; }
.nav-item { display: block; padding: 7px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--text); }
.nav-item.sub { padding-left: 24px; font-size: 14px; color: var(--muted); }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--cta); font-weight: 600; }
.who { margin-top: 20px; padding: 12px 10px 0; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.who form { margin: 0; }
.who-btns { display: flex; gap: 6px; }
.theme-toggle::before { content: "System"; }
:root[data-theme-pref="light"] .theme-toggle::before { content: "Light"; }
:root[data-theme-pref="dark"] .theme-toggle::before { content: "Dark"; }
.content { padding: 24px 28px 48px; min-width: 0; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px; margin-bottom: 16px; overflow-x: auto; }
.panel.pad { padding: 20px; }
.panel.narrow { max-width: 560px; }
.panel.group { padding: 14px 16px; }
.tag { font-size: 11px; font-weight: 600; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; color: var(--muted); margin-left: 6px; vertical-align: middle; }
.form-wide { max-width: 860px; }

.btn { font: inherit; font-size: 14px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--cta); color: var(--cta-text); border-color: var(--cta); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 3px 10px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 6px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--cta); outline-offset: 2px; }
.rowbtns { display: flex; gap: 6px; white-space: nowrap; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
.field.bool label { color: var(--text); font-size: 14px; display: flex; gap: 8px; align-items: center; }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
    font: inherit; background: var(--input-bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; width: 100%;
}
.filters { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.filters .field { min-width: 260px; }

.toast { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-radius: var(--r-md); padding: 10px 14px; margin: 0 0 14px; border: 1px solid var(--border); }
.toast.ok { background: var(--ok-tint); color: var(--ok); }
.toast.bad { background: var(--bad-tint); color: var(--bad); }
.x { background: none; border: 0; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num, .num { text-align: right; }
.tbl tr.retired td { opacity: .55; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; max-width: 760px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.tile:hover { border-color: var(--muted); }
.tile .num { font-size: 2rem; font-weight: 700; text-align: left; }

.modal-back { position: fixed; inset: 0; background: var(--overlay); z-index: 1000; }
.modal { position: fixed; z-index: 1001; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
    display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 20px 60px var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; }
.login-card h1 span { color: var(--cta); }
.login-card .muted { margin-bottom: 16px; }
.forgot { margin-top: 18px; font-size: 14px; color: var(--muted); }
.forgot summary { cursor: pointer; margin-bottom: 10px; }

@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .content { padding: 16px; }
}
