/* ATR Client Portal. Brand: slate #29323A, gold #AF9251 */
:root {
  --slate: #29323A; --slate-2: #3A4450; --slate-line: #3E4855;
  --gold: #AF9251; --gold-text: #7A5C1C; --tan: #EFE6D2; --cream: #FAF8F3; --cream-2: #FBF7EC;
  --line: #E5DECD; --line-2: #EEE8DA; --input: #C9C2B0; --muted: #4A5468; --muted-2: #5A6275; --side-text: #C9CFDB;
  --serif: 'Source Serif 4', Georgia, serif; --sans: Inter, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--slate); background: var(--cream); font-size: 15px; }
a { color: var(--gold-text); } a:hover { color: var(--slate); }
h1, h2, h3 { font-family: var(--serif); margin: 0; }
h2 { font-size: 21px; } h3 { font-size: 17px; }

/* App shell */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; max-width: 100%; background: var(--slate); padding: 24px 16px; display: flex; flex-direction: column; gap: 22px; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.brand img { width: 140px; height: auto; }
.brand-tag { font-size: 11px; color: var(--side-text); letter-spacing: .12em; }
.brand-admin { background: var(--gold); color: var(--slate); font-weight: 600; padding: 3px 8px; }
.btn-gold { min-height: 46px; background: var(--gold); color: var(--slate); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; text-decoration: none; }
.btn-gold:hover { color: var(--slate); background: #C2A563; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 12px; color: var(--side-text); font-size: 14px; text-decoration: none; border-left: 3px solid transparent; }
.nav a:hover { color: #fff; }
.nav a.on { color: #fff; background: var(--slate-2); font-weight: 600; border-left-color: var(--gold); }
.count { background: var(--gold); color: var(--slate); font-size: 12px; font-weight: 600; padding: 2px 8px; }
.who { margin-top: auto; padding: 12px 8px; border-top: 1px solid var(--slate-line); display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--side-text); word-break: break-word; }
.who strong { color: #fff; font-size: 13px; }
.who a { color: #E4D3A6; padding: 6px 0; }
@media (max-width: 800px) { .side { padding: 16px; } .who { margin-top: 0; } .main { padding: 20px 16px; } }

/* Titles */
.ptitle { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
.ptitle h1 { font-size: 30px; }
.rule { width: 56px; height: 3px; background: var(--gold); margin-top: 8px; }
.sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* Buttons */
.btn { min-height: 44px; padding: 0 18px; background: var(--slate); color: #fff; border: none; display: inline-flex; align-items: center; justify-content: center; font: 600 14px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { color: #fff; background: #3A4450; }
.btn-line { background: #fff; color: var(--slate); border: 1px solid var(--slate); }
.btn-line:hover { background: var(--cream-2); color: var(--slate); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-danger { background: #fff; color: #8A1F1F; border: 1px solid #C9A3A3; }
.linkbtn { background: none; border: none; color: var(--gold-text); font: 600 13px var(--sans); cursor: pointer; padding: 6px 0; text-decoration: underline; }

/* Cards, lists, tables */
.card { background: #fff; border: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.card-gold { border-top: 3px solid var(--gold); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.row > * { flex: 1 1 320px; min-width: 0; }
.quick { background: #fff; border: 1px solid var(--line); padding: 18px; text-decoration: none; color: var(--slate); display: flex; flex-direction: column; gap: 6px; }
.quick:hover { border-color: var(--gold); color: var(--slate); }
.quick strong { font-size: 15px; } .quick span { font-size: 13px; color: var(--muted-2); }
.job { background: #fff; border: 1px solid var(--line); display: flex; flex-wrap: wrap; }
.job-date { width: 84px; background: var(--tan); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 0; }
.job-date small { font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.job-date b { font-family: var(--serif); font-size: 28px; }
.job-body { flex: 1 1 300px; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.job-body a.title { font-weight: 600; font-size: 15px; color: var(--slate); text-decoration: none; }
.job-side { padding: 14px 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta { font-size: 13px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 3px 8px; background: #F4F1E8; border: 1px solid var(--line); }
.empty { background: #fff; border: 1px dashed var(--input); padding: 28px; text-align: center; color: var(--muted); font-size: 14px; }
.tablewrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--tan); text-align: left; padding: 12px 16px; font-weight: 600; white-space: nowrap; }
td { padding: 12px 16px; border-top: 1px solid var(--line-2); vertical-align: top; }
td.right, th.right { text-align: right; }
.filelist { display: flex; flex-direction: column; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.kind { min-width: 44px; height: 30px; padding: 0 6px; background: var(--slate); color: #E4D3A6; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.file-body { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.hash { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted-2); word-break: break-all; }
.note { font-size: 13px; color: var(--muted); background: var(--cream-2); padding: 12px; margin: 0; }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: #E3EEE6; color: #1E5631; } .badge-warn { background: #F3ECDB; color: #6B4E12; }
.badge-info { background: #E4E8F0; color: var(--slate); } .badge-muted { background: #EEEEEE; color: #555; }

/* Forms */
form.stack { display: flex; flex-direction: column; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=url], input[type=file], select, textarea {
  font: 14px var(--sans); border: 1px solid var(--input); padding: 0 12px; min-height: 44px; background: #fff; color: var(--slate); width: 100%; border-radius: 0; }
input[type=file] { padding: 10px; }
textarea { min-height: 96px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--slate); }
.svc { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.svc label { border: 1px solid var(--line); background: #fff; padding: 14px 16px; flex-direction: row; align-items: flex-start; gap: 12px; cursor: pointer; }
.svc label:has(input:checked) { border: 2px solid var(--gold); background: var(--cream-2); padding: 13px 15px; }
.svc small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; font-size: 13px; }
.hint { font-weight: 400; color: var(--muted-2); font-size: 12px; }
.actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.inline { display: inline; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; word-break: break-word; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } }

/* Flash */
.flash { padding: 12px 14px; font-size: 14px; }
.flash-ok { background: #E3EEE6; color: #1E5631; } .flash-error { background: #F8E3E3; color: #8A1F1F; } .flash-info { background: #F3ECDB; color: var(--slate); }

/* Sign-in pages */
body.auth { display: flex; flex-direction: column; min-height: 100vh; }
.auth-top { background: var(--slate); padding: 18px 32px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.auth-top span { color: var(--side-text); font-size: 12px; letter-spacing: .12em; font-weight: 600; }
.auth-top a { color: #E4D3A6; font-size: 14px; text-decoration: none; }
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); padding: 36px 40px; display: flex; flex-direction: column; gap: 18px; }
.auth-logo { width: 170px; align-self: center; margin-bottom: 4px; }
.auth-card h1 { font-size: 30px; }
.auth-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.codebox { font-size: 22px !important; letter-spacing: .4em; text-align: center; }
.auth-help { font-size: 13px !important; color: var(--muted-2) !important; border-top: 1px solid var(--line-2); padding-top: 16px; }
.foot { border-top: 3px solid var(--gold); background: #fff; padding: 16px 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; font-size: 13px; color: var(--muted); }
.foot strong { color: var(--slate); }
@media (max-width: 480px) { .auth-card { padding: 28px 22px; } }
.center { text-align: center; }
