:root {
  --ink: #102a2b;
  --ink-soft: #1b4141;
  --paper: #f1efe7;
  --card: #fff;
  --lime: #dfff68;
  --orange: #e7653d;
  --muted: #66736f;
  --line: #d9d6cb;
  --ok: #28704e;
  --danger: #8d3328;
  --shadow: 0 12px 35px rgba(16, 42, 43, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, sans-serif; }
.shell { display: grid; grid-template-columns: 245px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 28px 20px; position: sticky; top: 0; height: 100vh; }
.logo { color: #fff; text-decoration: none; font: 700 22px Georgia, serif; }
.logo b { background: var(--lime); color: var(--ink); padding: 9px 12px; border-radius: 9px; margin-right: 8px; }
.side small { display: block; margin: 42px 12px 12px; color: #93a7a3; letter-spacing: .15em; }
.side nav a { display: block; color: #c9d5d2; text-decoration: none; padding: 12px; border-radius: 8px; margin: 3px; }
.side nav a:hover, .side nav a.active { background: var(--ink-soft); color: #fff; box-shadow: inset 3px 0 var(--lime); }
.side footer { position: absolute; bottom: 25px; color: #89a09b; font-size: 10px; line-height: 1.7; }
.main { padding: 30px 4vw 70px; min-width: 0; }
.top { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .11em; }
.heading { display: flex; justify-content: space-between; align-items: end; margin: 45px 0 25px; gap: 20px; }
.heading h1 { font: 400 clamp(38px, 5vw, 62px)/1 Georgia, serif; margin: 0; }
.heading p { color: var(--muted); max-width: 650px; line-height: 1.5; }
.button { display: inline-block; background: var(--ink); color: #fff; text-decoration: none; border: 0; border-radius: 7px; padding: 12px 17px; font-weight: 700; cursor: pointer; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.metric, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.metric { padding: 20px; }
.metric small { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.metric strong { display: block; font: 400 38px Georgia, serif; margin: 12px 0; }
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.module { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; color: var(--ink); }
.module b { color: var(--orange); font-size: 11px; }
.module h3 { font: 400 24px Georgia, serif; }
.module p { font-size: 13px; color: var(--muted); line-height: 1.45; }
.panel { padding: 22px; margin-bottom: 20px; }
.panel h2 { font: 400 26px Georgia, serif; margin: 0 0 18px; }
.callout { border-left: 4px solid var(--orange); background: #fff4e8; padding: 15px; margin-bottom: 20px; font-size: 13px; line-height: 1.5; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid #ece9df; white-space: nowrap; }
.badge { background: #e6ece8; padding: 5px 9px; border-radius: 99px; font-size: 11px; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; }
input, select, textarea { font: inherit; padding: 11px; border: 1px solid #b8bdb7; border-radius: 6px; }
.actions { grid-column: 1 / -1; }
.notice { background: #ddf0e4; color: var(--ok); padding: 13px; border-radius: 7px; margin-bottom: 18px; }
.notice.error { background: #f8ded8; color: var(--danger); }

@media (max-width: 950px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .modules { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .shell { display: block; }
  .side { height: auto; position: relative; }
  .side nav { display: flex; overflow: auto; }
  .side footer, .side small { display: none; }
  .main { padding: 22px; }
  .metrics, .modules, form { grid-template-columns: 1fr; }
  .heading { display: block; }
}
/* Sign-in, sign-out, and service-state pages (control plane). */
.auth { max-width: 440px; margin: 9vh auto 0; padding: 0 16px; }
.auth h1 { font: 400 32px Georgia, serif; margin: 4px 0 18px; }
.auth form { display: grid; gap: 8px; }
.auth label { font-size: 13px; font-weight: 700; margin-top: 6px; }
.auth .button { margin-top: 14px; }
.auth .eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.auth .note { font-size: 14px; line-height: 1.5; color: var(--ink-soft); }

/* Records (data entry) */
.crumbs { margin: 0 0 6px; font-size: 12px; }
.crumbs a { color: var(--muted); }
form.search { display: flex; gap: 10px; margin-bottom: 16px; }
form.search input { flex: 1; min-width: 0; }
label.wide { grid-column: 1 / -1; }
label small { font-weight: 400; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.notice ul { margin: 8px 0 0; padding-left: 20px; }

/* Project dashboard */
.side nav a.sub { padding: 8px 12px 8px 26px; font-size: 13px; }
dialog.pop { width: min(1180px, 96vw); height: 90vh; padding: 0; border: 0; border-radius: 12px; box-shadow: var(--shadow); background: var(--paper); }
dialog.pop::backdrop { background: rgba(16, 42, 43, .55); }
dialog.pop .pop-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; background: var(--ink); color: #fff; }
dialog.pop .pop-bar a, dialog.pop .pop-bar button { color: #fff; background: none; border: 0; font: inherit; cursor: pointer; }
dialog.pop iframe { width: 100%; height: calc(100% - 46px); border: 0; display: block; }
dialog.pop .pop-body { padding: 22px; overflow: auto; height: calc(100% - 46px); }
dialog.pop fieldset { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; border: 1px solid var(--line); border-radius: 9px; padding: 16px; margin: 0; background: #fff; }
dialog.pop legend { font: 400 20px Georgia, serif; padding: 0 6px; }
td.tree span.kind { margin-left: 8px; }
td.tree .indent { display: inline-block; }
@media (max-width: 700px) { dialog.pop fieldset { grid-template-columns: 1fr; } }

[hidden] { display: none !important; }
.linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; text-decoration: underline; cursor: pointer; }
