/* ============================================================
   V-HUB OPERATIONS CENTER — design system
   Palette derives from the official V-HUB logo:
   navy #071A35 · orange #F05A28 · red #E2231A · green #0E9F4A · blue #1B53A8
   ============================================================ */

/* Be Vietnam Pro (spec §12) — served same-origin by the Worker (/api/font),
   because browsers block the third-party font host. Falls back to Arial. */
/* latin subset */
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/api/font?v=400&s=latin') 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: 'Be Vietnam Pro'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/api/font?v=500&s=latin') 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: 'Be Vietnam Pro'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/api/font?v=600&s=latin') 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: 'Be Vietnam Pro'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/api/font?v=700&s=latin') 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: 'Be Vietnam Pro'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('/api/font?v=800&s=latin') 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;
}

/* vietnamese subset (dấu tiếng Việt) */
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/api/font?v=400&s=vietnamese') 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;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/api/font?v=500&s=vietnamese') 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;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/api/font?v=600&s=vietnamese') 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;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/api/font?v=700&s=vietnamese') 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;
}
@font-face {
  font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('/api/font?v=800&s=vietnamese') 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 {
  --navy: #071A35;
  --navy-800: #0A2243;
  --navy-700: #0F2B52;
  --navy-600: #16375F;
  --navy-300: #7C90AB;
  --orange: #F05A28;
  --orange-600: #D9451A;
  --orange-100: #FDEDE7;
  --red: #E2231A;
  --green: #0E9F4A;
  --green-100: #E6F6EC;
  --blue: #1B53A8;
  --blue-100: #E8EFFA;
  --amber: #B4690E;
  --amber-100: #FDF3E2;
  --bg: #F3F5F7;
  --surface: #FFFFFF;
  --line: #E3E9F0;
  --line-strong: #CBD5E1;
  --text: #0F1B2D;
  --muted: #5F7189;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(7, 26, 53, .06), 0 1px 3px rgba(7, 26, 53, .04);
  --shadow: 0 4px 16px rgba(7, 26, 53, .08), 0 1px 3px rgba(7, 26, 53, .05);
  --shadow-lg: 0 24px 48px -12px rgba(7, 26, 53, .28);
  --sidebar: 268px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Be Vietnam Pro', Arial, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; color: var(--navy); letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 10px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ------------------------------- boot / login ------------------------------ */
.boot {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; color: var(--muted);
}
.boot-logo {
  font-size: 30px; font-weight: 800; letter-spacing: .08em;
  background: linear-gradient(100deg, var(--orange), var(--red));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--navy);
}
.login-hero {
  position: relative;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(240, 90, 40, .30), transparent 62%),
    radial-gradient(700px 400px at 96% 106%, rgba(27, 83, 168, .5), transparent 60%),
    linear-gradient(160deg, #071A35 10%, #0A2243 60%, #071A35 100%);
  overflow: hidden;
}
.login-hero::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(70% 60% at 30% 45%, #000 20%, transparent 100%);
  pointer-events: none;
}
.login-brand { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.login-brand img {
  height: 60px; width: auto; background: #fff; border-radius: 12px; padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.login-hero h1 { color: #fff; font-size: 32px; line-height: 1.22; max-width: 15em; margin-top: 40px; }
.login-hero h1 span { color: #FF8A5C; }
.login-hero p.lead { color: #B9C7DA; max-width: 34em; font-size: 14.5px; margin-top: 16px; }
.login-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.login-points li { display: flex; gap: 12px; align-items: flex-start; color: #D5DFEB; font-size: 13.5px; }
.login-points i {
  flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(240, 90, 40, .18); color: #FF8A5C; font-size: 11px; font-style: normal; font-weight: 700;
}
.login-foot { position: relative; z-index: 1; color: #8598B0; font-size: 12px; }
.login-panel {
  display: flex; align-items: center; justify-content: center; padding: 32px;
  background: var(--surface);
}
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 26px; font-size: 13.5px; }
.demo-accounts {
  margin-top: 26px; border-top: 1px dashed var(--line-strong); padding-top: 18px;
}
.demo-accounts h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.demo-grid { display: grid; gap: 6px; }
.demo-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #F8FAFC; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 11px; cursor: pointer; text-align: left; font-size: 12.5px; color: var(--text);
  transition: .15s;
}
.demo-btn:hover { border-color: var(--orange); background: var(--orange-100); }
.demo-btn b { font-weight: 600; }
.demo-btn span { color: var(--muted); font-size: 11.5px; }

/* -------------------------------- layout --------------------------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--navy); color: #C6D2E1;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 60;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 18px 18px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand img { height: 40px; background: #fff; border-radius: 9px; padding: 5px 8px; }
.sidebar-brand .t { font-size: 11px; color: #8FA2BA; line-height: 1.3; }
.sidebar-brand .t b { display: block; color: #fff; font-size: 12.5px; letter-spacing: .02em; }
.nav-group { padding: 14px 12px 4px; }
.nav-group-title {
  font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: #6F84A0; padding: 0 10px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  color: #C6D2E1; font-size: 13.2px; cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; transition: .14s; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-item.active { background: linear-gradient(90deg, rgba(240,90,40,.22), rgba(240,90,40,.06)); color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 var(--orange); }
.nav-item .ico { width: 18px; flex: none; text-align: center; font-size: 14px; opacity: .95; }
.nav-item .pill { margin-left: auto; background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.sidebar-user {
  margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; gap: 10px; align-items: center;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--orange), var(--red)); color: #fff; font-weight: 700; font-size: 13px;
}
.sidebar-user .n { font-size: 12.6px; color: #fff; font-weight: 600; line-height: 1.25; }
.sidebar-user .r { font-size: 11px; color: #8FA2BA; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 40;
}
.topbar .crumb { font-size: 12.5px; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.topbar .crumb b { color: var(--navy); font-weight: 600; }
.topbar .spacer { flex: 1; }
.week-chip {
  display: flex; align-items: center; gap: 8px; background: #F6F8FB; border: 1px solid var(--line);
  border-radius: 30px; padding: 5px 12px 5px 10px; font-size: 12.5px; color: var(--navy); font-weight: 500;
}
.week-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 15px; color: var(--navy);
}
.icon-btn:hover { border-color: var(--orange); color: var(--orange); }
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 10px;
  display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff;
}
.hamburger { display: none; }
.content { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 220px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------- cards ---------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { flex: 1; min-width: 140px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--navy-300); }
.stat.accent-orange::before { background: var(--orange); }
.stat.accent-green::before { background: var(--green); }
.stat.accent-blue::before { background: var(--blue); }
.stat.accent-red::before { background: var(--red); }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat .value { font-size: 27px; font-weight: 800; color: var(--navy); line-height: 1.2; margin-top: 6px; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* --------------------------------- buttons ------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border-radius: 9px; border: 1px solid var(--line-strong); background: #fff; color: var(--navy);
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: .14s; white-space: nowrap;
}
.btn:hover { border-color: var(--navy-300); background: #F8FAFC; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--orange), var(--orange-600)); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(240,90,40,.28); }
.btn-primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, var(--orange), var(--orange-600)); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-danger { background: #fff; border-color: #F3C0BC; color: var(--red); }
.btn-danger:hover { background: #FDF1F0; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--navy); }
.btn-ghost:hover { background: #F1F5F9; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 6px 9px; }

/* --------------------------------- forms --------------------------------- */
.field { margin-bottom: 14px; }
.field > label, .flabel {
  display: block; font-size: 12.3px; font-weight: 600; color: var(--navy); margin-bottom: 5px;
}
.field .req { color: var(--red); }
.hint { font-size: 11.8px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px;
  font-family: inherit; font-size: 13.3px; color: var(--text); background: #fff; transition: .14s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,90,80,.13);
}
textarea { min-height: 76px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--orange); }
.filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin-bottom: 0; min-width: 150px; }
.filters .search { min-width: 230px; flex: 1; }

/* --------------------------------- tables -------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-size: 11.3px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; padding: 10px 14px; background: #F8FAFC;
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid #EEF2F6; vertical-align: top; }
tbody tr:hover { background: #FBFCFE; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
td .strong { font-weight: 600; color: var(--navy); }
td .small { font-size: 11.8px; color: var(--muted); }
.code-tag { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 11.6px; background: #F1F5F9; border-radius: 5px; padding: 1px 6px; color: var(--navy-700); white-space: nowrap; }

/* --------------------------------- badges -------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.4px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap; line-height: 1.5;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.nodot::before { display: none; }
.b-grey { background: #F1F5F9; color: #52627A; }
.b-blue { background: var(--blue-100); color: var(--blue); }
.b-navy { background: #E7EDF6; color: var(--navy-600); }
.b-orange { background: var(--orange-100); color: var(--orange-600); }
.b-green { background: var(--green-100); color: #0B7C3B; }
.b-red { background: #FDEDEC; color: #B71C13; }
.b-amber { background: var(--amber-100); color: var(--amber); }

/* --------------------------------- misc ---------------------------------- */
.empty {
  text-align: center; padding: 44px 20px; color: var(--muted);
}
.empty .big { font-size: 30px; opacity: .5; margin-bottom: 8px; }
.empty h3 { color: var(--navy); margin-bottom: 4px; }
.empty p { font-size: 13px; margin: 0; }
.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-strong);
  border-top-color: var(--orange); animation: spin .7s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.alert {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 13px;
  border: 1px solid; margin-bottom: 16px; align-items: flex-start;
}
.alert .ai { flex: none; font-weight: 700; }
.alert-info { background: var(--blue-100); border-color: #C9DAF3; color: #14417F; }
.alert-warn { background: var(--amber-100); border-color: #F2DDB4; color: #7C4A05; }
.alert-error { background: #FDEDEC; border-color: #F6C7C3; color: #A8180F; }
.alert-ok { background: var(--green-100); border-color: #C3E6D0; color: #0A6B33; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex.spread { justify-content: space-between; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb0 { margin-bottom: 0; }
.mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }

.kv { display: grid; grid-template-columns: 168px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--navy); font-weight: 500; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--orange); border: 2px solid #fff;
}
.timeline .t { font-weight: 600; color: var(--navy); font-size: 13px; }
.timeline .d { font-size: 11.8px; color: var(--muted); }

.bar { height: 7px; background: #EDF1F6; border-radius: 6px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--red)); border-radius: 6px; }
.bar.green > i { background: linear-gradient(90deg, #16B85A, var(--green)); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 9px 15px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  border: none; background: none; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--orange-600); border-bottom-color: var(--orange); }

.item-card { border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-bottom: 11px; background: #fff; }
.item-card.dim { background: #FAFBFC; }
.item-card .ih { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.item-card .ih .ttl { flex: 1; font-weight: 600; color: var(--navy); font-size: 13.6px; }
.item-card .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.2px; color: var(--muted); }
.item-card .body { font-size: 12.9px; color: #33445C; margin-top: 6px; }

/* --------------------------------- modal --------------------------------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(7, 26, 53, .55); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg); animation: pop .16s ease-out;
}
.modal.wide { max-width: 840px; }
.modal.narrow { max-width: 440px; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.modal-head h2 { flex: 1; font-size: 16px; }
.modal-body { padding: 20px; max-height: 68vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }

/* --------------------------------- toasts -------------------------------- */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 400; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow-lg); display: flex; gap: 9px; align-items: center; max-width: 380px;
  animation: slidein .2s ease-out;
}
.toast.ok { background: #0B7C3B; }
.toast.err { background: #B71C13; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------- calendar -------------------------------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; }
.cal-dow { background: #F8FAFC; padding: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; }
.cal-cell { background: #fff; min-height: 104px; padding: 6px; font-size: 12px; }
.cal-cell.other { background: #FBFCFD; color: #B7C2D0; }
.cal-cell.today { background: #FFF8F4; box-shadow: inset 0 0 0 2px var(--orange); }
.cal-cell .d { font-weight: 700; color: var(--navy); font-size: 12px; margin-bottom: 4px; }
.cal-ev { border-radius: 5px; padding: 2px 5px; margin-bottom: 3px; font-size: 11px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.task { background: var(--blue-100); color: var(--blue); }
.cal-ev.book { background: var(--green-100); color: #0B7C3B; }
.cal-ev.shift { background: #F1F5F9; color: #52627A; }
.cal-ev.vtv { background: var(--orange-100); color: var(--orange-600); }

/* ------------------------------ responsive ------------------------------- */
@media (max-width: 1180px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.side { grid-template-columns: minmax(0, 1fr); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
@media (max-width: 900px) {
  .grid.c2, .grid.c3 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .hamburger { display: grid; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; gap: 9px; }
  .topbar .crumb { display: none; }
  .grid.c4 { grid-template-columns: minmax(0, 1fr); }
  .row, .row.r3 { grid-template-columns: minmax(0, 1fr); }
  .modal-body { max-height: 74vh; }
  .week-chip { display: none; }
  .cal-cell { min-height: 72px; }
  .login-panel { padding: 20px; }
}
@media (max-width: 520px) {
  h1 { font-size: 19px; }
  .stat .value { font-size: 23px; }
  .filters .field, .filters .search { min-width: 100%; }
}
