/* Asceniq Command Centre. Brand tokens from asceniq.com: blue #2563EB, tint #EEF3FF, navy #0F172A. */
/* Brand font: see docs/ADMIN-GUIDE.md ("Brand font") to self-host Archivo. Until then the system font is used. */
:root {
  --blue: #2563eb; --blue-ink: #1d4ed8; --tint: #eef3ff; --navy: #0f172a; --ink: #1e293b; --muted: #64748b; --line: #e2e8f0; --bg: #f6f8fc; --card: #fff;
  --good: #15803d; --good-bg: #e8f6ee; --warn: #a16207; --warn-bg: #fdf4dc; --bad: #b91c1c; --bad-bg: #fdecec; --info-bg: #e8effd; --mute-bg: #eef1f5;
  --side: 248px; --radius: 12px;
}
* { box-sizing: border-box; }
html { font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
body { margin: 0; }
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #93b4fb; outline-offset: 2px; border-radius: 6px; }
h1, h2 { color: var(--navy); margin: 0; letter-spacing: -0.01em; }
code { font-size: 0.85em; background: var(--mute-bg); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
small { color: var(--muted); }
.muted { color: var(--muted); } .strong { font-weight: 600; color: var(--navy); } .err { color: var(--bad); font-size: 0.9em; } .overdue { color: var(--bad); font-weight: 600; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 50; }

/* Sidebar */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; transition: width 0.15s, transform 0.2s; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 21px; color: var(--blue); flex: none; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; overflow-y: auto; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; color: #334155; font-weight: 500; }
.nav-item:hover { background: var(--bg); text-decoration: none; }
.nav-item.is-active { background: var(--tint); color: var(--blue-ink); font-weight: 600; }
.ico { width: 20px; height: 20px; flex: none; }
.side-foot { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .nav-label { display: flex; flex-direction: column; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 0.9rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--tint); color: var(--blue-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; color: var(--muted); font-size: 1rem; }
.link-btn { border: 0; background: none; color: var(--blue-ink); cursor: pointer; padding: 0; font: inherit; text-align: left; }
.link-btn:hover { text-decoration: underline; }
html.nav-collapsed { --side: 68px; }
html.nav-collapsed .nav-label, html.nav-collapsed .brand-name { display: none; }
html.nav-collapsed .side-head { flex-direction: column; gap: 10px; padding-inline: 8px; }
html.nav-collapsed .nav-item { justify-content: center; padding-inline: 0; }
html.nav-collapsed .side-collapse { transform: rotate(180deg); }
html.nav-collapsed .side-foot { align-items: center; }

/* Main */
.main { margin-left: var(--side); min-height: 100vh; transition: margin-left 0.15s; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 28px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top h1 { font-size: 1.3rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.menu-btn { display: none; }
main { padding: 22px 28px 60px; max-width: 1280px; }
.section { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 26px 0 10px; font-weight: 700; }
.section .count { background: var(--mute-bg); border-radius: 99px; padding: 1px 8px; margin-left: 4px; color: var(--ink); }
.crumbs { margin: 0 0 12px; color: var(--muted); }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; color: inherit; min-height: 128px; }
a.tile:hover { border-color: #b9ccf7; text-decoration: none; box-shadow: 0 1px 6px rgba(37, 99, 235, 0.08); }
.tile-label { color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.tile-value { font-size: 1.9rem; font-weight: 700; color: var(--navy); line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tile-na { font-size: 1.15rem; color: #94a3b8; font-weight: 600; letter-spacing: 0; }
.tile-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tile-sub { color: var(--muted); font-size: 0.8rem; }

.chip { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.chip-good { background: var(--good-bg); color: var(--good); } .chip-warn { background: var(--warn-bg); color: var(--warn); } .chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-info { background: var(--info-bg); color: var(--blue-ink); } .chip-mute { background: var(--mute-bg); color: #475569; }

/* Panels, bars, tables */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-top: 16px; }
.panel h2 { font-size: 1.02rem; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.lead { font-size: 1.02rem; margin: 0 0 8px; white-space: pre-line; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 6px; }
.bar-note { color: var(--muted); font-size: 0.85rem; }
.segs { display: inline-flex; background: var(--mute-bg); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg { padding: 6px 12px; border-radius: 8px; color: #475569; font-weight: 600; font-size: 0.88rem; }
.seg:hover { text-decoration: none; color: var(--navy); }
.seg.is-on { background: #fff; color: var(--blue-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: #fafbfd; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 600; color: var(--navy); }
.empty { color: var(--muted); background: var(--card); border: 1px dashed #cbd5e1; border-radius: var(--radius); padding: 18px; margin: 8px 0; }
.panel .empty { border: 0; padding: 0; background: none; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.feed li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.feed small { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; } .dot-bad { background: var(--bad); } .dot-warn { background: #d97706; }
.notice { margin: 12px 0; padding: 12px 16px 12px 32px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: #475569; font-size: 0.92rem; }
.notice li + li { margin-top: 6px; }
.notice-box { background: var(--tint); border: 1px solid #d6e2fb; border-radius: var(--radius); padding: 14px 18px; margin: 4px 0 16px; }
.notice-box p { margin: 6px 0 0; color: #334155; }
.detail-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-head .btn { margin-left: auto; }
.kvs { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 24px; }
.kv dt { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.kv dd { margin: 2px 0 0; overflow-wrap: anywhere; }

/* Forms */
input, select, textarea { font: inherit; color: inherit; border: 1px solid #cbd5e1; border-radius: 9px; padding: 8px 11px; background: #fff; width: 100%; min-height: 40px; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 0.86rem; color: #334155; }
.check-label { flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 9px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-top: 8px; }
.grid-form .wide { grid-column: span 2; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input[type="search"] { max-width: 300px; } .filters select { width: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cbd5e1; background: #fff; color: var(--navy); border-radius: 9px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; white-space: nowrap; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; } .btn-primary:hover { background: var(--blue-ink); }
.btn-danger { color: var(--bad); border-color: #f1c4c4; } .btn-block { width: 100%; } .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
details > summary { cursor: pointer; color: var(--blue-ink); font-weight: 600; font-size: 0.88rem; margin-top: 6px; }
.flash { padding: 11px 16px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.flash-good { background: var(--good-bg); color: var(--good); } .flash-bad { background: var(--bad-bg); color: var(--bad); }

/* Tasks */
.tasks { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.task-body { flex: 1; min-width: 0; } .task-title { font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.task.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 0.86rem; margin-top: 4px; }
.task-notes { margin: 6px 0 0; color: #475569; white-space: pre-line; }
.check { width: 28px; height: 28px; border-radius: 8px; border: 2px solid #94a3b8; background: #fff; cursor: pointer; color: #fff; font-weight: 800; flex: none; margin-top: 2px; }
.task.is-done .check { background: var(--good); border-color: var(--good); }

/* Sign-in */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-size: 1.35rem; } .brand-lg { font-size: 1.4rem; }

.scrim { display: none; }
@media (max-width: 880px) {
  .side { transform: translateX(-100%); width: 272px; box-shadow: 0 0 40px rgba(15, 23, 42, 0.25); }
  html.nav-open .side { transform: none; }
  html.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 20; }
  html.nav-collapsed { --side: 248px; } html.nav-collapsed .nav-label, html.nav-collapsed .brand-name { display: revert; }
  html.nav-collapsed .nav-item { justify-content: flex-start; padding-inline: 12px; } html.nav-collapsed .side-head { flex-direction: row; }
  .side-collapse { display: none; } .menu-btn { display: inline-block; }
  .main { margin-left: 0; } .top { padding: 12px 16px; } .top-meta { display: none; } main { padding: 16px 16px 60px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tile { padding: 13px 14px; min-height: 118px; } .tile-value { font-size: 1.55rem; }
  .grid-form .wide { grid-column: auto; } .detail-head .btn { margin-left: 0; }
}
@media (max-width: 420px) { .tiles { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
