/* =========================================================
   SOCA Neo — giao diện dùng chung (nhansu + reup)
   Kính mờ · nghiêng 3D · sáng/tối · thanh dock trên điện thoại
   Font Be Vietnam Pro (SIL Open Font License, xem /fonts/OFL.txt)
   ========================================================= */
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/be-vietnam-pro-Regular.woff") format("woff"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/be-vietnam-pro-Medium.woff") format("woff"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/be-vietnam-pro-SemiBold.woff") format("woff"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/be-vietnam-pro-Bold.woff") format("woff"); }

/* ---------- màu sắc: sáng (mặc định) ---------- */
:root {
  --bg: #f5f2ee;
  --orb-1: rgba(255, 128, 48, .46); --orb-2: rgba(255, 77, 109, .26); --orb-3: rgba(124, 92, 255, .30);
  --surface: rgba(255, 255, 255, .72);
  --surface-solid: #ffffff;
  --surface-2: rgba(30, 20, 40, .045);
  --surface-3: rgba(30, 20, 40, .08);
  --border: rgba(40, 25, 20, .11);
  --border-strong: rgba(40, 25, 20, .19);
  --glass-edge: rgba(255, 255, 255, .9);
  --text: #1a1512;
  --text-2: #45403b;
  --muted: #7a726b;
  --p1: #f2701e; --p2: #e23d2e;                /* hai đầu dải màu chính */
  --primary: #e4511a;
  --primary-2: #cc4313;
  --primary-soft: rgba(242, 112, 30, .13);
  --primary-ink: #b8400f;
  --hero: linear-gradient(135deg, #15110f 0%, #34190c 46%, #a8400f 100%);
  --hero-glow: #ff7a2f;
  --hero-a: #e4511a; --hero-b: #ff8a3d;
  --green: #0b7a52; --green-soft: rgba(16, 163, 110, .15);
  --amber: #a15a00; --amber-soft: rgba(245, 158, 11, .17);
  --red: #c62d15; --red-soft: rgba(239, 68, 68, .13);
  --blue: #1b5fc7; --blue-soft: rgba(59, 130, 246, .14);
  --gray-soft: rgba(30, 20, 40, .07);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(40, 20, 10, .05);
  --shadow: 0 1px 0 var(--glass-edge) inset, 0 16px 36px -16px rgba(60, 30, 10, .30);
  --shadow-lg: 0 30px 70px -18px rgba(30, 15, 5, .38);
  --sidebar-bg: rgba(255, 255, 255, .72);
  --font: "Be Vietnam Pro", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --sidebar-w: 256px;
  color-scheme: light;
}
/* ---------- màu sắc: tối ---------- */
:root[data-theme="dark"] {
  --bg: #0c0a09;
  --orb-1: rgba(255, 106, 31, .40); --orb-2: rgba(255, 61, 113, .24); --orb-3: rgba(124, 92, 255, .34);
  --surface: rgba(255, 255, 255, .055);
  --surface-solid: #1a1614;
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(255, 255, 255, .11);
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .17);
  --glass-edge: rgba(255, 255, 255, .10);
  --text: #f4efea;
  --text-2: #d3cbc3;
  --muted: #9a9088;
  --primary: #ff8a4d;
  --primary-2: #ffa271;
  --primary-soft: rgba(255, 122, 47, .17);
  --primary-ink: #ffb283;
  --hero: linear-gradient(135deg, #1c1411 0%, #43200d 46%, #c2500f 100%);
  --green: #4ade9f; --green-soft: rgba(52, 211, 153, .15);
  --amber: #fbbf5a; --amber-soft: rgba(251, 191, 36, .15);
  --red: #ff8a73; --red-soft: rgba(248, 113, 113, .15);
  --blue: #8bbcff; --blue-soft: rgba(96, 165, 250, .15);
  --gray-soft: rgba(255, 255, 255, .08);
  --shadow-sm: none;
  --shadow: 0 1px 0 var(--glass-edge) inset, 0 16px 40px -18px rgba(0, 0, 0, .75);
  --shadow-lg: 0 34px 80px -16px rgba(0, 0, 0, .85);
  --sidebar-bg: rgba(20, 16, 14, .72);
  color-scheme: dark;
}

* { box-sizing: border-box; }
svg:not([width]) { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  font-family: var(--font); background: transparent; color: var(--text); min-height: 100vh;
  font-size: 14.5px; line-height: 1.6; word-spacing: .05em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; position: relative; overflow-x: hidden;
}
/* nền mesh nhiều màu, đứng yên phía sau nội dung */
body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(70px); }
body::before { width: 70vmax; height: 70vmax; left: -22vmax; top: -26vmax; background: radial-gradient(circle, var(--orb-1), transparent 68%); animation: drift-a 26s ease-in-out infinite alternate; }
body::after { width: 56vmax; height: 56vmax; right: -20vmax; bottom: -24vmax; background: radial-gradient(circle, var(--orb-3), transparent 66%); animation: drift-b 32s ease-in-out infinite alternate; }
.bg-orb { position: fixed; z-index: -1; pointer-events: none; width: 40vmax; height: 40vmax; right: 8vmax; top: -12vmax; border-radius: 50%; background: radial-gradient(circle, var(--orb-2), transparent 66%); filter: blur(70px); }
@keyframes drift-a { to { transform: translate3d(7vmax, 5vmax, 0) scale(1.08); } }
@keyframes drift-b { to { transform: translate3d(-6vmax, -4vmax, 0) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } }

a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.35; letter-spacing: 0; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.012em; }
h2 { font-size: 16.5px; font-weight: 700; }
h3 { font-size: 14.5px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; word-break: break-word; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- khung ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.app > div:last-child { min-width: 0; }
.sidebar {
  background: var(--sidebar-bg); border: 1px solid var(--border); border-radius: 26px;
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: var(--shadow);
  padding: 16px 12px; position: sticky; top: 14px; height: calc(100vh - 28px); margin: 14px 0 14px 14px;
  display: flex; flex-direction: column; gap: 3px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 18px; font-weight: 700; font-size: 15px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 13px; flex: none; position: relative;
  background: linear-gradient(145deg, var(--p1), var(--p2)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 13.5px; letter-spacing: .02em;
  box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 -3px 0 rgba(0,0,0,.14) inset, 0 10px 18px -8px var(--p1);
}
.brand-logo svg { width: 19px; height: 19px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 7px 10px; border-radius: 14px; color: var(--text-2); font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s, transform .15s;
}
.nav-link > svg:first-child {
  width: 32px; height: 32px; padding: 7px; border-radius: 10px; background: var(--surface-2); flex: none; opacity: 1; transition: background .15s, color .15s, transform .2s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link:hover > svg:first-child { transform: translateY(-1px) scale(1.06); }
.nav-link.active { color: var(--text); background: var(--primary-soft); font-weight: 600; }
.nav-link.active > svg:first-child { background: linear-gradient(145deg, var(--p1), var(--p2)); color: #fff; box-shadow: 0 8px 14px -8px var(--p1); }
.nav-link svg:last-child:not(:first-child) { margin-left: auto; width: 14px; height: 14px; opacity: .5; }
.nav-sep { margin: 16px 12px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.nav-badge { margin-left: auto; background: linear-gradient(145deg, #ff5a4d, #e11d48); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; box-shadow: 0 4px 10px -3px rgba(225, 29, 72, .6); }
.sidebar-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sidebar-foot.link-card { display: flex; color: var(--text); border-radius: 16px; border-top: 0; background: var(--surface-2); padding: 9px 10px; }
.sidebar-foot.link-card:hover { background: var(--surface-3); text-decoration: none; }
.sidebar-tools { display: flex; gap: 6px; margin: 8px 0 2px; padding: 0 2px; }
.sidebar-tools .icon-btn { flex: 1; border: 1px solid var(--border); border-radius: 12px; }
.nav-scrim { display: none; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; position: relative; overflow: hidden;
  background: linear-gradient(145deg, var(--ag1, #ffb37a), var(--ag2, #ff6a3d)); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13.5px; text-shadow: 0 1px 2px rgba(0,0,0,.25);
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 6px 12px -6px rgba(0,0,0,.4);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; }
.av-0 { --ag1: #ffb37a; --ag2: #ff6a3d; } .av-1 { --ag1: #ff9ec0; --ag2: #e8386d; } .av-2 { --ag1: #b79bff; --ag2: #6d45f0; } .av-3 { --ag1: #7cd3ff; --ag2: #2f7df0; }
.av-4 { --ag1: #6fe3c1; --ag2: #0e9f78; } .av-5 { --ag1: #ffd36b; --ag2: #e8920a; } .av-6 { --ag1: #8be0ff; --ag2: #12a6c8; } .av-7 { --ag1: #ff9a8a; --ag2: #d6382a; }
.main { padding: 30px 40px 80px; max-width: 1280px; margin: 0 auto; }
.topbar, .bottom-nav { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin-top: 5px; color: var(--muted); }
.page-head > .row { gap: 8px; }
.page-tools { display: flex; align-items: center; gap: 8px; }
.view-in { animation: view-in .38s cubic-bezier(.2, .8, .2, 1); }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- khối (kính mờ) ---------- */
.card, .stat, .table-wrap, .ts-wrap, .empty {
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
}
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .stack > .card + .card, .plan-cards > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat {
  position: relative; display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); color: var(--text); overflow: hidden;
}
.stat::before { /* vệt sáng góc */ content: ""; position: absolute; right: -30px; top: -34px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, var(--primary-soft), transparent 70%); pointer-events: none; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 500; position: relative; }
.stat .value { font-size: 29px; font-weight: 700; margin-top: 6px; letter-spacing: -.015em; font-variant-numeric: tabular-nums; line-height: 1.1; position: relative; }
.stat .value small { font-size: 13.5px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat.link-card:hover { text-decoration: none; }
.stat.attn { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); background: linear-gradient(180deg, var(--amber-soft), var(--surface) 160%); }
.stat.attn .value { color: var(--amber); }
.stat.hl { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: linear-gradient(160deg, var(--primary-soft), var(--surface) 70%); }
.stat.hl .value { background: linear-gradient(120deg, var(--p1), var(--p2)); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }

/* hiệu ứng nghiêng 3D khi rê chuột (core/fx.js đặt --rx --ry --mx --my) */
.tilt-on { transform-style: preserve-3d; transition: transform .18s ease-out, box-shadow .2s; will-change: transform; }
.tilt-on.is-tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-3px) scale(1.012); box-shadow: 0 1px 0 var(--glass-edge) inset, 0 26px 44px -20px rgba(40, 15, 0, .45); }
.tilt-on::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .28), transparent 62%); }
:root[data-theme="dark"] .tilt-on::after { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .10), transparent 62%); }
.tilt-on.is-tilt::after { opacity: 1; }
.card.tilt-on, .tilt-on { position: relative; }

/* ---------- nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--text);
  padding: 9px 15px; border-radius: 13px; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.3;
  box-shadow: 0 1px 0 var(--glass-edge) inset, 0 2px 0 var(--border), 0 6px 14px -10px rgba(40, 20, 10, .3);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .08s, filter .12s;
}
:root[data-theme="dark"] .btn:not(.primary):not(.success):not(.solid):not(.ghost) { background: rgba(255, 255, 255, .08); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 2px 0 rgba(0,0,0,.35); }
.btn:hover { background: var(--surface-2); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--border); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn.primary {
  background: linear-gradient(180deg, var(--p1), var(--p2)); border-color: transparent; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.18);
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 3px 0 color-mix(in srgb, var(--p2) 70%, #000), 0 12px 20px -10px var(--p1);
}
.btn.primary:hover { filter: brightness(1.06); background: linear-gradient(180deg, var(--p1), var(--p2)); }
.btn.primary:active { box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 1px 0 color-mix(in srgb, var(--p2) 70%, #000); transform: translateY(2px); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: linear-gradient(180deg, #ef5a45, #d1301d); border-color: transparent; color: #fff; box-shadow: 0 3px 0 #a3220f, 0 12px 20px -10px #d1301d; }
.btn.success { background: linear-gradient(180deg, #22b97d, #0f9462); border-color: transparent; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.18); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 3px 0 #0a6e48, 0 12px 20px -10px #0f9462; }
.btn.success:hover { filter: brightness(1.06); background: linear-gradient(180deg, #22b97d, #0f9462); }
.btn.success:active { box-shadow: 0 1px 0 #0a6e48; transform: translateY(2px); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 14px 24px; font-size: 16px; border-radius: 16px; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; padding: 7px; border-radius: 10px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; position: relative; transition: background .12s, color .12s, transform .12s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #e11d48; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface-solid); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--text-2); line-height: 1.6;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--primary-soft); color: var(--primary-ink); }
.list-item > .badge:first-child::before { display: none; }
.list-item > .badge:first-child { min-width: 28px; justify-content: center; padding: 3px 8px; }

.callout { border-radius: 16px; padding: 13px 16px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.callout.amber { background: var(--amber-soft); border-color: transparent; }
.callout.green { background: var(--green-soft); border-color: transparent; }
.callout.blue { background: var(--blue-soft); border-color: transparent; }
.callout.red { background: var(--red-soft); border-color: transparent; }
.callout strong { display: block; margin-bottom: 2px; color: var(--text); }

.tabs { display: inline-flex; gap: 3px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 18px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 7px 15px; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: color .12s, background .12s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface-solid); box-shadow: 0 1px 0 var(--glass-edge) inset, 0 6px 14px -8px rgba(40, 20, 10, .35); }
:root[data-theme="dark"] .tab.active { background: rgba(255, 255, 255, .13); }
.tab .count { background: #e11d48; color: #fff; font-size: 11px; border-radius: 99px; padding: 0 6px; line-height: 17px; }

/* ---------- form ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
label.field > span.hint, .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input, select, textarea {
  font: inherit; word-spacing: inherit; font-size: 14.5px; color: var(--text); background: var(--surface-solid);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 13px; width: 100%; font-weight: 400;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] select option { background: #1a1614; color: var(--text); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border-strong)); }
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input[readonly] { background: var(--surface-2); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin: 2px 0 0; padding: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.days-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.days-pick label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px 12px; font-weight: 600; color: var(--text); cursor: pointer; }
.days-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.row > select { width: auto; min-width: 190px; max-width: 100%; }

/* ---------- bảng ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); white-space: nowrap; padding-top: 11px; padding-bottom: 11px; text-transform: uppercase; letter-spacing: .05em; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.right, th.right { text-align: right; }
tr.weekend td { background: var(--surface-2); color: var(--muted); }
.card .table-wrap { box-shadow: none; background: transparent; }

/* bảng công */
.ts-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-height: 72vh; box-shadow: var(--shadow); }
.ts { font-size: 12px; width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.ts th, .ts td { padding: 0; border: 0; border-bottom: 1px solid var(--border); text-align: center; text-transform: none; letter-spacing: 0; }
.ts td { padding: 4px 2px; }
.ts thead th { position: sticky; top: 0; z-index: 2; padding: 8px 2px; background: var(--surface-solid); font-weight: 600; line-height: 1.25; color: var(--text); }
:root[data-theme="dark"] .ts thead th, :root[data-theme="dark"] .ts .name { background: #1a1614; }
.ts thead th .muted { font-weight: 500; font-size: 11px; }
.ts thead th.off { color: var(--red); }
.ts .name { position: sticky; left: 0; z-index: 1; background: var(--surface-solid); text-align: left; padding: 8px 14px; min-width: 180px; max-width: 210px; border-right: 1px solid var(--border); }
.ts thead .name { z-index: 3; }
.ts .name b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts .sum { padding: 8px 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; border-left: 1px solid var(--border); }
.ts .sum.hl { background: var(--primary-soft); color: var(--primary-ink); }
.cell {
  width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 11px; font-weight: 700;
  cursor: pointer; color: var(--text); padding: 0; transition: transform .1s, box-shadow .1s;
}
.cell:hover { box-shadow: 0 0 0 2px var(--primary); transform: scale(1.1); }
.cell.full { background: var(--green-soft); color: var(--green); }
.cell.half { background: var(--blue-soft); color: var(--blue); }
.cell.late { background: var(--amber-soft); color: var(--amber); }
.cell.leave { background: var(--primary-soft); color: var(--primary-ink); }
.cell.holiday { background: var(--red-soft); color: var(--red); }
.cell.absent { background: linear-gradient(145deg, #ef5a45, #d1301d); color: #fff; }
.cell.off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, transparent 4px 8px); color: var(--muted); }
.cell.future { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.legend i.full { background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.legend i.half { background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.legend i.late { background: var(--amber-soft); box-shadow: inset 0 0 0 1px var(--amber); }
.legend i.leave { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.legend i.holiday { background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.legend i.absent { background: #d1301d; }

/* ---------- thẻ chấm công (hero 3D) ---------- */
.clock-card {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 30px 34px; border: 0; color: #fff; isolation: isolate; border-radius: 28px;
  background: var(--hero);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 34px 60px -28px var(--hero-glow);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.clock-card::before { content: ""; position: absolute; z-index: -1; right: -90px; top: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, var(--hero-glow), transparent 66%); opacity: .55; filter: blur(8px); }
.clock-card::after { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(120% 90% at 0% 110%, rgba(0,0,0,.45), transparent 60%), repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 14px); pointer-events: none; }
.clock { font-size: 56px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 4px; text-shadow: 0 8px 28px rgba(0,0,0,.35); }
.clock-date { color: rgba(255,255,255,.82); font-weight: 500; }
.clock-status { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.clock-card .badge { background: rgba(0,0,0,.28); color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.clock-card .badge::before { background: #fff; opacity: .8; }
.clock-card .badge.green::before { background: #5ff0b5; opacity: 1; }
.clock-card .badge.amber::before { background: #ffd07a; opacity: 1; }
.clock-card .badge.red::before { background: #ff9d8a; opacity: 1; }
.clock-card > div { min-width: 0; position: relative; z-index: 2; }
.hero-3d { position: absolute !important; z-index: 1 !important; right: 220px; top: 50%; width: 220px; height: 220px; margin-top: -110px; perspective: 700px; pointer-events: none; }
.hero-3d i { position: absolute; left: 50%; top: 50%; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 30px;
  background: linear-gradient(145deg, rgba(255,255,255,.34), rgba(255,255,255,.05) 55%, rgba(255,160,90,.25));
  border: 1px solid rgba(255,255,255,.35); box-shadow: 0 20px 40px -14px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  transform: rotateX(58deg) rotateZ(-34deg) translateZ(calc(var(--z) * 1px)); animation: hero-float 7s ease-in-out infinite; animation-delay: calc(var(--z) * -.05s); }
.hero-3d i:nth-child(1) { --z: -34; opacity: .55; } .hero-3d i:nth-child(2) { --z: 0; opacity: .8; } .hero-3d i:nth-child(3) { --z: 34; }
.hero-3d b { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff, var(--hero-glow) 45%, rgba(0,0,0,.4) 120%); box-shadow: 0 0 40px var(--hero-glow), 0 14px 22px -8px rgba(0,0,0,.6);
  transform: translateZ(90px); animation: hero-orb 5s ease-in-out infinite; }
@keyframes hero-float { 50% { transform: rotateX(58deg) rotateZ(-26deg) translateZ(calc(var(--z) * 1px + 14px)); } }
@keyframes hero-orb { 50% { transform: translateZ(90px) translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .hero-3d i, .hero-3d b { animation: none; } }
/* nút chấm công 3D kiểu "phím cơ" */
.checkin-btn { position: relative; z-index: 1; min-width: 210px; border: 0 !important; }
.clock-card .btn.checkin-btn {
  padding: 17px 28px; border-radius: 20px; font-size: 17px; font-weight: 700; text-shadow: none;
  background: linear-gradient(180deg, #fff, #ffe9db); color: #8a2f08;
  box-shadow: 0 1px 0 #fff inset, 0 7px 0 #d99a74, 0 24px 32px -12px rgba(0,0,0,.6);
  transition: transform .09s, box-shadow .09s;
}
.clock-card .btn.checkin-btn:hover { transform: translateY(-2px); filter: none; background: linear-gradient(180deg, #fff, #ffe9db); box-shadow: 0 1px 0 #fff inset, 0 9px 0 #d99a74, 0 28px 36px -12px rgba(0,0,0,.6); }
.clock-card .btn.checkin-btn:active { transform: translateY(6px); box-shadow: 0 1px 0 #fff inset, 0 1px 0 #d99a74, 0 8px 14px -8px rgba(0,0,0,.6); }
.clock-card .btn.success.checkin-btn { background: linear-gradient(180deg, #d9ffee, #8df0c4); color: #075c3b; box-shadow: 0 1px 0 #fff inset, 0 7px 0 #38b985, 0 24px 32px -12px rgba(0,0,0,.6); }
.clock-card .btn.success.checkin-btn:active { box-shadow: 0 1px 0 #fff inset, 0 1px 0 #38b985, 0 8px 14px -8px rgba(0,0,0,.6); }
.clock-card .btn.checkin-btn:not(.primary):not(.success) { background: rgba(255,255,255,.14); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 0 rgba(0,0,0,.28); }

.month-nav { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; padding: 2px; }
.month-nav input { width: 150px; border: 0; padding: 6px 8px; box-shadow: none !important; background: transparent; }

/* ---------- danh sách ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--muted); margin-top: 3px; align-items: center; }
.link-card { display: block; color: inherit; }
.link-card:hover { text-decoration: none; }
.list-item.link-card { display: flex; color: inherit; border-radius: 14px; margin: 0 -10px; padding-left: 10px; padding-right: 10px; transition: background .12s; }
.list-item.link-card:first-child { padding-top: 10px; }
.list-item.link-card:last-child { padding-bottom: 10px; }
.list-item.link-card:hover { background: var(--surface-2); }
.list-item.link-card:hover .title { color: var(--primary-ink); }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.plan-card { display: flex; flex-direction: column; gap: 12px; }
.plan-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.plan-card .title { font-weight: 600; font-size: 15px; line-height: 1.45; }
progress { width: 100%; height: 7px; border: 0; border-radius: 99px; overflow: hidden; background: var(--surface-3); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 99px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #22b97d, #6fe3a8); border-radius: 99px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, #22b97d, #6fe3a8); border-radius: 99px; }
.progress-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.progress-row progress { flex: 1; }

.todo { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--border); }
.todo:last-child { border-bottom: 0; padding-bottom: 0; }
.todo .txt { flex: 1; min-width: 0; }
.chk { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: inline-grid; place-items: center; flex: none; margin-top: 2px; }
.chk.on { background: linear-gradient(145deg, #22b97d, #0f9462); border-color: transparent; color: #fff; }
.chk svg { width: 13px; height: 13px; stroke-width: 3; }
.todo.done .txt > div:first-child { text-decoration: line-through; color: var(--muted); }
.todo .result { font-size: 13px; color: var(--green); margin-top: 4px; }
/* biểu mẫu kế hoạch */
.plan-form { max-width: 860px; }
.form-sec { padding: 20px 22px; }
.sec-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.sec-head p { margin-top: 2px; }
.sec-num { width: 30px; height: 30px; border-radius: 11px; background: linear-gradient(145deg, var(--p1), var(--p2)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; box-shadow: 0 8px 14px -8px var(--p1); }
.sec-num svg { width: 15px; height: 15px; }
.form-grid.two { gap: 12px; }
.rows { counter-reset: row; }
.rows-head { display: grid; gap: 8px; padding: 0 2px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-head, .kpi-row { grid-template-columns: 1fr 200px 34px; }
.item-head, .item-row { grid-template-columns: 22px 1fr 150px 130px 34px; }
.kpi-row, .item-row { display: grid; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-row { counter-increment: row; }
.drag-num::before { content: counter(row); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.add-row { margin-top: 2px; color: var(--primary-ink); }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 40%); }
.tpl-pick { margin-bottom: 18px; }
.tpl-pick-label { margin-bottom: 8px; font-weight: 600; }
.tpl-list { display: flex; gap: 10px; flex-wrap: wrap; }
.tpl-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-width: 200px; flex: 1; max-width: 280px; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); color: var(--text); transition: transform .12s, border-color .12s; }
.tpl-card:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-2px); }
.tpl-card span { font-size: 12.5px; color: var(--muted); }
.tpl-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.tpl-card.blank { border-style: dashed; }
.tpl-preview { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; }
.tpl-preview li::marker { color: var(--muted); }

/* chi tiết kế hoạch */
.grid-plan { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.progress-card { display: flex; gap: 20px; align-items: center; }
.pct { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 90px; height: 90px; border-radius: 50%; flex: none;
  background: conic-gradient(#22b97d calc(var(--p, 0) * 1%), var(--surface-3) 0); position: relative; box-shadow: 0 12px 22px -12px rgba(15, 148, 98, .55); }
.pct::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface-solid); }
:root[data-theme="dark"] .pct::before { background: #1d1816; }
.pct b, .pct span { position: relative; }
.pct b { font-size: 20px; line-height: 1.1; }
.pct span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.pc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pc-body progress { height: 8px; }
.pc-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.pc-stats .bad { color: var(--red); }
.goals { margin-top: 10px; }
.kpi-table td, .kpi-table th { padding: 10px 14px; }
.checklist { display: flex; flex-direction: column; }
.ck-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ck-item:first-child { padding-top: 0; }
.ck-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ck-item input[type=checkbox] { width: 20px; height: 20px; margin-top: 1px; cursor: pointer; }
.ck-item .chk { width: 20px; height: 20px; }
.ck-body { flex: 1; min-width: 0; }
.ck-text { font-weight: 500; }
.ck-item.done .ck-text { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.ck-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.ck-meta:empty { display: none; }
.due { display: inline-flex; align-items: center; gap: 4px; }
.due svg { width: 13px; height: 13px; }
.due.bad { color: var(--red); font-weight: 600; }
.ck-result { margin-top: 6px; font-size: 13.5px; color: var(--green); background: var(--green-soft); border-radius: 10px; padding: 6px 10px; display: inline-block; }
.ck-result a { font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.card.blocker { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); background: linear-gradient(180deg, var(--amber-soft), var(--surface) 130%); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: 12px; font-weight: 600; color: var(--text-2); font-size: 14px; }
.seg input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.comment { display: flex; gap: 10px; }
.comment .bubble { background: var(--surface-2); border-radius: 6px 18px 18px 18px; padding: 10px 14px; flex: 1; min-width: 0; }
.comment .who { font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.comment .who time { font-weight: 400; color: var(--muted); font-size: 12px; }
.comment .who .icon-btn { margin-left: auto; padding: 3px; opacity: .35; }
.comment:hover .who .icon-btn { opacity: 1; }
.timeline { display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; position: relative; }
.timeline div { display: flex; gap: 12px; position: relative; }
.timeline div::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--surface-solid); border: 2px solid var(--primary); margin-top: 5px; flex: none; }
.timeline div:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 18px; bottom: -14px; width: 1px; background: var(--border-strong); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.card .empty, td .empty { border: 0; padding: 32px 16px; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.empty svg { width: 40px; height: 40px; opacity: .45; margin-bottom: 8px; }

/* ---------- modal, toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 8, 6, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .14s ease-out; }
.modal { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 26px; width: 100%; max-width: 580px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); }
:root[data-theme="dark"] .modal { background: #1b1715; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 6px; position: sticky; top: 0; background: inherit; z-index: 1; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 12px 22px 22px; }
.toast-wrap { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #1d1816; color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: 380px; animation: slide .25s cubic-bezier(.2, .9, .3, 1.2); display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.1); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9ea0b5; flex: none; }
.toast.error::before { background: #ff7a5c; }
.toast.success::before { background: #4ee0a6; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes slide { from { transform: translateY(14px) scale(.96); opacity: 0; } }
.copy-box { display: flex; gap: 8px; }
.copy-box input { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: 18px; font-weight: 700; letter-spacing: .06em; }

/* ---------- đăng nhập ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; perspective: 1200px; }
.auth .card { width: 100%; max-width: 420px; padding: 38px 34px 32px; border-radius: 30px; box-shadow: var(--shadow-lg); border-color: var(--border); background: var(--surface); animation: auth-in .7s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
@keyframes auth-in { from { opacity: 0; transform: rotateX(14deg) translateY(30px) scale(.96); } }
.auth .brand { justify-content: center; padding-bottom: 14px; }
.auth .brand-logo { width: 56px; height: 56px; border-radius: 18px; font-size: 18px; }
.auth h1 { text-align: center; font-size: 23px; margin-bottom: 4px; }
.auth h1 + p { text-align: center; }
.auth form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth form > p.small { text-align: center; }
.loading { display: grid; place-items: center; align-content: center; min-height: 40vh; color: var(--muted); }
.loading::before { content: ""; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--primary); animation: spin .7s linear infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- thảo luận ---------- */
.feed { max-width: 720px; }
.composer { padding: 16px 18px; }
.composer-top { display: flex; gap: 12px; align-items: flex-start; }
.composer-top textarea { border: 0; background: var(--surface-2); min-height: 76px; resize: vertical; }
.composer-top textarea:focus { background: var(--surface-solid); }
.composer-bar { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.cat-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .12s, transform .12s; }
.chip:hover { background: var(--surface-2); transform: translateY(-1px); }
.chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
label.icon-btn { cursor: pointer; }
.img-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.img-thumbs:empty { display: none; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.thumb-x svg { width: 12px; height: 12px; }
.loading-thumb { display: grid; place-items: center; font-size: 11.5px; color: var(--muted); border: 1px dashed var(--border-strong); }
.feed-tabs { margin: 20px 0 14px; }
.post { padding: 18px 20px 14px; }
.post.pinned { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.post-head { display: flex; gap: 12px; align-items: flex-start; }
.post-who { flex: 1; min-width: 0; }
.post-who .row { gap: 8px; }
.post-who .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); margin-top: 1px; align-items: center; }
.cat-tag { font-weight: 600; }
.cat-tag.amber { color: var(--amber); } .cat-tag.blue { color: var(--blue); } .cat-tag.green { color: var(--green); } .cat-tag.red { color: var(--red); }
.pin-tag { color: var(--primary-ink); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.pin-tag svg { width: 13px; height: 13px; }
.post-actions { display: flex; gap: 0; opacity: .55; }
.post:hover .post-actions { opacity: 1; }
.post-text { margin-top: 12px; font-size: 15px; line-height: 1.6; }
.post-imgs { display: grid; gap: 4px; margin-top: 12px; border-radius: 16px; overflow: hidden; }
.post-imgs.n1 { grid-template-columns: 1fr; }
.post-imgs.n2 { grid-template-columns: 1fr 1fr; }
.post-imgs.n3, .post-imgs.n4 { grid-template-columns: 1fr 1fr; }
.post-imgs.n3 .post-img:first-child { grid-row: span 2; }
.post-img { border: 0; padding: 0; background: var(--surface-2); cursor: zoom-in; display: block; min-height: 120px; }
.post-img img { width: 100%; height: 100%; max-height: 420px; object-fit: cover; display: block; }
.post-imgs.n1 .post-img img { max-height: 520px; object-fit: contain; background: var(--surface-2); }
.reactions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.react-chip { border: 1px solid var(--border); background: var(--surface-2); border-radius: 99px; padding: 2px 10px; font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: transform .1s; color: var(--text); }
.react-chip:hover { transform: translateY(-1px) scale(1.04); }
.react-chip span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.react-chip.mine { border-color: var(--primary); background: var(--primary-soft); }
.react-chip.mine span { color: var(--primary-ink); }
.react-add { border: 1px dashed var(--border-strong); background: transparent; border-radius: 99px; padding: 3px 9px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; font: inherit; font-weight: 700; }
.react-add:hover { color: var(--primary); border-color: var(--primary); }
.react-bar { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 8px; padding: 6px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 99px; width: fit-content; box-shadow: var(--shadow); }
.react-bar button { border: 0; background: transparent; font-size: 21px; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; transition: transform .12s; }
.react-bar button:hover { background: var(--surface-2); transform: scale(1.25) translateY(-2px); }
.link-btn { border: 0; background: none; padding: 0; margin-top: 12px; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.link-btn:hover { color: var(--primary); }
.post-comments { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.post-comments .bubble { padding: 8px 12px; }
.comment-box { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.comment-box textarea { min-height: 38px; height: 38px; padding: 8px 14px; border-radius: 19px; resize: none; background: var(--surface-2); border-color: transparent; line-height: 1.4; }
.comment-box textarea:focus { background: var(--surface-solid); }
.comment-box .avatar { margin-bottom: 3px; }
.comment-box .send { color: var(--primary); }
.emoji-pop { position: absolute; z-index: 70; display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; padding: 8px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .12s ease-out; }
:root[data-theme="dark"] .emoji-pop { background: #1b1715; }
.emoji-pop button { border: 0; background: transparent; font-size: 20px; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; }
.emoji-pop button:hover { background: var(--surface-2); }
.lightbox { display: grid; place-items: center; background: var(--surface-2); border-radius: 14px; overflow: hidden; }
.lightbox img { max-width: 100%; max-height: 70vh; display: block; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- ca làm & nhóm ---------- */
.shift-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.shift-list.inline { margin-top: 0; }
.shift-chip { font-size: 12.5px; font-weight: 500; padding: 3px 11px; border-radius: 99px; background: rgba(0,0,0,.28); color: #fff; white-space: nowrap; box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset; }
.shift-list.inline .shift-chip { background: var(--surface-2); color: var(--text-2); box-shadow: none; }
.shift-chip.live { box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.shift-list.inline .shift-chip.live { background: var(--blue-soft); color: var(--blue); box-shadow: none; }
.report-grid { display: flex; flex-direction: column; gap: 8px; }
.report-row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; font-weight: 500; padding: 6px 10px; border: 1px solid var(--border); border-radius: 14px; }
.report-row input { text-align: right; font-size: 17px; font-weight: 600; padding: 7px 10px; }
.report-total { text-align: right; }
.sess-row { border: 1px solid var(--border); border-radius: 16px; padding: 12px; background: var(--surface-2); }
.sess-times { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 10px; align-items: end; }
.sess-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.sess-counts label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cell sup { font-size: 8.5px; margin-left: 1px; opacity: .8; }
.kpi-row.chan-row { grid-template-columns: 1fr 34px; }
.member-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 240px; overflow-y: auto; padding: 10px; border: 1px solid var(--border); border-radius: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row .badge::before { display: none; }
.sub-head { margin-bottom: 14px; }
.range-label { font-weight: 600; padding: 0 8px; font-size: 14px; white-space: nowrap; }
.video-table td, .video-table th { padding: 10px 12px; }
.video-table .total-row td { background: var(--surface-2); font-weight: 700; }
.bad-num { color: var(--red); font-weight: 600; }
td progress { height: 5px; margin-top: 4px; }
.chan-bars { display: flex; flex-direction: column; gap: 10px; }
.chan-bar { display: grid; grid-template-columns: 200px 1fr 60px; gap: 12px; align-items: center; font-size: 14px; }
.chan-bar b { text-align: right; }

/* ---------- lương ca & tài khoản nhận lương ---------- */
.pay-rule { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; }
.pay-rule svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.pay-callout { display: flex; gap: 10px; align-items: flex-start; }
.pay-callout > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.form-sep { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.form-sep svg, .card h2 svg, .list-item .title svg { width: 17px; height: 17px; vertical-align: -3px; }
.focus-card { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.bank-cell { font-size: 13px; line-height: 1.45; }
.bank-cell .acc { font-variant-numeric: tabular-nums; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.bank-cell .icon-btn { width: 26px; height: 26px; }
.bank-cell .icon-btn svg { width: 14px; height: 14px; }
.pay-table td, .pay-table th { white-space: nowrap; }
.pay-table .name-col { white-space: normal; min-width: 150px; }
.pay-preview { margin-top: 6px; }
.clock-card .pay-rule { color: rgba(255, 255, 255, .82); }
.report-total b { white-space: nowrap; }
.bank-alert { display: flex; align-items: center; gap: 12px; color: var(--red); text-decoration: none; }
.bank-alert:hover { text-decoration: none; filter: brightness(.98); }
.bank-alert > svg { width: 22px; height: 22px; flex: none; }
.bank-alert > svg:last-child { margin-left: auto; width: 18px; height: 18px; }
.bank-alert .small { color: var(--text-2); margin-top: 2px; }
.pay-table td.status-col { white-space: normal; min-width: 190px; }
.stat-sub { display: block; margin-top: 8px; color: var(--muted); position: relative; }
tr.current td { background: var(--primary-soft); }
.table-wrap.flat { border: 0; box-shadow: none; background: transparent; }

/* ---------- xác nhận ca ---------- */
.cf { font-size: 12px; font-weight: 600; white-space: nowrap; }
.cf.amber, .amber-text { color: var(--amber); }
.cf.green { color: var(--green); }
.cf.red { color: var(--red); }
.clock-card .cf { color: #fff; opacity: .9; }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: linear-gradient(145deg, #ffb13d, #f08a05); color: #fff; font-size: 12px; margin-left: 4px; }
.confirm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.confirm-card { display: flex; flex-direction: column; gap: 10px; }
.confirm-card .big-num { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
.confirm-card .big-num small { font-size: 12px; color: var(--muted); font-weight: 500; }
.confirm-actions { flex-wrap: wrap; gap: 8px; }
.brand-logo.has-img { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 16px -8px rgba(0,0,0,.35); padding: 4px; overflow: hidden; }
.brand-logo.has-img img { width: 100%; height: 100%; object-fit: contain; }
.logo-row { gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 72px; height: 72px; border-radius: 18px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; padding: 6px; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.clock-status .badge, .shift-chip { white-space: normal; max-width: 100%; }

/* ---------- tiện ích mới dùng chung ---------- */
.ring-wrap { position: relative; width: 150px; height: 150px; flex: none; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-wrap .trk { fill: none; stroke: var(--surface-3); stroke-width: 12; }
.ring-wrap .bar { fill: none; stroke: url(#ringGrad); stroke-width: 12; stroke-linecap: round; filter: drop-shadow(0 6px 8px color-mix(in srgb, var(--p1) 50%, transparent)); transition: stroke-dashoffset .9s cubic-bezier(.2, .8, .2, 1); }
.ring-wrap .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.15; }
.ring-wrap .mid b { font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ring-wrap .mid span { font-size: 12px; color: var(--muted); font-weight: 600; }
svg.minibars { width: 100%; max-width: 520px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.minibars rect { fill: url(#barGrad); transition: opacity .15s; }
.minibars rect.today { fill: url(#barGradHot); }
.minibars .lbl { font-size: 9.5px; fill: var(--muted); font-weight: 600; text-anchor: middle; }
.minibars .val { font-size: 9.5px; fill: var(--text-2); font-weight: 700; text-anchor: middle; }
.minibars g:hover rect { opacity: .75; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dot-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.kbd-hint { font-size: 12px; color: var(--muted); }
.notif-pop { position: fixed; z-index: 55; width: 380px; max-width: calc(100vw - 24px); max-height: min(560px, 76vh); overflow-y: auto; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; padding: 8px; }
:root[data-theme="dark"] .notif-pop { background: #1b1715; }
.notif-pop h3 { padding: 10px 12px 6px; display: flex; align-items: center; justify-content: space-between; }
.notif-item { display: flex; gap: 12px; padding: 11px 12px; border-radius: 16px; color: inherit; align-items: flex-start; cursor: pointer; }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item.unread { background: var(--primary-soft); }
.notif-item .ni { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--surface-2); flex: none; }
.notif-item .nt { font-weight: 600; font-size: 13.5px; line-height: 1.4; }
.notif-item .nb { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- máy tính bảng ---------- */
@media (max-width: 1180px) {
  .main { padding: 28px 28px 70px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-3d { right: 190px; }
}
@media (max-width: 1000px) { .hero-3d { display: none; } }
@media (max-width: 900px) { .grid-3, .grid-2, .grid-plan { grid-template-columns: 1fr; } }

/* ---------- điện thoại ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 10px; top: 10px; bottom: 10px; margin: 0; width: 290px; max-width: calc(100vw - 20px); height: auto; z-index: 40; transform: translateX(-115%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); }
  :root:not([data-theme="dark"]) .sidebar { background: rgba(255, 255, 255, .94); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 39; }
  .topbar {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
  }
  .topbar .title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar a.avatar { width: 34px; height: 34px; font-size: 12.5px; text-decoration: none; }
  .main { padding: 18px 16px calc(112px + env(safe-area-inset-bottom)); }
  h1 { font-size: 22px; }
  .page-head { margin-bottom: 18px; align-items: flex-start; }
  .page-head > .btn.primary, .page-head > a.btn.primary { width: 100%; }
  .grid { gap: 12px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px 15px; }
  .stat .value { font-size: 24px; }
  .card { padding: 17px; border-radius: 22px; }
  .clock-card { grid-template-columns: 1fr; padding: 24px 22px; gap: 20px; border-radius: 26px; }
  .clock { font-size: 50px; }
  .checkin-btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .rows-head { display: none; }
  .item-row { grid-template-columns: 22px 1fr 1fr 34px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
  .item-row input[name=item_text] { grid-column: 2 / -1; }
  .item-row input[name=item_due] { grid-column: 2; }
  .kpi-row { grid-template-columns: 1fr 34px; }
  .kpi-row input[name=kpi_target] { grid-column: 1; }
  .kpi-row .icon-btn { grid-row: 1; grid-column: 2; }
  .grid-plan { grid-template-columns: 1fr; }
  .form-sec { padding: 16px; }
  .tpl-card { max-width: none; min-width: 45%; }
  .progress-card { gap: 14px; }
  .hide-sm { display: none; }
  th, td { padding: 11px 12px; }
  .toast-wrap { left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { border-radius: 28px 28px 0 0; max-height: 92vh; animation: sheet .26s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom); }
  .month-nav input { width: 128px; }
  .tabs { display: flex; }
  .tab { flex: 1; justify-content: center; }
  .chan-bar { grid-template-columns: 1fr 50px; }
  .chan-bar progress { grid-column: 1 / -1; grid-row: 2; }
  .report-row { grid-template-columns: 1fr 90px; }
  .stat.hl .value { font-size: 22px; }
  .notif-pop { left: 12px !important; right: 12px; width: auto; top: 64px !important; }

  /* thanh dock nổi */
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 35;
    background: var(--sidebar-bg); -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px);
    border: 1px solid var(--border); border-radius: 28px; padding: 8px 6px; box-shadow: 0 24px 40px -14px rgba(20, 8, 0, .5), var(--shadow);
  }
  :root:not([data-theme="dark"]) .bottom-nav { background: rgba(255, 255, 255, .94); }
  :root[data-theme="dark"] .bottom-nav { background: rgba(26, 21, 19, .94); }
  .bottom-nav a {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px;
    color: var(--muted); font-size: 10.5px; font-weight: 600; border-radius: 16px; text-decoration: none; text-align: center; line-height: 1.2;
    transition: color .15s;
  }
  .bottom-nav a svg { width: 24px; height: 24px; padding: 3px; border-radius: 12px; transition: transform .25s cubic-bezier(.2, .9, .3, 1.4), background .2s, color .2s, box-shadow .2s; box-sizing: content-box; }
  .bottom-nav a.active { color: var(--text); }
  .bottom-nav a.active svg { background: linear-gradient(145deg, var(--p1), var(--p2)); color: #fff; transform: translateY(-9px) scale(1.12); box-shadow: 0 12px 16px -8px var(--p1); stroke-width: 2.1; }
  .bottom-nav a.active span:not(.nav-badge) { transform: translateY(-6px); }
  .bottom-nav a span { transition: transform .25s cubic-bezier(.2, .9, .3, 1.4); }
  .bottom-nav .nav-badge { position: absolute; top: -2px; left: 54%; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; margin: 0; }
}
@keyframes sheet { from { transform: translateY(60px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .view-in, .auth .card { animation: none; } .tilt-on { transition: none; } }
@media (hover: none) { .tilt-on.is-tilt { transform: none; } }

/* ---------- phụ ---------- */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic-sun { display: none; } .ic-moon { display: inline-grid; }
:root[data-theme="dark"] .ic-sun { display: inline-grid; } :root[data-theme="dark"] .ic-moon { display: none; }
.topbar .icon-btn { flex: none; }

/* ---------- trang quản lý: tông tím chàm + thanh bên tối ---------- */
body.mode-admin {
  --p1: #7c6bff; --p2: #4f3fe0; --primary: #5846e8; --primary-2: #4a3bd0; --primary-soft: rgba(99, 82, 245, .13); --primary-ink: #4434c9;
  --orb-1: rgba(99, 82, 245, .30); --orb-2: rgba(34, 190, 220, .16); --orb-3: rgba(236, 72, 153, .15);
  --hero: linear-gradient(135deg, #0e0c26 0%, #231d66 50%, #5a48ee 100%); --hero-glow: #8d7dff;
}
:root[data-theme="dark"] body.mode-admin { --primary: #a79bff; --primary-2: #bdb4ff; --primary-soft: rgba(124, 107, 255, .2); --primary-ink: #c5bcff; --orb-1: rgba(99, 82, 245, .30); }
body.mode-admin .sidebar { --text: #eceaff; --text-2: #cdc9f2; --muted: #9a95c4; --surface-2: rgba(255, 255, 255, .07); --surface-3: rgba(255, 255, 255, .12); --border: rgba(255, 255, 255, .09);
  --primary-soft: rgba(124, 107, 255, .26); background: linear-gradient(170deg, rgba(23, 20, 58, .94), rgba(12, 10, 32, .94)); color: var(--text); border-color: rgba(255, 255, 255, .08); }
body.mode-admin .sidebar .nav-link { color: var(--text-2); }
body.mode-admin .sidebar .nav-link.active, body.mode-admin .sidebar .nav-link:hover { color: #fff; }
body.mode-admin .sidebar .sidebar-foot.link-card { color: var(--text); }
@media (max-width: 760px) { body.mode-admin .sidebar { background: linear-gradient(170deg, rgba(23, 20, 58, .98), rgba(12, 10, 32, .98)); } }

/* =========================================================
   REUP — nhận việc, đăng video, duyệt, kho việc
   ========================================================= */
.red-text { color: var(--red); } .green-text { color: var(--green); }
.tab-count.red { background: linear-gradient(145deg, #ef5a45, #d1301d); }
.break { word-break: break-all; }
.nav-btn { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; }

/* thẻ hero: số video hôm nay */
.clock small { font-size: .36em; font-weight: 600; opacity: .72; margin-left: 5px; letter-spacing: 0; }
.clock-card .muted { color: rgba(255, 255, 255, .74); }
.clock-card .pay-rule { color: rgba(255, 255, 255, .82); margin-top: 12px; }
.hero-bar { height: 10px; margin-top: 14px; max-width: 400px; background: rgba(255, 255, 255, .18); }
.hero-bar::-webkit-progress-bar { background: rgba(255, 255, 255, .18); }
.hero-bar::-webkit-progress-value { background: linear-gradient(90deg, #ffd07a, #fff); box-shadow: 0 0 14px rgba(255, 200, 120, .75); }
.hero-bar::-moz-progress-bar { background: linear-gradient(90deg, #ffd07a, #fff); }
.empty-work { grid-template-columns: 1fr; padding: 38px 34px; }
.empty-work h2 { color: #fff; font-size: 24px; margin-bottom: 6px; }
.empty-work p { max-width: 460px; margin-bottom: 18px; }
.empty-work .claim-bar { justify-content: flex-start; gap: 14px; }
.empty-work .claim-bar .muted { font-weight: 600; }
.empty-work .btn:not(.primary) { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .22); box-shadow: none; }

/* xếp hạng, quy định */
.rank-list { display: flex; flex-direction: column; gap: 4px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; }
.rank-row.me { background: var(--primary-soft); }
.rank-no { width: 28px; text-align: center; font-weight: 700; font-size: 16px; flex: none; }
.rank-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rank-body b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-body progress { height: 5px; }
.rank-num { text-align: right; display: flex; flex-direction: column; line-height: 1.25; min-width: 44px; }
.rank-gap { text-align: center; color: var(--muted); letter-spacing: 5px; line-height: 1; }
.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }

/* trang Việc làm */
.today-strip { display: flex; align-items: center; gap: 20px; padding: 16px 22px; }
.today-strip .ring-wrap { width: 96px; height: 96px; }
.today-strip .ring-wrap .mid b { font-size: 24px; }
.ts-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.work-grid > * { min-width: 0; }
.task-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.task-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.step { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-num { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none;
  background: linear-gradient(145deg, var(--p1), var(--p2)); box-shadow: 0 6px 10px -6px var(--p1); }
.vid-box { border-radius: 16px; overflow: hidden; background: #0b0908; display: grid; place-items: center; box-shadow: 0 14px 24px -16px rgba(0, 0, 0, .6); }
.vid-box video { width: 100%; max-height: 340px; display: block; background: #000; }
.step-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hint-line { margin: -2px 0 0; }
.cap-box { max-height: 190px; overflow: auto; padding: 12px 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); font-size: 14.5px; line-height: 1.55; }
.link-list { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 10px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); }
.link-i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--primary-soft); color: var(--primary-ink); flex: none; }
.link-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--text-2); }
.posted-bar { display: flex; gap: 10px; align-items: center; }
.posted-bar input { flex: 1; min-width: 0; }
.posted-bar .btn.lg { white-space: nowrap; }
.task-foot { display: flex; justify-content: center; }
.claim-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.queue { display: flex; flex-direction: column; gap: 6px; max-height: 440px; overflow: auto; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); color: var(--text); font-size: 14px; transition: background .12s, transform .12s; }
.q-item:hover { background: var(--surface-3); text-decoration: none; transform: translateX(2px); }
.q-item.rej { background: var(--red-soft); }
.q-no { width: 26px; height: 26px; border-radius: 9px; background: var(--surface-solid); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.q-body { flex: 1; min-width: 0; }
.q-item > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

/* trang Đã đăng */
.done-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 4px; }
.done-item { display: flex; flex-direction: column; gap: 9px; padding: 16px; }
.di-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* duyệt video */
.rv-person .card-head { margin-bottom: 6px; }
.rv-list { display: flex; flex-direction: column; }
.rv-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--border); }
.rv-row:first-child { border-top: 0; }
.rv-no { width: 26px; height: 26px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--muted); flex: none; }
.rv-body { flex: 1; min-width: 0; cursor: pointer; }
.rv-btns { display: flex; align-items: center; gap: 6px; flex: none; }

/* kho việc */
.pool-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.pool-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; transition: border-color .12s, transform .12s; }
.pool-item:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.pi-main { flex: 1; min-width: 0; }
.search-box { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; max-width: 440px; padding: 0 12px; border: 1px solid var(--border-strong); background: var(--surface-solid); border-radius: 13px; }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-box svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search-box input, :root[data-theme="dark"] .search-box input { border: 0; background: transparent; box-shadow: none; padding: 9px 0; width: 100%; outline: none; }
.search-box input:focus, .search-box input:hover { box-shadow: none; border: 0; }
.storage-card { display: flex; flex-direction: column; gap: 8px; }
progress.bad::-webkit-progress-value { background: linear-gradient(90deg, #ef5a45, #ff9d8a); }
progress.bad::-moz-progress-bar { background: linear-gradient(90deg, #ef5a45, #ff9d8a); }
.upload-drop { display: flex; align-items: center; gap: 12px; padding: 16px; border: 2px dashed var(--border-strong); border-radius: 16px; cursor: pointer; color: var(--text-2); font-weight: 600; background: var(--surface-2); transition: border-color .12s, background .12s; }
.upload-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-drop svg { width: 24px; height: 24px; color: var(--primary); flex: none; }
.prod-check { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.pc-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 11px; background: var(--surface-2); }
.pc-row.full { background: var(--red-soft); }
.api-doc { margin-top: 14px; }
.api-doc summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.api-doc .pre { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; overflow: auto; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }

@media (max-width: 900px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .task-card { padding: 14px; gap: 14px; }
  .step { padding: 13px; }
  .posted-bar { flex-direction: column; align-items: stretch; }
  .posted-bar .btn { width: 100%; padding: 16px; }
  .today-strip { gap: 14px; padding: 14px 16px; }
  .today-strip .ring-wrap { width: 84px; height: 84px; }
  .rv-row { gap: 9px; }
  .rv-btns .icon-btn { display: none; }
  .rv-person .card-head { align-items: stretch; }
  .rv-person .card-head > .btn { width: 100%; }
  .done-list, .pool-list { grid-template-columns: 1fr; }
  .empty-work { padding: 28px 22px; }
  .search-box { max-width: none; }
}
