/* Giao diện chung cho trang tài khoản và quản trị */
:root {
  --bg: #EEF3F1; --surface: #FFFFFF; --ink: #10231C; --muted: #4F645C; --line: #CBD8D2;
  --accent: #0A6B58; --accent-ink: #FFFFFF; --warm: #A85A05; --warn-bg: #FFF3E0; --ok-bg: #E2F4EC; --bad: #B3261E; --bad-bg: #FCE8E6; --info-bg: #E6EEF9; --info: #1F4E99;
  --display: "Bricolage Grotesque", "Be Vietnam Pro", system-ui, sans-serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1815; --surface: #16241F; --ink: #E6F0EC; --muted: #9DB3AA; --line: #2B3F37;
    --accent: #3FBF9F; --accent-ink: #07201A; --warm: #F0A04B; --warn-bg: #2B2012; --ok-bg: #12302A; --bad: #F2B8B5; --bad-bg: #3A1D1B; --info-bg: #17263D; --info: #A8C7FA;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15.5px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.topbar { background: var(--ink); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 19px; color: #fff; text-decoration: none; }
.brand b { color: #5fd9b8; }
.topbar .who { display: flex; gap: 12px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.topbar a, .topbar button.link { color: #cfe9e1; }
.demo-banner { background: var(--warn-bg); color: var(--ink); font-size: 14px; }
.demo-banner .wrap { padding-top: 8px; padding-bottom: 8px; }
.label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.btn { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0; padding: 10px 18px; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.small { padding: 6px 12px; font-size: 14px; }
button.link { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.side { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
@media (max-width: 860px) { .cols-3, .cols-2, .side { grid-template-columns: minmax(0, 1fr); } }
main { padding-block: 24px 64px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13.5px; font-weight: 600; }
.field input, .field textarea, .field select { font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 6px; padding: 9px 11px; width: 100%; }
.field textarea { min-height: 80px; resize: vertical; }
.form { display: grid; gap: 12px; }
.msg { padding: 10px 12px; border-radius: 6px; font-size: 14.5px; }
.msg.ok { background: var(--ok-bg); } .msg.bad { background: var(--bad-bg); color: var(--bad); } .msg.warn { background: var(--warn-bg); }
.pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.st-new { background: var(--info-bg); color: var(--info); }
.st-doing { background: var(--warn-bg); color: var(--warm); }
.st-review { background: var(--warn-bg); color: var(--warm); border: 1px dashed var(--warm); }
.st-done { background: var(--ok-bg); color: var(--accent); }
.st-fix { background: var(--bad-bg); color: var(--bad); }
.stat b { display: block; font-family: var(--display); font-size: 30px; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: 13.5px; color: var(--muted); }
.meter { height: 8px; background: var(--bg); border-radius: 8px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { font: inherit; font-weight: 600; background: none; border: 0; padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.item .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .quote { border-left: 3px solid var(--line); padding-left: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.day { font-weight: 700; font-size: 14px; color: var(--muted); margin-top: 8px; }
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1.5px dashed var(--line); border-radius: 8px; }
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 640px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
tr.sel td { background: var(--ok-bg); }
tr.click { cursor: pointer; }
.auth { max-width: 420px; margin: 40px auto; }
.mono { font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

/* Các bảng làm việc và điều khiển dùng chung */
.topbar { background: #122b24; }
.topbar .who { overflow-wrap: anywhere; min-width: 0; }
.card { border-radius: 14px; box-shadow: 0 8px 22px rgb(13 42 32 / 5%); }
.item { border-radius: 12px; }
.tabs { gap: 6px; }
.tab, .btn, .field select { min-height: 44px; }
.tab[aria-selected="true"] { background: var(--ok-bg); }
.toolbar { display:flex; gap:12px; align-items:end; flex-wrap:wrap; margin: 0 0 14px; }
.toolbar .field { flex:1 1 180px; }
.view-head { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; margin: 0 0 18px; }
.work-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
@media (max-width: 540px) {
  .card { padding:15px; }
  .tab { flex: 1 1 42%; padding-inline: 6px; }
  .topbar .who { gap: 8px; }
}
