/* City of Agents — server riêng (xem claude/city-of-agents-design.md). Màu + font theo đúng 2 bản thiết kế 3D đã
   duyệt (thành phố neon + văn phòng Trading Bot).
   Trang chính (body.city-page): cảnh 3D phủ kín màn hình + HUD nổi + dock dưới đáy + cửa sổ bảng lớn. */
:root {
  /* Tông tím neon của 2 bản thiết kế đã duyệt ("Thành phố neon" + "Văn phòng Trading Bot") */
  --bg: #0b0a24; --surface: #1b1338; --surface-2: #150f2e; --border: #352a66; --border-2: #46388a;
  --fg: #efeaff; --muted: #a69cd0; --dim: #7a70a8;
  --accent: #ff4fd8; --ok: #21c17e; --warn: #f0a500; --down: #ff5a6a; --violet: #b57bff; --teal: #14b8a6;
  --pos: #3fd598; --neg: #ff6b78;
  --glass: rgba(18, 12, 38, .74); --glass-strong: rgba(18, 12, 38, .88);
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Chakra Petch", "Be Vietnam Pro", system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.6 var(--sans);
  padding: 20px 20px 40px;
}
h1 { font-size: 22px; margin: 0 0 4px; }
code { font-family: var(--mono); font-size: .92em; }
.small { font-size: 12px; color: var(--dim); }
.muted { color: var(--muted); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: var(--down); }
.dot--ok { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.dot--warn { background: var(--warn); box-shadow: 0 0 7px var(--warn); }
.dot--down { background: var(--down); box-shadow: 0 0 7px var(--down); }

/* ------------------------------------------------------------------ trang chính: toàn màn hình */
body.city-page {
  padding: 0; height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none;
  background: radial-gradient(120% 90% at 50% 35%, #182254 0%, #0a0f2c 70%);
}
.stage { position: fixed; inset: 0; }
#canvas-wrap { position: absolute; inset: 0; touch-action: none; cursor: grab; }
#canvas-wrap:active { cursor: grabbing; }
#canvas-wrap.hot { cursor: pointer; }
#canvas-wrap:focus { outline: none; }
#canvas-wrap:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
#canvas-wrap canvas { display: block; width: 100%; height: 100%; }

.city-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 96px 20px 180px;
  background-color: #0b1030;
  background-image:
    linear-gradient(rgba(255,79,216,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,79,216,.07) 1px, transparent 1px),
    radial-gradient(70% 60% at 50% 45%, rgba(255,79,216,.08), transparent 70%);
  background-size: 40px 40px, 40px 40px, 100% 100%;
  background-position: center center;
}
.city-fallback[hidden] { display: none; }
.city-fallback__card {
  max-width: 440px; text-align: center; padding: 22px 24px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--border); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.city-fallback__title { font-weight: 650; font-size: 16px; margin-bottom: 6px; }
.city-fallback__text { color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* HUD chung */
.hud { position: fixed; z-index: 10; display: flex; gap: 8px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud--tl { top: calc(14px + var(--safe-t)); left: calc(16px + var(--safe-l)); flex-direction: column; gap: 6px;
  align-items: flex-start; max-width: calc(100vw - 200px); }
.hud--tr { top: calc(14px + var(--safe-t)); right: calc(16px + var(--safe-r)); align-items: center; }
.hud-brand {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 8px 7px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--border); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); pointer-events: none;
}
.hud-brand__name { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
.hud-tag {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: .7px; line-height: 1.6; color: var(--accent);
  background: rgba(255,79,216,.1); border: 1px solid rgba(255,79,216,.35); border-radius: 999px; padding: 2px 10px;
  max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hud-updated { font-size: 11.5px; color: var(--muted); padding-left: 14px; text-shadow: 0 1px 3px #000; pointer-events: none; }
.hud-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; color: var(--fg); background: var(--glass); border: 1px solid var(--border); cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap;
}
.hud-btn:hover { border-color: var(--accent); }
a.hud-btn { text-decoration: none; }
.hud-btn--user { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.hud-btn--danger { color: var(--down); border-color: rgba(255,90,106,.5); }
.hud-btn[hidden] { display: none; }
.logout-form { margin: 0; }

.auth-note {
  position: fixed; z-index: 11; top: calc(66px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  width: min(620px, calc(100vw - 32px)); display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 8px 8px 14px; border-radius: 12px; font-size: 12.5px; line-height: 1.5; color: #f6d48a;
  background: rgba(40, 28, 4, .78); border: 1px solid rgba(240,165,0,.55); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.auth-note[hidden] { display: none; }
.auth-note span { flex: 1; }
.auth-note__close {
  flex: none; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: inherit;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.auth-note__close:hover { background: rgba(240,165,0,.15); }

.hud-hint {
  position: fixed; z-index: 9; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h, 74px) + 10px + var(--safe-b));
  font-size: 11.5px; color: rgba(239,234,255,.75); padding: 4px 12px; border-radius: 999px;
  background: rgba(18,12,38,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  pointer-events: none; white-space: nowrap;
}
.hud-hint[hidden] { display: none; }

/* Dock dưới đáy */
.dock {
  position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b));
  max-width: calc(100vw - 24px); display: flex; gap: 8px; padding: 8px; border-radius: 18px;
  background: var(--glass-strong); border: 1px solid var(--border); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0,0,0,.45);
  overflow-x: auto; scrollbar-width: thin;
}
.dock:empty { display: none; }
.dock-chip {
  display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 16px 8px 13px;
  border-radius: 12px; border: 1px solid var(--border); background: rgba(27,19,56,.85); cursor: pointer;
  white-space: nowrap; font-size: 14px; font-weight: 600; flex: none;
}
.dock-chip:hover { border-color: var(--accent); }
.dock-chip__sub { font-weight: 400; font-size: 12px; color: var(--muted); }
.dock-chip--down .dock-chip__sub { color: var(--down); }
.dock-empty { color: var(--muted); font-size: 13px; padding: 8px 12px; }

.dock--boards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); width: min(1240px, calc(100vw - 24px)); }
.dock-board {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px;
  padding: 9px 12px 9px 14px; border-radius: 12px; text-align: left; cursor: pointer; overflow: hidden;
  border: 1px solid var(--border); background: rgba(27,19,56,.88);
}
.dock-board::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--c, var(--accent)); }
.dock-board:hover { border-color: var(--c, var(--accent)); background: rgba(36,26,72,.95); }
.dock-board__label { font-size: 13px; font-weight: 650; line-height: 1.3; display: flex; align-items: center; gap: 7px; }
.dock-board__label .dot { width: 7px; height: 7px; }
.dock-board__value, .dock-board__sub { line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; font-variant-numeric: tabular-nums; }
.dock-board__value { font-size: 13px; color: var(--fg); opacity: .92; }
.dock-board__sub { font-size: 12px; color: var(--muted); }
.dock-board--off .dock-board__value { color: var(--dim); }
.dock-board--off .dock-board__sub { color: var(--dim); font-style: italic; }

/* Bảng điều khiển dự án (màn thành phố): số dự án đang chạy + danh sách; thay cho dock ở màn này */
.dock.dock--hidden-desktop { display: none; }
.dash {
  position: fixed; z-index: 10; left: calc(16px + var(--safe-l)); top: calc(96px + var(--safe-t));
  width: min(340px, calc(100vw - 32px)); max-height: calc(100vh - 200px); display: flex; flex-direction: column;
  border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0,0,0,.4); overflow: hidden;
}
.dash[hidden] { display: none; }
.dash__head {
  display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 12px 14px; border: 0; background: none;
  cursor: pointer; text-align: left; color: var(--fg);
}
.dash__title { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .6px; text-transform: uppercase; }
.dash__count { font-family: var(--mono); font-size: 13px; color: var(--ok); font-variant-numeric: tabular-nums; }
.dash__chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.dash--closed .dash__chev { transform: rotate(-90deg); }
.dash--closed .dash__list { display: none; }
.dash__list { list-style: none; margin: 0; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.dash__item {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 12px; border: 1px solid var(--border); background: rgba(27,19,56,.7);
  cursor: pointer; text-align: left; color: var(--fg);
}
.dash__item:hover { border-color: var(--cc, var(--accent)); }
.dash__swatch { width: 10px; height: 34px; border-radius: 4px; background: var(--cc, var(--accent)); box-shadow: 0 0 10px var(--cc, var(--accent)); }
.dash__text { display: flex; flex-direction: column; min-width: 0; }
.dash__name { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash__sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash__pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.dash__pill--ok { color: var(--ok); } .dash__pill--warn { color: var(--warn); } .dash__pill--down { color: var(--down); }
.dash__empty { color: var(--muted); font-size: 13px; padding: 6px 8px; }

/* ------------------------------------------------------------------ cửa sổ bảng lớn */
.board-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; }
.board-modal[hidden] { display: none; }
.board-modal__backdrop { position: absolute; inset: 0; background: rgba(8,5,20,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.board-modal__dialog {
  position: relative; width: min(1200px, 96vw); max-height: min(90vh, 90dvh); height: min(90vh, 90dvh);
  display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #1b1338 0%, #140e2c 100%); border: 1px solid var(--border-2);
  box-shadow: 0 30px 90px rgba(0,0,0,.6), 0 0 0 1px rgba(255,79,216,.06) inset;
  animation: modal-in .18s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.board-modal__head {
  display: flex; align-items: flex-start; gap: 16px; padding: 20px 20px 16px 28px;
  border-bottom: 1px solid var(--border); border-top: 3px solid var(--c, var(--accent));
}
.board-modal__titles { flex: 1; min-width: 0; }
.board-modal__title { margin: 0; font-family: var(--display); font-size: 28px; line-height: 1.25; font-weight: 700; letter-spacing: -.2px; }
.board-modal__meta { margin-top: 4px; font-size: 14px; color: var(--muted); }
.board-modal__close {
  flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  font-size: 26px; line-height: 1; cursor: pointer; color: var(--fg);
}
.board-modal__close:hover { border-color: var(--accent); }
.board-modal__body { flex: 1; overflow: auto; padding: 22px 28px 32px; font-size: 16px; line-height: 1.55; overscroll-behavior: contain; }
.board-modal__body:focus-visible { outline-offset: -3px; }

.bv-section { margin-top: 28px; }
.bv-section:first-child { margin-top: 0; }
.bv-h { margin: 0 0 12px; font-size: 14px; font-weight: 650; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.bv-note { color: var(--muted); font-size: 14.5px; margin: 10px 0 0; }
.bv-msg {
  padding: 28px 24px; border-radius: 14px; border: 1px dashed var(--border-2); color: var(--muted); font-size: 17px;
  text-align: center; background: rgba(27,19,56,.5);
}
.bv-msg--warn { color: var(--warn); border-color: rgba(240,165,0,.4); }

.bv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.bv-tile { padding: 14px 16px 15px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.bv-tile__label { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.bv-tile__value { margin-top: 4px; font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere; }
.bv-tile__value--text { font-size: 22px; line-height: 1.3; padding-top: 3px; }
.bv-tile__value small { font-size: 16px; font-weight: 500; color: var(--muted); }
.bv-tile__sub { margin-top: 3px; font-size: 13px; color: var(--dim); }

.bv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.bv-chip {
  min-height: 38px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 14.5px; color: var(--muted);
}
.bv-chip:hover { border-color: var(--accent); color: var(--fg); }
.bv-chip[aria-pressed="true"] { background: rgba(255,79,216,.14); border-color: var(--accent); color: var(--fg); font-weight: 600; }

.bv-table-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.bv-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.bv-table th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 600; font-size: 13px; color: var(--muted);
  background: #1e1640; padding: 11px 12px; border-bottom: 1px solid var(--border-2); white-space: nowrap;
}
.bv-table td { padding: 11px 12px; border-bottom: 1px solid rgba(53,42,102,.7); white-space: nowrap; vertical-align: middle; }
.bv-table tr:last-child td { border-bottom: 0; }
.bv-table tbody tr.is-hl td { background: rgba(20,184,166,.18); }
.bv-table tbody tr.is-hl td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.bv-table tbody tr:hover td { background: rgba(255,79,216,.04); }
.bv-table .num { text-align: right; }
.bv-table td.wrap { white-space: normal; min-width: 220px; max-width: 420px; }
.bv-table .sym { font-weight: 700; }
.bv-table .cell-note { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }

.pos { color: var(--pos); } .neg { color: var(--neg); } .zero { color: var(--muted); } .warn-text { color: var(--warn); }
.bv-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.5;
  border: 1px solid var(--border-2); color: var(--muted); white-space: nowrap;
}
.bv-badge--ok { color: var(--ok); border-color: rgba(33,193,126,.45); background: rgba(33,193,126,.08); }
.bv-badge--warn { color: var(--warn); border-color: rgba(240,165,0,.45); background: rgba(240,165,0,.08); }
.bv-badge--down { color: var(--neg); border-color: rgba(255,90,106,.45); background: rgba(255,90,106,.08); }
.bv-badge--info { color: var(--accent); border-color: rgba(255,79,216,.4); background: rgba(255,79,216,.08); }

.bv-progress { display: grid; gap: 14px; }
.bv-prog__top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.bv-prog__name { font-weight: 650; font-size: 16px; }
.bv-prog__val { color: var(--muted); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.bv-bar { margin-top: 6px; height: 10px; border-radius: 999px; background: #241a48; overflow: hidden; }
.bv-bar__fill { height: 100%; border-radius: inherit; background: var(--accent); }
.bv-bar__fill--done { background: var(--ok); }

.bv-events { display: grid; gap: 10px; }
.bv-event {
  display: grid; grid-template-columns: 130px 64px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
}
.bv-event__time { font-weight: 700; font-variant-numeric: tabular-nums; }
.bv-event__cc { font-family: var(--mono); color: var(--muted); font-size: 14px; }
.bv-event__name { font-weight: 550; min-width: 0; }
.bv-event > .bv-badge { justify-self: start; }

.bv-room { padding: 26px 28px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--c, var(--accent)); max-width: 760px; }
.bv-room__role { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 650; }
.bv-room__value { margin-top: 10px; font-size: 52px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bv-room__status { margin-top: 10px; font-size: 18px; color: var(--fg); }
.bv-room__caption { margin-top: 8px; font-size: 16px; color: var(--muted); line-height: 1.6; }
.bv-room__job { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 14px; color: var(--dim); }

/* điện thoại */
@media (max-width: 759px) {
  .hud--tl { left: calc(10px + var(--safe-l)); top: calc(10px + var(--safe-t)); max-width: calc(100vw - 150px); }
  .hud--tr { right: calc(10px + var(--safe-r)); top: calc(10px + var(--safe-t)); flex-direction: column; align-items: flex-end; gap: 6px; }
  .hud-brand { padding: 6px 8px 6px 12px; gap: 6px; border-radius: 14px; }
  .hud-brand__name { font-size: 14px; }
  .hud-tag { max-width: calc(100vw - 170px); }
  .hud-btn { min-height: 34px; padding: 5px 12px; font-size: 12.5px; }
  .auth-note { top: auto; bottom: calc(var(--dock-h, 74px) + 22px + var(--safe-b)); font-size: 12px; }
  .hud-hint { display: none; }
  .dock { bottom: calc(10px + var(--safe-b)); left: 10px; right: 10px; transform: none; max-width: none; justify-content: flex-start; }
  .dash { top: auto; bottom: calc(10px + var(--safe-b)); left: 10px; right: 10px; width: auto; max-height: 46vh; }
  .dock:not(.dock--boards) > :first-child { margin-left: auto; }
  .dock:not(.dock--boards) > :last-child { margin-right: auto; }
  .dock--boards { width: auto; grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; gap: 6px; padding: 6px; }
  .dock-board { min-height: 0; padding: 7px 9px 7px 12px; gap: 1px; }
  .dock-board::before { top: 8px; bottom: 8px; }
  .dock-board__label { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
  .dock-board__label .dot { display: none; }
  .dock-board__value { font-size: 12px; }
  .dock-board__sub { display: none; }
  .board-modal { padding: 0; }
  .board-modal__dialog { width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
  .board-modal__head { padding: calc(14px + var(--safe-t)) 12px 12px 18px; }
  .board-modal__title { font-size: 21px; }
  .board-modal__meta { font-size: 13px; }
  .board-modal__body { padding: 16px 14px calc(28px + var(--safe-b)); font-size: 15px; }
  .bv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bv-tile { padding: 11px 12px; }
  .bv-tile__value { font-size: 22px; }
  .bv-tile__value--text { font-size: 18px; }
  .bv-table { font-size: 14px; }
  .bv-table th, .bv-table td { padding: 9px 10px; }
  .bv-table-wrap { max-height: none; }
  .bv-event { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .bv-event__name { grid-column: 1 / -1; }
  .bv-event__cc { justify-self: end; }
  .bv-room { padding: 18px; }
  .bv-room__value { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ đăng nhập / chưa đặt mật khẩu */
.auth-card { max-width: 420px; margin: 48px auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.auth-input { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font: inherit; }
.auth-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-btn { background: var(--accent); color: #1a0616; border: 0; border-radius: 8px; padding: 10px 12px;
  font: 600 14px/1.2 var(--sans); cursor: pointer; }
.auth-error { color: var(--down); margin: 8px 0; }
.auth-pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow-x: auto;
  font: 12.5px/1.5 var(--mono); white-space: pre; }

/* ------------------------------------------------------------------ trang thường (đăng nhập / quản trị / tài khoản) */
body.page-plain { padding: 24px 16px 48px; background: radial-gradient(120% 90% at 50% 0%, #182254 0%, #0b0a24 70%); min-height: 100vh; }
.auth-title { font-family: var(--display); font-size: 26px; margin: 6px 0 6px; }
.auth-card label, .adm label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.link { color: var(--accent); text-decoration: none; font-size: 13.5px; }
.link:hover { text-decoration: underline; }
.flash { padding: 10px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; }
.flash--ok { color: #bff3da; background: rgba(33,193,126,.12); border: 1px solid rgba(33,193,126,.45); }
.flash--err { color: #ffd0d5; background: rgba(255,90,106,.12); border: 1px solid rgba(255,90,106,.5); }
.adm { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.adm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.adm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.adm-h { font-family: var(--display); font-size: 18px; margin: 0 0 12px; }
.adm-form { display: flex; flex-direction: column; gap: 12px; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.adm-fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px 12px; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.adm-fieldset legend { padding: 0 6px; color: var(--muted); font-size: 13px; }
.adm .adm-check { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); font-size: 14px; }
.adm-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--sw); box-shadow: 0 0 6px var(--sw); }
.adm-fieldset .small { flex-basis: 100%; margin: 0; }
.adm-user { border-top: 1px solid var(--border); padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.adm-user__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-user__name { font-family: var(--mono); font-weight: 600; font-size: 15px; }
.adm-user--off .adm-user__name { color: var(--dim); text-decoration: line-through; }
.adm-act summary { cursor: pointer; color: var(--accent); font-size: 13.5px; }
.adm-act form { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 4px; max-width: 520px; }
.adm-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.adm-del { display: flex; gap: 8px; align-items: center; margin: 0; }
.adm-del .auth-input { width: 190px; padding: 7px 10px; }
.adm .logout-form, .adm-row form { margin: 0; }
select.auth-input { appearance: auto; }
