/* K'S brand: navy + gold on ivory, Arial, rounded and flat — same as the CAD Library and Production portal. */
:root {
  --navy: #12263f;
  --navy-2: #1d3a5c;
  --navy-soft: #e8edf3;
  --gold: #b08a45;
  --gold-dark: #9c7939;
  --gold-soft: #e9dcc2;
  --bg: #f4f2ee;
  --card: #ffffff;
  --soft: #f6f4f0;
  --ink: #1b2430;
  --muted: #6f7886;
  --line: #e4e2dd;
  --good: #2f7d4f;
  --bad: #b4503f;
  --shadow: 0 1px 2px rgba(18, 38, 63, .05), 0 10px 26px rgba(18, 38, 63, .07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.5 Arial, "Helvetica Neue", Helvetica, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--soft); padding: 9px 15px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--navy); }
button:hover:not(:disabled) { background: #ece8e1; }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--gold); border-color: var(--gold); color: #fff; font-size: 15px; padding: 13px 20px; min-height: 46px; }
button.primary:hover:not(:disabled) { background: var(--gold-dark); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover:not(:disabled) { color: var(--navy); background: var(--soft); }
input, select { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-size: 16px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--bad); font-size: 13px; background: #fbefec; border: 1px solid #f0d5ce; border-radius: 8px; padding: 10px 12px; }

/* K'S wordmark */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.wordmark { font-weight: 700; letter-spacing: -.02em; color: var(--navy); }
.wordmark span { color: var(--gold); }
.eyebrow { letter-spacing: .18em; font-size: 10px; color: var(--gold); font-weight: 700; text-transform: uppercase; }

/* sign in: navy page, white card */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--navy); }
.login { width: min(400px, 100%); background: var(--card); border-radius: 16px; padding: 32px 26px; display: grid; gap: 14px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.login .wordmark { font-size: 34px; line-height: 1; }
.login .eyebrow { margin-top: -6px; }
.login h1 { margin: 10px 0 0; color: var(--navy); font-size: 22px; }
.login p.sub { margin: -6px 0 8px; font-size: 14px; }
.login label { display: grid; gap: 6px; font-weight: 700; font-size: 12px; color: var(--navy); text-align: left; }

/* home */
header.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; }
header.top .topmark { font-size: 20px; color: var(--gold); font-weight: 700; letter-spacing: -.02em; }
header.top .brand strong { display: block; font-size: 15px; }
header.top .brand small { display: block; font-size: 9px; letter-spacing: .16em; color: #9fb0c4; font-weight: 700; }
header.top .grow { flex: 1; }
header.top .user-name { color: #cfdced; }
header.top button.ghost { background: rgba(255, 255, 255, .1); color: #fff; }
header.top button.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .18); color: #fff; }
main { max-width: 1040px; margin: 0 auto; padding: 32px 16px 48px; }
.hello { margin: 0 0 4px; font-size: 28px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.lede { margin: 0 0 26px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tile { position: relative; display: grid; gap: 10px; align-content: start; min-height: 190px; padding: 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tile:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--gold), var(--shadow); }
.tile .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: var(--gold); }
.tile h2 { margin: 6px 0 0; font-size: 19px; color: var(--navy); }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile .open { margin-top: auto; color: var(--gold); font-weight: 700; font-size: 14px; }
.light { position: absolute; top: 20px; right: 20px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.light::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.light.up::before { background: var(--good); box-shadow: 0 0 0 3px rgba(47, 125, 79, .18); }
.light.down { color: var(--bad); }
.light.down::before { background: var(--bad); }
.note { margin-top: 22px; }
.empty { padding: 30px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed #cfc7b6; border-radius: 12px; }

/* admin */
.panel { margin-top: 36px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }
.panel h3 { margin: 0 0 4px; font-size: 17px; color: var(--navy); }
.panel h3 + p { margin: 0 0 14px; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tabs button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.form-row { display: grid; grid-template-columns: 1.2fr 1.2fr .8fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.form-row button.primary { font-size: 13px; padding: 10px 16px; min-height: 0; }
.app-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 14px; font-size: 14px; }
.app-checks label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.app-checks input { width: auto; accent-color: var(--gold); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.dim td { opacity: .55; }
td.right { text-align: right; white-space: nowrap; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); }
.pill.admin { background: var(--gold-soft); border-color: var(--gold-soft); color: #6d5525; }
.scroll { overflow-x: auto; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 700px) {
  header.top { padding: 10px 14px; }
  header.top .brand small { display: none; }
  main { padding-top: 22px; }
  .hello { font-size: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .user-name { display: none; }
}
.app-checks.tight { margin: 0; }
