:root {
  --ink: #071d24; --ink-2: #0d2d37; --ink-3: #15404d;
  --lime: #b4e717; --lime-d: #9bc90f;
  --bg: #f3f6f6; --card: #fff; --line: #e3e9ea; --text: #0b2229; --muted: #6a7f86;
  --red: #c62828; --amber: #b7791f; --green: #1b7a3a;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 18px; background: var(--ink); color: #fff; padding: 0 20px; height: 56px; position: sticky; top: 0; z-index: 20; }
.brand { text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--lime); color: var(--ink); font-weight: 800; }
.logo.big { width: 48px; height: 48px; font-size: 22px; margin-bottom: 10px; }
.mainnav { display: flex; gap: 4px; }
.mainnav a { color: #cfe0e4; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.mainnav a:hover { background: var(--ink-2); color: #fff; }
.mainnav a.on { background: var(--ink-2); color: var(--lime); }
.spacer { flex: 1; }
.search { position: relative; width: 320px; }
.search input { width: 100%; background: var(--ink-2); border: 1px solid var(--ink-3); color: #fff; border-radius: 999px; padding: 8px 16px; }
.search input::placeholder { color: #8fa8af; }
#search-results { position: absolute; top: 44px; left: 0; right: 0; background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.25); overflow: hidden; }
#search-results a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; text-decoration: none; border-bottom: 1px solid var(--line); }
#search-results a:hover, #search-results a.sel { background: #f1f7e2; }
#search-results .none { padding: 12px 14px; color: var(--muted); }
.userbox { display: flex; align-items: center; gap: 10px; margin: 0; color: #cfe0e4; }
.linkbtn { background: none; border: 0; color: var(--lime); cursor: pointer; font: inherit; font-weight: 600; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid transparent; border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.lime { background: var(--lime); color: var(--ink); } .btn.lime:hover { background: var(--lime-d); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); } .btn.ghost:hover { border-color: var(--ink); }
.btn.red { background: var(--red); color: #fff; }
.btn.sm { padding: 6px 14px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 8px; }
.ib { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; font-size: 13px; }
.ib:hover { background: var(--ink-3); } .ib.red { background: #fde8e8; color: var(--red); } .ib.red:hover { background: var(--red); color: #fff; }
.ib.sm { height: 24px; font-size: 12px; background: var(--bg); color: var(--text); border: 1px solid var(--line); }

/* subnav */
.subnav { display: flex; gap: 2px; background: var(--ink-2); padding: 0 20px; overflow-x: auto; }
.subnav a { color: #cfe0e4; text-decoration: none; padding: 13px 18px; white-space: nowrap; font-weight: 500; border-bottom: 3px solid transparent; }
.subnav a:hover { color: #fff; background: var(--ink-3); }
.subnav a.on { color: var(--lime); border-bottom-color: var(--lime); font-weight: 700; }

/* layout: full width */
.page { padding: 24px 20px 60px; width: 100%; }
.cust-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; padding: 24px 20px 60px; align-items: start; }
.side { display: grid; gap: 16px; }
@media (max-width: 900px) { .cust-layout { grid-template-columns: 1fr; } .search { width: 200px; } }

.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(7,29,36,.04); }
.card { overflow: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #fff; padding: 12px 16px; font-weight: 700; }
.card-h .ib { background: var(--ink-3); color: var(--lime); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); } .kv b { font-weight: 600; word-break: break-word; }
.panel { padding: 20px; }
.panel.center { max-width: 520px; margin: 60px auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.table-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.table-tools input, .chips input, .inline input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
.data th { text-align: left; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .03em; padding: 10px 12px; white-space: nowrap; }
.data th:first-child { border-top-left-radius: 8px; } .data th:last-child { border-top-right-radius: 8px; }
.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.data tbody tr:hover { background: #f7faf0; }
.data td.empty { text-align: center; color: var(--muted); padding: 28px; white-space: normal; }
.data td.act, .data th.act { text-align: right; } .data td.act { display: flex; gap: 6px; justify-content: flex-end; }
.data td.act form { margin: 0; }
.data td.old { color: var(--red); } .data td.new { color: var(--green); font-weight: 600; }
tr.clickable { cursor: pointer; }
.secret code { letter-spacing: 1px; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; background: #e8eef0; color: var(--ink); }
.b-live, .b-on, .b-complete, .b-yes, .b-created { background: #dff3e4; color: var(--green); }
.b-quote, .b-pending, .b-updated { background: #fff1d6; color: var(--amber); }
.b-development { background: var(--lime); color: var(--ink); }
.b-off, .b-no, .b-lost, .b-deleted { background: #fde8e8; color: var(--red); }
.card-h .badge { margin-left: 8px; }

/* dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.stat span { color: var(--muted); display: block; } .stat b { font-size: 30px; letter-spacing: -.02em; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 20px; }
.age { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #e8eef0; font-weight: 700; font-size: 12px; }
.age.warm { background: #fff1d6; color: var(--amber); } .age.hot { background: #fde8e8; color: var(--red); }
.legend { margin: 14px 0 0; display: flex; gap: 8px; }

/* chips */
.chips { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.chip { padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; font-weight: 600; }
.chip.on { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.chips .grow { margin-left: auto; }

/* forms */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid.g3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.fld { display: grid; gap: 5px; } .fld.wide { grid-column: 1 / -1; }
.fld > span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fld input, .fld select, .fld textarea { width: 100%; border: 1px solid #cdd8da; border-radius: 8px; padding: 9px 11px; font: inherit; background: #fff; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .table-tools input:focus, .inline input:focus { outline: 2px solid var(--lime); border-color: var(--ink); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-panel { margin-bottom: 20px; }
.panel.danger { border-color: #f1c4c4; margin-top: 20px; display: grid; gap: 10px; }
.inline { display: flex; gap: 8px; align-items: center; margin: 0; }
.add-row { margin-bottom: 16px; }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidetabs { display: grid; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.sidetabs a { padding: 10px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.sidetabs a:hover { background: var(--bg); } .sidetabs a.on { background: var(--ink); color: var(--lime); }

dialog { border: 0; border-radius: 16px; padding: 24px; width: min(720px, 94vw); box-shadow: 0 24px 64px rgba(7,29,36,.35); }
dialog::backdrop { background: rgba(7,29,36,.55); }
#dlg-title { margin-bottom: 16px; }

.flash { padding: 12px 20px; font-weight: 600; background: #fff1d6; color: var(--amber); }
.flash.err { background: #fde8e8; color: var(--red); }

.login-wrap { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; display: grid; gap: 14px; box-shadow: 0 12px 40px rgba(7,29,36,.08); }

/* ---- v2 ---- */
.pill { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: 11px; font-weight: 800; text-align: center; }
.hint { margin: -8px 0 14px; color: var(--muted); font-size: 13px; max-width: 900px; }
.data td.wrap { white-space: normal; min-width: 240px; max-width: 520px; }
.data td.act form { margin: 0; }
.ib.txt { padding: 0 10px; font-weight: 600; background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.ib.txt:hover { background: #fff; border-color: var(--ink); }
.ib.txt.ok { background: #dff3e4; color: var(--green); border-color: #bfe3c9; }
.ib.txt.ok:hover { background: var(--green); color: #fff; }
tr.dim td { opacity: .55; } tr.dim td.act { opacity: 1; }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.pinned td:first-child { box-shadow: inset 3px 0 0 var(--lime); }
.chip .n { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: #e8eef0; font-size: 12px; }
.chip.on .n { background: var(--ink-3); color: #fff; }
.chip.alert .n { background: #fde8e8; color: var(--red); }
button.chip { font: inherit; cursor: pointer; }
.chips select, .table-tools select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; background: #fff; }

.b-open { background: #e1effa; color: #1d5f94; }
.b-high { background: #fde8e8; color: var(--red); } .b-normal { background: #e8eef0; } .b-low { background: #f0f2f3; color: var(--muted); }
.b-done, .b-resolved { background: #dff3e4; color: var(--green); }
.b-cancelled, .b-archived { background: #eceff0; color: var(--muted); }
.b-pinned { background: var(--lime); color: var(--ink); }
.b-ionos { background: #e1effa; color: #1d5f94; font-size: 11px; }
a.dnslink { font-weight: 700; text-decoration: underline; text-decoration-color: var(--lime); text-underline-offset: 3px; }

.notice { padding: 14px 18px; border-radius: var(--radius); background: #fff1d6; color: #7a5313; margin-bottom: 16px; }
.notice.err { background: #fde8e8; color: var(--red); }
.zone-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
code.val { font-size: 12px; word-break: break-all; }

/* Server board */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; align-items: start; }
.col { background: #e9eff0; border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; }
.col > header { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; }
.col .count { background: var(--ink); color: var(--lime); border-radius: 999px; padding: 1px 10px; font-weight: 700; font-size: 12px; }
.col.unassigned { background: #fff1d6; } .col.extra { background: #fde8e8; }
.col .note, .empty-col { margin: 0; padding: 0 4px; color: var(--muted); font-size: 13px; }
.dcard { display: grid; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; }
.dcard:hover { border-color: var(--ink); box-shadow: 0 2px 8px rgba(7,29,36,.08); }
.dcard .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* Audit */
.stat b.good, .score.good { color: var(--green); } .stat b.mid, .score.mid { color: var(--amber); } .stat b.bad, .score.bad { color: var(--red); }
.score { font-weight: 800; font-size: 16px; }
.errcell { color: var(--red); }
tr.detail > td { background: #f7faf0; padding: 12px 20px; }
table.mini { width: 100%; border-collapse: collapse; }
.mini th { background: none; color: var(--muted); padding: 4px 10px; font-size: 11px; text-transform: uppercase; }
.mini td { padding: 5px 10px; border-bottom: 1px solid var(--line); }
details.how { margin-top: 14px; color: var(--muted); }
details.how summary { cursor: pointer; font-weight: 600; }
.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---- v2 layout fixes ---- */
.data td.act { display: table-cell; text-align: right; white-space: normal; min-width: 150px; max-width: 300px; }
.data td.act > * { display: inline-block; vertical-align: middle; margin: 2px 0 2px 4px; }
.data td.act form { display: inline-block; }
.data th.act { text-align: right; }
.two-col .data td.wrap { min-width: 110px; max-width: 220px; }
.two-col .data td, .two-col .data th { padding: 10px 9px; }
.two-col .data td.act { min-width: 0; }

/* ---- streams ---- */
.data .num, .data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data tfoot td { padding: 12px; border-top: 2px solid var(--ink); background: #f7faf0; white-space: nowrap; }
.share { height: 4px; border-radius: 4px; background: #e8eef0; margin-top: 6px; max-width: 260px; overflow: hidden; }
.share i { display: block; height: 100%; background: var(--lime); border-radius: 4px; }
tr.dim-row td { background: #fafbfb; }
.stat b.muted-num { color: var(--muted); }
.siteinfo{margin:0 0 .6rem;line-height:1.9}
.fld[hidden] { display: none; }
.fld .chk { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.fld .chk input { width: auto; }

/* Apps */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.app-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.app-top { background: var(--brand); color: var(--brand-ink); padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.app-top a { color: inherit; opacity: .8; font-size: 13px; text-decoration: none; }
.app-top a:hover { opacity: 1; text-decoration: underline; }
.app-top h2 { margin: 0 0 2px; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.app-logo { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: #fff; padding: 4px; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.app-logo.ph { display: grid; place-items: center; font-size: 26px; font-weight: 800; color: var(--brand); }
.app-body { padding: 18px 20px 6px; flex: 1; }
.app-num { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.app-lbl { color: var(--muted); margin-top: 4px; }
.app-delta { margin-top: 10px; font-weight: 700; color: #1b7a3a; } .app-delta span { color: var(--muted); font-weight: 400; }
.app-err { font-size: 13px; color: #b32d2e; }
.app-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 20px 14px; font-size: 12px; }
.app-links { display: flex; gap: 4px; align-items: center; } .app-links form { margin: 0; }
.app-foot .ib { white-space: nowrap; }
.app-foot > .muted { min-width: 0; }
.b-green { background: #dff3e4; color: var(--green); } .b-amber { background: #fff1d6; color: var(--amber); } .b-red { background: #fde8e8; color: var(--red); }
.b-emailed { background: #e1effa; color: #1d5f94; }

/* Pulse / chase */
.dev-panel { margin-bottom: 20px; }
.dev-table tr.stale > td:first-child { box-shadow: inset 4px 0 0 #e0a100; }
.dev-table tr.stale { background: #fffaf0; }
.stale-count { color: var(--amber); }
.pulse-cell { max-width: 420px; } .pulse-note { color: var(--ink-2, #34505a); }
.qa { white-space: nowrap; } .qa .ib { margin-left: 4px; }
.ib.lime { background: var(--lime); color: var(--ink); font-weight: 700; }
.rag-pick { display: flex; gap: 8px; margin: 4px 0 14px; }
.rag { flex: 1; } .rag input { position: absolute; opacity: 0; }
.rag span { display: block; text-align: center; padding: 9px 0; border-radius: 10px; border: 2px solid var(--line); font-weight: 700; cursor: pointer; }
.rag-green input:checked + span { background: #dff3e4; border-color: #2e9a52; color: var(--green); }
.rag-amber input:checked + span { background: #fff1d6; border-color: #e0a100; color: var(--amber); }
.rag-red input:checked + span { background: #fde8e8; border-color: #d23b3b; color: var(--red); }
.rag input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.chase-msg { padding: 10px 14px; border-radius: 8px; font-weight: 600; } .chase-msg.ok { background: #dff3e4; color: var(--green); } .chase-msg.err { background: #fde8e8; color: var(--red); }
dialog textarea { width: 100%; border: 1px solid #cdd8da; border-radius: 8px; padding: 9px 11px; font: inherit; background: #fff; }

.sidetabs a.sep { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.tpl-form textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.tpl-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0 14px; }
.tpl-chips .chip { padding: 3px 10px; font: 12px ui-monospace, Menlo, monospace; cursor: pointer; }
.tpl-preview { background: #f6f9fa; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.tpl-preview pre { white-space: pre-wrap; font: inherit; margin: 8px 0 0; }
.flash.ok { background: #dff3e4; color: var(--green); }
