/* DoorRoster admin — palette shared with the kiosk (DesignSystem/Theme.swift). */
:root {
  --ink: #10243a; --muted: #64758a; --blue: #0f4d7f; --blue-deep: #08365e; --sky: #33a9dc;
  --green: #5db34a; --red: #dc5a60; --amber: #8a5200; --amber-bg: #fff0d7; --line: #dbe6ef;
  --soft: #f4f8fb; --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--soft); }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin-card { width: min(460px, 100%); display: grid; gap: 14px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: 0 10px 30px rgba(16,36,58,.07); }
.eyebrow { margin: 0; color: var(--blue); font-size: .8rem; letter-spacing: .17em; font-weight: 800; }
h1 { margin: 0 0 4px; font-size: 2rem; letter-spacing: -.03em; }
h2 { margin: 28px 0 12px; font-size: 1.25rem; }
.muted { color: var(--muted); margin: 0; }
label { display: grid; gap: 6px; font-weight: 650; font-size: .95rem; }
input, select, textarea { border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px; background: var(--white); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); }
input[type=checkbox] { width: 20px; height: 20px; }
.primary { border: 0; border-radius: 14px; background: var(--blue); color: var(--white); font-weight: 800; padding: 12px 18px; cursor: pointer; }
.primary:disabled { opacity: .4; cursor: not-allowed; }
.secondary { border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--blue); font-weight: 700; padding: 8px 14px; cursor: pointer; }
.danger { color: #a9343b; }
.link { border: 0; background: none; color: var(--blue); font-weight: 700; cursor: pointer; padding: 6px; }
.message { min-height: 1.2em; margin: 0; color: #a9343b; font-weight: 650; }
.message.ok { color: #28733f; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: var(--white); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 900; font-size: 1.3rem; color: var(--blue); }
nav { display: grid; gap: 2px; flex: 1; }
nav a { padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
nav a.active { background: #e9f3f9; color: var(--blue); }
.view { padding: 30px 36px 60px; min-width: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 8px 0 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 18px 0; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.stat b { display: block; font-size: 2rem; }
.stat.attention { background: var(--amber-bg); border-color: #f0c98a; color: var(--amber); }

.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { background: var(--soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); position: sticky; top: 0; }
td.wrap { white-space: normal; min-width: 180px; }
tr.review td { background: #fff7e8; }
tr.excluded td { color: var(--muted); text-decoration: line-through; }
tr.total td { font-weight: 800; background: var(--soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: #e9f3f9; color: var(--blue); margin-right: 4px; }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.ok { background: #edf8ea; color: #28733f; }
.badge.off { background: #eee; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.checks { display: flex; flex-wrap: wrap; gap: 14px; }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 600; }

dialog { border: 0; border-radius: 22px; padding: 0; width: min(620px, 94vw); max-height: 92vh; overflow: auto; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(5,22,38,.55); }
#dialog-form { padding: 26px; display: grid; gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  nav { grid-template-columns: repeat(2, 1fr); }
  .view { padding: 20px 16px; }
}
fieldset legend { color: var(--ink); }
img { vertical-align: middle; }
input[type=file] { max-width: 100%; }
