/* PupilScreen admin web app. Layout and colors follow the Lo-Fi Prototype's admin pages. */
:root {
  --ink: #1A1A1A; --ink-2: #404040; --muted: #595959; --line: #D9D9D9; --soft: #F2F2F2;
  --accent: #3D5A80; --accent-soft: #EEF2F7; --white: #FFFFFF;
  --green: #2E7D4F; --green-bg: #EAF5EE; --green-fg: #1F6B3F;
  --amber: #B45309; --amber-bg: #FFF4D6; --amber-fg: #8A4B08;
  --red: #B42318; --red-bg: #FDECEA; --red-fg: #8F1D14;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--soft); color: var(--ink); font: 14px/1.45 -apple-system, "SF Pro Text", system-ui, sans-serif; }
a { color: var(--accent); }
a:hover { color: var(--ink); }
h1 { margin: 0; font-size: 30px; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 8px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }

.env-banner { background: #FFE14D; color: #1A1A1A; text-align: center; font-weight: 700; padding: 6px 12px; border-bottom: 1px solid #C9A800; letter-spacing: .3px; }

.app { display: flex; min-height: 100vh; }
.sidebar { flex: 0 0 230px; background: var(--white); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 6px; }
.brand { padding: 0 10px 18px; font-size: 20px; font-weight: 700; }
.nav-item { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-item:hover { background: var(--soft); color: var(--ink); }
.nav-item.current { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.main-column { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 12px 32px; background: var(--white); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.topbar form { margin: 0; }
.content { padding: 28px 32px; display: flex; flex-direction: column; gap: 16px; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.end { justify-content: flex-end; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 22px; border: none; background: var(--accent); color: var(--white); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover { color: var(--white); filter: brightness(1.1); }
.button.secondary { background: var(--white); color: var(--accent); border: 1px solid #8C8C8C; }
.button.secondary:hover { color: var(--ink); }
.button.danger { background: var(--red); }
.button.small { min-height: 34px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--ink); }
.button.disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.field input, .field select { height: 40px; border: 1px solid #8C8C8C; border-radius: 10px; padding: 0 10px; font: inherit; font-size: 14px; background: var(--white); color: var(--ink); }
.stack .field input, .stack .field select { height: 44px; font-size: 15px; }
.help { color: var(--muted); font-size: 12px; }
.field-error, .form-error { color: var(--red); font-size: 13px; }
.form-error { font-size: 14px; margin: 0; padding: 10px 12px; background: var(--red-bg); border-radius: 10px; }

.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split > .table-card { flex: 999 1 560px; }
.table-card { min-width: 0; overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding: 12px 14px; font-weight: 600; }
td { padding: 10px 14px; border-top: 1px solid var(--soft); vertical-align: top; }
tr.selected td { background: var(--accent-soft); }
td.empty { color: var(--muted); text-align: center; padding: 24px; }
table.compact th, table.compact td { padding: 6px 8px; font-size: 13px; }
tr.sub td { border-top: none; padding-top: 0; }
.eye-line { margin: 2px 0; }

.detail { flex: 1 1 360px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
dl.rows { margin: 0; font-size: 14px; }
dl.rows .row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--soft); }
dl.rows dt { color: var(--muted); }
dl.rows dd { margin: 0; text-align: right; }

.pill { display: inline-block; white-space: nowrap; padding: 3px 10px; border-radius: 12px; border: 1px solid #8C8C8C; background: var(--soft); font-size: 13px; font-weight: 600; }
.pill.small { padding: 0 8px; font-size: 12px; }
.pill.large { padding: 6px 12px; border-width: 2px; font-size: 15px; font-weight: 700; }
.pill-green { border-color: var(--green); background: var(--green-bg); color: var(--green-fg); }
.pill-grey { border-color: var(--muted); background: var(--soft); color: var(--ink); }
.pill-amber { border-color: var(--amber); background: var(--amber-bg); color: var(--amber-fg); }
.pill-red { border-color: var(--red); background: var(--red-bg); color: var(--red-fg); }
.pill-blue { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.form-card { max-width: 520px; }
.public { display: flex; justify-content: center; padding: 64px 16px; }
.card.narrow { width: 100%; max-width: 420px; }
.card.narrow .brand { padding: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.message { padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.message.success { background: var(--green-bg); color: var(--green-fg); }
.message.error { background: var(--red-bg); color: var(--red-fg); }

.pagination { display: flex; gap: 16px; justify-content: center; padding: 12px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
