/* MIDU OS — giao diện liquid glass kiểu macOS. Màu định nghĩa bằng token, có chế độ sáng/tối riêng. */

:root {
  color-scheme: light;
  --wall:
    radial-gradient(1200px 820px at -5% -10%, #bcd6ff 0%, rgba(188, 214, 255, 0) 60%),
    radial-gradient(1000px 760px at 105% -5%, #ffd9ee 0%, rgba(255, 217, 238, 0) 58%),
    radial-gradient(1100px 900px at 70% 115%, #c9f1e4 0%, rgba(201, 241, 228, 0) 60%),
    radial-gradient(900px 700px at 10% 110%, #fff1cc 0%, rgba(255, 241, 204, 0) 55%),
    #eef1f7;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(250, 250, 252, 0.86);
  --panel: rgba(255, 255, 255, 0.7);
  --panel-solid: #f8f9fc;
  --card: rgba(255, 255, 255, 0.96);
  --col-bg: rgba(255, 255, 255, 0.42);
  --edge: rgba(255, 255, 255, 0.85);
  --hair: rgba(0, 0, 0, 0.08);
  --hair-2: rgba(0, 0, 0, 0.13);
  --text: #1c1c1e;
  --text-2: #48484a;
  --text-3: #8e8e93;
  --accent: #0a7aff;
  --accent-2: #0063d1;
  --accent-soft: rgba(10, 122, 255, 0.12);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.07);
  --fill-3: rgba(118, 118, 128, 0.2);
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --good-soft: rgba(12, 163, 12, 0.12);
  --warn-soft: rgba(250, 178, 25, 0.18);
  --crit-soft: rgba(208, 59, 59, 0.12);
  --sh-1: 0 1px 2px rgba(16, 24, 40, 0.06);
  --sh-2: 0 2px 6px rgba(16, 24, 40, 0.05), 0 12px 32px rgba(16, 24, 40, 0.08);
  --sh-pop: 0 30px 80px rgba(16, 24, 40, 0.25), 0 4px 12px rgba(16, 24, 40, 0.1);
  --r-xl: 22px;
  --r-lg: 16px;
  --r: 12px;
  --r-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --wall:
      radial-gradient(1200px 820px at -5% -10%, rgba(52, 86, 180, 0.55) 0%, transparent 60%),
      radial-gradient(1000px 760px at 105% -5%, rgba(140, 52, 120, 0.42) 0%, transparent 58%),
      radial-gradient(1100px 900px at 70% 115%, rgba(20, 110, 95, 0.38) 0%, transparent 60%),
      #0c0d12;
    --glass: rgba(30, 31, 38, 0.55);
    --glass-strong: rgba(32, 33, 40, 0.9);
    --panel: rgba(30, 31, 38, 0.66);
    --panel-solid: #1d1e25;
    --card: rgba(48, 49, 58, 0.95);
    --col-bg: rgba(255, 255, 255, 0.04);
    --edge: rgba(255, 255, 255, 0.08);
    --hair: rgba(255, 255, 255, 0.09);
    --hair-2: rgba(255, 255, 255, 0.15);
    --text: #f5f5f7;
    --text-2: #c7c7cc;
    --text-3: #8e8e93;
    --accent: #3b95ff;
    --accent-2: #0a84ff;
    --accent-soft: rgba(59, 149, 255, 0.2);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.14);
    --fill-3: rgba(118, 118, 128, 0.34);
    --good-soft: rgba(12, 163, 12, 0.2);
    --warn-soft: rgba(250, 178, 25, 0.2);
    --crit-soft: rgba(208, 59, 59, 0.24);
    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --sh-2: 0 2px 6px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.35);
    --sh-pop: 0 30px 80px rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --wall:
    radial-gradient(1200px 820px at -5% -10%, rgba(52, 86, 180, 0.55) 0%, transparent 60%),
    radial-gradient(1000px 760px at 105% -5%, rgba(140, 52, 120, 0.42) 0%, transparent 58%),
    radial-gradient(1100px 900px at 70% 115%, rgba(20, 110, 95, 0.38) 0%, transparent 60%),
    #0c0d12;
  --glass: rgba(30, 31, 38, 0.55);
  --glass-strong: rgba(32, 33, 40, 0.9);
  --panel: rgba(30, 31, 38, 0.66);
  --panel-solid: #1d1e25;
  --card: rgba(48, 49, 58, 0.95);
  --col-bg: rgba(255, 255, 255, 0.04);
  --edge: rgba(255, 255, 255, 0.08);
  --hair: rgba(255, 255, 255, 0.09);
  --hair-2: rgba(255, 255, 255, 0.15);
  --text: #f5f5f7;
  --text-2: #c7c7cc;
  --text-3: #8e8e93;
  --accent: #3b95ff;
  --accent-2: #0a84ff;
  --accent-soft: rgba(59, 149, 255, 0.2);
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.14);
  --fill-3: rgba(118, 118, 128, 0.34);
  --good-soft: rgba(12, 163, 12, 0.2);
  --warn-soft: rgba(250, 178, 25, 0.2);
  --crit-soft: rgba(208, 59, 59, 0.24);
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --sh-2: 0 2px 6px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.35);
  --sh-pop: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* ------------------------------------------------------------------ nền */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--wall);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em; background: var(--fill); padding: 1px 5px; border-radius: 5px; }
kbd { font-family: var(--font); font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 5px; border: 1px solid var(--hair-2); border-bottom-width: 2px; color: var(--text-3); background: var(--fill-2); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--fill-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.ic { width: 16px; height: 16px; flex: none; }
.glass {
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--edge);
  box-shadow: 0 0 0 0.5px var(--hair), var(--sh-2);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 0.5px var(--hair), var(--sh-1);
}

/* ------------------------------------------------------------- bố cục */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 12px; padding: 12px; height: 100vh; }
.sidebar { border-radius: var(--r-xl); padding: 14px 10px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 12px; }
.toolbar { border-radius: 18px; height: 54px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 16px; }
.content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; border-radius: var(--r-xl); }
#view { min-height: 100%; }
.page { padding: 6px 6px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1600px; }

.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #4aa3ff, #5b4cf0); color: #fff; display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 12px rgba(74,110,240,.35); }
.logo svg { width: 20px; height: 20px; }
.sb-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.sb-sub { font-size: 11.5px; color: var(--text-3); }
.sb-capture { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 36px; border-radius: 10px; background: var(--fill-2); border: 1px solid var(--hair); color: var(--text-3); cursor: text; }
.sb-capture input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 13px; color: var(--text); }
.sb-capture:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); }
.sb-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.sb-foot { display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--hair); padding-top: 8px; }
.nav-group { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 12px 10px 4px; }
.nav-add { border: 0; background: transparent; color: var(--text-3); cursor: pointer; border-radius: 6px; width: 22px; height: 22px; display: grid; place-items: center; }
.nav-add:hover { background: var(--fill); color: var(--text); }
.nav-item { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 9px; color: var(--text); font-size: 13.5px; border: 0; background: transparent; cursor: pointer; text-align: left; width: 100%; }
.nav-item:hover { background: var(--fill-2); text-decoration: none; }
.nav-item.on { background: var(--fill); font-weight: 600; }
.nav-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .ni { width: 17px; height: 17px; color: var(--tone, var(--text-2)); }
.nav-count { flex: none !important; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.pdot { width: 10px; height: 10px; border-radius: 3px; flex: none; margin: 0 3px; }

.icon-btn.tb-menu { display: none; } /* ghép .icon-btn: luật .icon-btn ở dưới cùng độ ưu tiên từng đè làm nút hiện trên máy tính */
.tb-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; min-width: 0; }
.tb-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-search { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--fill-2); border: 1px solid var(--hair); color: var(--text-3); width: 260px; cursor: text; }
.tb-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 13px; color: var(--text); }
.tb-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); }
.tb-right { display: flex; align-items: center; gap: 8px; }

/* tones */
.tone-orange { --tone: #ff9500; } .tone-blue { --tone: #007aff; } .tone-violet { --tone: #af52de; } .tone-teal { --tone: #30b0c7; }
.tone-red { --tone: #ff3b30; } .tone-yellow { --tone: #f5b800; } .tone-green { --tone: #34c759; } .tone-pink { --tone: #ff2d55; }
.tone-purple { --tone: #8e5cf2; } .tone-cyan { --tone: #32ade6; } .tone-magenta { --tone: #d6338a; } .tone-brown { --tone: #a2845e; }
.tone-indigo { --tone: #5856d6; } .tone-accent { --tone: var(--accent); }

/* --------------------------------------------------------------- điều khiển */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--hair-2); background: var(--card); color: var(--text); font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap; box-shadow: var(--sh-1); text-decoration: none; }
.btn:hover { background: var(--panel-solid); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #2a8cff, var(--accent)); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 8px rgba(10,122,255,.3); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary kbd { color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.35); background: transparent; }
.btn.glass { background: var(--fill-2); border-color: var(--hair); box-shadow: none; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--fill); }
.btn.danger { color: var(--crit); }
.btn.danger-solid { background: var(--crit); color: #fff; border-color: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--fill); color: var(--text); }
.link-btn { border: 0; background: transparent; color: var(--accent); font-size: 12.5px; cursor: pointer; padding: 4px 2px; text-align: left; }
.link-btn.right { margin-left: auto; }
.input { width: 100%; height: 36px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--hair-2); background: var(--card); outline: none; font-size: 13.5px; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.lg { height: 44px; font-size: 16px; font-weight: 500; }
.input.sm { height: 30px; font-size: 12.5px; width: auto; }
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--hair-2); background: var(--card); font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.fchip i { width: 8px; height: 8px; border-radius: 50%; }
.fchip.on { background: var(--accent-soft); border-color: transparent; color: var(--text); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--fill); color: var(--text-2); font-size: 11.5px; font-weight: 500; white-space: nowrap; max-width: 100%; }
.chip .ic { width: 12px; height: 12px; }
.chip.tone-crit { background: var(--crit-soft); color: var(--text); } .chip.tone-crit .ic { color: var(--crit); }
.chip.tone-warn { background: var(--warn-soft); color: var(--text); } .chip.tone-warn .ic { color: #c98500; }
.chip.tone-good { background: var(--good-soft); color: var(--text); } .chip.tone-good .ic { color: var(--good); }
.chip.tone-accent { background: var(--accent-soft); color: var(--text); } .chip.tone-accent .ic { color: var(--accent); }
.chip.st { background: var(--fill-2); color: var(--text); }
.tone-ic-good { color: var(--good); } .tone-ic-warn { color: #c98500; } .tone-ic-crit { color: var(--crit); } .tone-ic-accent { color: var(--accent); } .tone-ic-serious { color: var(--serious); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; background: var(--text-3); }
.dot-good { background: var(--good); } .dot-warn { background: var(--warn); } .dot-crit { background: var(--crit); } .dot-accent { background: var(--accent); } .dot-neutral { background: var(--text-3); }
.ptag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); max-width: 150px; min-width: 0; }
.ptag i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.ptag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--fill-3); border-radius: 99px; cursor: pointer; transition: background .15s; }
.switch span::after { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(16px); }

.muted { color: var(--text-3); }
.small { font-size: 12px; }
.txt-crit { color: var(--crit); }
.sp { flex: 1; }
.ph { color: var(--text-3); }
.count { font-size: 12px; color: var(--text-3); font-weight: 500; margin-left: 6px; }
.empty-sm { padding: 10px 4px; color: var(--text-3); font-size: 13px; }
.footnote { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.footnote.small { font-size: 11.5px; margin-top: 6px; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r); font-size: 13.5px; }
.notice.warn { background: var(--warn-soft); } .notice.warn .ic { color: #c98500; }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); background: var(--fill-2); padding: 9px 11px; border-radius: 10px; }
.hint .ic { margin-top: 2px; color: var(--text-3); }
.hint.warn { background: var(--warn-soft); margin-top: 6px; } .hint.warn .ic { color: #c98500; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--fill-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
.spin.sm { width: 12px; height: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; flex: none; }
.pulse.sm { width: 7px; height: 7px; }
.pulse.good { background: var(--good); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(10,122,255,.55); } 70% { box-shadow: 0 0 0 8px rgba(10,122,255,0); } 100% { box-shadow: 0 0 0 0 rgba(10,122,255,0); } }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 24px; color: var(--text-2); }
.empty-state > .ic { width: 34px; height: 34px; color: var(--text-3); }
.empty-state.slim { padding: 22px; }
.empty-title { font-weight: 600; font-size: 15px; color: var(--text); }
.empty-state p { max-width: 460px; }

/* ----------------------------------------------------------- đầu trang */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 4px 0; }
.head-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.head-ic { width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 78%, white), var(--tone)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 16px color-mix(in srgb, var(--tone) 32%, transparent); }
.head-ic .ic { width: 24px; height: 24px; }
.page-head h1, .hero h1, .proj-head h1 { font-size: 28px; line-height: 1.15; font-weight: 700; }
.sub { color: var(--text-2); margin-top: 4px; max-width: 760px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-row, .filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.count-note { font-size: 12.5px; color: var(--text-3); }
.section-title { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 17px; padding: 6px 4px 0; }
.section-title .ic { align-self: center; color: var(--text-3); }
.section-title .muted { font-weight: 400; font-size: 12.5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border: 0; background: transparent; color: var(--text-2); font-size: 13.5px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

/* ------------------------------------------------------------- thẻ việc */
.card { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; background: var(--card); border-radius: 12px; box-shadow: 0 0 0 1px var(--hair), var(--sh-1); cursor: pointer; transition: box-shadow .12s, transform .12s; }
.card:hover { box-shadow: 0 0 0 1px var(--hair-2), var(--sh-2); }
.card.dragging { opacity: .4; }
.card.is-p1 { box-shadow: inset 3px 0 0 var(--crit), 0 0 0 1px var(--hair), var(--sh-1); }
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 500; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.card.is-done .card-title { text-decoration: line-through; color: var(--text-3); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.card.compact { padding: 9px 10px; }
.card.compact .card-title { font-size: 13px; }
.check { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--hair-2); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.check .ic { width: 12px; height: 12px; }
.check:hover { border-color: var(--good); color: var(--good); }
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.card-tools { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.card:hover .card-tools, .card-tools.always { opacity: 1; }
.tool { width: 26px; height: 26px; border-radius: 7px; border: 0; background: var(--fill-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.tool .ic { width: 14px; height: 14px; }
.tool:hover { background: var(--fill); color: var(--text); }
.tool.on { background: var(--good-soft); color: var(--good); }
.tool.add { background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------------- hôm nay */
.day-progress { display: flex; align-items: center; gap: 12px; }
.day-progress .meter { flex: 1; }
.day-progress-num { font-weight: 600; font-size: 13px; color: var(--text-2); width: 40px; text-align: right; }
.meter { height: 8px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #4aa3ff, var(--accent)); border-radius: 99px; }
.meter.lg { height: 12px; }
.meter.sm { height: 6px; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.bands { display: flex; flex-direction: column; gap: 14px; }
.band { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r-lg); box-shadow: 0 0 0 .5px var(--hair), var(--sh-1); padding: 14px 16px; transition: background .12s, box-shadow .12s; }
.band.drop-over { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.band-orange { --tone: #ff9500; } .band-blue { --tone: #007aff; } .band-violet { --tone: #8e5cf2; }
.band-head { display: flex; align-items: center; gap: 12px; }
.band-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 75%, white), var(--tone)); flex: none; }
.band-ic .ic { width: 19px; height: 19px; }
.band-titles { flex: 1; min-width: 0; }
.band-title { font-weight: 700; font-size: 16px; display: flex; align-items: baseline; gap: 10px; }
.band-time { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.band-hint { font-size: 12.5px; color: var(--text-2); }
.cap { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.cap-dots { display: flex; gap: 4px; }
.cap-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--fill-3); }
.cap-dots i.on { background: var(--accent); }
.cap-dots i.x { background: var(--warn); }
.cap.over { color: var(--text); }
.band-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.empty-drop { grid-column: 1 / -1; min-height: 58px; border: 1.5px dashed var(--hair-2); border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-3); font-size: 13px; }
.rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; }
.rail-panel { padding: 14px; display: flex; flex-direction: column; gap: 8px; transition: background .12s; }
.rail-panel.drop-over { background: var(--accent-soft); }
.rail-title { font-weight: 700; font-size: 15px; }
.rail-sub { font-size: 12px; color: var(--text-3); }
.rail-group { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.rail-gtitle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.rail-gtitle .ic { width: 14px; height: 14px; color: var(--text-3); }
.notice-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); color: var(--text); font-size: 13px; }
.notice-link span { flex: 1; }
.notice-link:hover { text-decoration: none; filter: brightness(.98); }
.wait-row { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 0; background: var(--fill-2); padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.wait-row:hover { background: var(--fill); }
.wait-title { font-size: 13px; font-weight: 500; }
.wait-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wait-who { font-size: 12px; color: var(--text-2); }

/* ------------------------------------------------------------------ bảng */
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.col { flex: 1 0 250px; max-width: 340px; background: var(--col-bg); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 0 0 .5px var(--hair); transition: background .12s; }
.col.drop-over { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; font-weight: 600; font-size: 13.5px; }
.col-name { flex: 0 1 auto; }
.col-dot { width: 9px; height: 9px; border-radius: 50%; }
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.col-empty { font-size: 12.5px; color: var(--text-3); text-align: center; padding: 14px 0; border: 1.5px dashed var(--hair); border-radius: 10px; }
.col-add-btn { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-3); padding: 7px 6px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.col-add-btn:hover { background: var(--fill-2); color: var(--text); }
.col-add-input { width: 100%; height: 36px; border-radius: 9px; border: 1px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); padding: 0 10px; outline: none; }

/* ------------------------------------------------------------- ý tưởng */
.capture-big { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; }
.capture-big > .ic { color: #f5b800; width: 20px; height: 20px; }
.capture-big .bare { flex: 1; border: 0; background: transparent; outline: none; font-size: 16px; height: 40px; }
.list-panel { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.lp-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.lp-head .ic { color: var(--text-3); }
.lp-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-top: 1px solid var(--hair); font-size: 13.5px; }
.lp-row.as-btn { border-left: 0; border-right: 0; border-bottom: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; }
.lp-row.as-btn:hover { background: var(--fill-2); }
.lp-id { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--text-3); flex: none; width: 48px; }
.lp-text { flex: 1; min-width: 0; }
.idea-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-top: 1px solid var(--hair); }
.idea-main { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.idea-main:hover { background: var(--fill-2); }
.idea-title { font-weight: 500; }
.idea-time { font-size: 12px; color: var(--text-3); }

/* ------------------------------------------------------------- timeline */
.tl-wrap { padding: 0; overflow: hidden; }
.tl-scroll { overflow: auto; max-height: calc(100vh - 260px); }
.tl-inner { position: relative; }
.tl-head { position: sticky; top: 0; z-index: 4; display: flex; background: var(--panel-solid); border-bottom: 1px solid var(--hair); }
.tl-corner { position: sticky; left: 0; z-index: 5; width: 260px; flex: none; padding: 10px 14px; font-size: 12px; color: var(--text-3); background: var(--panel-solid); border-right: 1px solid var(--hair); display: flex; align-items: flex-end; }
.tl-scale { flex: none; }
.tl-months { display: flex; height: 26px; }
.tl-month { flex: none; border-left: 1px solid var(--hair); font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; overflow: hidden; }
.tl-month span { padding: 0 8px; white-space: nowrap; }
.tl-days { display: flex; height: 26px; }
.tl-day { flex: none; text-align: center; font-size: 11px; color: var(--text-3); line-height: 26px; white-space: nowrap; overflow: hidden; }
.tl-day small { margin-right: 2px; font-size: 10px; }
.tl-day.is-today { background: var(--accent); color: #fff; border-radius: 6px; font-weight: 700; }
.tl-body { position: relative; }
.tl-grid { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 0; }
.tl-we { position: absolute; top: 0; bottom: 0; background: var(--fill-2); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); opacity: .7; }
.tl-row { display: flex; height: 38px; position: relative; z-index: 1; }
.tl-row.tl-group { height: 34px; }
.tl-row.tl-group .tl-label { background: color-mix(in srgb, var(--panel-solid) 92%, var(--text)); font-size: 13px; }
.tl-label { position: sticky; left: 0; z-index: 2; width: 260px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--panel-solid); border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); font-size: 13px; overflow: hidden; white-space: nowrap; }
.tl-label span { overflow: hidden; text-overflow: ellipsis; }
.tl-label.sub { padding-left: 28px; cursor: pointer; }
.tl-label.sub:hover { color: var(--accent); }
.tl-label.sub .ic { width: 14px; height: 14px; color: var(--text-3); }
.tl-label.done span { text-decoration: line-through; color: var(--text-3); }
.tl-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tl-track { position: relative; flex: none; border-bottom: 1px solid var(--hair); }
.tl-bar { position: absolute; top: 7px; height: 24px; border-radius: 7px; background: color-mix(in srgb, var(--c) 20%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); color: var(--text); font-size: 12px; font-weight: 500; display: flex; align-items: center; padding: 0 10px 0 12px; cursor: grab; overflow: hidden; white-space: nowrap; box-shadow: var(--sh-1); user-select: none; touch-action: none; }
.tl-bar::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.tl-bar-label { overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; pointer-events: none; }
.tl-bar-label .ic { width: 12px; height: 12px; }
.tl-bar.short { overflow: visible; }
.tl-bar.short .tl-bar-label { position: absolute; left: calc(100% + 8px); color: var(--text-2); overflow: visible; }
.tl-bar.kind-camp { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 24%, var(--card)) 0 6px, color-mix(in srgb, var(--c) 10%, var(--card)) 6px 12px); }
.tl-bar.kind-exp { border-style: dashed; }
.tl-bar.done { opacity: .5; }
.tl-bar.overdue { border-color: var(--crit); box-shadow: 0 0 0 1px var(--crit); }
.tl-bar.dragging { cursor: grabbing; box-shadow: var(--sh-2); z-index: 3; }
.tl-handle { position: absolute; right: 0; top: 0; bottom: 0; width: 9px; cursor: ew-resize; }
.tl-ms { position: absolute; top: 9px; width: 20px; height: 20px; color: var(--c); cursor: grab; touch-action: none; }
.tl-ms .ic { width: 20px; height: 20px; fill: color-mix(in srgb, var(--c) 35%, transparent); }
.tl-ms.overdue { color: var(--crit); }
.tl-ms-label { position: absolute; top: 10px; font-size: 12px; color: var(--text-2); white-space: nowrap; pointer-events: none; }
.tl-empty { display: flex; align-items: center; gap: 8px; padding: 30px; color: var(--text-3); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--text-2); padding: 0 4px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg .ic { width: 14px; height: 14px; color: var(--text-3); }
.lg-bar { width: 22px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 20%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.lg-bar.camp { background: repeating-linear-gradient(135deg, var(--fill-3) 0 4px, transparent 4px 8px); border-color: var(--text-3); }
.lg-bar.exp { border-style: dashed; border-color: var(--text-3); background: transparent; }
.lg-bar.overdue { border-color: var(--crit); background: var(--crit-soft); }

/* ----------------------------------------------------------------- lịch */
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-title { font-size: 18px; font-weight: 700; min-width: 150px; text-align: center; }
.cal { padding: 0; overflow: hidden; }
.cal-wd { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--hair); }
.cal-wd div { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(120px, auto); }
.cal-cell { border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background .1s; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: var(--fill-2); }
.cal-cell.out .cal-num { color: var(--text-3); }
.cal-cell.drop-over { background: var(--accent-soft); }
.cal-top { display: flex; align-items: center; justify-content: space-between; }
.cal-num { font-size: 12.5px; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-cell.today .cal-num { background: var(--accent); color: #fff; }
.cal-add { opacity: 0; width: 22px; height: 22px; border-radius: 6px; border: 0; background: var(--fill); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.cal-add .ic { width: 13px; height: 13px; }
.cal-cell:hover .cal-add { opacity: 1; }
.cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-item { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 6px; border-radius: 6px; background: var(--card); box-shadow: 0 0 0 1px var(--hair); cursor: pointer; min-width: 0; }
.cal-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-item i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cal-item .ptg { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .01em; }
.cal-item .knd { flex: none; font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .02em; padding: 1px 5px; border-radius: 4px; background: var(--fill-3); color: var(--text-2); }
.cal-item.camp .knd { background: transparent; box-shadow: 0 0 0 1px var(--hair); }
.cal-item .ic { width: 12px; height: 12px; color: var(--text-3); }
.cal-item .ic.ok { color: var(--good); }
.cal-item.done span { text-decoration: line-through; color: var(--text-3); }
.cal-item.overdue { box-shadow: 0 0 0 1px color-mix(in srgb, var(--crit) 60%, transparent); }
.cal-item.plan { background: var(--accent-soft); box-shadow: none; color: var(--text-2); }
.cal-item.camp { background: transparent; box-shadow: none; color: var(--text-2); }
.cal-item.loose { display: inline-flex; max-width: 280px; }
.cal-loose { padding: 10px 12px; margin-bottom: 10px; }
.cal-loose-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.cal-loose-head .ic { width: 15px; height: 15px; color: var(--text-3); }
.cal-loose-head .btn { margin-left: auto; }
.cal-loose-items { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-loose-items .cal-item.loose { max-width: 360px; }
.cal-item .knd.late { background: color-mix(in srgb, var(--crit) 14%, transparent); color: var(--crit); }
.cal-more { border: 0; background: transparent; color: var(--accent); font-size: 12px; text-align: left; padding: 2px 6px; cursor: pointer; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chb { font-size: 9.5px; font-weight: 700; letter-spacing: .02em; padding: 1px 5px; border-radius: 4px; background: var(--fill-3); color: var(--text-2); flex: none; }

/* ----------------------------------------------------------------- sheet */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r-lg); box-shadow: 0 0 0 .5px var(--hair), var(--sh-1); padding: 13px 15px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile.clickable { cursor: pointer; }
.tile.clickable:hover { box-shadow: 0 0 0 .5px var(--hair-2), var(--sh-2); }
.tile-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.tile-label .ic { width: 15px; height: 15px; color: var(--text-3); }
.tile-label .ic[class*="tone-ic-"] { color: inherit; }
.tile-label .tone-ic-good { color: var(--good); } .tile-label .tone-ic-warn { color: #c98500; } .tile-label .tone-ic-crit { color: var(--crit); }
.tile-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-panel { padding: 0; overflow: hidden; }
.sheet-scroll { overflow: auto; }
.sheet { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.sheet th { position: sticky; top: 0; background: var(--panel-solid); text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); padding: 9px 10px; border-bottom: 1px solid var(--hair-2); white-space: nowrap; z-index: 1; }
.sheet td { padding: 0 10px; height: 40px; border-bottom: 1px solid var(--hair); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.sheet tbody tr:hover td { background: var(--fill-2); }
.sheet td.cell { cursor: text; }
.sheet td.t-select, .sheet td.t-project, .sheet td.t-check { cursor: pointer; }
.sheet td.primary { font-weight: 600; }
.sheet td.editing { padding: 0 4px; }
.c-num { width: 46px; text-align: center; color: var(--text-3); font-size: 12px; position: relative; }
.row-open { display: none; width: 26px; height: 26px; border-radius: 7px; border: 0; background: var(--accent-soft); color: var(--accent); cursor: pointer; place-items: center; margin: auto; }
.row-open .ic { width: 13px; height: 13px; }
tr:hover .row-open { display: grid; }
tr:hover .c-num .n { display: none; }
.cell-input { width: 100%; height: 32px; border-radius: 7px; border: 1px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); padding: 0 8px; outline: none; }
.cell-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.cbox { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--hair-2); display: inline-grid; place-items: center; vertical-align: middle; }
.cbox.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cbox .ic { width: 12px; height: 12px; }
.pbar { display: inline-flex; align-items: center; gap: 8px; width: 100%; }
.pbar-track { flex: 1; height: 6px; background: var(--fill); border-radius: 99px; overflow: hidden; min-width: 50px; }
.pbar-fill { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.pbar.over .pbar-fill { background: var(--warn); }
.pbar-num { font-size: 12px; color: var(--text-2); min-width: 36px; text-align: right; }
.score { display: inline-block; min-width: 30px; text-align: center; font-weight: 700; font-size: 12.5px; padding: 2px 7px; border-radius: 7px; background: var(--accent-soft); }
.add-row { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-3); padding: 11px 14px; cursor: pointer; font-size: 13px; text-align: left; }
.add-row:hover { background: var(--fill-2); color: var(--text); }
.rec-card { flex-direction: column; gap: 0; }
.card-field { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.card-field em { font-style: normal; color: var(--text-3); }
.card-field .pbar { width: 120px; }
.computed { font-weight: 600; }
.checkin-form { display: grid; grid-template-columns: 140px 110px 1fr auto; gap: 8px; }
.checkins { display: flex; flex-direction: column; margin-top: 8px; }
.ci-row { display: grid; grid-template-columns: 100px 90px 1fr; gap: 10px; padding: 7px 4px; border-top: 1px solid var(--hair); font-size: 13px; }

/* --------------------------------------------------------- khung chi tiết */
.drawer-bg { position: fixed; inset: 0; background: rgba(15, 20, 30, .14); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(560px, calc(100vw - 24px)); z-index: 31; display: flex; flex-direction: column; border-radius: var(--r-xl); background: var(--glass-strong); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border: 1px solid var(--edge); box-shadow: var(--sh-pop); transform: translateX(calc(100% + 24px)); transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--hair); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); min-width: 0; }
.crumbs .sep { color: var(--text-3); }
.drawer-tools { display: flex; align-items: center; gap: 4px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px 30px; }
.drawer-empty { display: flex; gap: 8px; align-items: center; padding: 30px; color: var(--text-2); }
.title-input { width: 100%; border: 0; background: transparent; outline: none; resize: none; font-size: 22px; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; overflow: hidden; padding: 0; }
.props { display: flex; flex-direction: column; gap: 4px; margin: 16px 0 6px; }
.prop { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 36px; }
.prop-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.prop-label .ic { width: 15px; height: 15px; color: var(--text-3); }
.prop-value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.prop-input { height: 32px; border-radius: 8px; border: 1px solid transparent; background: var(--fill-2); padding: 0 9px; outline: none; font-size: 13.5px; max-width: 100%; }
.prop-input:hover { background: var(--fill); }
.prop-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); }
.prop-input.wide { flex: 1; min-width: 160px; }
.hint-inline { font-size: 12px; color: var(--text-3); }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 16px 0 6px; }
.field-label .ic { width: 14px; height: 14px; color: var(--text-3); }
.field { width: 100%; border-radius: 10px; border: 1px solid var(--hair-2); background: var(--card); padding: 9px 11px; outline: none; resize: none; line-height: 1.5; overflow: hidden; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.need { border-color: color-mix(in srgb, var(--warn) 70%, transparent); background: color-mix(in srgb, var(--warn-soft) 50%, var(--card)); }
.meta-foot { margin-top: 18px; font-size: 12px; color: var(--text-3); }

/* ----------------------------------------------------- modal, menu, toast */
.modal-root.open { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 20, 30, .28); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: var(--r-xl); background: var(--glass-strong); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border: 1px solid var(--edge); box-shadow: var(--sh-pop); animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 20px; }
.modal-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.modal-title .ic { color: var(--accent); }
.modal-body { padding: 8px 20px 16px; overflow-y: auto; }
.modal-body > .muted { margin-bottom: 12px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--hair); }
.foot-note { margin-right: auto; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--card) inset; }
.menu { position: fixed; z-index: 60; min-width: 200px; max-width: 320px; max-height: 360px; overflow-y: auto; padding: 5px; border-radius: 12px; background: var(--glass-strong); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border: 1px solid var(--edge); box-shadow: var(--sh-pop); }
.menu-item { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 13.5px; text-align: left; }
.menu-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover { background: var(--accent); color: #fff; }
.menu-item:hover .ic { color: #fff; }
.menu-check { color: var(--accent); }
.menu-sep { height: 1px; background: var(--hair); margin: 4px 0; }
.menu-head { font-size: 11.5px; color: var(--text-3); padding: 6px 9px 2px; }
.toast-root { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 14px; background: rgba(30, 30, 34, .9); color: #fff; font-size: 13.5px; box-shadow: var(--sh-pop); backdrop-filter: blur(20px); animation: pop .2s; transition: opacity .3s, transform .3s; }
.toast .ic { color: #8fc2ff; }
.toast-good .ic { color: #5fd35f; }
.toast-error .ic { color: #ff7b7b; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-btn { border: 0; background: rgba(255, 255, 255, .16); color: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-weight: 600; font-size: 12.5px; }
.palette-root.open { position: fixed; inset: 0; z-index: 80; }
.pal-backdrop { position: absolute; inset: 0; background: rgba(15, 20, 30, .22); display: flex; justify-content: center; padding-top: 12vh; }
.palette { width: min(640px, calc(100vw - 32px)); max-height: 62vh; display: flex; flex-direction: column; border-radius: 18px; background: var(--glass-strong); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); border: 1px solid var(--edge); box-shadow: var(--sh-pop); overflow: hidden; animation: pop .15s; }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--hair); color: var(--text-3); }
.pal-input .ic { width: 19px; height: 19px; }
.pal-input input { flex: 1; height: 54px; border: 0; background: transparent; outline: none; font-size: 17px; color: var(--text); }
.pal-list { overflow-y: auto; padding: 6px; }
.pal-group { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 8px 10px 4px; }
.pal-item { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 14px; text-align: left; }
.pal-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .ic { color: var(--text-3); }
.pal-item.on { background: var(--accent); color: #fff; }
.pal-item.on .ic { color: #fff; }
.pal-foot { display: flex; gap: 14px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--hair); font-size: 11.5px; color: var(--text-3); }
.timer-pill, .agent-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 12px; border-radius: 99px; border: 1px solid var(--hair); background: var(--card); cursor: pointer; font-size: 12.5px; box-shadow: var(--sh-1); }
.agent-pill { padding-right: 12px; }
.tp-clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.tp-title { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.tp-stop { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--crit-soft); color: var(--crit); }
.tp-stop .ic { width: 12px; height: 12px; }

/* ------------------------------------------------------------------ agent */
.agent-page { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; height: calc(100vh - 92px); padding-bottom: 0; max-width: none; }
.runs-pane { display: flex; flex-direction: column; min-height: 0; padding: 12px 8px; }
.pane-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 8px; }
.pane-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.runs-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pane-foot { padding: 8px 8px 0; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--hair); }
.run-item { display: flex; align-items: flex-start; gap: 10px; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; cursor: pointer; text-align: left; width: 100%; }
.run-item:hover { background: var(--fill-2); }
.run-item.on { background: var(--accent-soft); }
.run-st { width: 16px; height: 18px; display: grid; place-items: center; flex: none; }
.run-st .ic { width: 15px; height: 15px; }
.muted-ic { color: var(--text-3); }
.run-txt { display: flex; flex-direction: column; min-width: 0; }
.run-name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-sub { font-size: 12px; color: var(--text-3); }
.agent-main { min-width: 0; min-height: 0; overflow-y: auto; }
.agent-home { display: flex; flex-direction: column; gap: 18px; padding-bottom: 30px; }
.launch { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.launch-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.launch-title .ic { color: var(--accent); width: 20px; height: 20px; }
.launch-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
label.inline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.cat-group { display: flex; flex-direction: column; gap: 8px; }
.cat-title { font-weight: 700; font-size: 14px; padding-left: 2px; }
.cat-grid, .qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.qa-grid.one { grid-template-columns: 1fr; }
.cat-card { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--edge); background: var(--panel); box-shadow: 0 0 0 .5px var(--hair), var(--sh-1); cursor: pointer; }
.cat-card:hover { box-shadow: 0 0 0 .5px var(--hair-2), var(--sh-2); background: var(--card); }
.cat-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cat-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cat-label { font-weight: 600; font-size: 13.5px; }
.cat-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.all-skills { padding: 12px 16px; }
.all-skills summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.all-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px; margin-top: 10px; }
.all-row { display: flex; flex-direction: column; text-align: left; border: 0; background: transparent; padding: 8px; border-radius: 9px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.all-row b { color: var(--text); font-size: 13px; }
.all-row:hover { background: var(--fill-2); }
.run-wrap { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }
.run-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; flex: none; }
.run-title-wrap { flex: 1; min-width: 0; }
.run-title { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; font-size: 12.5px; }
.run-meta .muted { display: inline-flex; align-items: center; gap: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.running { background: var(--accent-soft); }
.pill.attn { background: var(--warn-soft); }
.pill.attn .ic { width: 13px; height: 13px; color: #c98500; }
.run-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.run-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.run-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 4px 12px; }
.run-side { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-height: 0; }
.side-box { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.msg { display: flex; gap: 10px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: linear-gradient(180deg, #2a8cff, var(--accent)); color: #fff; border-radius: 16px 16px 4px 16px; max-width: 78%; padding: 10px 14px; white-space: pre-wrap; }
.msg.agent .bubble { background: var(--card); border-radius: 4px 16px 16px 16px; padding: 12px 16px; box-shadow: 0 0 0 1px var(--hair), var(--sh-1); max-width: 100%; min-width: 0; overflow-x: auto; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4aa3ff, #5b4cf0); }
.avatar .ic { width: 15px; height: 15px; }
.msg.sub { align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); padding-left: 40px; }
.msg.err { align-items: center; gap: 8px; background: var(--crit-soft); padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.msg.err .ic { color: var(--crit); }
.steps { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; margin-left: 40px; border-radius: 12px; background: var(--fill-2); }
.steps-toggle { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 2px 0 4px; }
.steps-more { font-size: 12px; color: var(--text-3); padding: 0 0 2px 24px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); min-height: 24px; }
.step.nested { padding-left: 22px; }
.step-st { width: 16px; display: grid; place-items: center; flex: none; }
.step.ok .step-st .ic { width: 13px; height: 13px; color: var(--good); }
.step.err .step-st .ic { width: 14px; height: 14px; color: var(--crit); }
.step-ic { width: 14px; height: 14px; color: var(--text-3); }
.step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.pending .step-label { color: var(--text); font-weight: 500; }
.result-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); padding-left: 40px; flex-wrap: wrap; }
.result-line .ic { color: var(--good); width: 15px; height: 15px; }
.result-line.err .ic { color: var(--crit); }
.thinking { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-left: 40px; border-radius: 12px; background: var(--accent-soft); font-size: 13px; font-weight: 500; }
.run-wait { display: flex; align-items: center; gap: 10px; padding: 30px; color: var(--text-2); }
.composer { padding: 10px 12px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.composer.attn { box-shadow: 0 0 0 2px var(--warn), var(--sh-2); }
.composer-hint { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.composer-hint .ic { width: 14px; height: 14px; }
.composer-row { display: flex; align-items: flex-end; gap: 10px; }
.composer-row textarea { flex: 1; border: 1px solid var(--hair-2); border-radius: 12px; background: var(--card); padding: 9px 12px; outline: none; resize: none; max-height: 200px; line-height: 1.45; }
.composer-row textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.todo { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text-2); padding: 3px 0; }
.todo .ic { width: 14px; height: 14px; color: var(--good); margin-top: 2px; }
.todo .spin { margin-top: 2px; }
.todo.completed span { text-decoration: line-through; color: var(--text-3); }
.todo.in_progress { color: var(--text); font-weight: 500; }
.todo-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--hair-2); margin: 3px 2px 0; flex: none; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--hair); }
.file-row > .ic { color: var(--text-3); }
.file-path { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; font-weight: 500; overflow: hidden; }
.file-path small { font-size: 11px; color: var(--text-3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kvs { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.kvs div { display: flex; justify-content: space-between; gap: 10px; }
.kvs span { color: var(--text-3); }
.resume-hint { font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.resume-hint code { font-size: 11px; word-break: break-all; }

/* ------------------------------------------------------------- tổng quan */
.hero { padding: 20px 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.home-top { display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(0, 2fr); gap: 14px; align-items: stretch; }
.home-top .tiles-5 { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); align-content: start; }
.north { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.north.empty { cursor: default; }
.north-top { display: flex; align-items: center; justify-content: space-between; }
.north-title { font-weight: 700; font-size: 17px; }
.north-nums { display: flex; align-items: baseline; gap: 8px; }
.north-nums .big { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.north-nums .of { color: var(--text-2); font-size: 15px; }
.north-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.north-metric { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.proj-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: box-shadow .12s; }
.proj-card:hover { box-shadow: 0 0 0 .5px var(--hair-2), var(--sh-2); }
.pc-top { display: flex; align-items: center; gap: 12px; }
.pc-badge, .ph-badge { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.pc-names { flex: 1; min-width: 0; }
.pc-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-stage { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-next { display: flex; flex-direction: column; gap: 3px; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--fill-2); }
.pc-next .lbl { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.pc-next .txt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-foot { display: flex; flex-direction: column; gap: 8px; }
.pc-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.ag-day { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--hair); }
.ag-date { font-size: 12.5px; font-weight: 600; color: var(--text-2); padding-top: 5px; }
.ag-date.today { color: var(--accent); }
.ag-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-item { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; text-align: left; padding: 5px 6px; border-radius: 8px; cursor: pointer; min-width: 0; font-size: 13px; }
.ag-item:hover { background: var(--fill-2); }
.ag-item > .ic { color: var(--text-3); width: 14px; height: 14px; }
.ag-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf-block { padding: 8px 0; border-top: 1px solid var(--hair); }
.perf-title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.perf-title .ic { width: 14px; height: 14px; color: var(--text-3); }
.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini { display: flex; flex-direction: column; }
.mini-label { font-size: 12px; color: var(--text-3); }
.mini-value { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.mini-sub { font-size: 11.5px; color: var(--text-2); }
.bars { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.bar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 90px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-track { height: 12px; background: var(--fill-2); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; }
.bar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bars-total { font-size: 12px; color: var(--text-3); text-align: right; }

/* ----------------------------------------------------------- buồng lái */
.proj-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; flex-wrap: wrap; }
.ph-badge { width: 54px; height: 54px; border-radius: 15px; font-size: 18px; }
.ph-main { flex: 1; min-width: 240px; }
.ph-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kv { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.kv-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.kv-label .ic { width: 14px; height: 14px; }
.kv-body { max-height: 210px; overflow-y: auto; font-size: 13.5px; }
.kv.bottleneck .kv-label .ic { color: var(--crit); }
.kv.next .kv-label .ic { color: var(--accent); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.two-col.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.state-full { padding: 14px 16px; }
.state-full summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.docs-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; align-items: start; }
.docs-list { padding: 10px; max-height: calc(100vh - 300px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.docs-gtitle { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 4px 6px; }
.docs-gtitle .ic { width: 13px; height: 13px; }
.doc-item { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; text-align: left; }
.doc-item span:not(.new-dot) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item .ic { width: 14px; height: 14px; color: var(--text-3); }
.doc-item:hover { background: var(--fill-2); }
.doc-item.on { background: var(--accent-soft); font-weight: 600; }
.new-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.docs-view { padding: 18px 26px; max-height: calc(100vh - 300px); overflow-y: auto; min-width: 0; }
.docs-view-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; }
.doc-loading { display: flex; align-items: center; gap: 10px; padding: 24px; color: var(--text-2); }

/* ------------------------------------------------------- chữ tài liệu */
.md { line-height: 1.6; word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1 { font-size: 24px; margin: 18px 0 10px; }
.md h2 { font-size: 19px; margin: 22px 0 8px; }
.md h3 { font-size: 16px; margin: 18px 0 6px; }
.md h4 { font-size: 14px; margin: 14px 0 6px; }
.md p { margin: 6px 0; }
.md ul, .md ol { margin: 6px 0; padding-left: 22px; }
.md li { margin: 2px 0; }
.md blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--fill-2); border-radius: 0 10px 10px 0; color: var(--text-2); }
.md table { border-collapse: collapse; margin: 10px 0; font-size: 13px; display: block; overflow-x: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--hair-2); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--fill-2); font-weight: 600; }
.md pre { background: var(--fill-2); padding: 10px 12px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; }
.md pre code { background: transparent; padding: 0; }
.md hr { border: 0; border-top: 1px solid var(--hair); margin: 16px 0; }
.doc { max-width: 860px; }
.doc-pre { white-space: pre-wrap; font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; }
.doc-table th, .doc-table td { white-space: normal; height: auto; padding: 8px 10px; }

/* ------------------------------------------------------------ thương hiệu */
.brand-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; align-items: end; }
.brand-meta label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.brand-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-2); }
.brand-progress .meter { flex: 1; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.brand-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.brand-card.empty { border-style: dashed; }
.bc-title { font-weight: 700; font-size: 14.5px; }
.bc-q { font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.bc-text { width: 100%; min-height: 70px; border: 1px solid transparent; border-radius: 10px; background: var(--fill-2); padding: 9px 11px; outline: none; resize: none; line-height: 1.5; overflow: hidden; }
.bc-text:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); }

/* --------------------------------------------------------------- cẩm nang */
.guide { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.guide h2 { font-size: 20px; }
.guide h3 { font-size: 16px; margin-top: 8px; }
.guide-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.gs { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--fill-2); }
.gs-n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.gs p { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.guide-doc { padding: 22px 28px; }

/* ------------------------------------------------------------------ khác */
.offline-banner { display: none; position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; background: var(--crit); color: #fff; padding: 8px 14px; border-radius: 99px; font-size: 13px; box-shadow: var(--sh-pop); }
body.offline .offline-banner { display: block; }
body.is-dragging .card-tools { opacity: 0 !important; }

@media (max-width: 1280px) {
  .today-grid { grid-template-columns: 1fr; }
  .rail { position: static; }
  .home-top { grid-template-columns: 1fr; }
  .run-grid { grid-template-columns: 1fr; }
  .run-side { max-height: 260px; }
  .brand-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .home-cols, .two-col, .two-col.wide-left, .kv-grid, .docs-layout { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-page { grid-template-columns: 1fr; height: auto; }
  .runs-pane { max-height: 260px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; padding: 8px; }
  .sidebar { position: fixed; left: 8px; top: 8px; bottom: 8px; width: 270px; z-index: 40; transform: translateX(-110%); transition: transform .2s; }
  body.sb-open .sidebar { transform: none; }
  .icon-btn.tb-menu { display: inline-grid; }
  .tb-search { display: none; }
  .hide-sm { display: none; }
  .form-row, .checkin-form { grid-template-columns: 1fr; }
  .prop { grid-template-columns: 1fr; }
}
.hint.small-hint { align-self: end; font-size: 12px; }

/* ------------------------------------------------------------------ bộ não */
.brain-ask { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; }
.brain-ask > .ic { color: var(--text-3); width: 19px; height: 19px; }
.brain-ask .bare { flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; height: 40px; min-width: 0; }
.hit { width: 100%; display: flex; flex-direction: column; gap: 3px; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; cursor: pointer; text-align: left; border-bottom: 1px solid var(--hair); }
.hit:hover { background: var(--fill-2); }
.hit.on { background: var(--accent-soft); }
.hit-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; }
.hit-title .ic { width: 14px; height: 14px; color: var(--text-3); }
.hit-path { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit-snip { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-chip { height: 18px; font-size: 10.5px; padding: 0 6px; flex: none; }
.learn-box { margin-left: 40px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #ff2d55 8%, var(--card)); box-shadow: 0 0 0 1px color-mix(in srgb, #ff2d55 25%, transparent); display: flex; flex-direction: column; gap: 6px; }
.learn-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.learn-head .ic { color: #ff2d55; width: 15px; height: 15px; }
.learn-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.learn-row span:first-child { flex: 1; }

/* --------------------------------------------------------------- đính kèm */
.attach { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border: 1.5px dashed var(--hair-2); border-radius: 12px; transition: background .12s, border-color .12s; }
.attach.compact { padding: 6px 8px; border-style: dashed; }
.attach.over { background: var(--accent-soft); border-color: var(--accent); }
.attach-list { display: contents; }
.attach-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--fill-2); color: var(--text-2); font-size: 12.5px; font-weight: 500; cursor: pointer; flex-direction: row !important; }
.attach-btn:hover { background: var(--fill); color: var(--text); }
.attach-btn .ic { width: 14px; height: 14px; }
.attach-hint { font-size: 12px; color: var(--text-3); }
.att-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 9px; border-radius: 8px; background: var(--card); box-shadow: 0 0 0 1px var(--hair); font-size: 12.5px; max-width: 280px; }
.att-chip .ic { width: 13px; height: 13px; color: var(--accent); flex: none; }
.att-chip.err .ic { color: var(--crit); }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.att-name[data-act]:hover { color: var(--accent); text-decoration: underline; }
.att-size { color: var(--text-3); font-size: 11.5px; flex: none; }
.att-x { width: 20px; height: 20px; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.att-x:hover { background: var(--fill); color: var(--text); }
.att-x .ic { width: 12px; height: 12px; color: inherit; }
.form label.attach-btn { flex-direction: row; }

.brain-compose { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.bcomp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bcomp-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin-right: auto; }
.bcomp-title .ic { color: var(--accent); width: 18px; height: 18px; }
.bcomp-desc { font-size: 13px; color: var(--text-2); }
.bcomp-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bcomp-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.bcomp-status .ic { width: 14px; height: 14px; color: var(--text-3); }
.att-help { display: block; margin-top: 6px; }

/* ---------------------------------------------------- mục tiêu & KPI dự án */
.goal-row, .camp-row { width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left; border: 0; border-top: 1px solid var(--hair); background: transparent; padding: 10px 4px; cursor: pointer; }
.goal-row:hover, .camp-row:hover { background: var(--fill-2); }
.gr-top { display: flex; align-items: center; gap: 10px; }
.gr-title, .cr-name { flex: 1; font-weight: 600; font-size: 13.5px; }
.gr-bar { display: flex; align-items: center; gap: 10px; }
.gr-bar .meter { flex: 1; }
.gr-num { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gr-meta, .cr-meta { font-size: 12px; color: var(--text-3); }
.camp-row { flex-direction: row; flex-wrap: wrap; align-items: center; }
.cr-meta { width: 100%; }
.cg-proj { padding: 8px 0; border-top: 1px solid var(--hair); }
.cg-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; padding: 4px 4px 2px; }
.cg-head i { width: 10px; height: 10px; border-radius: 3px; }
.cg-head a { color: var(--text); }
.cg-proj .goal-row { border-top: 0; }
.pc-goal { display: flex; flex-direction: column; gap: 5px; }
.pc-goal .lbl { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.pc-goal .lbl .ic { width: 13px; height: 13px; color: var(--good); }
.goal-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.goal-link .ic { width: 13px; height: 13px; color: var(--good); }
.kpi-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--fill-2); }
.kpi-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 150px; gap: 10px; align-items: center; font-size: 13px; }
.kpi-l { color: var(--text-2); }
.kpi-v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-cpl { grid-column: 2 / 4; font-weight: 600; }
.kpi-note { font-size: 11.5px; color: var(--text-3); }
.pbar-track { position: relative; }
.pbar-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .55; border-radius: 1px; }
.ci-row.as-btn { border: 0; border-top: 1px solid var(--hair); background: transparent; text-align: left; cursor: pointer; width: 100%; align-items: center; }
.ci-row.as-btn:hover { background: var(--fill-2); }

/* ------------------------------------------------- quy trình nội dung */
.flow { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; background: var(--fill-2); }
.flow-step { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.flow-step.done { color: var(--text-2); }
.flow-step.now { color: var(--text); font-weight: 600; }
.fs-n { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--fill-3); color: var(--text-2); }
.flow-step.done .fs-n { background: var(--good); color: #fff; }
.flow-step.done .fs-n .ic { width: 12px; height: 12px; }
.flow-step.now .fs-n { background: var(--accent); color: #fff; }
.fs-l { flex: 1; min-width: 180px; }
.pipe-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 0; }
.pipe-l { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pipe { display: flex; align-items: center; gap: 2px; overflow-x: auto; }
.pipe-cell { flex: 1; min-width: 74px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 10px; border: 0; background: var(--fill-2); cursor: pointer; }
.pipe-cell b { font-size: 18px; color: var(--text-3); }
.pipe-cell span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.pipe-cell.has { background: var(--accent-soft); }
.pipe-cell.has b { color: var(--text); }
.pipe-cell:hover { filter: brightness(.97); }
.pipe-arrow { color: var(--text-3); display: grid; }
.pipe-arrow .ic { width: 14px; height: 14px; }

/* ---- Tổng quan v2: thẻ dự án dạng biểu đồ */
:root { --seg-todo: color-mix(in srgb, var(--text-3) 45%, transparent); }
.home-top.no-north { grid-template-columns: 1fr; }
.tiles.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pc-legend { margin-left: auto; display: inline-flex; gap: 12px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.pc-legend span, .pc-stack-lg span { display: inline-flex; align-items: center; gap: 5px; }
.pc-legend i, .pc-stack-lg i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.proj-card.v2 { gap: 10px; }
.proj-card.v2 .pc-badge { width: auto; min-width: 40px; padding: 0 8px; font-size: 12.5px; }
.pc-body { display: flex; align-items: center; gap: 14px; }
.pc-ring { width: 72px; height: 72px; flex: none; }
.pc-ring .ring-bg { fill: none; stroke: var(--fill-3); stroke-width: 7; }
.pc-ring .ring-fg { fill: none; stroke-width: 7; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 32px 32px; }
.pc-ring text { font-size: 14px; font-weight: 700; fill: var(--text); }
.pc-figs { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.pc-nums { display: flex; gap: 12px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.pc-nums b { font-size: 15px; color: var(--text); margin-right: 2px; }
.pc-nums .txt-crit b { color: var(--crit); }
.pc-stack { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--fill-2); }
.pc-stack span { display: block; min-width: 3px; }
.pc-stack-lg { display: flex; gap: 10px; font-size: 11.5px; color: var(--text-2); }
.pc-gline { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pc-gline .lbl { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); flex: none; }
.pc-gline .lbl .ic { width: 12px; height: 12px; }
.pc-gline .meter { flex: 1; }
.pc-gline b { font-size: 12px; }
.pc-nextline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); padding-top: 8px; border-top: 1px solid var(--hair); }
.pc-nextline span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pc-nextline .ic { width: 13px; height: 13px; flex: none; color: var(--text-3); }
.home-more-btn { display: inline-flex; align-items: center; gap: 6px; margin: 4px auto 0; padding: 8px 14px; border-radius: 10px; font-size: 13px; color: var(--text-2); background: var(--fill-2); border: 0; cursor: pointer; }
.home-more-btn .ic { width: 14px; height: 14px; }
@media (max-width: 760px) { .tiles.tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pc-legend { display: none; } }

/* 05/10 — giao việc cho agent: ngữ cảnh, thẻ gắn phiên, tiến độ chiến dịch */
.ctx-box { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--fill-2); font-size: 12.5px; line-height: 1.45; }
.ctx-row { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); }
.ctx-row svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.ctx-row b { color: var(--text); font-weight: 600; }
.ctx-row.warn { color: color-mix(in srgb, var(--warn) 55%, #000); }
.agent-chip { display: inline-flex; align-items: center; gap: 5px; border: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fill-3); color: var(--text-2); white-space: nowrap; }
.agent-chip svg { width: 12px; height: 12px; }
.agent-chip.running { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.agent-chip.attn { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 55%, #000); }
.agent-chip.done { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.agent-chip.done.new::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.agent-chip.err { background: color-mix(in srgb, var(--crit) 14%, transparent); color: var(--crit); }
.flow-agent { margin: 4px 0 8px; }
.cal-item b.code, .card-title b.code { font-weight: 700; color: var(--accent); }
.cal-item .pulse { flex: none; }
.camp-prog { font-size: 11.5px; color: var(--text-2); }
.camp-doc { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; }
.camp-doc > span { flex: 1; min-width: 0; }
.agent-results .wait-meta .pill, .agent-results .wait-meta .chip { font-size: 10.5px; }
.chip.as-btn { cursor: pointer; border: 0; font: inherit; }

/* Hộp duyệt · giao nhiều việc · lịch tự động (Trợ lý agent) */
.inbox-panel, .batch-panel, .autos-panel { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.inbox-panel { border: 1px solid var(--warn); }
.launch-title .sp { flex: 1; }
.draft-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--hair); }
.draft-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.draft-sum { font-size: 13.5px; max-height: 220px; overflow: auto; }
.draft-file { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); opacity: .75; word-break: break-all; }
.draft-file .ic { width: 14px; height: 14px; flex: none; }
.draft-patches { font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.draft-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.draft-actions .sp { flex: 1; }
.auto-list { display: flex; flex-direction: column; }
.auto-row { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-top: 1px solid var(--hair); }
.auto-row.off { opacity: .55; }
.auto-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 46px; }
.auto-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; font-size: 13.5px; }
.auto-txt .muted { font-size: 12.5px; }
.auto-global { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) {
  .auto-row { flex-wrap: wrap; }
  .draft-actions .sp { display: none; }
}

/* Trợ lý Gettime */
.gt-page { display: flex; flex-direction: column; gap: 16px; padding-bottom: 30px; }
.gt-status { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 13.5px; flex-wrap: wrap; }
.gt-status .ic { width: 18px; height: 18px; flex: none; }
.gt-status.ok .ic { color: var(--good); }
.gt-status.warn { border: 1px solid var(--warn); }
.gt-status.warn .ic { color: var(--warn); }
.gt-status .sp, .gt-actions .sp, .gt-bhead .sp { flex: 1; }
.gt-panel, .gt-batch { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.gt-bhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gt-bhead b { display: inline-flex; align-items: center; gap: 6px; }
.gt-bhead .ic { width: 16px; height: 16px; color: var(--accent); }
.gt-item { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--hair); }
.gt-item.off { opacity: .5; }
.gt-item.saved { border-color: var(--good); }
.gt-row1 { display: flex; align-items: center; gap: 10px; }
.gt-title { flex: 1; min-width: 0; font-weight: 600; }
.gt-row2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.gt-row2 label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-2); min-width: 0; }
.gt-row2 .input { width: 100%; min-width: 0; }
.gt-desc { font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 2px; }
.gt-msg { font-size: 12.5px; color: var(--text-2); }
.gt-msg.err { color: var(--crit); }
.gt-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gt-picklist { max-height: 420px; overflow: auto; display: flex; flex-direction: column; }
.gt-pick { display: flex; align-items: baseline; gap: 10px; padding: 7px 2px; border-top: 1px solid var(--hair); font-size: 13.5px; cursor: pointer; flex-wrap: wrap; }
.gt-pick-t { flex: 1; min-width: 200px; }
.gt-pick .muted { font-size: 12.5px; }
.gt-times { width: 140px; }
.gt-num { max-width: 120px; }
.gt-foot { font-size: 12.5px; }

/* Bảng điều hành dự án (cockpit.js) */
:root { --ck-s1: #2a78d6; --ck-s2: #e8833a; --ck-sb: #8a5cf6; --ck-ready-bg: rgba(10,122,255,.14); --ck-doing-bg: rgba(250,178,25,.22); --ck-done-bg: rgba(12,163,12,.14); --ck-late-bg: rgba(208,59,59,.14); --ck-block-bg: rgba(118,118,128,.10); }
.ck-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ck-stat { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.ck-stat.bad { border-color: var(--crit); }
.ck-stat.bad .ck-sv { color: var(--crit); }
.ck-sl { font-size: 12px; color: var(--text-2); }
.ck-sv { font-size: 18px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.ck-ss { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.ck-sec { padding: 16px 18px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.ck-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.ck-h .ic { width: 18px; height: 18px; color: var(--accent); }
.ck-h .sp, .ck-mtop .sp { flex: 1; }
.ck-red { color: var(--crit); }
.ck-bar { height: 6px; border-radius: 4px; background: var(--fill); overflow: hidden; flex: 1; min-width: 60px; }
.ck-bar span { display: block; height: 100%; background: var(--accent); }
.ck-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.ck-metric { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.ck-mtop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ck-mname { font-weight: 600; }
.ck-mnums { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.ck-cur { width: 96px; }
.ck-mnote { font-size: 12.5px; color: var(--text-2); }
.ck-mnote.warn { color: var(--serious); }
.ck-tl-wrap { overflow-x: auto; }
.ck-tl-bar { position: relative; height: 54px; min-width: 560px; background: var(--fill); border-radius: var(--r-sm); }
.ck-phase { position: absolute; top: 4px; bottom: 4px; border-radius: 7px; background: var(--card); border: 1px solid var(--hair); padding: 4px 8px; overflow: hidden; display: flex; flex-direction: column; font-size: 12px; }
.ck-phase.on { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.ck-phase small { color: var(--text-2); font-weight: 400; }
.ck-msdot { position: absolute; bottom: -2px; transform: translateX(-50%); font-size: 11px; color: var(--serious); }
.ck-today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--crit); }
.ck-ms { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.ck-outs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ck-out { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.ck-out-h { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ck-out-p { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.ck-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 999px; background: var(--fill); white-space: nowrap; margin-left: auto; }
.ck-lbl.l-xong { background: var(--good-soft); color: var(--good); }
.ck-lbl.l-đang-xây, .ck-lbl.l-đang-chạy-thử { background: var(--warn-soft); }
.ck-lbl.l-đến-lượt { background: var(--accent-soft); color: var(--accent); }
.ck-next { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.ck-leads { font-size: 12px; }
.ck-tl { cursor: pointer; color: inherit; text-decoration: underline; text-decoration-color: var(--hair); }
.ck-tl:hover { color: var(--accent); }
.ck-grid-wrap, .ck-list-wrap, .ck-gantt-wrap { overflow-x: auto; }
.ck-grid, .ck-list, .ck-gantt { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.ck-grid th, .ck-grid td, .ck-list th, .ck-list td { border-bottom: 1px solid var(--hair); padding: 6px 8px; text-align: left; vertical-align: top; }
.ck-grid .on { background: var(--accent-soft); font-weight: 600; }
.ck-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ck-side { font-weight: 700; padding-left: 8px; border-left: 4px solid; margin-bottom: 6px; }
.ck-side.side1 { border-color: var(--ck-s1); }
.ck-side.side2 { border-color: var(--ck-s2); }
.ck-person { font-size: 13px; padding: 4px 0; border-top: 1px solid var(--hair); }
.ck-owe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; padding: 4px 0; border-top: 1px solid var(--hair); }
.ck-owe.late a { color: var(--crit); }
.ck-qs { margin: 0; padding-left: 20px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.ck-st { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; margin-right: 4px; background: var(--ck-block-bg); white-space: nowrap; }
.ck-st.ready { background: var(--ck-ready-bg); color: var(--accent); font-weight: 600; }
.ck-st.doing { background: var(--ck-doing-bg); }
.ck-st.done { background: var(--ck-done-bg); color: var(--good); }
.ck-st.late { background: var(--ck-late-bg); color: var(--crit); font-weight: 600; }
.ck-st.undecided { opacity: .6; }
.ck-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ck-flow { padding: 12px 16px; margin-bottom: 12px; }
.ck-flow summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ck-flow-body { position: relative; display: flex; gap: 34px; overflow-x: auto; padding: 14px 4px 6px; }
.ck-arrows { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.ck-arrows path { fill: none; stroke: var(--text-3, #999); stroke-width: 1.4; marker-end: url(#ckah); }
.ck-arrows marker path { fill: var(--text-3, #999); stroke: none; }
.ck-col { display: flex; flex-direction: column; gap: 12px; min-width: 200px; max-width: 230px; position: relative; z-index: 1; }
.ck-card { border: 1px solid var(--hair); border-left: 4px solid var(--ck-s1); border-radius: 10px; padding: 8px 10px; background: var(--card); font-size: 12.5px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.ck-card.mini { padding: 2px 8px; font-size: 11.5px; cursor: default; display: inline-block; }
.ck-card.side2 { border-left-color: var(--ck-s2); }
.ck-card.sideb { border-left-color: var(--ck-sb); }
.ck-card.blocked { background: var(--ck-block-bg); color: var(--text-2); }
.ck-card.ready { background: var(--ck-ready-bg); box-shadow: 0 0 0 2px var(--accent) inset; }
.ck-card.doing { background: var(--ck-doing-bg); }
.ck-card.done { background: var(--ck-done-bg); }
.ck-card.late { background: var(--ck-late-bg); }
.ck-card.undecided { opacity: .55; }
.ck-card.ghost { border-style: dashed; border-left-width: 1px; opacity: .7; }
.ck-ct { font-weight: 600; }
.ck-cm { color: var(--text-2); font-size: 11.5px; }
.ck-undec { font-size: 12px; color: var(--text-2); margin-top: 8px; }
.ck-list .ck-wk td { background: var(--fill); font-weight: 700; }
.ck-list .ck-wk.late td { background: var(--ck-late-bg); color: var(--crit); }
.ck-list tbody.cur .ck-wk td { background: var(--accent-soft); }
.ck-list tr.faded { opacity: .5; }
.ck-list tr.late td:nth-child(6) { color: var(--crit); font-weight: 600; }
.ck-star { color: var(--serious); font-weight: 600; margin-left: 8px; }
.ck-gantt { min-width: 720px; table-layout: fixed; }
.ck-gantt th { font-size: 11px; font-weight: 600; padding: 4px 2px; text-align: center; border-bottom: 1px solid var(--hair); }
.ck-gantt th:first-child, .ck-gname { width: 280px; text-align: left; }
.ck-gantt td { height: 24px; border-bottom: 1px solid var(--hair); text-align: center; font-size: 11px; padding: 0 1px; }
.ck-gantt td.past { background: rgba(118,118,128,.06); }
.ck-gantt th.cur, .ck-gantt td.cur { outline: 1px solid var(--accent); outline-offset: -1px; }
.ck-gname { padding: 2px 8px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-grow td { background: var(--fill); }
.ck-gantt td.g-sum { background: rgba(118,118,128,.35); }
.ck-gantt td.g-side1 { background: rgba(42,120,214,.30); }
.ck-gantt td.g-side2 { background: rgba(232,131,58,.32); }
.ck-gantt td.g-sideb { background: rgba(138,92,246,.30); }
.ck-gantt td.g-side1.due { background: rgba(42,120,214,.6); }
.ck-gantt td.g-side2.due { background: rgba(232,131,58,.65); }
.ck-gantt td.g-sideb.due { background: rgba(138,92,246,.6); }
.ck-gantt td.g-done { background: rgba(12,163,12,.35); }
.ck-gantt td.g-late { background: rgba(208,59,59,.18); }
.ck-gantt td.g-late.due { background: rgba(208,59,59,.55); }
.ck-drawer { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 10px 0; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.ck-dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ck-dgrid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-2); }
.ck-dgrid .ck-chk { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 6px; }
.ck-prev { width: 100%; font-size: 12.5px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ck-block-bg: rgba(160,160,170,.14); } }
:root[data-theme="dark"] { --ck-block-bg: rgba(160,160,170,.14); }
/* thanh tiến độ trong thẻ metric không được giãn theo chiều dọc; thẻ workflow nền đặc để mũi tên không xuyên qua chữ */
.ck-metric .ck-bar { flex: none; width: 100%; }
.ck-card { background-color: var(--panel-solid); }
.ck-card.blocked { background: linear-gradient(var(--ck-block-bg), var(--ck-block-bg)), var(--panel-solid); }
.ck-card.ready { background: linear-gradient(var(--ck-ready-bg), var(--ck-ready-bg)), var(--panel-solid); }
.ck-card.doing { background: linear-gradient(var(--ck-doing-bg), var(--ck-doing-bg)), var(--panel-solid); }
.ck-card.done { background: linear-gradient(var(--ck-done-bg), var(--ck-done-bg)), var(--panel-solid); }
.ck-card.late { background: linear-gradient(var(--ck-late-bg), var(--ck-late-bg)), var(--panel-solid); }
.ck-card.ghost { background: var(--panel-solid); }
.ck-cd { font-size: 11.5px; color: var(--text-2); border-top: 1px dashed var(--hair); padding-top: 3px; }
/* metrics dạng thẻ số */
.ck-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ck-tile { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; cursor: help; min-width: 0; }
.ck-tile.nodata { border-style: dashed; }
.ck-tname { font-size: 12.5px; color: var(--text-2); line-height: 1.3; min-height: 2.6em; }
.ck-tnum { display: flex; align-items: baseline; gap: 4px; }
.ck-tin { width: 100%; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 26px; font-weight: 700; color: var(--text); padding: 0; -moz-appearance: textfield; }
.ck-tin::-webkit-outer-spin-button, .ck-tin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ck-tin:focus { outline: none; border-bottom: 2px solid var(--accent); }
.ck-tile.nodata .ck-tin::placeholder { color: var(--text-3); }
.ck-tunit { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.ck-bar.ghost { background: repeating-linear-gradient(90deg, var(--fill) 0 6px, transparent 6px 10px); }
.ck-tfoot { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.ck-hint { font-size: 12px; font-weight: 400; }
.ck-tile .ck-bar { flex: none; width: 100%; }

/* =====================================================================
 * Hệ giao diện MIDU — sáng (19/10/2026, theo 3 mẫu chủ sở hữu chọn)
 * - Chỉ giao diện sáng. Nền ấm nhạt, khối trắng bo tròn lớn, nút và nhãn dạng viên thuốc.
 * - Màu tươi mang nghĩa: xanh dương = đang làm, cam = chờ bạn, xanh lá = xong, đỏ = quá hạn,
 *   tím = tài liệu/duyệt; giai đoạn workflow mỗi giai đoạn một màu.
 * - Tiêu đề, con số: Unbounded. Chữ thường: Be Vietnam Pro.
 * ===================================================================== */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --font-head: "Unbounded", "Be Vietnam Pro", -apple-system, sans-serif;
  --wall: #f3f3ee;
  --glass: #ffffff; --glass-strong: #ffffff; --panel: #ffffff; --panel-solid: #ffffff; --card: #ffffff;
  --soft: #f6f6f2; --col-bg: #f0f0ea;
  --edge: #e8e8e1; --hair: #efefe9; --hair-2: #dedfd7;
  --text: #1f2229; --text-2: #5c616c; --text-3: #9a9ea7;
  --fill: rgba(31, 34, 41, 0.06); --fill-2: rgba(31, 34, 41, 0.035); --fill-3: rgba(31, 34, 41, 0.12);
  --accent: #5b6cff; --accent-2: #4757f2; --accent-soft: #eceefe;
  --blue: #4c8dff;   --blue-bg: #e9f1ff;   --blue-tx: #2563d8;
  --orange: #ff9a3c; --orange-bg: #fff1e3; --orange-tx: #c96510;
  --green: #2fbf71;  --green-bg: #e3f6eb;  --green-tx: #1b8a4f;
  --red: #ff5b62;    --red-bg: #ffecec;    --red-tx: #d63a41;
  --purple: #9b6bff; --purple-bg: #f1eaff; --purple-tx: #7a46e6;
  --yellow: #ffc83d; --yellow-bg: #fff6d9; --yellow-tx: #a47800;
  --teal: #19b9b1;   --teal-bg: #e1f6f5;   --teal-tx: #0f8a84;
  --run: var(--blue); --run-bg: var(--blue-bg); --run-tx: var(--blue-tx);
  --wait: var(--orange); --wait-bg: var(--orange-bg); --wait-tx: var(--orange-tx);
  --done: var(--green); --done-bg: var(--green-bg); --done-tx: var(--green-tx);
  --crit: var(--red); --crit-bg: var(--red-bg); --crit-tx: var(--red-tx);
  --info: var(--purple); --info-bg: var(--purple-bg); --info-tx: var(--purple-tx);
  --good: var(--green); --warn: var(--orange);
  --idle: #c3c5bd; --line: #dcdcd4;
  --r-xl: 24px; --r-lg: 18px; --r: 14px; --r-sm: 10px;
  --sh-1: 0 1px 2px rgba(30, 32, 25, 0.04);
  --sh-2: 0 1px 2px rgba(30, 32, 25, 0.04), 0 8px 24px rgba(30, 32, 25, 0.06);
  --sh-pop: 0 24px 60px rgba(30, 32, 25, 0.16), 0 4px 12px rgba(30, 32, 25, 0.06);
}

/* ----- khung app: thanh bên và thanh trên là khối trắng nổi */
body { background: var(--wall); font-family: var(--font); font-size: 13.5px; letter-spacing: -0.003em; color: var(--text); }
.glass { background: var(--panel); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--sh-1); border: 1px solid var(--edge); }
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.app { gap: 12px; padding: 12px; grid-template-columns: 248px minmax(0, 1fr); }
.main { gap: 12px; }
.sidebar { border-radius: var(--r-xl); padding: 16px 12px 12px; gap: 10px; color: var(--text); }
.toolbar { border-radius: 20px; height: 56px; padding: 0 12px 0 20px; }
.tb-title { font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.tb-search { background: var(--soft); border: 1px solid transparent; border-radius: 999px; height: 36px; }
.tb-search:focus-within { background: var(--paper); }
.content { border-radius: 0; padding: 4px 4px 24px; }
.page { padding: 0 0 32px; }

/* ----- nút, ô nhập: dạng viên thuốc */
.btn { height: 34px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--hair-2); background: var(--paper); color: var(--text); font-weight: 550; font-size: 13px; box-shadow: none; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--fill-2); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 999px; }
.btn[disabled] { opacity: .45; cursor: default; }
.icon-btn { border-radius: 999px; }
.input { border-radius: 12px; border-color: var(--hair-2); background: var(--paper); }
.seg { background: var(--soft); border-radius: 999px; padding: 3px; }
.seg button { border-radius: 999px; }
.seg button.on { box-shadow: var(--sh-1); }
kbd { background: var(--soft); border-color: var(--hair-2); }
.toast { background: var(--paper); color: var(--text); border: 1px solid var(--edge); border-radius: 16px; box-shadow: var(--sh-pop); backdrop-filter: none; padding: 10px 12px; }
.toast > .ic { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--blue-bg); color: var(--blue); }
.toast-good > .ic { background: var(--green); color: #fff; }
.toast-error > .ic { background: var(--red); color: #fff; }
.toast-btn { border-radius: 999px; }
.modal, .palette, .menu, .drawer { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; border-color: var(--edge); }
.modal { border-radius: var(--r-xl); }
.pulse { background: var(--blue); }

/* ----- thanh bên sáng */
.sidebar .sb-name { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--text); }
.sidebar .sb-sub { color: var(--text-3); font-size: 11.5px; }
.sidebar .logo { background: linear-gradient(135deg, #7c8cff, #5b6cff); color: #fff; box-shadow: 0 6px 14px rgba(91, 108, 255, .3); border-radius: 12px; width: 34px; height: 34px; }
.sidebar .sb-capture { background: var(--soft); border: 1px solid transparent; border-radius: 999px; color: var(--text-3); height: 36px; padding: 0 12px; }
.sidebar .sb-capture input { color: var(--text); }
.sidebar .sb-capture:focus-within { background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sidebar .nav-group { color: var(--text-3); font-size: 11px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; padding: 14px 10px 6px; }
.sidebar .nav-add { color: var(--text-3); border-radius: 999px; }
.sidebar .nav-add:hover { background: var(--fill); color: var(--text); }
.sidebar .nav-item { height: 36px; color: var(--text-2); font-size: 13.5px; border-radius: 999px; padding: 0 12px; gap: 10px; }
.sidebar .nav-item .ni { color: var(--text-3); width: 17px; height: 17px; }
.sidebar .nav-item:hover { background: var(--soft); text-decoration: none; }
.sidebar .nav-item.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 650; }
.sidebar .nav-item.on .ni { color: var(--accent); }
.sidebar .nav-count { color: var(--text-3); }
.sidebar .nav-count.warn { color: #fff; background: var(--orange); border-radius: 999px; padding: 0 7px; font-weight: 700; line-height: 18px; font-size: 11px; }
.sidebar .sb-foot { border-top-color: var(--hair); }
.nav-more { width: 100%; border: 0; background: transparent; cursor: pointer; justify-content: flex-start !important; gap: 4px; }
.nav-more .ic { width: 12px; height: 12px; }
.nav-item span.pulse { flex: none; width: 7px; height: 7px; }
.org { display: flex; flex-direction: column; gap: 1px; margin-bottom: 6px; }
.org-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 0; }
.org-name { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; padding: 6px 8px; border-radius: 999px; flex: 1; text-align: left; }
.org-name:hover { background: var(--soft); }
.org-name .ic { width: 12px; height: 12px; color: var(--text-3); }
.org-n { margin-left: auto; font-size: 11px; color: var(--text-3); font-weight: 500; }
.org .nav-item.proj { padding-left: 26px; height: 32px; }
.org-empty { font-size: 11.5px; color: var(--text-3); padding: 4px 10px 4px 28px; }
.org-pages { margin: 4px 0 2px 22px; padding-top: 4px; border-top: 1px dashed var(--hair-2); }
.org-pages .nav-item { height: 30px; font-size: 12.5px; padding-left: 8px; }
.proj-more { flex: none; width: 22px; height: 22px; border: 0; background: transparent; color: var(--text-3); border-radius: 999px; display: none; place-items: center; cursor: pointer; padding: 0; }
.proj-more .ic { width: 14px; height: 14px; }
.nav-item.proj:hover .proj-more { display: grid; }
.nav-item.proj:hover .nav-count { display: none; }
.proj-more:hover { background: var(--fill); color: var(--text); }

/* khối Gettime đầu thanh bên */
.sb-gt:empty { display: none; }
.gt-card { border-radius: 18px; padding: 11px 12px; display: flex; flex-direction: column; gap: 9px; background: var(--green-bg); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); }
.gt-card.due { background: var(--orange-bg); border-color: color-mix(in srgb, var(--orange) 35%, transparent); }
.gt-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.gt-row b { font-family: var(--font-head); font-weight: 600; font-size: 12.5px; }
.gt-logo { width: 22px; height: 22px; border-radius: 7px; background: var(--green); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-size: 11px; font-weight: 700; flex: none; }
.gt-st { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.gt-st .ic { width: 12px; height: 12px; }
.gt-st.ok { color: var(--green-tx); }
.gt-st.due { color: var(--orange-tx); }
.gt-actions { display: flex; gap: 6px; }
.gt-btn { flex: 1; height: 28px; border-radius: 999px; border: 1px solid var(--hair-2); background: var(--paper); color: var(--text); font: inherit; font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; white-space: nowrap; padding: 0 8px; }
.gt-btn:first-child { flex: 0 0 auto; padding: 0 10px; }
.gt-btn .ic { width: 12px; height: 12px; }
.gt-btn:hover { background: var(--soft); }
.gt-btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.gtc-foot { display: flex; align-items: center; gap: 4px; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--green) 20%, transparent); }
.gt-sync { display: flex; gap: 8px; border: 0; background: transparent; padding: 0; font: inherit; font-size: 11.5px; color: var(--text-2); cursor: pointer; text-align: left; flex: 1; white-space: nowrap; }
.gt-sync b { color: var(--text); font-weight: 700; }
.gt-sync .due b { color: var(--red-tx); }
.gt-ico { width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--hair-2); background: var(--paper); color: var(--text-2); display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.gt-ico .ic { width: 12px; height: 12px; }
.gt-ico:hover { color: var(--text); background: var(--soft); }
.gt-ico[disabled] { opacity: .5; cursor: default; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- chấm, nhãn viên thuốc */
.sdot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; background: var(--idle); }
.sdot-run { background: var(--blue); animation: sdot 1.6s infinite; }
.sdot-wait { background: var(--orange); }
.sdot-done { background: var(--green); }
.sdot-crit { background: var(--red); }
@keyframes sdot { 0% { box-shadow: 0 0 0 0 rgba(76, 141, 255, .5); } 70% { box-shadow: 0 0 0 6px rgba(76, 141, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(76, 141, 255, 0); } }
.lchip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--soft); font-size: 11.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
a.lchip:hover { text-decoration: none; background: var(--fill); }
.lchip.ghost { background: transparent; border: 1px solid var(--hair-2); }
.lchip .pdot { width: 7px; height: 7px; margin: 0; border-radius: 50%; }
.lchip-run { background: var(--blue-bg); color: var(--blue-tx); }
.lchip-wait { background: var(--orange-bg); color: var(--orange-tx); }
.lchip-done { background: var(--green-bg); color: var(--green-tx); }
.lchip-crit { background: var(--red-bg); color: var(--red-tx); }
.tx-wait { color: var(--orange-tx); } .tx-run { color: var(--blue-tx); } .tx-crit { color: var(--red-tx); } .tx-done { color: var(--green); }
.sm { font-size: 12px; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ----- Phòng điều hành */
.mc { display: flex; flex-direction: column; gap: 16px; max-width: 1520px; padding-bottom: 28px; }
.mc-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 8px 4px 0; }
.mc-hero h1 { font-family: var(--font-head); font-weight: 600; font-size: 26px; letter-spacing: -0.02em; line-height: 1.25; color: var(--text-2); }
.mc-hero h1 em { font-style: normal; color: var(--accent); }
.mc-hero p { margin-top: 6px; color: var(--text-3); font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 18px; border: 0; border-radius: 22px; color: #fff; text-align: left; font: inherit; cursor: pointer; overflow: hidden; box-shadow: var(--sh-2); transition: transform .12s; }
.kpi:hover { transform: translateY(-2px); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.kpi-ic { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); display: grid; place-items: center; margin-bottom: 6px; }
.kpi-ic .ic { width: 17px; height: 17px; }
.kpi-n { font-family: var(--font-head); font-weight: 600; font-size: 30px; line-height: 1; letter-spacing: -0.02em; }
.kpi-l { font-weight: 650; font-size: 14px; }
.kpi-c { font-size: 12px; opacity: .85; }
.k-orange { background: linear-gradient(135deg, #ffad5c, #ff8f2e); }
.k-blue { background: linear-gradient(135deg, #6aa0ff, #4c7dff); }
.k-purple { background: linear-gradient(135deg, #b38bff, #8f5cff); }
.k-red { background: linear-gradient(135deg, #ff7a80, #ff4f5a); }
.kpi.zero { opacity: .9; }

/* bảng workflow đội agent */
.wf { padding: 18px; border-radius: var(--r-xl); }
.wf-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.wf-title { display: flex; align-items: baseline; gap: 10px; }
.wf-title h2 { font-family: var(--font-head); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.wf-title span { color: var(--text-3); font-size: 12.5px; }
.wf-legend { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.wf-legend > span { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--soft); font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.wf-board { display: grid; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.wf-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wf-ch { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.wf-ch i { width: 4px; height: 18px; border-radius: 4px; background: var(--stage); flex: none; }
.wf-ch b { font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-sub { font-size: 11.5px; color: var(--text-3); padding: 0 4px 4px 16px; }
.wf-body { background: var(--soft); border-radius: 18px; padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.wf-col.wide .wf-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); align-items: start; align-content: start; }
.s-blue { --stage: var(--blue); } .s-purple { --stage: var(--purple); } .s-orange { --stage: var(--orange); }
.s-green { --stage: var(--green); } .s-red { --stage: var(--red); } .s-teal { --stage: var(--teal); } .s-gray { --stage: var(--idle); }

/* thẻ agent: dải màu trạng thái ở đầu, hộp nét đứt bên trong (mẫu 1) */
.ag { border-radius: 16px; background: var(--band, #e8e8e2); padding-top: 22px; position: relative; min-width: 0; box-shadow: var(--sh-1); }
.ag-band { position: absolute; top: 0; left: 0; right: 0; height: 22px; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
.ag-card { background: var(--paper); border-radius: 14px 14px 16px 16px; padding: 7px; display: flex; flex-direction: column; gap: 7px; }
.ag-in { border: 1.5px dashed var(--hair-2); border-radius: 11px; padding: 8px 9px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ag-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ag-name b { font-weight: 700; font-size: 13px; line-height: 1.25; overflow-wrap: break-word; } /* xuống dòng thay vì cắt "Nghiê…" ở cột hẹp */
.ag-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--text-2); flex: none; }
.ag-ic .ic { width: 13px; height: 13px; }
.ag-idle { font-size: 11.5px; color: var(--text-3); }
.ag-job { display: flex; flex-direction: column; gap: 5px; width: 100%; text-align: left; border: 0; background: transparent; padding: 0; cursor: pointer; font: inherit; color: var(--text); min-width: 0; }
.ag-job + .ag-job { border-top: 1px solid var(--hair); padding-top: 7px; }
.ag-job-t { font-size: 12px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-job-t:hover { color: var(--accent); }
.ag-job-m { display: flex; align-items: center; gap: 5px; min-width: 0; flex-wrap: wrap; }
.ag-job-m .lchip { height: 20px; font-size: 10.5px; padding: 0 7px; }
.ag-step { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ag-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; padding: 0 4px 2px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ag-foot span { display: inline-flex; align-items: center; gap: 4px; }
.ag-foot .ic { width: 12px; height: 12px; }
.ag-foot .when { white-space: nowrap; } /* cột hẹp: mốc giờ xuống dòng nguyên cụm, không gãy "32 / phút / trước" */
.ag-foot .when { margin-left: auto; }
.ag-more { font-size: 11px; color: var(--text-3); }
.ag.st-run { --band: linear-gradient(180deg, #5b97ff, #4c7dff); }
.ag.st-wait { --band: linear-gradient(180deg, #ffab5a, #ff8f2e); }
.ag.st-done { --band: linear-gradient(180deg, #43cf84, #2fbf71); }
.ag.st-idle { --band: #e4e5de; }
.ag.st-idle .ag-band { color: var(--text-3); }
.ag.st-run .ag-ic { background: var(--blue-bg); color: var(--blue); }
.ag.st-wait .ag-ic { background: var(--orange-bg); color: var(--orange); }
.ag.st-done .ag-ic { background: var(--green-bg); color: var(--green); }
.ag.st-idle .ag-card { padding: 6px; }
.ag.st-idle .ag-in { border-style: solid; border-color: transparent; background: var(--soft); padding: 7px 8px; gap: 3px; }

/* khu làm việc: tab kiểu ngăn hồ sơ (mẫu 2) + Việc của bạn */
.mc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; height: 620px; }
.mc-main { min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-xl); background: var(--col-bg); border: 0; box-shadow: none; padding: 8px 8px 0; }
.mc-tabs { display: flex; align-items: flex-end; gap: 4px; flex: none; padding: 0 4px; }
.mc-tab { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; border-radius: 16px 16px 0 0; }
.mc-tab:hover { color: var(--text); }
.mc-tab.on { background: var(--paper); color: var(--text); }
.mc-tab .cnt { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--paper); font-size: 11px; display: inline-grid; place-items: center; color: var(--text-2); font-weight: 700; }
.mc-tab.on .cnt { background: var(--soft); }
.mc-tab .cnt.wait { background: var(--orange); color: #fff; }
.mc-tab .cnt.run { background: var(--blue); color: #fff; }
.mc-body { flex: 1; min-height: 0; overflow: hidden; display: flex; background: var(--paper); border-radius: 0 20px 0 0; margin: 0 -8px; border-top-left-radius: 0; }
.mc-empty { margin: auto; text-align: center; color: var(--text-3); padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 380px; }
.mc-empty .ic { width: 40px; height: 40px; padding: 10px; border-radius: 50%; background: var(--green-bg); color: var(--green); }
.mc-empty b { color: var(--text); font-size: 14px; }

.ib-list { width: 300px; flex: none; border-right: 1px solid var(--hair); overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ib-row { display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 11px 12px; border: 1px solid var(--hair); border-radius: 14px; background: var(--paper); text-align: left; font: inherit; color: var(--text); cursor: pointer; position: relative; }
.ib-row:hover { border-color: var(--hair-2); }
.ib-row.on { background: var(--orange-bg); border-color: color-mix(in srgb, var(--orange) 35%, transparent); }
.ib-top { display: flex; align-items: center; gap: 7px; }
.ib-title { font-weight: 650; font-size: 13px; flex: 1; }
.ib-age { font-size: 11px; color: var(--text-3); flex: none; }
.ib-q { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.ib-meta { display: flex; gap: 5px; flex-wrap: nowrap; overflow: hidden; }
.ib-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ib-head { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 12px; border-bottom: 1px solid var(--hair); flex: none; }
.ib-head-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ib-head-row h3 { flex: 1; font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.ib-head-a { display: flex; gap: 4px; flex: none; }
.ib-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.ib-ask { background: var(--orange-bg); border-radius: 16px; padding: 14px 16px; }
.ib-ask-h { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--orange-tx); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.ib-ask-h .ic { width: 14px; height: 14px; }
.ib-ask ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.ib-ask li, .ib-ask p { font-size: 14.5px; line-height: 1.55; color: var(--text); }
.ib-full .md { margin-top: 10px; font-size: 13.5px; max-width: 760px; color: var(--text-2); }
.ib-step { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.ib-compose { flex: none; border-top: 1px solid var(--hair); padding: 12px 20px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.ib-compose textarea, .compose-mini textarea { width: 100%; resize: none; min-height: 68px; max-height: 180px; padding: 11px 14px; border-radius: 16px; border: 1px solid var(--hair-2); background: var(--soft); outline: none; font: inherit; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.ib-compose textarea:focus, .compose-mini textarea:focus { border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 3px var(--accent-soft); }
.ib-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.opt { border: 1px solid var(--hair-2); background: var(--paper); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--text); }
.opt:hover { border-color: var(--accent); color: var(--accent); }
.ib-foot { display: flex; align-items: center; gap: 10px; }
.ib-note { flex: 1; font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 4px; cursor: help; }
.ib-note kbd { font-size: 10.5px; padding: 2px 4px; }
.ib-note kbd:first-of-type { margin-left: 6px; }

.mc-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.run-card { border: 1px solid var(--hair); border-radius: 18px; background: var(--paper); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.run-head { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.run-title { font-weight: 650; font-size: 13.5px; color: var(--text); flex: 1; min-width: 0; }
.run-sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 14px; border-bottom: 1px solid var(--hair); position: sticky; top: 0; background: var(--paper); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--soft); }
.tbl .t-title { max-width: 420px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }

/* sơ đồ Trưởng nhóm → agent (trang chi tiết phiên, tab phiên đang chạy) */
.lflow { display: flex; align-items: center; }
.node { position: relative; border: 1px solid var(--hair-2); border-radius: 16px; background: var(--paper); padding: 10px 12px; width: 290px; max-width: 100%; display: flex; flex-direction: column; gap: 3px; }
.node.lead { width: 270px; flex: none; }
.node-run { border-color: color-mix(in srgb, var(--blue) 50%, transparent); box-shadow: 0 0 0 4px var(--blue-bg); }
.node-wait { border-color: color-mix(in srgb, var(--orange) 50%, transparent); }
.node-top { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.node-top b { font-weight: 700; }
.node-st { margin-left: auto; font-size: 11px; color: var(--text-3); font-weight: 600; }
.node-run .node-st { color: var(--blue-tx); }
.node-done .node-st { color: var(--green-tx); }
.node-task { font-size: 12.5px; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.node-now { font-size: 11.5px; color: var(--text-3); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-run .node-now { color: var(--blue-tx); }
.node-meta { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.node-more { font-size: 11.5px; color: var(--text-3); padding: 2px 4px; position: relative; }
.flow-branch { position: relative; display: flex; flex-direction: column; gap: 8px; padding-left: 40px; }
.flow-branch::before { content: ""; position: absolute; left: 20px; top: 20px; bottom: 20px; border-left: 2px solid var(--line); }
.flow-branch > .node::before, .flow-branch > .node-more::before { content: ""; position: absolute; left: -20px; top: 50%; width: 20px; border-top: 2px solid var(--line); }
.flow-branch > .node-run::before { border-top-color: var(--blue); }
.lflow.has-branch > .node.lead::after { content: ""; position: absolute; right: -21px; top: 50%; width: 21px; border-top: 2px solid var(--line); }

/* Việc của bạn: thẻ có nút hành động (mẫu 2) */
.todo { min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-xl); background: var(--col-bg); border: 0; box-shadow: none; }
.todo-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; flex: none; }
.todo-head h2 { font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.todo-n { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--paper); color: var(--text-2); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.todo-n.on { background: var(--orange); color: #fff; }
.todo-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.td { background: var(--paper); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sh-1); }
.td-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.td-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--tone-bg); color: var(--tone); }
.td-ic .ic { width: 15px; height: 15px; }
.td-type { font-weight: 700; font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-tag { flex: none; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 650; display: inline-flex; align-items: center; background: var(--tone-bg); color: var(--tone-tx); }
.td-text { font-size: 13px; color: var(--text); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.td-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); min-width: 0; }
.td-meta .pdot { width: 7px; height: 7px; margin: 0; border-radius: 50%; flex: none; }
.td-actions { display: flex; gap: 8px; }
.td-actions .btn { flex: 1; justify-content: center; height: 32px; }
.td-wait { --tone: var(--orange); --tone-bg: var(--orange-bg); --tone-tx: var(--orange-tx); }
.td-crit { --tone: var(--red); --tone-bg: var(--red-bg); --tone-tx: var(--red-tx); }
.td-info { --tone: var(--purple); --tone-bg: var(--purple-bg); --tone-tx: var(--purple-tx); }
.td-run { --tone: var(--blue); --tone-bg: var(--blue-bg); --tone-tx: var(--blue-tx); }
.td-green { --tone: var(--green); --tone-bg: var(--green-bg); --tone-tx: var(--green-tx); }

/* ----- chi tiết phiên */
.det { max-width: 1520px; gap: 16px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.det-head { display: flex; align-items: flex-start; gap: 16px; }
.det-head-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.det-head h1 { font-family: var(--font-head); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; line-height: 1.3; }
.det-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.det-stat { padding: 12px 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--edge); display: flex; flex-direction: column; gap: 2px; }
.det-stat b { font-family: var(--font-head); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.det-stat span { font-size: 11.5px; color: var(--text-3); }
.flow-panel { padding: 16px; overflow-x: auto; border-radius: var(--r-xl); }
.det-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.det-grid > .panel, .det-side > .panel { padding: 6px 0 10px; border-radius: var(--r-xl); }
.det-side { display: flex; flex-direction: column; gap: 16px; }
.pane-h { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-family: var(--font-head); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--hair); }
.pane-h .ic { color: var(--text-3); }
.det-grid .tabs { padding: 0 12px; }
.tab-note { padding: 10px 16px 0; }
.lt-wrap { max-height: 62vh; overflow-y: auto; padding: 4px 8px; }
.lt { list-style: none; margin: 0; padding: 0; }
.lt-i { display: grid; grid-template-columns: 26px 42px minmax(0, 1fr); gap: 8px; align-items: start; padding: 7px 8px; border-radius: 12px; font-size: 12.5px; }
.lt-i:hover { background: var(--soft); }
.lt-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--text-3); }
.lt-ic .ic { width: 13px; height: 13px; }
.lk-prompt .lt-ic { background: var(--purple-bg); color: var(--purple); }
.lk-delegate .lt-ic { background: var(--blue-bg); color: var(--blue); }
.lk-handback .lt-ic { background: var(--green-bg); color: var(--green); }
.lt-at { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; padding-top: 4px; }
.lt-label { color: var(--text-2); word-break: break-word; padding-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-text { color: var(--text); word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; cursor: pointer; padding-top: 3px; }
.lt-text.open { -webkit-line-clamp: unset; display: block; }
.lk-prompt .lt-text { background: var(--purple-bg); border-radius: 12px; padding: 7px 10px; }
.file-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--text); font: inherit; padding: 9px 16px; }
.file-row:hover { background: var(--soft); }
.file-row > .ic { color: var(--purple); flex: none; }
.file-path { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.file-path small { color: var(--text-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-mini { padding: 12px 16px 6px; display: flex; flex-direction: column; gap: 8px; }

/* ----- Tài liệu */
.docs-page { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; max-width: none; height: calc(100vh - 104px); padding-bottom: 0; }
.dl-list { padding: 12px 10px; display: flex; flex-direction: column; min-height: 0; border-radius: var(--r-xl); }
.dl-list .pane-head { gap: 8px; flex-wrap: wrap; }
.docs-rows { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.doc-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 14px; color: var(--text); }
.doc-row > .ic { width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: var(--purple-bg); color: var(--purple); }
.doc-row:hover { background: var(--soft); text-decoration: none; }
.doc-row.on { background: var(--accent-soft); }
.doc-row-t { display: flex; flex-direction: column; min-width: 0; }
.doc-row-t b { font-weight: 650; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row-t small { color: var(--text-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-main { min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-xl); }
.doc-view { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.doc-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.doc-bar-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.doc-bar-t b { font-family: var(--font-head); font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-bar-t small { color: var(--text-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-bar-a { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.doc-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 16px; background: var(--accent-soft); font-size: 12.5px; }
.doc-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.doc-scroll.editing { overflow: hidden; }
.reader { max-width: 760px; margin: 0 auto; padding: 36px 28px 80px; font-size: 15px; line-height: 1.75; }
.reader.md h1, .reader.md h2, .reader.md h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; }
.reader.md h1 { font-size: 22px; margin-top: 0; } .reader.md h2 { font-size: 17px; margin-top: 30px; } .reader.md h3 { font-size: 15px; }
.reader.md table { font-size: 13px; }
.reader.md td, .reader.md th { padding: 7px 10px; }
.pre-wrap { white-space: pre-wrap; font-family: inherit; margin: 0; }
.doc-editor { height: 100%; }
.doc-editor .toastui-editor-defaultUI { border: 0; border-radius: 0; }
.doc-editor .toastui-editor-contents { font-size: 15px; line-height: 1.7; font-family: var(--font); }
.doc-frame { width: 100%; height: 100%; border: 0; background: var(--paper); display: block; }
.doc-img { padding: 20px; text-align: center; }
.doc-img img { max-width: 100%; height: auto; border-radius: 14px; }

/* ----- Gettime: cửa sổ việc, giao việc */
.gtt-h { font-family: var(--font-head); font-size: 13px; font-weight: 600; margin: 16px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.gtt-h .muted { font-family: var(--font); font-weight: 500; font-size: 11.5px; }
.gtt { border: 1px solid var(--hair); border-radius: 18px; overflow: hidden; max-height: 260px; overflow-y: auto; }
.gtt-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13px; }
.gtt-row + .gtt-row { border-top: 1px solid var(--hair); }
.gtt-row.late { background: var(--red-bg); }
.gtt-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtt-d { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; }
.gta-text { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.5; resize: vertical; border-radius: 16px; }
.gta-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; }
.gta-item { border: 1px solid var(--hair); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--soft); }
.gta-row { display: flex; gap: 6px; }
.gta-row .input { font-weight: 650; }
.gta-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 8px; }
.gta-grid label, .gta-full { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.gta-grid .input, .gta-full .input { height: 34px; font-size: 13px; }
.gta-warn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--orange-tx); }
.gta-res { border: 1px solid var(--hair); border-radius: 18px; overflow: hidden; margin-bottom: 10px; }

@media (max-width: 1240px) {
  .mc-grid { grid-template-columns: minmax(0, 1fr); height: auto; }
  .mc-main { height: 620px; }
  .todo { max-height: 560px; }
  .det-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .content { padding: 4px 4px 20px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-c { display: none; }
  .mc-hero h1 { font-size: 20px; }
  .wf-board { grid-template-columns: repeat(6, minmax(200px, 1fr)) !important; }
  .mc-body { flex-direction: column; overflow: visible; }
  .mc-main { height: auto; overflow: visible; }
  .mc-tabs { overflow-x: auto; }
  .mc-tab { white-space: nowrap; padding: 0 12px; }
  .ib-list { width: auto; border-right: 0; border-bottom: 1px solid var(--hair); max-height: 240px; }
  .ib-scroll { overflow: visible; }
  .lflow { flex-direction: column; align-items: stretch; }
  .node, .node.lead { width: 100%; }
  .flow-branch { padding-left: 24px; margin-top: 10px; }
  .flow-branch::before { left: 10px; top: 0; }
  .flow-branch > .node::before, .flow-branch > .node-more::before { left: -14px; width: 14px; }
  .lflow.has-branch > .node.lead::after { display: none; }
  .docs-page { grid-template-columns: minmax(0, 1fr); height: auto; }
  .dl-list { max-height: 300px; }
  .docs-main { min-height: 70vh; }
  .tbl .hide-sm { display: none; }
  .gta-grid { grid-template-columns: 1fr 1fr; }
}

.kpi, .kpi .kpi-n, .kpi .kpi-l, .kpi .kpi-c { color: #fff; }
.wf-legend .sdot { width: 7px; height: 7px; padding: 0; }

/* khối Gettime: chữ rõ nghĩa, mỗi trạng thái một dòng */
.gt-row .gt-ico { margin-left: auto; border-color: transparent; background: transparent; }
.gtc-me { font-size: 12px; font-weight: 600; color: var(--text-2); margin: -2px 0 6px 34px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user { font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtc-line { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; color: var(--text-2); flex-wrap: wrap; }
.gtc-line .ic { width: 13px; height: 13px; flex: none; }
.gtc-line.ok { color: var(--green-tx); }
.gtc-line.due { color: var(--orange-tx); font-weight: 650; }
.gtc-link { margin-left: auto; border: 0; background: transparent; padding: 0; font: inherit; font-size: 11.5px; font-weight: 650; color: var(--accent); cursor: pointer; }
.gtc-link:hover { text-decoration: underline; }
.gtc-stats { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; text-align: left; font: inherit; font-size: 11.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtc-stats b { color: var(--text); font-weight: 700; }
.gtc-stats b.late { color: var(--red-tx); }
.gtc-assign { flex: 0 0 auto !important; height: 26px; padding: 0 10px; }
.gt-card.due .gtc-foot { border-top-color: color-mix(in srgb, var(--orange) 25%, transparent); }
.gts { display: flex; flex-direction: column; gap: 12px; }
.gts label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.gts .gts-row { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 500; color: var(--text); }
.gts .gts-row input { margin-top: 2px; }
.gts .input { width: 140px; }

/* =====================================================================
 * Bảng màu pastel (19/10/2026, chủ sở hữu chọn — dopely.top #17)
 * #86E3CE bạc hà · #D0E6A5 pistachio · #FFDD94 vàng bơ · #FA897B san hô · #CCABD8 oải hương.
 * Nền màu pastel đi với chữ tối; chữ màu dùng bản đậm của cùng sắc.
 * Nghĩa: oải hương = đang chạy · vàng bơ → san hô = cần bạn · bạc hà = hoàn thành · san hô = quá hạn · pistachio = tài liệu/duyệt.
 * ===================================================================== */
:root, :root[data-theme="light"] {
  --mint: #86e3ce;   --mint-bg: #e7f8f3;   --mint-tx: #1d8a70;
  --pista: #d0e6a5;  --pista-bg: #f2f8e5;  --pista-tx: #5a7a1c;
  --butter: #ffdd94; --butter-bg: #fff6df; --butter-tx: #9a6a0c;
  --coral: #fa897b;  --coral-bg: #feece8;  --coral-tx: #c94636;
  --lav: #ccabd8;    --lav-bg: #f5eef8;    --lav-tx: #7e4f96;
  --accent: #8a63b8; --accent-2: #74519f; --accent-soft: #f3ecf8;
  --run: #b58fd0; --run-bg: var(--lav-bg); --run-tx: var(--lav-tx);
  --wait: #f5b94a; --wait-bg: var(--butter-bg); --wait-tx: var(--butter-tx);
  --done: #4fcfae; --done-bg: var(--mint-bg); --done-tx: var(--mint-tx);
  --crit: #f2735f; --crit-bg: var(--coral-bg); --crit-tx: var(--coral-tx);
  --info: #a6c766; --info-bg: var(--pista-bg); --info-tx: var(--pista-tx);
  --blue: var(--run); --blue-bg: var(--run-bg); --blue-tx: var(--run-tx);
  --orange: var(--wait); --orange-bg: var(--wait-bg); --orange-tx: var(--wait-tx);
  --green: var(--done); --green-bg: var(--done-bg); --green-tx: var(--done-tx);
  --red: var(--crit); --red-bg: var(--crit-bg); --red-tx: var(--crit-tx);
  --purple: var(--info); --purple-bg: var(--info-bg); --purple-tx: var(--info-tx);
  --g-run: linear-gradient(135deg, #ccabd8, #86e3ce);
  --g-wait: linear-gradient(135deg, #ffdd94, #fa897b);
  --g-done: linear-gradient(135deg, #86e3ce, #d0e6a5);
  --g-crit: linear-gradient(135deg, #fa897b, #ccabd8);
  --g-info: linear-gradient(135deg, #d0e6a5, #ffdd94);
  --on-pastel: #2c2531;
  --ck-s1: #b58fd0; --ck-s2: #f5b94a; --ck-sb: #4fcfae;
  --ck-ready-bg: var(--lav-bg); --ck-doing-bg: var(--butter-bg); --ck-done-bg: var(--mint-bg); --ck-late-bg: var(--coral-bg); --ck-block-bg: #f1f1ec;
}
.sidebar .logo { background: var(--g-run); color: var(--on-pastel); box-shadow: 0 6px 14px rgba(150, 120, 180, .25); }
.pulse { background: var(--run); }

/* thẻ chỉ số: nền pastel chuyển màu, chữ tối */
.kpi, .kpi .kpi-n, .kpi .kpi-l, .kpi .kpi-c { color: var(--on-pastel); }
.kpi .kpi-c { opacity: .75; }
.kpi-ic { background: rgba(255, 255, 255, 0.5); }
.kpi::after { background: rgba(255, 255, 255, 0.25); }
.k-orange { background: var(--g-wait); }
.k-blue { background: var(--g-run); }
.k-purple { background: var(--g-info); }
.k-red { background: var(--g-crit); }

/* dải trạng thái thẻ agent */
.ag-band { color: var(--on-pastel); }
.ag.st-run { --band: var(--g-run); }
.ag.st-wait { --band: var(--g-wait); }
.ag.st-done { --band: var(--g-done); }
.ag.st-idle { --band: #ecece5; }

/* vạch màu giai đoạn */
.s-blue { --stage: #ccabd8; } .s-purple { --stage: #86e3ce; } .s-orange { --stage: #ffdd94; }
.s-green { --stage: #d0e6a5; } .s-red { --stage: #fa897b; } .s-teal { --stage: linear-gradient(#ccabd8, #86e3ce); } .s-gray { --stage: #d9d9d2; }
.wf-ch i { width: 5px; height: 20px; }

/* chấm trạng thái */
.sdot-run { background: var(--run); }
.sdot-wait { background: var(--wait); }
.sdot-done { background: var(--done); }
.sdot-crit { background: var(--crit); }
@keyframes sdot { 0% { box-shadow: 0 0 0 0 rgba(181, 143, 208, .55); } 70% { box-shadow: 0 0 0 6px rgba(181, 143, 208, 0); } 100% { box-shadow: 0 0 0 0 rgba(181, 143, 208, 0); } }

/* khối Gettime */
.gt-card { background: var(--mint-bg); border-color: color-mix(in srgb, var(--mint) 55%, transparent); }
.gt-card.due { background: var(--butter-bg); border-color: color-mix(in srgb, var(--butter) 80%, transparent); }
.gt-logo { background: var(--mint); color: var(--on-pastel); }
.gt-btn.primary { background: var(--butter); border-color: var(--butter); color: var(--on-pastel); }
.gtc-line.ok { color: var(--mint-tx); }
.gtc-line.due { color: var(--butter-tx); }
.toast-good > .ic { background: var(--mint); color: var(--on-pastel); }
.toast-error > .ic { background: var(--coral); color: #fff; }
.mc-empty .ic { background: var(--mint-bg); color: var(--mint-tx); }

/* Việc của bạn: lưới thẻ toàn chiều ngang */
.todo { background: transparent; border-radius: 0; overflow: visible; }
.todo-head { padding: 4px 4px 12px; flex-wrap: wrap; }
.todo-head .muted { margin-left: 4px; }
.todo-n.on { background: var(--g-wait); color: var(--on-pastel); }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.todo-grid .mc-empty { grid-column: 1 / -1; background: var(--paper); border-radius: var(--r-xl); max-width: none; }
.td { border: 1px solid var(--edge); box-shadow: var(--sh-1); }
.td-text { -webkit-line-clamp: 2; min-height: 2.9em; }
.td-wait { --tone: #e9a531; }
.td-actions .btn.primary { background: var(--accent); border-color: var(--accent); }

/* hộp trả lời trong cửa sổ nổi */
.ask-modal { display: flex; flex-direction: column; gap: 14px; }
.ib-full summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.ib-full summary::-webkit-details-marker { display: none; }
.ib-full summary .ic { width: 14px; height: 14px; transition: transform .15s; }
.ib-full[open] summary .ic { transform: rotate(90deg); }
.ib-full .md { margin-top: 10px; max-height: 320px; overflow-y: auto; font-size: 13.5px; color: var(--text-2); }
.modal-foot .ib-compose.in-modal { border: 0; padding: 0; width: 100%; background: transparent; }

/* nhãn nhỏ: viên thuốc không viền, chấm màu ở đầu */
.chip { border: 0; border-radius: 999px; height: 24px; padding: 0 10px; background: var(--soft); color: var(--text-2); font-weight: 600; font-size: 11.5px; gap: 5px; }
.chip.tone-crit { background: var(--coral-bg); color: var(--coral-tx); } .chip.tone-crit .ic { color: var(--coral-tx); }
.chip.tone-warn { background: var(--butter-bg); color: var(--butter-tx); } .chip.tone-warn .ic { color: var(--butter-tx); }
.chip.tone-good { background: var(--mint-bg); color: var(--mint-tx); } .chip.tone-good .ic { color: var(--mint-tx); }
.chip.tone-accent { background: var(--lav-bg); color: var(--lav-tx); } .chip.tone-accent .ic { color: var(--lav-tx); }
.ck-legend { gap: 6px; }
.ck-legend .ck-card.mini { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px 0 10px; border: 0; border-radius: 999px; background: var(--paper); box-shadow: 0 0 0 1px var(--hair-2) inset; color: var(--text-2); font-size: 12px; font-weight: 600; opacity: 1; }
.ck-legend .ck-card.mini::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, #cfcfc8); flex: none; }
.ck-legend .side1 { --dot: var(--ck-s1); } .ck-legend .side2 { --dot: var(--ck-s2); } .ck-legend .sideb { --dot: var(--ck-sb); }
.ck-legend .blocked { --dot: #cfcfc8; } .ck-legend .ready { --dot: var(--lav); background: var(--lav-bg); box-shadow: none; }
.ck-legend .doing { --dot: var(--butter); } .ck-legend .done { --dot: var(--mint); } .ck-legend .undecided { --dot: transparent; }
.ck-legend .undecided::before { box-shadow: 0 0 0 1.5px #cfcfc8 inset; } .ck-legend .late { --dot: var(--coral); }
.ck-card { border-radius: 14px; border-left-width: 4px; }
.ck-st { border-radius: 999px; padding: 2px 9px; font-weight: 600; }

/* nút chuyển kiểu xem (Hôm nay | Bảng việc; Bảng | Theo tuần | Gantt) */
.view-switch { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--paper); border: 1px solid var(--edge); box-shadow: var(--sh-1); align-self: flex-start; }
.view-switch a, .view-switch button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; }
.view-switch a:hover, .view-switch button:hover { color: var(--text); text-decoration: none; }
.view-switch .on { background: var(--accent-soft); color: var(--accent-2); }
.view-switch .ic { width: 15px; height: 15px; }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-2); }
.btn.soft:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--lav)); }
.td-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text); line-height: 1.45; }
.td-list li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----- Trang Dự án: tab Tổng quan (thẻ pastel, lộ trình, Output) */
.project { gap: 16px; }
.proj-head { border-radius: var(--r-xl); padding: 20px 22px; }
.proj-head h1 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; }
.ph-badge { border-radius: 16px; }
.project > .tabs { border-bottom: 0; gap: 4px; background: var(--paper); border-radius: 999px; padding: 5px; border: 1px solid var(--edge); align-self: flex-start; box-shadow: var(--sh-1); }
.project > .tabs .tab { border-radius: 999px; border-bottom: 0; margin: 0; height: 34px; padding: 0 16px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.project > .tabs .tab:hover { color: var(--text); text-decoration: none; }
.project > .tabs .tab.on { background: var(--accent-soft); color: var(--accent-2); }
.project > .tabs .tab .ic { width: 15px; height: 15px; }
.pj-kpis { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr 1fr; gap: 14px; }
.pk { border-radius: 22px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; color: var(--on-pastel); box-shadow: var(--sh-2); min-width: 0; position: relative; overflow: hidden; }
.pk::after { content: ""; position: absolute; right: -28px; top: -28px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.pk-run { background: var(--g-run); } .pk-wait { background: var(--g-wait); } .pk-done { background: var(--g-done); } .pk-info { background: var(--g-info); }
.pk-l { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; opacity: .8; }
.pk-l .ic { width: 14px; height: 14px; }
.pk-v { font-family: var(--font-head); font-weight: 600; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pk-v.big { font-size: 30px; line-height: 1; }
.pk-v small { font-size: 16px; opacity: .6; margin-left: 2px; }
.pk-s { font-size: 12px; opacity: .85; margin-top: auto; }
.pk-pill { display: inline-flex; height: 24px; align-items: center; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, .55); font-weight: 650; }
.pk-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .5); overflow: hidden; }
.pk-bar span { display: block; height: 100%; border-radius: 999px; background: var(--on-pastel); opacity: .55; }

.pj-sec, .ck-sec { border-radius: var(--r-xl); padding: 18px 20px; }
.pj-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pj-h h3 { font-family: var(--font-head); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.pj-h.sub { margin: 18px 0 10px; }
.pj-h h4 { font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.ck-h { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.pj-track-wrap { position: relative; padding-top: 22px; }
.pj-track { display: flex; gap: 6px; }
.pj-ph { min-width: 0; border-radius: 14px; padding: 10px 12px; background: var(--soft); display: flex; flex-direction: column; gap: 2px; }
.pj-ph b { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-ph small { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-ph.past { background: var(--mint-bg); }
.pj-ph.past b { color: var(--mint-tx); }
.pj-ph.now { background: var(--g-run); box-shadow: var(--sh-2); }
.pj-ph.now b, .pj-ph.now small { color: var(--on-pastel); }
.pj-today { position: absolute; top: 0; bottom: -4px; width: 0; border-left: 2px dashed var(--coral); }
.pj-today em { position: absolute; top: 0; left: 6px; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--coral-tx); white-space: nowrap; }
.pj-ms { display: flex; flex-direction: column; gap: 8px; }
.pj-m { display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 16px; background: var(--soft); }
.pj-date { width: 46px; height: 46px; flex: none; border-radius: 14px; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--sh-1); }
.pj-date b { font-family: var(--font-head); font-size: 16px; font-weight: 600; line-height: 1; }
.pj-date small { font-size: 10.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.pj-m:first-child .pj-date { background: var(--g-wait); }
.pj-m-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pj-m-t b { font-size: 13.5px; font-weight: 650; }
.pj-m-t span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-outs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pj-out { border: 1px solid var(--edge); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); min-width: 0; }
.pj-out.o-run { border-color: color-mix(in srgb, var(--lav) 70%, transparent); }
.pj-out.o-wait { border-color: color-mix(in srgb, var(--butter) 90%, transparent); }
.pj-out.o-done { background: var(--mint-bg); border-color: transparent; }
.pj-out-top { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.pj-out-top b { font-size: 13.5px; font-weight: 650; line-height: 1.35; padding-top: 3px; }
.pj-num { width: 28px; height: 28px; flex: none; border-radius: 9px; background: var(--soft); display: grid; place-items: center; font-family: var(--font-head); font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.o-run .pj-num { background: var(--lav-bg); color: var(--lav-tx); }
.o-wait .pj-num { background: var(--butter-bg); color: var(--butter-tx); }
.o-done .pj-num { background: var(--paper); color: var(--mint-tx); }
.pj-out-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pj-out-n { font-size: 11.5px; color: var(--text-3); }
.pj-out-bar { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.pj-out-bar span { display: block; height: 100%; border-radius: 999px; background: var(--g-done); }
.pj-next { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.pj-lead { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); margin-top: auto; }
.pj-av { width: 22px; height: 22px; border-radius: 50%; background: var(--g-run); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--on-pastel); flex: none; }
@media (max-width: 1100px) { .pj-kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .pj-kpis { grid-template-columns: 1fr; } .pj-track { flex-direction: column; } .pj-today { display: none; } }
.pj-h .sp { flex: 1; }
.pj-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pj-person { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--soft); cursor: help; min-width: 0; }
.pj-person .pj-av { width: 32px; height: 32px; font-size: 13px; }
.pj-person.sd-2 .pj-av { background: var(--g-wait); }
.pj-person.sd-both .pj-av { background: var(--g-done); }
.pj-person.empty { background: transparent; border: 1.5px dashed var(--hair-2); }
.pj-person.empty .pj-av { background: var(--soft); color: var(--text-3); }
.pj-pn { display: flex; flex-direction: column; min-width: 0; }
.pj-pn b { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-person.empty .pj-pn b { color: var(--text-3); font-weight: 600; }
.pj-pn small { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-qs summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.pj-qs summary::-webkit-details-marker { display: none; }
.pj-qs summary .ic { margin-left: auto; width: 16px; height: 16px; color: var(--text-3); transition: transform .15s; }
.pj-qs[open] summary .ic { transform: rotate(180deg); }
.pj-qs[open] summary { margin-bottom: 12px; }
.ck-qs { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; }
.ck-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ck-tile { border: 0; border-radius: 18px; background: var(--soft); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ck-tile.nodata { background: var(--soft); }
.ck-tname { font-size: 12px; font-weight: 650; color: var(--text-2); min-height: 2.6em; line-height: 1.3; }
.ck-tnum { display: flex; align-items: baseline; gap: 4px; }
.ck-tin { width: 100%; min-width: 0; border: 0; background: transparent; font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--text); padding: 0; outline: none; }
.ck-tin::placeholder { color: var(--hair-2); }
.ck-tin:focus { background: var(--paper); border-radius: 8px; box-shadow: 0 0 0 3px var(--accent-soft); }
.ck-tunit { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.ck-tile .ck-bar { height: 5px; border-radius: 999px; background: var(--paper); overflow: hidden; }
.ck-tile .ck-bar span { display: block; height: 100%; background: var(--g-done); border-radius: 999px; }
.ck-tile .ck-bar.ghost { background: repeating-linear-gradient(90deg, #fff 0 6px, transparent 6px 10px); }
.ck-tfoot { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--text-3); }
.ck-tfoot b { color: var(--text); }
.ck-owe { padding: 9px 12px; border-radius: 14px; background: var(--soft); margin-bottom: 6px; font-size: 13px; }
.ck-owe.late { background: var(--coral-bg); }
.ck-grid-wrap { margin-top: 16px; border: 1px solid var(--edge); border-radius: 18px; overflow: auto; }
.ck-grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ck-grid th { text-align: left; font-size: 11.5px; font-weight: 650; color: var(--text-2); padding: 10px 12px; background: var(--soft); border-bottom: 1px solid var(--hair); }
.ck-grid td { padding: 9px 12px; border-bottom: 1px solid var(--hair); color: var(--text-2); }
.ck-grid tr:last-child td { border-bottom: 0; }
.ck-grid td:first-child { font-weight: 600; color: var(--text); }
.ck-grid th.on { background: var(--lav-bg); color: var(--lav-tx); }
.ck-grid td.on { background: color-mix(in srgb, var(--lav-bg) 70%, #fff); color: var(--text); font-weight: 600; }
.pj-divider { display: flex; align-items: center; gap: 12px; margin: 10px 4px -2px; }
.pj-divider h2 { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--text-2); letter-spacing: -0.01em; white-space: nowrap; }
.pj-divider::after { content: ""; flex: 1; height: 1px; background: var(--hair-2); }
.pj-results .ck-tile:not(.nodata) { background: var(--mint-bg); }
.pj-results .ck-tile:not(.nodata) .ck-tin { font-size: 24px; }
.ck-pct { color: var(--mint-tx); }
.pj-empty { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; background: var(--soft); flex-wrap: wrap; }
.pj-empty p { flex: 1; min-width: 260px; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.pj-empty-a { display: flex; gap: 8px; }

/* ----- Việc (Hôm nay · Tuần · Bảng) */
.wk-page { gap: 16px; max-width: 1520px; }
.wk-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 4px 0; }
.wk-hero h1 { font-family: var(--font-head); font-weight: 600; font-size: 24px; letter-spacing: -0.02em; color: var(--text-2); }
.wk-hero h1 em { font-style: normal; color: var(--accent); }
.wk-hero p { margin-top: 6px; color: var(--text-3); font-size: 13px; }
.wk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wk-sec { background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r-xl); padding: 14px 16px; box-shadow: var(--sh-1); }
.wk-sh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wk-sh h3 { font-family: var(--font-head); font-weight: 600; font-size: 14px; }
details.wk-sec summary { list-style: none; cursor: pointer; margin-bottom: 0; }
details.wk-sec summary::-webkit-details-marker { display: none; }
details.wk-sec summary .ic { margin-left: auto; width: 16px; height: 16px; color: var(--text-3); }
details.wk-sec[open] summary { margin-bottom: 8px; }
.wk-late { border-color: color-mix(in srgb, var(--coral) 45%, var(--edge)); }
.wk-list { display: flex; flex-direction: column; }
.wk-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--hair); }
.wk-list .wk-row:first-child { border-top: 0; }
.wk-row:hover { background: var(--soft); border-radius: 12px; }
.wk-check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--hair-2); background: var(--paper); display: grid; place-items: center; cursor: pointer; color: transparent; padding: 0; }
.wk-check .ic { width: 13px; height: 13px; }
.wk-check:hover { border-color: var(--mint); color: var(--mint-tx); background: var(--mint-bg); }
.wk-check.gt { border: 0; background: var(--mint); color: var(--on-pastel); font-family: var(--font-head); font-size: 11px; font-weight: 700; cursor: default; }
.wk-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wk-title { border: 0; background: transparent; padding: 0; text-align: left; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
span.wk-title { cursor: default; }
button.wk-title:hover { color: var(--accent); }
.wk-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.wk-meta .lchip { height: 20px; font-size: 10.5px; }
.lchip.wk-gt { background: var(--mint-bg); color: var(--mint-tx); }
.wk-acts { display: flex; gap: 6px; }
.wk-empty { font-size: 12.5px; color: var(--text-3); padding: 6px 4px; }
.wk-week { display: grid; gap: 10px; overflow-x: auto; }
.wk-day { background: var(--col-bg); border-radius: 18px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 260px; }
.wk-day.on { background: var(--lav-bg); box-shadow: 0 0 0 2px var(--lav) inset; }
.wk-day.late { background: var(--coral-bg); }
.wk-dh { display: flex; align-items: baseline; gap: 6px; padding: 4px 6px; }
.wk-dh span { font-size: 11.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; }
.wk-dh b { font-family: var(--font-head); font-size: 18px; font-weight: 600; }
.wk-day.late .wk-dh b, .wk-day.late .wk-dh span { color: var(--coral-tx); }
.wk-dl { display: flex; flex-direction: column; gap: 6px; }
.wk-none { color: var(--hair-2); text-align: center; padding: 10px 0; }
.wk-card { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 0; border-radius: 12px; background: var(--paper); padding: 8px 10px; cursor: pointer; font: inherit; color: var(--text); box-shadow: var(--sh-1); }
.wk-card:hover { box-shadow: 0 0 0 1.5px var(--lav) inset; }
.wk-card.gt { background: var(--mint-bg); }
.wk-card.late { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--coral) 60%, transparent) inset; }
.wk-card-t { font-size: 12px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wk-card-m { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-3); }
.wk-card-m .pdot { width: 6px; height: 6px; margin: 0; border-radius: 50%; }
.wk-page.board-page .chips-row, .wk-page .board-filters { margin-top: 0; }

/* ----- Dự án: tổng quan hiệu quả mọi dự án */
.pf-page { gap: 16px; max-width: 1520px; }
.kpi .kpi-n small { font-size: 16px; opacity: .6; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.pf-card { background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r-xl); padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--sh-1); min-width: 0; }
.pf-h { display: flex; align-items: flex-start; gap: 12px; }
.pf-badge { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; flex: none; }
.pf-ht { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-ht a b { font-size: 14.5px; font-weight: 700; color: var(--text); }
.pf-ht .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pf-kpi { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; background: var(--soft); }
.pf-ring { --p: 0; width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center; background: radial-gradient(closest-side, #fff 76%, transparent 78% 100%), conic-gradient(var(--done) calc(var(--p) * 1%), var(--hair) 0); }
.pf-ring span { font-family: var(--font-head); font-size: 13px; font-weight: 600; }
.pf-kpi-t { display: flex; flex-direction: column; gap: 2px; }
.pf-kpi-t b { font-size: 13.5px; }
.pf-kpi-t span { font-size: 12px; color: var(--text-3); }
.pf-metrics { display: flex; flex-direction: column; gap: 9px; }
.pf-m-t { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; }
.pf-m-t .ellip { flex: 1; color: var(--text-2); }
.pf-m-t b { font-family: var(--font-head); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pf-m-t small { font-family: var(--font); color: var(--text-3); font-weight: 500; }
.pf-bar { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; margin-top: 4px; }
.pf-bar span { display: block; height: 100%; border-radius: 999px; background: var(--g-run); }
.pf-bar .t-done { background: var(--g-done); } .pf-bar .t-wait { background: var(--g-wait); } .pf-bar .t-crit { background: var(--coral); }
.pf-f { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--text-3); }
.pf-f span { display: inline-flex; align-items: center; gap: 5px; }
.pf-f .ic { width: 13px; height: 13px; }
.pf-a { display: flex; gap: 8px; justify-content: flex-end; margin-top: auto; }

/* ----- Báo cáo */
.rp-page { gap: 16px; max-width: 1520px; }
.rp-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.rp-list { padding: 14px 10px; border-radius: var(--r-xl); display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; }
.rp-list .pj-h { padding: 0 6px; }
.rp-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; color: var(--text); }
.rp-item:hover { background: var(--soft); text-decoration: none; }
.rp-item.on { background: var(--accent-soft); }
.rp-item .pdot { width: 9px; height: 9px; border-radius: 50%; margin: 0; flex: none; }
.rp-item span { display: flex; flex-direction: column; min-width: 0; }
.rp-item b { font-size: 13px; font-weight: 650; }
.rp-item small { font-size: 11.5px; color: var(--text-3); }
.rp-build, .rp-view { border-radius: var(--r-xl); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.rp-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: end; }
.rp-form label, .rp-notes label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.rp-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-notes textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; border-radius: 14px; }
.rp-msg { border-radius: 18px; background: var(--mint-bg); padding: 12px 14px; }
.rp-msg-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rp-msg-h .btn { margin-left: auto; }
.rp-msg pre { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 13px; line-height: 1.55; max-height: 260px; overflow-y: auto; }
.rp-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rp-actions .sp { flex: 1; }
.rp-view-h { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rp-view-h > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rp-view-h b { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.rp-view-a { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-frame { width: 100%; height: 72vh; border: 1px solid var(--edge); border-radius: 18px; background: var(--wall); }
.modal-frame { height: 70vh; }
@media (max-width: 1000px) { .rp-grid { grid-template-columns: minmax(0, 1fr); } .rp-list { position: static; } .rp-form, .rp-notes { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .wk-row { grid-template-columns: 28px minmax(0, 1fr); } .wk-row > .lchip, .wk-acts { grid-column: 2; } }


/* =====================================================================
 * Hệ nhận diện gettime (brand guideline v3.1, 19/10/2026) — chỉ chế độ sáng.
 * Trung tính: kem #FDF4E2 (nền) · giấy #FFFFFF (thẻ) · đêm #0D0B1E (chữ) · đường kẻ #E6DCC6.
 * Thương hiệu: tím #765DF6 · tím UI #6A4FF0 (nút, link, chữ nhỏ) · tím nhạt #DFD3E6 (nền nhấn).
 * Tám màu agent chỉ để nhận diện agent (K.AGENT_BRAND trong core.js), không dùng cho trạng thái.
 * Trạng thái (chạy, chờ, xong, lỗi) dùng bộ màu riêng và luôn có chữ đi kèm.
 * Chữ: Space Grotesk (tiêu đề Bold −6%, phụ Medium −3%, nội dung Regular); nhãn, số liệu: Space Mono +4%.
 * Không gradient, không trộn màu agent thành cầu vồng.
 * ===================================================================== */
:root, :root[data-theme="light"] {
  --kem: #FDF4E2; --dem: #0D0B1E; --giay: #FFFFFF; --duong-ke: #E6DCC6;
  --tim: #765DF6; --tim-ui: #6A4FF0; --tim-nhat: #DFD3E6;
  --font: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, Menlo, monospace;
  --wall: var(--kem); --paper: var(--giay); --glass: var(--paper); --glass-strong: var(--paper); --panel: var(--paper); --panel-solid: var(--paper); --card: var(--paper);
  --soft: #FBF1DD; --col-bg: #F6EAD0; --edge: var(--duong-ke); --hair: #EFE6D3; --hair-2: #DDD0B5;
  --text: var(--dem); --text-2: #48445A; --text-3: #85808F;
  --fill: rgba(13, 11, 30, 0.06); --fill-2: rgba(13, 11, 30, 0.035); --fill-3: rgba(13, 11, 30, 0.12);
  --accent: var(--tim-ui); --accent-2: #5336DE; --accent-soft: #ECE6FB;
  --run: var(--tim-ui); --run-bg: #ECE6FB; --run-tx: #5336DE;
  --wait: #E8A317; --wait-bg: #FCEBC4; --wait-tx: #885800;
  --done: #2E9E5B; --done-bg: #DAF0E0; --done-tx: #216E47;
  --crit: #D9434B; --crit-bg: #FBDCDA; --crit-tx: #A3262E;
  --info: #6B6679; --info-bg: #EFE6D3; --info-tx: #48445A;
  --mint: #7FD3A0; --mint-bg: var(--done-bg); --mint-tx: var(--done-tx);
  --pista: var(--tim-nhat); --pista-bg: var(--info-bg); --pista-tx: var(--info-tx);
  --butter: #FFCB5C; --butter-bg: var(--wait-bg); --butter-tx: var(--wait-tx);
  --coral: #FF9A8E; --coral-bg: var(--crit-bg); --coral-tx: var(--crit-tx);
  --lav: #C7BBFB; --lav-bg: var(--run-bg); --lav-tx: var(--run-tx);
  --blue: var(--run); --blue-bg: var(--run-bg); --blue-tx: var(--run-tx);
  --orange: var(--wait); --orange-bg: var(--wait-bg); --orange-tx: var(--wait-tx);
  --green: var(--done); --green-bg: var(--done-bg); --green-tx: var(--done-tx);
  --red: var(--crit); --red-bg: var(--crit-bg); --red-tx: var(--crit-tx);
  --purple: var(--info); --purple-bg: var(--info-bg); --purple-tx: var(--info-tx);
  --g-run: var(--lav); --g-wait: var(--butter); --g-done: var(--mint); --g-crit: var(--coral); --g-info: var(--tim-nhat);
  --on-pastel: var(--dem);
  --idle: #CFC3A8; --line: var(--duong-ke);
  --ck-s1: var(--run); --ck-s2: var(--wait); --ck-sb: var(--done);
  --ck-ready-bg: var(--run-bg); --ck-doing-bg: var(--wait-bg); --ck-done-bg: var(--done-bg); --ck-late-bg: var(--crit-bg); --ck-block-bg: #F3EBDA;
  --r-xl: 18px; --r-lg: 14px; --r: 10px; --r-sm: 8px;
  --sh-1: none;
  --sh-2: 0 1px 0 rgba(13, 11, 30, 0.04), 0 8px 24px rgba(13, 11, 30, 0.06);
  --sh-pop: 0 24px 60px rgba(13, 11, 30, 0.18), 0 4px 12px rgba(13, 11, 30, 0.06);
}
body { font-family: var(--font); letter-spacing: 0; }
code, kbd, .lp-id, .ib-step, .doc-pre { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* tiêu đề: Space Grotesk Bold −6% cho tiêu đề lớn, Medium −3% cho tiêu đề phụ */
.mc-hero h1, .wk-hero h1, .proj-head h1, .det-head h1, .tm-head h1 { font-weight: 700; letter-spacing: -0.05em; color: var(--text); }
.mc-hero h1 em { color: var(--tim); }
.tb-title, .wf-title h2, .todo-head h2, .ib-head-row h3, .pj-h h3, .ck-h, .wk-sh h3, .pj-divider h2, .rp-view-h b, .gtt-h, .pane-h { font-weight: 600; letter-spacing: -0.03em; }
.kpi-n, .pk-v, .det-stat b, .pj-date b, .wk-dh b, .pf-ring span, .pf-m-t b { font-weight: 700; letter-spacing: -0.04em; }

/* nhãn, số liệu nhỏ: Space Mono, chữ thường, giãn +4% */
.ag-band, .sidebar .nav-group, .wf-ch b, .wf-sub, .nav-count, .ck-delta, .gt-st, .tm-card-head code, .tm-head-row code, .lchip-run, .lchip-wait, .lchip-done, .lchip-crit, .wf-legend {
  font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: none;
}
.ag-band { font-size: 10.5px; font-weight: 400; }
.sidebar .nav-group { font-size: 11px; font-weight: 400; text-transform: lowercase; }
.wf-ch b { font-size: 11.5px; font-weight: 700; text-transform: lowercase; }

/* khung app: giấy trên nền kem, kẻ viền thay bóng */
.glass, .panel { box-shadow: none; }
.sidebar .sb-name { font-weight: 700; font-size: 17px; letter-spacing: -0.05em; }
.sidebar .sb-name .os { color: var(--tim); }
.sidebar .logo { width: 34px; height: 34px; border-radius: 50%; background: none; box-shadow: none; color: var(--dem); }
.sidebar .logo svg { width: 34px; height: 34px; }

/* nút: tím UI cho việc chính, viền đêm cho việc phụ */
.btn { border-radius: 8px; font-weight: 500; border-color: var(--hair-2); }
.btn.sm { border-radius: 8px; }
.btn.primary { background: var(--tim-ui); border-color: var(--tim-ui); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.soft { background: var(--accent-soft); color: var(--accent-2); }
.btn.soft:hover { background: var(--tim-nhat); }
.input { border-radius: 8px; }
.td-actions .btn.primary { background: var(--tim-ui); border-color: var(--tim-ui); }
.view-switch .on, .project > .tabs .tab.on, .sidebar .nav-item.on { background: var(--accent-soft); color: var(--accent-2); }
.sidebar .nav-item.on .ni { color: var(--tim-ui); }
.sidebar .sb-capture:focus-within { border-color: var(--tim-ui); box-shadow: 0 0 0 3px var(--accent-soft); }

/* thẻ chỉ số: nền màu đặc, chữ đêm; ô "agent đang chạy" nền tím chữ kem */
.kpi { box-shadow: none; border-radius: 16px; }
.kpi, .kpi .kpi-n, .kpi .kpi-l, .kpi .kpi-c { color: var(--dem); }
.kpi .kpi-c { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; opacity: .8; }
.kpi-ic { background: rgba(255, 255, 255, 0.45); }
.kpi::after { background: rgba(255, 255, 255, 0.18); }
.k-blue { background: var(--tim); }
.k-blue, .k-blue .kpi-n, .k-blue .kpi-l, .k-blue .kpi-c { color: var(--kem); }
.k-blue .kpi-ic { background: rgba(253, 244, 226, 0.2); }
.k-orange { background: var(--butter); }
.k-green { background: var(--mint); }
.k-red { background: var(--coral); }
.k-purple { background: var(--tim-nhat); }

/* dải trạng thái thẻ agent */
.ag-band { color: var(--dem); }
.ag.st-run { --band: var(--g-run); }
.ag.st-wait { --band: var(--g-wait); }
.ag.st-done { --band: var(--g-done); }
.ag.st-idle { --band: #EFE6D3; }
.ag-ic.ag-av { width: 26px; height: 26px; border-radius: 8px; background: none; padding: 0; }
.ag.st-run .ag-ic.ag-av, .ag.st-wait .ag-ic.ag-av, .ag.st-done .ag-ic.ag-av { background: none; }
.ag-ic.ag-av svg { width: 26px; height: 26px; }

/* vạch giai đoạn = màu agent phụ trách giai đoạn đó */
.s-blue { --stage: var(--dem); } .s-purple { --stage: #6EC8FF; } .s-orange { --stage: #FFB020; }
.s-green { --stage: var(--tim); } .s-red { --stage: #CFF05B; } .s-teal { --stage: #2EC4B6; } .s-gray { --stage: var(--idle); }
@keyframes sdot { 0% { box-shadow: 0 0 0 0 rgba(106, 79, 240, .5); } 70% { box-shadow: 0 0 0 6px rgba(106, 79, 240, 0); } 100% { box-shadow: 0 0 0 0 rgba(106, 79, 240, 0); } }

/* avatar agent: khung bo góc nền màu agent, mặt đồng hồ màu đêm (maestro: nền đêm, mặt kem) */
.agav { display: inline-block; flex: none; line-height: 0; }
.agav svg { display: block; width: 100%; height: 100%; }

.toast-good > .ic { background: var(--done); color: #fff; }
.toast-error > .ic { background: var(--crit); color: #fff; }
.gt-card { background: var(--done-bg); border-color: color-mix(in srgb, var(--done) 30%, transparent); }
.gt-card.due { background: var(--wait-bg); border-color: color-mix(in srgb, var(--wait) 40%, transparent); }
.gt-logo { background: var(--dem); color: var(--kem); border-radius: 50%; }
.gt-btn.primary { background: var(--tim-ui); border-color: var(--tim-ui); color: #fff; }
.nav-count.warn, .sidebar .nav-count.warn { background: var(--wait); color: var(--dem); }
.mc-tab .cnt.wait, .todo-n.on { background: var(--butter); color: var(--dem); }
.doc-frame, .rp-frame { background: var(--wall); }
.rp-assess { border: 1px solid var(--edge); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.rp-as-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rp-as-h .btn { margin-left: auto; }
.rp-as-row { display: grid; grid-template-columns: minmax(180px, 1.1fr) 140px minmax(0, 2fr); gap: 10px; align-items: start; padding: 8px 10px; border-radius: 14px; background: var(--soft); border-left: 4px solid var(--idle); }
.rp-as-row.v-tot { border-left-color: var(--done); }
.rp-as-row.v-can-cai-thien { border-left-color: var(--crit); }
.rp-as-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-as-t b { font-size: 12.5px; }
.rp-as-t small { font-size: 11.5px; color: var(--text-3); }
.rp-as-row textarea { height: auto; min-height: 52px; padding: 8px 10px; line-height: 1.45; resize: vertical; border-radius: 12px; font-size: 12.5px; }
@media (max-width: 900px) { .rp-as-row { grid-template-columns: 1fr; } }

/* ---- Trang Việc: mục "Cần bạn"; Phòng điều hành: thời gian dự kiến xong (19/10/2026) */
.wk-needsec { border-color: color-mix(in srgb, var(--wait) 38%, var(--line)); }
.wk-need .nd-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; border: 0; flex: none; }
.wk-need .nd-ic svg { width: 15px; height: 15px; }
.wk-need .nd-ic.t-wait { background: var(--wait-bg); color: var(--wait-tx); }
.wk-need .nd-ic.t-info { background: var(--info-bg); color: var(--info-tx); }
.wk-need .nd-ic.t-done { background: var(--done-bg); color: var(--done-tx); }
.wk-need .wk-title { white-space: normal; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk-need .lchip.ellip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-wait { color: var(--wait-tx); font-weight: 600; text-decoration: none; }
.tx-wait:hover { text-decoration: underline; }
.ag-eta { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--run-tx); }
.ag-eta svg { width: 12px; height: 12px; }
.k-green { background: var(--g-done); }
.ans-note { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--done-bg); border-color: color-mix(in srgb, var(--done) 30%, transparent); color: var(--done-tx); font-size: 13.5px; }
.ans-note svg { width: 18px; height: 18px; flex: none; }
.ans-note span { flex: 1; }

/* ---------- Đội agent (19/10/2026) ---------- */
.tm-page { display: flex; flex-direction: column; gap: 14px; }
.tm-dot { display: inline-block; border-radius: 99px; flex: none; }
.tm-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.tm-node { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--card); box-shadow: 0 0 0 1px var(--hair); color: var(--text); font-weight: 600; font-size: 12.5px; text-decoration: none; }
.tm-node:hover { box-shadow: 0 0 0 1px var(--hair-2), var(--sh-1); }
.tm-par { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 99px; background: var(--fill); }
.tm-arrow { color: var(--text-3); display: inline-flex; }
.tm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tm-card { display: flex; flex-direction: column; gap: 9px; padding: 14px 15px; text-decoration: none; color: var(--text); border-top: 3px solid var(--tm); }
.tm-card:hover { box-shadow: 0 0 0 1px var(--hair-2), var(--sh-1); }
.tm-card-head, .tm-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tm-card-head code, .tm-head-row code { font-size: 11.5px; color: var(--text-3); }
.tm-role { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.tm-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.tm-crumb a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-size: 13px; }
.tm-head { padding: 16px 18px; border-left: 4px solid var(--tm); display: flex; flex-direction: column; gap: 8px; }
.tm-head h1 { margin: 0; font-size: 22px; }
.tm-head p { margin: 0; color: var(--text-2); line-height: 1.5; }
.tm-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.tm-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.tm-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tm-skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tm-skill { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--edge); background: var(--panel); cursor: pointer; }
.tm-skill b { font-size: 13px; }
.tm-skill span { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.tm-skill:hover { box-shadow: 0 0 0 1px var(--hair-2), var(--sh-1); }
.tm-runs { position: sticky; top: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 120px); }
.tm-runs .runs-list { overflow: auto; }
@media (max-width: 1100px) { .tm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tm-cols { grid-template-columns: 1fr; } .tm-runs { position: static; max-height: none; } }
@media (max-width: 700px) { .tm-grid, .tm-skills { grid-template-columns: 1fr; } }
/* Đội chuyên gia cấp máy (23/10/2026) */
.dg-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 14px; font-size: 13px; color: var(--text-2); }
.dg-bar > .ic { color: var(--good); flex: none; }
.dg-bar.warn > .ic { color: var(--warn); }
.dg-bar span { min-width: 0; }
.dg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dg-ic { display: inline-flex; color: var(--tm); }
.dg-st.ok { color: var(--good); }
.dg-st.warn { color: var(--warn); }
.dg-chung { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.dg-chung p { margin: 0; }
.dg-members { display: flex; flex-wrap: wrap; gap: 6px; }
.dg-dim { font-weight: 500; color: var(--text-3); font-size: 11.5px; }
.dg-mcard { text-decoration: none; color: var(--text); }
.dg-mcard b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dg-mcard code { font-size: 11px; color: var(--text-3); font-weight: 500; }
.dg-res { list-style: none; margin: 0; padding: 6px 14px; }
.dg-res li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.dg-res li:last-child { border-bottom: 0; }
.dg-res li span { text-align: right; flex: none; max-width: 45%; }
.dg-live { padding: 4px 14px; }
.dg-more { margin: 6px 0 8px; }
.dg-job { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--hair); text-decoration: none; color: var(--text); font-size: 13px; }
.dg-job:last-child { border-bottom: 0; }
.dg-job-t { flex: 1; min-width: 160px; color: var(--text-2); }
.dg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; margin-right: 4px; }
.dg-dot.run { background: var(--good); animation: pulse 1.6s infinite; }
@media (max-width: 700px) { .dg-grid { grid-template-columns: 1fr; } .dg-res li { flex-direction: column; gap: 2px; } .dg-res li span { text-align: left; max-width: none; } }
/* Ô chỉ số: cột theo tuần + mức đổi so với mốc (19/10/2026) */
.ck-trend { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 30px; }
.ck-spark { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 28px; flex: 1; min-width: 0; max-width: 120px; }
.ck-spark i { flex: 1; max-width: 12px; border-radius: 3px 3px 1px 1px; background: var(--tim-nhat); }
.ck-spark i.last { background: var(--tim); }
.ck-spark em { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--hair-2); pointer-events: none; }
.ck-delta { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--soft); color: var(--text-2); white-space: nowrap; }
.ck-delta.up { background: var(--done-bg); color: var(--done-tx); }
.ck-delta.down { background: var(--crit-bg); color: var(--crit-tx); }
.wk-more { margin-top: 8px; }

/* Phụ đề hạn mức Claude (limit-banner.js) và ô chọn làm chung (đồng bộ) */
.limit-banner { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 99px; background: var(--warn-soft); color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; }
.limit-banner[hidden] { display: none; }
.shared-tick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.shared-tick input { margin: 0; }
@media (max-width: 720px) { .limit-banner { display: none; } }

/* Việc giao giữa hai người (assign.js) */
.wk-check.as { background: var(--orange-bg); color: var(--orange-tx); cursor: default; }
.wk-meta .lchip.wk-as { background: var(--orange-bg); color: var(--orange-tx); }
.wk-card.as { border-left: 3px solid var(--orange-tx); }
.as-board .col { max-width: none; min-width: 230px; }
.as-card { display: flex; flex-direction: column; gap: 7px; padding: 11px 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--hair); box-shadow: var(--sh-1); }
.as-card.late { border-color: color-mix(in srgb, var(--crit) 45%, transparent); }
.as-card.closed { opacity: 0.65; }
.as-title { font-weight: 600; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.as-note { font-size: 12.5px; color: var(--text-2); line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.as-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.as-reason { display: flex; gap: 6px; align-items: flex-start; padding: 7px 9px; border-radius: 8px; background: var(--crit-soft); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.as-reason .ic { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.as-foot { font-size: 11.5px; color: var(--text-3); }
.as-acts { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.as-switch { margin: 0; }
.as-cancelled { margin-top: 14px; }
.as-cancelled summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.as-cancel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
@media (max-width: 900px) { .as-board { flex-direction: column; } .as-board .col { max-width: none; width: 100%; } }

/* ---- Nông trại (farm.js): đảo 1440x1040 kéo và phóng to được, chữ là lớp HTML phủ lên, cỡ chữ theo --fz (mức phóng) ---- */
.farm-page { --font-pixel: "VT323", "Space Mono", ui-monospace, monospace; }
.farm-page .fm-sub { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.farm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.farm-stage { --fz: 1; position: relative; width: 100%; height: clamp(420px, 68vh, 760px); border-radius: var(--r-lg); overflow: hidden; border: 3px solid #5b3a1e; box-shadow: var(--sh-2); background: #2f78bf; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.farm-stage.dragging { cursor: grabbing; }
.farm-stage canvas.farm-view { position: absolute; inset: 0; display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.farm-ov, .farm-cds, .farm-pops, .farm-names { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.farm-sign { position: absolute; transform: translate(0, -100%); display: flex; flex-direction: column; align-items: stretch; gap: 1px; padding: 1px 4px 2px; background: linear-gradient(#a8743f, #8a5a2e); border: 2px solid #4a2c12; border-radius: 2px; color: #fff3d6; font-family: var(--font-pixel); font-size: clamp(9px, calc(10.5px * var(--fz)), 15px); line-height: 1; white-space: nowrap; overflow: hidden; box-shadow: inset 0 1px 0 #c99556, 0 2px 0 #00000040; text-shadow: 1px 1px 0 #4a2c12; }
.farm-sign b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.farm-sign i { font-style: normal; color: #d9f5b8; font-size: .85em; overflow: hidden; text-overflow: ellipsis; }
.farm-bar { display: block; height: 3px; background: #5b3a1e; }
.farm-bar span { display: block; height: 100%; background: #ffd23f; }
.farm-sign.live { border-color: #2f7d32; box-shadow: inset 0 1px 0 #c99556, 0 0 0 1px #9be37c, 0 2px 0 #00000040; }
.farm-sign.capped { border-color: #c98a1a; }
.farm-sign.capped i { color: #ffc46b; }
/* biển gỗ nhỏ chỉ ghi tên, có cọc cắm đất; rê chuột vào mới mở dòng phụ và thanh XP */
.farm-sign { pointer-events: auto; overflow: visible; background: repeating-linear-gradient(180deg, #a8743f 0 3px, #9a6835 3px 4px); }
.farm-sign::after { content: ""; position: absolute; left: 6px; bottom: -7px; width: 3px; height: 5px; background: #5b3a1e; box-shadow: 1px 0 0 #3a2410; }
.farm-sign i, .farm-sign .farm-bar { display: none; }
.farm-sign:hover { z-index: 5; max-width: none !important; }
.farm-house-tag[title] { pointer-events: auto; cursor: help; }
.farm-sign:hover i, .farm-sign:hover .farm-bar { display: block; }
.farm-pop { position: absolute; transform: translate(-50%, -100%); padding: 1px 6px; background: #ffd23f; color: #3d2a14; border: 2px solid #7a4b25; font-family: var(--font-pixel); font-size: clamp(11px, calc(14px * var(--fz)), 20px); white-space: nowrap; animation: farm-rise 2.4s ease-out forwards; }
@keyframes farm-rise { 0% { opacity: 0; margin-top: 8px; } 15% { opacity: 1; margin-top: 0; } 75% { opacity: 1; } 100% { opacity: 0; margin-top: -24px; } }
/* nhãn khu, lều, lửa trại, lâu đài, cây: khung gỗ tối chữ pixel, viền theo màu người qua --pc */
.farm-house-tag, .farm-tent-tag, .farm-fire-tag, .farm-tree-tag { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; padding: 1px 6px; background: #3d2a14e6; color: #f6e7c1; border: 2px solid #1f150a; font-family: var(--font-pixel); line-height: 1; white-space: nowrap; }
.farm-house-tag b, .farm-tent-tag b, .farm-fire-tag b, .farm-tree-tag b { font-weight: 400; }
.farm-house-tag i, .farm-tent-tag i, .farm-fire-tag i, .farm-tree-tag i { font-style: normal; font-size: .8em; color: #c9b88f; }
.farm-house-tag { border-color: var(--pc, #1f150a); font-size: clamp(11px, calc(15px * var(--fz)), 22px); }
.farm-house-tag.on i { color: #9be37c; }
.farm-tent-tag { border-color: var(--pc, #1f150a); font-size: clamp(10px, calc(11px * var(--fz)), 16px); }
.farm-tent-tag.on i { color: #ffb35c; }
.farm-fire-tag { transform: translate(-50%, 0); background: #2b1d10e6; color: #ffd9a0; border-color: #7a4b25; font-size: clamp(10px, calc(12px * var(--fz)), 18px); }
.farm-fire-tag.lv0 { color: #b8b0a2; border-color: #4a3a2a; }
.farm-fire-tag.lv3, .farm-fire-tag.lv4 { border-color: #f08a4b; box-shadow: 0 0 10px #ff9d3c88; }
.farm-fire-tag.lv4 b { color: #ffd23f; }
.farm-tree-tag { background: #1f3d1ae6; color: #c8f2a8; border-color: #10240c; font-size: clamp(10px, calc(12px * var(--fz)), 18px); }
.farm-tree-tag i { color: #a6d98a; }
.farm-more { position: absolute; transform: translate(-50%, -50%); font-family: var(--font-pixel); font-size: clamp(10px, calc(12px * var(--fz)), 18px); color: #fff; text-shadow: 1px 1px 0 #000; white-space: nowrap; }
.farm-note { position: absolute; transform: translate(-50%, -50%); max-width: 280px; padding: 4px 8px; background: #000000aa; color: #fff; font-family: var(--font-pixel); font-size: clamp(11px, calc(14px * var(--fz)), 20px); text-align: center; }
.farm-place { position: absolute; transform: translate(-50%, -50%); padding: 2px 8px; background: #2a1d10b3; color: #fff3d6; border: 1px solid #f1e4c855; font-family: var(--font-pixel); font-size: clamp(10px, calc(12px * var(--fz)), 17px); letter-spacing: 0.04em; white-space: nowrap; pointer-events: none; }
.farm-fog-tag { position: absolute; transform: translate(-50%, -50%); max-width: 300px; padding: 4px 10px; background: #1f2a3bd9; color: #e8eef7; border: 2px solid #0d1420; font-family: var(--font-pixel); font-size: clamp(11px, calc(14px * var(--fz)), 20px); line-height: 1.1; text-align: center; }
.farm-cd-tag { position: absolute; transform: translate(-50%, -100%); padding: 0 4px; background: #1f2a6b; color: #fff; border: 2px solid #0d1440; font-family: var(--font-pixel); font-size: clamp(10px, calc(12px * var(--fz)), 18px); line-height: 1.05; white-space: nowrap; }
.farm-name { position: absolute; transform: translate(-50%, -100%); padding: 0 4px; background: #1f150ad9; color: #fff; border: 2px solid var(--pc, #ffd23f); font-family: var(--font-pixel); font-size: clamp(10px, calc(11px * var(--fz)), 16px); line-height: 1.05; white-space: nowrap; }
.farm-name.me { color: #ffd23f; }
/* thu nhỏ quá thì bỏ chi tiết vụn: dòng phụ, thanh XP */
.farm-stage.far .farm-sign { padding: 0 3px 1px; opacity: .92; }
.farm-stage.far .farm-sign i, .farm-stage.far .farm-bar, .farm-stage.far .farm-house-tag i, .farm-stage.far .farm-tent-tag i, .farm-stage.far .farm-fire-tag i, .farm-stage.far .farm-tree-tag i { display: none; }
.farm-stage.far .farm-tent-tag, .farm-stage.far .farm-fire-tag { display: none; }
.farm-stage.tiny .farm-sign { display: none; }
.farm-zoom { position: absolute; right: 10px; bottom: 10px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }
.farm-zoom button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; background: #f6e7c1; color: #3d2a14; border: 2px solid #7a4b25; border-radius: 4px; box-shadow: 0 2px 0 #00000040; font-family: var(--font-pixel); font-size: 26px; line-height: 1; cursor: pointer; }
.farm-zoom button:hover { background: #fff4cf; }
.farm-zoom button:active { transform: translateY(1px); box-shadow: none; }
.farm-zoom .ic { width: 18px; height: 18px; }
.farm-tip { position: absolute; z-index: 3; width: 230px; padding: 8px 10px; background: #2b2118f2; color: #f6e7c1; border: 2px solid #1f150a; font-size: 12.5px; line-height: 1.4; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.farm-tip[hidden] { display: none; }
.farm-tip b { font-family: var(--font-pixel); font-size: 19px; font-weight: 400; line-height: 1.05; color: #fff; }
.farm-tip span { color: #e3d4ad; }
/* biển tên đảo kiểu cuộn giấy da ở góc trên trái, không chặn bấm vào bản đồ */
.farm-title { position: absolute; left: 10px; top: 10px; z-index: 2; pointer-events: none; padding: 4px 18px 5px; background: linear-gradient(#f9ecc8, #ead39c); border: 3px solid #7a4b25; border-radius: 3px; box-shadow: inset 0 0 0 2px #fff6dc, 0 3px 0 #00000045; }
.farm-title::before, .farm-title::after { content: ''; position: absolute; top: -6px; bottom: -6px; width: 9px; background: #c99556; border: 3px solid #7a4b25; border-radius: 4px; }
.farm-title::before { left: -9px; }
.farm-title::after { right: -9px; }
.farm-title span { display: block; font-family: var(--font-pixel); font-size: clamp(20px, 3.2vw, 30px); line-height: 1; color: #5b3a1e; letter-spacing: .02em; text-shadow: 1px 1px 0 #fff6dc, 2px 2px 0 #c99556; white-space: nowrap; }
.farm-title small { display: block; margin-top: 3px; font-family: var(--font-pixel); font-size: clamp(11px, 1.3vw, 13px); line-height: 1; color: #7a4b25; text-align: center; white-space: nowrap; }
.farm-title small:empty { display: none; }
@media (max-width: 560px) { .farm-title { padding: 3px 12px 4px; } .farm-title span { font-size: 18px; } .farm-title small { font-size: 10px; } }
.farm-side { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.farm-side h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-top: 6px; }
.fm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fm-stats div { background: var(--fill-2); border-radius: var(--r-sm); padding: 8px 10px; display: flex; flex-direction: column; }
.fm-stats b { font-family: var(--font-pixel); font-size: 30px; font-weight: 400; line-height: 1; }
.fm-stats span { color: var(--text-3); font-size: 12px; }
.fm-stats .hot b { color: var(--serious); }
.fm-stats .crit b { color: var(--crit); }
.fm-muted { color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.fm-ok { color: var(--good); font-size: 12.5px; }
.fm-warn { color: var(--crit); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.fm-warn .ic { width: 14px; height: 14px; }
.fm-switch { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.fm-legend { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; padding: 0; margin: 0; }
.fm-legend li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
canvas.fm-mini { width: 20px; height: 33px; image-rendering: pixelated; flex: none; }
.fm-sum { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--hair-2); display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.fm-sum li { display: flex; justify-content: space-between; gap: 8px; }
.fm-sum b { font-weight: 600; }
.fm-sum span { color: var(--text-3); text-align: right; }
.fm-more { border-top: 1px solid var(--hair-2); padding-top: 8px; }
.fm-more > summary { display: flex; align-items: center; gap: 8px; min-height: 30px; cursor: pointer; list-style: none; font-weight: 600; font-size: 13px; }
.fm-more > summary::-webkit-details-marker { display: none; }
.fm-more > summary::before { content: ""; flex: none; width: 6px; height: 6px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s; }
.fm-more[open] > summary::before { transform: rotate(45deg); }
.fm-more > summary em { margin-left: auto; font-style: normal; font-weight: 400; font-size: 12px; color: var(--text-3); }
.fm-more-body { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 4px; }
.fm-more-body h4, .fm-more-body p { margin: 0; }
.fm-more-body h4:not(:first-child) { margin-top: 6px; }
.fm-hero { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--hair-2); }
.fm-hero h4 { margin-top: 0; }
.fm-outfits { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.fm-outfit { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; border: 2px solid transparent; border-radius: var(--r-sm); background: var(--fill-2); color: var(--text-2); font-size: 10.5px; line-height: 1.15; cursor: pointer; }
.fm-outfit:hover { border-color: var(--hair-2); }
.fm-outfit.on { border-color: #e0a92a; background: #fff4cf; color: #3d2a14; font-weight: 600; }
canvas.fm-pick { width: 32px; height: 52px; image-rendering: pixelated; }
.fm-levels { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 12px; }
.fm-levels li { display: flex; justify-content: space-between; color: var(--text-2); }
.fm-levels span { color: var(--text-3); font-variant-numeric: tabular-nums; }
.fm-levels.fm-fire { grid-template-columns: 1fr; }
.fm-ms li:not(.on) { opacity: .55; }
.fm-ms li.on b { color: var(--good); }
.farm-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; }
.fm-person { padding: 14px 16px; }
.fm-person header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fm-person h3 { font-size: 16px; font-weight: 700; }
.fm-count { margin-left: auto; color: var(--text-3); font-size: 12.5px; }
.fm-dot { width: 10px; height: 10px; border-radius: 2px; background: var(--fill-3); box-shadow: inset 0 0 0 2px var(--pc); }
.fm-dot.on { background: var(--pc); }
.fm-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.fm-sess { padding: 10px 12px; border-radius: var(--r); background: var(--fill-2); display: flex; flex-direction: column; gap: 5px; transition: box-shadow .3s; }
.fm-sess.fm-flash, .fm-agents li.fm-flash { box-shadow: 0 0 0 2px #ffd23f; }
.fm-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fm-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.fm-meta { color: var(--text-3); font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.fm-tool { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.fm-tool .ic, .fm-limit .ic { width: 13px; height: 13px; flex: none; }
.fm-limit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; border-radius: var(--r-sm); background: var(--crit-soft); font-size: 12.5px; }
.fm-limit em { font-style: normal; color: var(--text-2); }
.fm-limit .farm-cd { font-variant-numeric: tabular-nums; }
.fm-wake { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; max-width: 100%; }
.fm-wake.on em { color: var(--good); font-weight: 600; }
.fm-limit .fm-wake-off { background: var(--panel-solid); border: 1px solid var(--edge); }
.fm-wake-at { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); min-width: 0; max-width: 100%; }
.fm-wake-at > span { white-space: nowrap; }
.fm-wakelast { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; }
.fm-wakelast .ic { width: 12px; height: 12px; flex: none; }
.fm-limit .fm-wake-at select { background: var(--panel-solid); border: 1px solid var(--edge); min-width: 0; max-width: 100%; flex: 1 1 auto; }
.fm-agents { list-style: none; margin: 2px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--hair-2); display: flex; flex-direction: column; gap: 6px; }
.fm-agents li { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; border-radius: 6px; padding: 2px; }
.fm-agents li > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
@media (max-width: 1100px) { .farm-wrap { grid-template-columns: 1fr; } .farm-stage { max-width: none; } }
@media (max-width: 520px) { .farm-lists { grid-template-columns: minmax(0, 1fr); } .fm-legend { grid-template-columns: 1fr; } }

/* ---- Kho Claude (public/js/kho.js) */
.kh-note { display: flex; align-items: flex-start; gap: 7px; color: var(--text-2); font-size: 13px; margin: 0 4px; }
.kh-note .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--text-3); }
.kh-note.warn .ic { color: #c98500; }
.kh-note code { font-size: 12px; background: var(--fill); padding: 1px 5px; border-radius: 5px; }
.kh-tiles .tile.kh-on { box-shadow: 0 0 0 1.5px var(--accent), var(--sh-1); }
.kh-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kh-bar .kh-q { margin-left: auto; width: 260px; max-width: 100%; }
.kh-pf { border: 0; cursor: pointer; }
.kh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kh-card { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 14px 16px; cursor: pointer; font: inherit; color: inherit; min-width: 0; }
.kh-card:hover { box-shadow: 0 0 0 .5px var(--hair-2), var(--sh-2); }
.kh-card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kh-card-head .ic { width: 16px; height: 16px; color: var(--accent); flex: none; }
.kh-card-head b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kh-desc { color: var(--text-2); font-size: 12.5px; line-height: 1.45; margin: 0; overflow-wrap: anywhere; }
.kh-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--text-3); }
.kh-where { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.kh-group { padding: 12px 16px; }
.kh-gt { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 650; margin: 0 0 6px; }
.kh-gt span { font-size: 12px; font-weight: 500; color: var(--text-3); }
.kh-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2px 18px; }
.kh-item { padding: 8px 0; border-top: 1px solid var(--hair); min-width: 0; }
.kh-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kh-name code { font-size: 13px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.kh-item .kh-desc { margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 760px) {
  .kh-tiles.tiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kh-bar .kh-q { margin-left: 0; width: 100%; }
  .kh-list { grid-template-columns: 1fr; }
}
/* nút Chia sẻ trong Kho (chia-se.js) */
.kh-card-wrap { position: relative; min-width: 0; display: flex; }
.kh-card-wrap .kh-card { flex: 1; }
.kh-card-wrap .kh-card-head { padding-right: 30px; }
.kh-share { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; }
.kh-share .ic, .kh-share-sm .ic { width: 15px; height: 15px; }
.kh-share-sm { width: 26px; height: 26px; margin-left: auto; opacity: .55; }
.kh-item:hover .kh-share-sm, .kh-share-sm:focus-visible { opacity: 1; }

/* Trang Chia sẻ (chia-se.js) */
.cs-list { list-style: none; margin: 0; padding: 0; }
.cs-to { border: 1px solid var(--hair); border-radius: 8px; padding: 8px 12px 10px; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cs-to legend { font-size: 12px; color: var(--text-2); padding: 0 4px; }
.cs-to label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.cs-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 0; border-top: 1px solid var(--hair); }
.cs-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); }
.cs-ic .ic { width: 16px; height: 16px; }
.cs-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cs-main .kh-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cs-view { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; margin-top: 12px; height: min(60vh, 560px); }
.cs-files { overflow: auto; border: 1px solid var(--hair); border-radius: 10px; padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.cs-file { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--text); }
.cs-file span { overflow-wrap: anywhere; min-width: 0; }
.cs-file small { color: var(--text-3); white-space: nowrap; }
.cs-file:hover { background: var(--fill); }
.cs-file.on { background: var(--accent-soft); }
.cs-body { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--hair); border-radius: 10px; overflow: hidden; }
.cs-body-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--hair); background: var(--fill-2); }
.cs-body-h code { font-size: 12px; overflow-wrap: anywhere; }
.cs-pre { margin: 0; padding: 12px; overflow: auto; flex: 1; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.cs-body .empty-state { flex: 1; }
@media (max-width: 760px) {
  .cs-row { grid-template-columns: 32px minmax(0, 1fr); }
  .cs-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .cs-view { grid-template-columns: 1fr; height: auto; }
  .cs-files { max-height: 160px; }
  .cs-pre { max-height: 50vh; }
}

/* Automations: lịch tự động, bật tắt, chia sẻ lịch (tu-dong.js) */
.au-global { display: flex; gap: 14px; align-items: flex-start; }
.au-global .switch { flex: none; margin-top: 2px; }
.au-global p { margin: 4px 0 0; font-size: 13px; }
.au-row { grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; }
.au-row.off .cs-main { opacity: .55; }
.au-row .kh-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.au-when { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-2); }
.au-meta { margin: 10px 0 8px; }
.au-prompt { max-height: 50vh; border: 1px solid var(--hair); border-radius: 10px; }
@media (max-width: 760px) {
  .au-row { grid-template-columns: 38px minmax(0, 1fr); }
}

/* Hộp thoại cập nhật máy của chủ không gian (cap-nhat.js) */
.cn-body p { margin: 0 0 10px; line-height: 1.55; }
.cn-cmd { display: flex; align-items: center; gap: 8px; background: var(--fill); border: 1px solid var(--hair); border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; }
.cn-cmd code { flex: 1; background: none; padding: 0; word-break: break-word; }
.cn-note { white-space: pre-wrap; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; background: var(--fill); border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; max-height: 160px; overflow: auto; }
.cn-wait { display: flex; align-items: center; gap: 10px; }

/* ---- Nông trại: thanh thời kỳ dưới bản đồ và hộp xem trước từng thời kỳ */
.farm-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.farm-era { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r-lg); background: #3a2614; border: 3px solid #5b3a1e; color: #fff3d6; font-family: var(--font-pixel); box-shadow: var(--sh-1); }
.fe-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.fe-step { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 8px; border: 2px solid #6b4a2a; border-radius: 4px; background: #24170c; color: #c9b08a; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.fe-step b, .fe-step small { position: relative; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fe-step b { font-size: 17px; line-height: 1; }
.fe-step small { font-size: 13px; line-height: 1; opacity: .8; }
.fe-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#7a5a2a, #5b4220); }
.fe-step.done { color: #fff3d6; border-color: #8a6a3a; }
.fe-step.done .fe-fill { background: linear-gradient(#6b8a3e, #4f6a2c); }
.fe-step.on { color: #fff3d6; border-color: #ffd23f; box-shadow: 0 0 0 1px #ffd23f inset; }
.fe-step.on .fe-fill { background: linear-gradient(#c98a3a, #9a6420); }
.fe-step:hover { border-color: #ffd23f; }
.fe-step:focus-visible { outline: 2px solid #ffd23f; outline-offset: 1px; }
.fe-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 16px; line-height: 1.15; }
.fe-line b { font-weight: 400; color: #ffd23f; }
.fe-have { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.fe-res { display: inline-block; padding: 0 5px; border-radius: 3px; background: #5b3a1e; color: #fff3d6; font-family: var(--font-pixel); font-size: 15px; line-height: 1.3; }
.fe-res[data-r="wood"] { background: #7a4b25; } .fe-res[data-r="fish"] { background: #2f6a9f; } .fe-res[data-r="herb"] { background: #3f7a2a; }
.fe-res[data-r="stone"] { background: #6a6e75; } .fe-res[data-r="ore"] { background: #9a4a2a; } .fe-res[data-r="gold"] { background: #a07a10; }
.fe-tabs { margin-bottom: 10px; flex-wrap: wrap; }
.fe-prev { border: 3px solid #5b3a1e; border-radius: var(--r-md, 8px); overflow: hidden; background: #2f78bf; }
.fe-prev canvas { display: block; width: 100%; height: auto; }
.fe-note { margin: 10px 0 4px; font-size: 14px; }
.fe-meta { margin: 4px 0; color: var(--text-2); font-size: 13px; }
@media (max-width: 720px) { .fe-steps { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; } .fe-step small { display: none; } .fe-step b { font-size: 14px; } }

/* ----- Soát giao diện 27/10 */
/* ô lọc chỉ hiện ở trang lọc được */
body.no-filter .tb-search { display: none; }
/* Tài liệu: tiêu đề trang trải hết lưới hai cột */
.docs-page { grid-template-rows: auto minmax(0, 1fr); }
.docs-head { grid-column: 1 / -1; }
/* Bảng việc: 5 cột vừa khung 1440px, khung hẹp hơn thì cuộn ngang */
.board > .col { flex: 1 1 0; min-width: 190px; }
/* Báo cáo: ba mốc nhanh nằm một hàng riêng */
.rp-presets { grid-column: 1 / -1; flex-wrap: nowrap; }
/* Đội agent: 3 ô thì 3 cột, chữ phụ xuống dòng thay vì cắt */
.tm-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tm-tiles .tile-sub { white-space: normal; }
/* Gettime gọn: một hàng trạng thái, chân thẻ không kẻ */
.gt-card.gt-compact { gap: 6px; padding: 9px 12px; }
.gt-compact .gtc-foot { border-top: 0; padding-top: 0; }
.gt-compact .gt-row { min-width: 0; }
.gt-compact .gtc-line { flex: 1; min-width: 0; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
/* Hộp duyệt: nhóm bản nháp cũ thu gọn */
.draft-old { margin-top: 12px; }
.draft-old > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 8px 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.draft-old > summary::-webkit-details-marker { display: none; }
.draft-old > summary .sp { flex: 1; }
.draft-old[open] > summary { margin-bottom: 8px; }
.wk-needline { margin: 0 0 12px; }
/* chữ nhỏ: chip tối thiểu 11.5px, nhãn nhóm thanh bên cùng kiểu chữ giao diện */
.ag-job-m .lchip, .wk-meta .lchip { font-size: 11.5px; }
.sidebar .nav-group { font-family: inherit; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; }
.farm-sign { font-size: clamp(11px, calc(11.5px * var(--fz)), 15px); }
/* nút đóng menu chỉ có trên điện thoại */
.sb-close { display: none; }
.sb-scrim { display: none; }
@media (max-width: 860px) {
  .sb-close { display: inline-grid; order: 3; margin-left: auto; }
  body.sb-open .sb-scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgb(0 0 0 / .32); }
  /* vùng chạm tối thiểu 36px */
  .sidebar .sb-capture { height: 40px; }
  .sidebar .sb-capture input { align-self: stretch; }
  .gt-ico { width: 36px; height: 36px; }
  .gt-btn, .gtc-assign { height: 36px; }
  .gtc-stats { min-height: 36px; }
  .btn.sm { min-height: 36px; }
  .org-name { min-height: 36px; }
  .nav-add { width: 32px; height: 32px; }
  .sidebar .sb-close { flex: none; width: 36px; min-width: 36px; height: 36px; }
  .sidebar .sb-capture input { min-height: 36px; }
  .seg button, .fchip, .input.sm, .tm-node, .fe-step, .kh-share { min-height: 36px; }
  .draft-file { display: inline-flex; align-items: center; min-height: 32px; }
  .wk-sh { flex-wrap: wrap; row-gap: 4px; }
  .wk-sh h3 { white-space: nowrap; }
  .wk-sh > .muted { flex-basis: 100%; }
  .tm-tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  /* bản đồ thu nhỏ trên điện thoại: tên vùng chồng biển dự án, chỉ giữ biển */
  .farm-stage.far .farm-place { display: none; }
}

/* Trang Người dùng (public/js/users.js) */
.us-panel { padding: 0; overflow-x: auto; }
.us-who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.us-ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.us-name { font-weight: 650; color: var(--text); }
.us-miss { font-size: 11.5px; color: var(--crit); }
.us-off td { opacity: .55; }
.us-off td.us-act { opacity: 1; }
.us-act { white-space: nowrap; text-align: right; }
.us-act .switch { vertical-align: middle; margin-right: 6px; }
.us-date { white-space: nowrap; }
.us-secret { display: flex; gap: 8px; }
.us-secret .input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.us-steps { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); }
@media (max-width: 640px) { .us-date { display: none; } .us-row { grid-template-columns: 1fr; } }
