/* ==========================================================================
   Team Management · Phòng nội dung — giao diện tông Moodboard (đất nung / kem)
   Kính mờ, nền ấm đơn sắc, hạt phim, đồng bộ hệ sinh thái trợ lý + quản lý + moodboard.
   ========================================================================== */

:root {
  --bg: #0b0a08;
  --ink: #f4efe6;
  --ink-2: #d8d0c2;
  --muted: #9a9286;
  --faint: #766f62;
  --accent: #cc785c;
  --accent-2: #caa56a;
  --good: #5db8a6;
  --warn: #caa56a;
  --crit: #e0574a;
  --info: #7ba3c9;
  --violet: #b18fd4;
  --cyan: #6fb2b0;

  --hair: rgba(255, 255, 255, .10);
  --hair-2: rgba(255, 255, 255, .055);
  --panel: rgba(255, 255, 255, .045);
  --panel-2: rgba(255, 255, 255, .07);
  --panel-grad: radial-gradient(135% 125% at 50% 22%, rgba(255, 255, 255, .12), rgba(255, 255, 255, .004) 70%);
  --glass: blur(28px) saturate(1.2);

  --radius: 18px;
  --radius-sm: 12px;
  --pill: 999px;
  --elev: 0 2px 10px -4px rgba(0, 0, 0, .5);
  --elev-lg: 0 30px 64px -28px rgba(0, 0, 0, .8);
  --smooth: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --serif: "Fraunces", Georgia, "Palatino Linotype", "Times New Roman", serif;
}

:root[data-theme="light"] {
  --bg: #efe8db;
  --ink: #2b2620;
  --ink-2: #4b4438;
  --muted: #6f675a;
  --faint: #9a9184;
  --hair: rgba(40, 30, 20, .14);
  --hair-2: rgba(40, 30, 20, .07);
  --panel: rgba(255, 255, 255, .5);
  --panel-2: rgba(255, 255, 255, .68);
  --panel-grad: radial-gradient(135% 125% at 50% 22%, rgba(255, 255, 255, .72), rgba(255, 255, 255, .28) 74%);
  --elev-lg: 0 26px 56px -30px rgba(60, 40, 20, .4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Nền ấm đơn sắc + hạt phim + vignette ------------------------------------ */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(72% 52% at 80% -6%, rgba(204, 120, 92, .15), transparent 60%),
    radial-gradient(64% 48% at 4% 4%, rgba(202, 165, 106, .09), transparent 58%),
    radial-gradient(66% 58% at 52% 112%, rgba(150, 104, 74, .075), transparent 62%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); mix-blend-mode: screen; }
.orb.a { width: 44vw; height: 44vw; left: -8vw; top: -12vw; background: #cc785c; opacity: .2; }
.orb.b { width: 38vw; height: 38vw; right: -6vw; top: 8vw; background: #caa56a; opacity: .14; }
.orb.c { width: 40vw; height: 40vw; left: 30vw; bottom: -16vw; background: #a86b4a; opacity: .1; }

#app, #login { position: relative; z-index: 2; }

/* ---- Typography helpers ---- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.tnum { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); }

/* ==========================  ĐĂNG NHẬP  ================================== */
#login {
  min-height: 100vh; display: none; align-items: center; justify-content: center; padding: 28px;
}
#login.on { display: flex; }

.login-shell {
  width: 100%; max-width: 950px;
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 52px;
  animation: rise .5s var(--smooth);
}

/* ---- Mảng giới thiệu (trái) ---- */
.login-hero { padding: 6px 2px; }
.login-hero .lh-top { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.lh-mark {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 25px; color: #201306;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 75%, transparent);
}
.lh-name { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.lh-title {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.025em; line-height: 1.08;
  font-size: clamp(2rem, 3.4vw, 2.85rem); text-wrap: balance;
}
.lh-tag { color: var(--muted); font-size: 15px; line-height: 1.6; margin-top: 14px; max-width: 34ch; }
.lh-feats { list-style: none; margin: 30px 0 0; display: flex; flex-direction: column; gap: 13px; }
.lh-feats li { display: flex; align-items: center; gap: 13px; color: var(--ink-2); font-size: 14.5px; }
.lh-feats svg {
  width: 17px; height: 17px; flex: none; color: var(--accent);
  padding: 8px; box-sizing: content-box; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}

/* ---- Card đăng nhập (phải) ---- */
.login-panel { display: flex; justify-content: center; }
.login-card {
  width: 100%; max-width: 384px; padding: 36px 32px 26px;
  background: var(--panel-grad); border: 1px solid var(--hair); border-radius: var(--radius);
  box-shadow: var(--elev-lg); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
  text-align: center;
}
.login-card .lc-eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.login-card .lc-head { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.login-card .sub { color: var(--muted); font-size: 13.5px; margin-top: 7px; line-height: 1.55; }
.login-card .brand { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.login-card .brand b { color: var(--accent); font-weight: 600; }
.login-card .google-btn { width: 100%; margin: 22px auto 0; }
.lc-note { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--hair-2);
  font-size: 12.5px; color: var(--faint); line-height: 1.6; }

@media (max-width: 780px) {
  .login-shell { grid-template-columns: 1fr; gap: 32px; max-width: 400px; }
  .login-hero { text-align: center; }
  .login-hero .lh-top { justify-content: center; }
  .lh-title { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .lh-tag { margin-left: auto; margin-right: auto; }
  .lh-feats { max-width: 300px; margin-left: auto; margin-right: auto; }
}
.who-pick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 22px 0 6px; }
.who-pick button {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: var(--pill);
  border: 1px solid var(--hair); background: var(--panel); color: var(--ink); cursor: pointer;
  font-size: 13px; font-weight: 600; transition: all .2s var(--smooth); font-family: var(--sans);
}
.who-pick button:hover { border-color: var(--accent); transform: translateY(-1px); }
.who-pick button.sel { background: linear-gradient(140deg, var(--accent-2), var(--accent)); color: #1a1400; border-color: transparent; }
.who-pick .ava { width: 20px; height: 20px; font-size: 10px; }
.pin-label { color: var(--muted); font-size: 12.5px; margin: 16px 0 10px; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.pin-dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--faint); transition: all .2s; }
.pin-dots i.f { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; max-width: 240px; margin: 0 auto; }
.keypad button {
  height: 50px; border-radius: 13px; border: 1px solid var(--hair); background: var(--panel);
  color: var(--ink); font-size: 20px; font-weight: 600; cursor: pointer; font-family: var(--serif);
  transition: all .12s var(--smooth); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.keypad button:hover { background: var(--panel-2); border-color: var(--accent); }
.keypad button:active { transform: scale(.94); }
.keypad button.wide { font-size: 14px; color: var(--muted); }
.login-err { color: var(--crit); font-size: 12.5px; min-height: 18px; margin-top: 12px; }
.login-hint { color: var(--faint); font-size: 11.5px; margin-top: 14px; line-height: 1.6; }

/* ==========================  KHUNG APP  ================================= */
#app { display: none; }
#app.on { display: flex; flex-direction: column; min-height: 100vh; }
/* Tràn ngang + cao đầy màn. 21:9 giữ tỉ lệ như 16:9 (cap 2560px, thừa đều 2 bên). */
.wrap { width: 100%; max-width: 2560px; margin: 0 auto; padding: 20px clamp(16px, 2vw, 46px) 28px;
  flex: 1; display: flex; flex-direction: column; min-height: 0; }

.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.logo { display: flex; align-items: center; gap: 11px; }
.logo .mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent-2), var(--accent)); color: #1a1400; flex: none;
  box-shadow: var(--elev); font-family: var(--serif); font-weight: 700; font-size: 18px;
}
.logo .t1 { font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.05; }
.logo .t2 { font-size: 11.5px; color: var(--muted); }
.topbar .spacer { flex: 1; }

.userchip { display: flex; align-items: center; gap: 9px; padding: 5px 6px 5px 12px; border-radius: var(--pill);
  border: 1px solid var(--hair); background: var(--panel); box-shadow: var(--elev); }
.userchip .nm { font-size: 13px; font-weight: 600; }
.userchip .role { font-size: 10.5px; color: var(--muted); }
.iconbtn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--hair); background: var(--panel);
  color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: all .2s var(--smooth); }
.iconbtn:hover { border-color: var(--accent); transform: translateY(-1px); }
.iconbtn svg { width: 17px; height: 17px; }

.ava { border-radius: 50%; display: grid; place-items: center; color: #10100c; font-weight: 800;
  flex: none; width: 30px; height: 30px; font-size: 12px; text-transform: uppercase; }

/* Tabs */
.tabs { display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--pill);
  padding: 5px; -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); box-shadow: var(--elev); flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: var(--pill);
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: var(--sans); transition: all .25s var(--smooth); position: relative; }
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent-2) 24%, transparent));
  box-shadow: inset 0 1px rgba(255, 255, 255, .18); }

.screen { display: none; animation: fade .4s var(--smooth); }
.screen.on { display: block; flex: 1; min-height: 0; }
#kanban.on { display: flex; flex-direction: column; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.screen-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.screen-head h1 { font-size: 22px; }
.screen-head .desc { color: var(--muted); font-size: 13.5px; }

/* Filter bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input, .field select, .field input, .field textarea {
  font-family: var(--sans); font-size: 13.5px; color: var(--ink); background: var(--panel);
  border: 1px solid var(--hair); border-radius: 10px; padding: 8px 11px; outline: none; transition: border-color .2s; }
.filters select:focus, .filters input:focus, .field select:focus, .field input:focus, .field textarea:focus { border-color: var(--accent); }
.filters select option, .field select option { background: #1a1712; color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: var(--pill);
  border: 1px solid transparent; background: linear-gradient(140deg, var(--accent-2), var(--accent));
  color: #1a1400; font-weight: 700; font-size: 13px; cursor: pointer; font-family: var(--sans);
  box-shadow: var(--elev); transition: transform .2s var(--spring), filter .2s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn svg { width: 15px; height: 15px; }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--hair); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.sm { padding: 6px 12px; font-size: 12px; }

/* ==========================  KANBAN  =================================== */
.board { display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; padding-bottom: 10px;
  flex: 1; min-height: 0; align-items: stretch; }
/* Cột phẳng & gọn (bớt sương mù): nền đặc hơn, blur nhẹ, bóng ôm sát. */
.col { background: color-mix(in srgb, var(--bg) 58%, transparent); border: 1px solid var(--hair); border-radius: var(--radius); padding: 13px 12px;
  -webkit-backdrop-filter: blur(12px) saturate(1.04); backdrop-filter: blur(12px) saturate(1.04); box-shadow: 0 6px 18px -14px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; gap: 11px; min-height: 220px; flex: 1 1 0; min-width: 262px;
  transition: border-color .25s, box-shadow .25s; }
.col.drop { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 6px 18px -14px rgba(0, 0, 0, .5); }
.col-head { display: flex; align-items: center; gap: 8px; }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.col-head .ct { font-weight: 700; font-size: 14.5px; }
.col-head .n { margin-left: auto; font-size: 12.5px; color: var(--muted); background: var(--panel);
  border: 1px solid var(--hair); border-radius: var(--pill); padding: 1px 9px; }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 40px; flex: 1;
  overflow-y: auto; overflow-x: hidden; margin: 0 -3px; padding: 0 3px; }

/* Thẻ phẳng: bỏ backdrop-filter lồng (nguyên nhân chính gây mờ), bóng ôm sát. */
.kcard { --pc: var(--accent); background: color-mix(in srgb, var(--ink) 7%, var(--bg)); border: 1px solid var(--hair); border-radius: 14px;
  padding: 12px; box-shadow: 0 3px 9px -7px rgba(0, 0, 0, .55);
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform .4s var(--smooth), box-shadow .3s, border-color .3s; border-left: 3px solid var(--pc); }
.kcard:hover { will-change: transform; }
.kcard:hover { box-shadow: 0 8px 18px -12px rgba(0, 0, 0, .55); border-color: color-mix(in srgb, var(--accent) 30%, var(--hair)); }
.kcard.dragging { opacity: .5; }
.kcard.over { border-left-color: var(--crit); }
.kcard .toprow { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; flex-wrap: wrap; }
.kcard .proj { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: var(--pill); }
.kcard .prio { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.kcard .prio i { width: 6px; height: 6px; border-radius: 50%; }
.kcard .nm { font-size: 15px; font-weight: 600; line-height: 1.35; margin-bottom: 9px; }
.kcard .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.kcard .meta .ava { width: 24px; height: 24px; font-size: 11px; }
.kcard .dl { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.kcard .dl svg { width: 12px; height: 12px; }
.kcard .badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--pill); }
.kcard .prog { height: 5px; border-radius: var(--pill); background: var(--hair-2); overflow: hidden; }
.kcard .prog i { display: block; height: 100%; border-radius: var(--pill); background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.kcard .rev { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.kcard .rev b { color: var(--ink-2); }
.order-line { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--violet); margin-bottom: 9px; }
.order-line svg { width: 13px; height: 13px; flex: none; }
.order-line b { color: var(--ink-2); }

/* ==========================  DANH SÁCH  ================================ */
.table-wrap { background: var(--panel-grad); border: 1px solid var(--hair); border-radius: var(--radius);
  -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); box-shadow: var(--elev-lg); overflow: hidden; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
table.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  padding: 12px 14px; border-bottom: 1px solid var(--hair); font-weight: 700; white-space: nowrap; }
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--hair-2); }
table.tbl tr { cursor: pointer; transition: background .18s; }
table.tbl tbody tr:hover { background: var(--panel); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: var(--pill); }
.pill i { width: 6px; height: 6px; border-radius: 50%; }

/* ==========================  LỊCH  ==================================== */
.cal-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-nav .mth { font-family: var(--serif); font-weight: 600; font-size: 22px; min-width: 160px; }
.cal-stats { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.cstat { background: var(--panel-grad); border: 1px solid var(--hair); border-radius: 12px; padding: 8px 15px;
  box-shadow: var(--elev); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); }
.cstat .n { font-size: 22px; font-weight: 700; line-height: 1; }
.cstat .n.a { color: var(--accent-2); }
.cstat .l { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; }
/* Nền lịch đặc hơn (bớt glass) để chữ/số nổi rõ, dễ đọc. */
.cal { background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--hair); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--elev-lg); -webkit-backdrop-filter: blur(14px) saturate(1.08); backdrop-filter: blur(14px) saturate(1.08); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dow { padding: 12px 13px; font-size: 13px; font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--hair); }
.dow.we { color: var(--crit); }
.cell { min-height: 132px; border-right: 1px solid var(--hair-2); border-bottom: 1px solid var(--hair-2);
  padding: 9px; display: flex; flex-direction: column; gap: 4px; transition: background .25s; }
.cell:nth-child(7n) { border-right: 0; }
.cell:hover { background: var(--panel); }
.cell.oth { opacity: .5; }
.cell .dn { font-size: 15px; color: var(--ink-2); font-weight: 600; align-self: flex-start; padding: 1px 7px; border-radius: 7px; }
.cell.today .dn { background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: #1a1400; font-weight: 800; }
.lanes { display: flex; flex-direction: column; gap: 3px; margin: 4px -9px 0; }
.seg { height: 24px; display: flex; align-items: center; font-size: 12px; font-weight: 600; padding: 0 8px;
  color: var(--ink); border-top: 1px solid var(--sc); border-bottom: 1px solid var(--sc); background: var(--sf);
  overflow: hidden; cursor: pointer; transition: filter .2s; }
.seg:hover { filter: brightness(1.08); }
.seg.start { border-top-left-radius: 8px; border-bottom-left-radius: 8px; border-left: 1px solid var(--sc); margin-left: 3px; }
.seg.end { border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-right: 1px solid var(--sc); margin-right: 3px; }
.seg .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--sk); flex: none; margin-right: 5px; }
.seg .who { font-weight: 800; color: var(--sk); white-space: nowrap; margin-right: 6px; }
.seg .nm { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg.spacer { background: none; border-color: transparent; pointer-events: none; }
.cal-legend { display: flex; gap: 18px; margin-top: 14px; font-size: 13.5px; color: var(--ink-2); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legend i { width: 17px; height: 12px; border-radius: 4px; background: color-mix(in srgb, var(--k) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--k) 42%, transparent); }

/* ==========================  DASHBOARD  =============================== */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card { background: var(--panel-grad); border: 1px solid var(--hair); border-radius: var(--radius); padding: 18px;
  -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); box-shadow: var(--elev-lg); }
.card h3 { font-size: 14px; color: var(--muted); font-family: var(--sans); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 14px; }
.kpi .v { font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1; }
.kpi .l { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.kpi .v.accent { color: var(--accent); }
.kpi .v.good { color: var(--good); }
.kpi .v.crit { color: var(--crit); }
.span2 { grid-column: span 2; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 46px; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13.5px; }
.bar-row .lbl { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 9px; border-radius: var(--pill); background: var(--hair-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: var(--pill); }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ring-wrap { display: flex; align-items: center; gap: 20px; }
.ring { width: 116px; height: 116px; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative; }
.ring::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--bg); }
.ring .pct { position: relative; font-family: var(--serif); font-size: 27px; font-weight: 600; }
.up-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hair-2); }
.up-item:last-child { border: 0; }
.up-item .nm { font-size: 14px; font-weight: 600; flex: 1; }
.up-item .sub { font-size: 12.5px; color: var(--muted); }

/* ==========================  MODAL CHI TIẾT  ========================== */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(4, 6, 10, .62);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); display: none; align-items: flex-start;
  justify-content: center; padding: 40px 16px; overflow-y: auto; }
.overlay.on { display: flex; animation: fade .22s ease; }
.modal { width: 100%; max-width: 760px; background: var(--panel-grad); border: 1px solid var(--hair);
  border-radius: var(--radius); box-shadow: var(--elev-lg); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
  overflow: hidden; animation: mc .42s var(--spring); }
@keyframes mc { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.modal-hd { padding: 20px 22px 14px; border-bottom: 1px solid var(--hair); display: flex; gap: 12px; align-items: flex-start; }
.modal-hd .titlewrap { flex: 1; }
.modal-hd h2 { font-size: 20px; }
.modal-hd .crumbs { font-size: 12.5px; color: var(--muted); margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal-close { border: 1px solid var(--hair); background: var(--panel); color: var(--ink); width: 32px; height: 32px;
  border-radius: 9px; cursor: pointer; display: grid; place-items: center; flex: none; }
.modal-close:hover { border-color: var(--crit); color: var(--crit); }
.modal-body { display: grid; grid-template-columns: 1fr 236px; gap: 0; }
.mcol { padding: 18px 22px; }
.mcol.side { border-left: 1px solid var(--hair); background: var(--panel); }
.sec { margin-bottom: 22px; }
.sec .sh { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin-bottom: 11px; }
.sec .sh svg { width: 14px; height: 14px; }
.sec .sh .btn { margin-left: auto; }
.desc-box { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; white-space: pre-wrap; min-height: 20px; cursor: text; }
.desc-box.editable { cursor: text; border-radius: 9px; margin: -5px -8px; padding: 5px 8px; transition: background .15s var(--smooth); }
.desc-box.editable:hover { background: var(--panel); }
.desc-box .empty { color: var(--faint); font-style: italic; }
textarea.inp { width: 100%; min-height: 74px; resize: vertical; }
.inp { font-family: var(--sans); font-size: 13px; color: var(--ink); background: var(--panel);
  border: 1px solid var(--hair); border-radius: 10px; padding: 9px 11px; outline: none; }
.inp:focus { border-color: var(--accent); }

/* attachments */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.att { border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; background: var(--panel); position: relative; }
.att .thumb { height: 78px; display: grid; place-items: center; color: #fff; position: relative; }
.att .thumb svg { width: 26px; height: 26px; opacity: .92; }
.att .thumb img { width: 100%; height: 100%; object-fit: cover; }
.att .cap { padding: 7px 9px; font-size: 11px; }
.att .cap .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att .cap .t { color: var(--muted); font-size: 10px; }
.att .del { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 7px; border: 0;
  background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.att:hover .del { opacity: 1; }
.att .del svg { width: 12px; height: 12px; }
.upload { border: 1.5px dashed var(--hair); border-radius: 12px; display: grid; place-items: center; min-height: 78px;
  cursor: pointer; color: var(--muted); font-size: 12px; transition: all .2s; text-align: center; padding: 6px; }
.upload:hover { border-color: var(--accent); color: var(--ink); }

/* links */
.link-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--hair);
  border-radius: 10px; margin-bottom: 8px; background: var(--panel); }
.link-row .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.link-row .ic svg { width: 16px; height: 16px; }
.link-row a { color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.link-row a:hover { color: var(--accent); }
.link-row .k { font-size: 10.5px; color: var(--muted); }
.icon-del { border: 0; background: transparent; color: var(--faint); cursor: pointer; width: 26px; height: 26px;
  border-radius: 7px; display: grid; place-items: center; flex: none; }
.icon-del:hover { color: var(--crit); background: var(--panel-2); }
.icon-del svg { width: 14px; height: 14px; }
.addline { display: flex; gap: 8px; margin-top: 10px; }
.addline .inp { flex: 1; }

/* checklist */
.ck-prog { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.ck-prog .bar { flex: 1; }
.ck-prog .bar i { background: linear-gradient(90deg, var(--good), var(--accent-2)); }
.ck-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.ck-box { width: 19px; height: 19px; border-radius: 6px; border: 1.5px solid var(--faint); cursor: pointer; flex: none;
  display: grid; place-items: center; transition: all .18s; }
.ck-box.on { background: var(--good); border-color: var(--good); }
.ck-box svg { width: 12px; height: 12px; color: #10100c; opacity: 0; }
.ck-box.on svg { opacity: 1; }
.ck-item .tx { font-size: 13.5px; flex: 1; }
.ck-item.done .tx { text-decoration: line-through; color: var(--faint); }

/* comments */
.cmt { display: flex; gap: 10px; margin-bottom: 13px; }
.cmt .ava { width: 30px; height: 30px; font-size: 11px; }
.cmt .body { flex: 1; }
.cmt .who { font-size: 13.5px; font-weight: 700; }
.cmt .when { font-size: 11.5px; color: var(--faint); margin-left: 6px; }
.cmt .txt { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.cmt-box { display: flex; gap: 9px; margin-top: 6px; }
.cmt-box .inp { flex: 1; }

/* sidebar of modal */
.side .slab { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin: 14px 0 6px; }
.side .s-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 4px; }
.side .btn { width: 100%; justify-content: center; margin-bottom: 8px; }
.side .btn.good { background: linear-gradient(140deg, #6fcbb9, var(--good)); }
.side .btn.crit { background: transparent; border-color: color-mix(in srgb, var(--crit) 50%, transparent); color: var(--crit); }
.side .btn.crit:hover { background: color-mix(in srgb, var(--crit) 12%, transparent); }
.side .btn.warn { background: transparent; border-color: var(--hair); color: var(--muted); }

.disc { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--pill); }

/* toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 90;
  background: rgba(20, 16, 12, .94); color: var(--ink); border: 1px solid var(--hair); border-radius: var(--pill);
  padding: 11px 20px; font-size: 13px; box-shadow: var(--elev-lg); opacity: 0; transition: all .3s var(--smooth);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: color-mix(in srgb, var(--crit) 50%, transparent); }

.empty { color: var(--faint); font-size: 13px; font-style: italic; padding: 8px 2px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field .inp, .field select, .field input, .field textarea { width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 820px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .span2 { grid-column: span 2; }
  .modal-body { grid-template-columns: 1fr; }
  .mcol.side { border-left: 0; border-top: 1px solid var(--hair); }
}
@media (max-width: 520px) {
  .bento { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
}
