@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext-var.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-vietnamese-var.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  --canvas: #ffffff;
  --ground: #fafafb;
  --stage: #f3f4f5;
  --ink: #1c1d1f;
  --secondary-ink: #242629;
  --support: #707781;
  --muted: #949ba5;
  --tertiary: #505967;
  --rule: #e4e7ec;
  --weak-rule: #eeeff1;
  --control-edge: #cad0d9;
  --button: #1f2125;
  --button-text: #f3f4f5;
  --accent: #386be5;
  --accent-ink: #2458b3;
  --accent-wash: #edf2ff;
  --positive: #2e7d32;
  --negative: #c4242a;
  --warning: #92400e;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fffbeb; --pill-warning-ink: #92400e;
  --pill-neutral-bg: #eeeeee; --pill-neutral-ink: #3d3d3d;
  --pill-accent-bg: #edf2ff; --pill-accent-ink: #2458b3;
  --radius-control: 10px;
  --radius-panel: 12px;
  --radius-tag: 8px;
  --row-height: 44px;
  --sidebar-width: 244px;
  --gap: 16px;
  --pad: 24px;
  --control-height: 36px;
  --topbar: 52px;
  --fs-title: 24px;
  --fs-section: 16px;
  --fs-kpi: 30px;
  --fs-body: 14px;
  --fs-small: 12px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1 {
  font-size: var(--fs-title);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: var(--fs-section); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.nums, .table, .kpi .v, .bar-val { font-variant-numeric: tabular-nums; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.skip {
  position: absolute; left: -999px; top: 8px;
}
.skip:focus { left: 8px; z-index: 40; background: var(--canvas); padding: 8px 12px; border-radius: var(--radius-control); }

/* shell */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) 1fr; }
.sidebar {
  background: var(--ground);
  border-right: 1px solid var(--rule);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 20px;
}
.brand .mark {
  width: 24px; height: 24px; flex: none;
  border-radius: 6px;
  background: var(--ink);
  color: var(--canvas);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
}
.brand strong { font-size: 14px; font-weight: 600; display: block; line-height: 1.2; letter-spacing: -0.02em; }
.brand span { display: block; color: var(--support); font-size: var(--fs-small); font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px;
  border-radius: var(--radius-control);
  color: var(--secondary-ink);
  font-size: 15px; font-weight: 500; letter-spacing: -0.011em;
}
.nav a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.75; flex: none; }
.nav a:hover { background: var(--stage); }
.nav a.active { background: var(--stage); color: var(--ink); font-weight: 600; }
.main { min-width: 0; display: flex; flex-direction: column; background: var(--ground); }
.topbar {
  height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--rule);
  background: var(--ground);
  gap: 16px;
  position: sticky; top: 0; z-index: 8;
}
.topbar form { min-width: 0; flex: 1; max-width: 240px; }
.period {
  height: var(--control-height);
  padding: 0 32px 0 12px;
  border: 1px solid var(--control-edge);
  border-radius: var(--radius-control);
  background: var(--canvas) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23707781' stroke-width='1.75'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none; -webkit-appearance: none;
  color: var(--ink);
  font-weight: 500;
  min-width: 200px;
}
.topbar .who {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto;
  font-size: var(--fs-small);
  color: var(--support);
  white-space: nowrap;
}
.avatar {
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--stage); color: var(--ink);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}
.who b { color: var(--ink); font-weight: 600; }
.content { padding: var(--pad); max-width: 1200px; width: 100%; }
.row { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); margin-bottom: 20px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi {
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  padding: 16px 18px;
}
.kpi .v { font-size: var(--fs-kpi); font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.kpi .l { color: var(--support); font-size: var(--fs-small); margin-top: 8px; font-weight: 500; }

/* panels / tables */
.panel {
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  overflow: hidden;
}
.panel-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px; font-weight: 600;
}
.panel-h span { color: var(--support); font-weight: 500; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.card { background: var(--canvas); border: 1px solid var(--rule); border-radius: var(--radius-panel); overflow-x: auto; }
.table { width: 100%; min-width: 720px; border-collapse: collapse; }
.table th {
  text-align: left; font-weight: 500; color: var(--support);
  font-size: var(--fs-small); padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
}
.table td { padding: 0 16px; height: var(--row-height); border-bottom: 1px solid var(--weak-rule); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--ground); }
.table a:hover { color: var(--accent-ink); }
.table .num, .table td.num { text-align: right; }
.table th.num { text-align: right; }
.code { color: var(--support); font-size: 12px; letter-spacing: 0; white-space: nowrap; }
.tcode { color: var(--support); font-weight: 500; margin-right: 6px; }
.content > .panel, .content > .card, .content > .comp-strip { margin-bottom: 20px; }
.comp-strip {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
}
.comp-strip .comp-bar { flex: 1; min-width: 160px; margin: 0; }
.comp-strip .legend { padding: 0; }

/* status */
.st {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--secondary-ink); white-space: nowrap;
}
.st i {
  width: 7px; height: 7px; border-radius: 99px; background: var(--muted); flex: none;
}
.st-ASSIGNED i, .st-DRAFT i { background: #9aa0a8; }
.st-ACCEPTED i, .st-IN_PROGRESS i { background: var(--accent); }
.st-SUBMITTED i { background: #d97706; }
.st-APPROVED i { background: var(--positive); }
.st-NEEDS_INFO i, .st-REJECTED i, .st-CANCELLED i { background: var(--negative); }
.pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 500;
}
.rk-EXCELLENT { background: var(--pill-accent-bg); color: var(--pill-accent-ink); }
.rk-GOOD { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.rk-MET { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.rk-NOT_MET { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-height); padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font-weight: 500; font-size: 14px; letter-spacing: -0.005em;
}
.btn-primary { background: var(--button); color: var(--button-text); border-color: var(--tertiary); }
.btn-primary:hover { background: #000; color: #fff; }
.btn-ghost { background: var(--canvas); color: var(--secondary-ink); border-color: var(--control-edge); }
.btn-ghost:hover { border-color: var(--tertiary); }
.btn-danger { background: var(--canvas); color: var(--negative); border-color: var(--control-edge); }
.btn-danger:hover { border-color: var(--negative); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 36px; padding: 0; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters a {
  height: 32px; padding: 0 10px; display: inline-flex; align-items: center;
  border-radius: 999px; border: 1px solid var(--control-edge);
  font-size: 13px; background: var(--canvas);
}
.filters a.on { background: var(--stage); border-color: var(--tertiary); color: var(--ink); font-weight: 600; }

/* forms */
select, input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], textarea {
  height: var(--control-height); padding: 0 10px;
  border: 1px solid var(--control-edge); border-radius: var(--radius-control);
  background: var(--canvas); width: 100%; color: var(--ink);
}
textarea { height: auto; padding: 8px 10px; min-height: 72px; resize: vertical; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; }
.form { display: grid; gap: 16px; max-width: 520px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: flex-start; }
.err { color: var(--negative); font-size: 13px; margin: 0 0 12px; }
.meta { display: grid; gap: 10px; padding: 18px 20px; }
.meta div { display: flex; gap: 16px; font-size: 14px; }
.meta .k { color: var(--support); min-width: 108px; }

/* charts */
.comp-bar {
  display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--stage); margin: 8px 16px 16px;
}
.comp-bar span { display: block; height: 100%; }
.comp-bar .doing { background: var(--tertiary); }
.comp-bar .wait { background: var(--accent); }
.comp-bar .done { background: #c5cbd3; }
.legend { display: flex; gap: 16px; padding: 0 16px 16px; font-size: 12px; color: var(--support); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.legend .doing { background: var(--tertiary); }
.legend .wait { background: var(--accent); }
.legend .done { background: #c5cbd3; }
.bars { padding: 8px 16px 16px; display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 28px 1fr 48px; gap: 10px; align-items: center; }
.bar-row .name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row a.name:hover { color: var(--accent-ink); }
.track { height: 10px; background: var(--stage); border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar-val { font-size: 13px; text-align: right; color: var(--ink); }

/* toast / empty / skeleton */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--button); color: var(--button-text);
  padding: 10px 16px; border-radius: var(--radius-control);
  font-size: 14px; z-index: 30;
  animation: toast-in .2s ease, toast-out .3s ease 2.4s forwards;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(-50%) translateY(8px); } }
.empty { padding: 48px 16px; text-align: center; color: var(--support); font-size: 14px; }
.skel { background: linear-gradient(90deg, var(--stage) 0%, var(--weak-rule) 50%, var(--stage) 100%); background-size: 200% 100%; animation: sk 1.2s ease infinite; border-radius: 6px; height: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

.menu-btn, .bottom-nav { display: none; }
.crumb { color: var(--support); font-size: 13px; margin: 0 0 12px; }
.crumb a:hover { color: var(--ink); }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--ground); }
.login-art {
  padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid var(--rule);
  background: var(--ground);
}
.login-art .mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--ink); color: var(--canvas);
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.login-art h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; max-width: 12ch; }
.login-art p { color: var(--support); font-size: 16px; margin: 12px 0 0; }
.login-box { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--canvas); }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 24px; margin-bottom: 20px; }
.demos { display: grid; gap: 2px; margin-top: 20px; border: 1px solid var(--rule); border-radius: var(--radius-panel); overflow: hidden; }
.demo {
  text-align: left; border: 0; background: var(--canvas);
  padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; width: 100%;
}
.demo + .demo { border-top: 1px solid var(--weak-rule); }
.demo:hover { background: var(--ground); }
.demo b { font-size: 13px; font-weight: 600; }
.demo span { font-size: 12px; color: var(--support); }
.pw { font-size: 12px; color: var(--support); margin: 16px 0 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open {
    display: flex; position: fixed; inset: 0; z-index: 20;
    background: var(--ground); width: min(280px, 86vw); border-right: 1px solid var(--rule);
  }
  .topbar { height: 52px; padding: 0 16px; }
  .topbar form { max-width: none; }
  .period { min-width: 0; width: 100%; max-width: none; }
  .toast { bottom: 72px; }
  .who .role, .who b { display: none; }
  .content { padding: 16px 16px 80px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .menu-btn { display: inline-flex; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: var(--ground); border-top: 1px solid var(--rule); height: 56px;
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 10px; font-weight: 500; color: var(--support);
  }
  .bottom-nav a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; }
  .bottom-nav a.active { color: var(--ink); }
}
