/* ==========================================================================
   Sổ tay nhiệm vụ — Văn phòng Tỉnh ủy Lào Cai
   Hệ thiết kế: trang trọng, rõ ràng, tương phản cao (phong cách "Accessible & Ethical").
   - Màu nhấn duy nhất: đỏ cờ; vàng sao chỉ dùng làm chi tiết (ngôi sao, vạch đánh dấu).
   - Điểm nhấn thị giác đặt ở thanh bên đỏ thẫm; vùng nội dung giữ yên tĩnh, nền trắng – xám lạnh.
   - Font Be Vietnam Pro (thiết kế cho tiếng Việt), lưu sẵn trong static/vendor/fonts — chạy không cần internet.
   ========================================================================== */

/* ---------- Font ---------- */
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro-vietnamese-400.61f0b094762b.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; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro-latin-400.ec4890cc91be.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: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro-vietnamese-500.e114e58c7ce3.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; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro-latin-500.a787f4dc9815.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: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro-vietnamese-600.fddb4ea1f52e.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; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro-latin-600.54156380a29a.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: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro-vietnamese-700.ffbd2c81aac3.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; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../vendor/fonts/be-vietnam-pro-latin-700.99df06229b59.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; }

/* ---------- Token ---------- */
:root {
  --red-900: #5c0b0e;
  --red-800: #7a1014;      /* thanh bên */
  --red-700: #8f1418;
  --red-600: #a4161a;      /* màu chính: nút, liên kết (tương phản 7,4:1 trên nền trắng) */
  --red-50:  #fbefef;
  --gold-500: #d4a017;     /* vàng sao: chỉ dùng trang trí / vạch đánh dấu */
  --gold-300: #f2c94c;     /* vàng trên nền đỏ */
  --ink: #1b1f24;
  --ink-2: #3d444d;
  --muted: #59616b;        /* 6,2:1 trên nền trắng */
  --line: #dde1e6;
  --line-2: #eef0f3;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ok: #157347;  --ok-bg: #e8f4ee;
  --info: #0b5cad; --info-bg: #e8f1fb;
  --warn: #8a5a00; --warn-bg: #fdf3dc;
  --danger: #b42318; --danger-bg: #fdecea;
  --neutral: #4b5563; --neutral-bg: #eef0f3;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 8px 24px rgba(16, 24, 40, .10);
  --sidebar-w: 264px;
  --topbar-h: 60px;
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", Arial, sans-serif;

  --bs-body-font-family: var(--font);
  --bs-body-font-size: 0.9375rem;
  --bs-body-line-height: 1.55;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
  --bs-link-color-rgb: 164, 22, 26;
  --bs-link-hover-color-rgb: 122, 16, 20;
  --bs-border-radius: var(--radius-sm);
  --bs-secondary-color: var(--muted);
}
@media (max-width: 575.98px) { :root { --bs-body-font-size: 1rem; } }

/* ---------- Nền tảng ---------- */
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); min-height: 100dvh; display: flex; flex-direction: column; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); letter-spacing: -0.01em; }
a { color: var(--red-600); text-underline-offset: 2px; }
a:hover { color: var(--red-800); }
.text-muted, .text-body-secondary { color: var(--muted) !important; }
:focus-visible { outline: 3px solid rgba(164, 22, 26, .45); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--red-600); box-shadow: 0 0 0 .2rem rgba(164, 22, 26, .2); outline: 0;
}
.form-check-input:checked { background-color: var(--red-600); border-color: var(--red-600); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; vertical-align: -3px; margin-right: .35rem; }
.skip-link { position: absolute; left: .75rem; top: -60px; z-index: 2000; background: var(--ink); color: #fff; padding: .5rem .9rem; border-radius: var(--radius-sm); }
.skip-link:focus { top: .75rem; color: #fff; }
.tabular, .stat-num, td { font-variant-numeric: tabular-nums; }

/* ---------- Thanh bên ---------- */
.sidebar {
  --bs-offcanvas-width: 284px;
  background: var(--red-800);
  color: #fff;
  display: flex; flex-direction: column;
  border-top: 4px solid var(--gold-500);
}
@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1030; overflow-y: auto; }
  .has-shell .shell { margin-left: var(--sidebar-w); }
}
.sidebar.offcanvas-lg { background: var(--red-800); }
/* Bootstrap đặt nền trong suốt (!important) cho offcanvas-lg ở màn hình lớn: giữ nền đỏ của thanh bên. */
@media (min-width: 992px) { .sidebar.offcanvas-lg { background-color: var(--red-800) !important; } }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1.1rem 1.1rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.brand-lockup { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.brand-lockup:hover { color: #fff; }
.brand-star { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--red-600); box-shadow: inset 0 0 0 2px rgba(242, 201, 76, .55); color: var(--gold-300); flex: none; }
.brand-star svg { width: 22px; height: 22px; }
/* Biểu trưng Lào Cai: đặt trên nền tròn trắng để nổi trên nền đỏ. */
.brand-logo { display: block; width: 40px; height: 40px; flex: none; border-radius: 50%; background: #fff; padding: 2px; box-shadow: 0 0 0 2px rgba(242, 201, 76, .7); object-fit: contain; }
.topbar-brand .brand-logo { width: 32px; height: 32px; }
.auth-hero .auth-logo { width: 88px; height: 88px; padding: 4px; margin-bottom: 1.25rem; box-shadow: 0 0 0 3px var(--gold-300), 0 6px 18px rgba(0, 0, 0, .25); }
@media (max-width: 991.98px) { .auth-hero .auth-logo { width: 64px; height: 64px; margin-bottom: .75rem; } }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .02em; }
.brand-org { font-size: .8rem; color: rgba(255, 255, 255, .78); margin-top: .15rem; }
.sidebar-nav { padding: .75rem .65rem; flex: 1 1 auto; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-group { margin: 1.1rem .7rem .4rem; font-size: .78rem; font-weight: 600; color: rgba(255, 255, 255, .62); }
.side-link {
  position: relative; display: flex; align-items: center; gap: .7rem;
  min-height: 42px; padding: .5rem .75rem; border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .86); text-decoration: none; font-weight: 500; font-size: .92rem;
  transition: background-color .15s ease, color .15s ease;
}
.side-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-link.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.side-link.active::before { content: ""; position: absolute; left: -.65rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--gold-300); }
.side-link:focus-visible { outline-color: var(--gold-300); }
.side-count { margin-left: auto; min-width: 22px; padding: 0 .4rem; border-radius: 11px; background: var(--gold-300); color: var(--red-900); font-size: .75rem; font-weight: 700; text-align: center; line-height: 22px; }
.sidebar-foot { padding: .9rem 1.1rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .82rem; }
.sidebar-user { font-weight: 600; }
.sidebar-role { color: rgba(255, 255, 255, .72); }

/* ---------- Khung nội dung, thanh trên cùng ---------- */
.shell { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 1020;
  height: var(--topbar-h); display: flex; align-items: center; gap: .5rem;
  padding: 0 .75rem; background: var(--red-800); color: #fff;
  border-bottom: 3px solid var(--gold-500);
}
.topbar-btn { display: inline-grid; place-items: center; position: relative; width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; }
.topbar-btn:hover { background: rgba(255, 255, 255, .12); color: inherit; }
.topbar-brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; text-decoration: none; text-transform: uppercase; font-size: .95rem; letter-spacing: .02em; }
.topbar-brand:hover { color: #fff; }
.topbar-brand .brand-star { width: 30px; height: 30px; }
.topbar-brand .brand-star svg { width: 17px; height: 17px; }
.topbar-title { color: var(--muted); font-size: .9rem; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.topbar-user { display: flex; align-items: center; gap: .55rem; max-width: 260px; min-height: 44px; padding: .25rem .5rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; font-weight: 500; }
.topbar-user:hover { background: rgba(255, 255, 255, .12); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--gold-300); color: var(--red-900); font-weight: 700; font-size: .9rem; flex: none; }
.bell-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--gold-300); color: var(--red-900); font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; }
@media (min-width: 992px) {
  .topbar { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); padding: 0 1.75rem; }
  .topbar-btn:hover, .topbar-user:hover { background: var(--line-2); }
  .bell-count { background: var(--red-600); color: #fff; }
  .avatar { background: var(--red-600); color: #fff; }
}
.dropdown-menu { border-color: var(--line); border-radius: var(--radius-sm); padding: .35rem; }
.dropdown-item { border-radius: 5px; padding: .5rem .75rem; }
.dropdown-item:active { background: var(--red-600); }

/* ---------- Vùng nội dung ---------- */
.app-main { flex: 1 0 auto; width: 100%; max-width: 1560px; margin-inline: auto; padding: 1.25rem 1rem 2rem; }
.app-main:focus { outline: 0; }
@media (min-width: 992px) { .app-main { padding: 1.75rem 1.75rem 2.5rem; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.25; text-wrap: balance; }
.page-sub { color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.section-title { font-size: 1.05rem; font-weight: 700; margin: 1.75rem 0 .75rem; }
.section-title small { font-weight: 400; font-size: .85rem; color: var(--muted); }
.alert { border-radius: var(--radius-sm); border-width: 1px; padding: .7rem 1rem; }

/* ---------- Thẻ, bảng ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); }
.card-header { background: var(--surface); border-bottom-color: var(--line); }
.list-group-item { border-color: var(--line-2); padding: .85rem 1rem; }
.table { --bs-table-hover-bg: #fafbfc; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .65rem .75rem; border-bottom-color: var(--line-2); }
.table thead th, .table .table-light th { background: #f7f8fa; color: var(--muted); font-weight: 600; font-size: .8125rem; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table-tasks td { vertical-align: top; font-size: .9rem; }
.table-tasks .col-content { min-width: 280px; max-width: 520px; }
.table-tasks a.fw-semibold { color: var(--ink); }
.table-tasks a.fw-semibold:hover { color: var(--red-600); }
.empty-state { text-align: center; color: var(--muted); padding: 2.25rem 1rem; border: 1px dashed #c9ced5; border-radius: var(--radius); background: var(--surface); }
.nav-tabs { border-bottom-color: var(--line); }
.nav-tabs .nav-link { color: var(--muted); font-weight: 500; border: 0; border-bottom: 3px solid transparent; }
.nav-tabs .nav-link.active { color: var(--red-600); background: transparent; border-bottom-color: var(--red-600); }
.pagination .page-link { color: var(--red-600); }
details > summary { cursor: pointer; color: var(--red-600); }

/* ---------- Nút ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-brand, .btn-primary { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.btn-brand:hover, .btn-brand:focus, .btn-primary:hover, .btn-primary:focus { background: var(--red-800); border-color: var(--red-800); color: #fff; }
.btn-brand:active, .btn-primary:active { background: var(--red-900) !important; border-color: var(--red-900) !important; }
.btn-outline-secondary { color: var(--ink-2); border-color: #c4cad2; background: var(--surface); }
.btn-outline-secondary:hover { background: var(--line-2); color: var(--ink); border-color: #b3bac3; }
.btn-outline-primary { color: var(--red-600); border-color: var(--red-600); }
.btn-outline-primary:hover { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.text-brand { color: var(--red-600); }
.bg-brand { background: var(--red-800); }

/* ---------- Form ---------- */
.form-label { color: var(--ink-2); }
.form-control, .form-select { border-color: #c9ced5; border-radius: var(--radius-sm); background-color: var(--surface); }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--line-2); }
.form-control::placeholder { color: #8a929c; }
.form-text { color: var(--muted); }

/* ---------- Huy hiệu trạng thái (luôn có chữ, không chỉ dựa vào màu) ---------- */
.tag { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tag-neutral { color: var(--neutral); background: var(--neutral-bg); }
.tag-info { color: var(--info); background: var(--info-bg); }
.tag-ok { color: var(--ok); background: var(--ok-bg); }
.tag-warn { color: var(--warn); background: var(--warn-bg); }
.tag-danger { color: var(--danger); background: var(--danger-bg); }
.tag-dark { color: #fff; background: #4b5563; }
.tag-plain { color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); font-weight: 500; }
.tag-plain::before { display: none; }
.badge-soft { font-weight: 500; }

/* ---------- Dashboard ---------- */
.stat-card .card-body { padding: .9rem 1rem; }
.stat-card .stat-num { font-size: 2rem; font-weight: 700; line-height: 1.1; margin-top: .15rem; }
.stat-card .stat-label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.stat-card a { text-decoration: none; color: inherit; }
.stat-card a:hover .stat-num { text-decoration: underline; text-decoration-thickness: 2px; }
.stat-card.accent-success { border-left: 4px solid var(--ok); }
.stat-card.accent-primary { border-left: 4px solid var(--info); }
.stat-card.accent-danger { border-left: 4px solid var(--danger); }
.stat-card.accent-warning { border-left: 4px solid var(--gold-500); }
.stat-card .text-success { color: var(--ok) !important; }
.stat-card .text-primary { color: var(--info) !important; }
.stat-card .text-danger { color: var(--danger) !important; }
.stat-card .text-warning { color: var(--warn) !important; }
.rate-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.rate-strip > div { padding: .9rem .75rem; text-align: center; }
.rate-strip > div + div { border-left: 1px solid var(--line); }
.rate-strip .stat-label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.rate-strip .stat-num { font-size: 1.7rem; font-weight: 700; }
.rate-strip .text-success { color: var(--ok) !important; }
.rate-strip .text-danger { color: var(--danger) !important; }
@media (max-width: 399.98px) { .rate-strip .stat-num { font-size: 1.3rem; } .stat-card .stat-num { font-size: 1.6rem; } }
.chart-box { width: 100%; height: 300px; }
@media (max-width: 575.98px) { .chart-box { height: 260px; } }
.dept-cards { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 576px) { .dept-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dept-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow-1); }
.dept-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .6rem; }
.dept-card dl { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; margin: 0; font-size: .9rem; }
.dept-card dt { font-weight: 400; color: var(--muted); }
.dept-card dd { margin: 0; text-align: right; font-weight: 600; }
.alert-group { border-top: 3px solid var(--line); }
.alert-group-overdue { border-top-color: var(--danger); }
.alert-group-due_soon, .alert-group-not_reported { border-top-color: var(--gold-500); }
.alert-group-stale { border-top-color: var(--neutral); }
.alert-items li { padding: .45rem 0; border-bottom: 1px solid var(--line-2); }
.alert-items li:last-child { border-bottom: 0; }
.alert-items a { color: var(--ink); text-decoration: none; font-weight: 500; }
.alert-items a:hover { color: var(--red-600); text-decoration: underline; }

/* ---------- Danh sách nhiệm vụ: bộ lọc, thẻ trên tablet / điện thoại ---------- */
@media (min-width: 992px) { .filter-panel.collapse:not(.show) { display: block; } }
.filter-panel .form-label { font-weight: 500; color: var(--muted); }
.task-cards { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 576px) { .task-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.task-card { display: block; background: var(--surface); color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-left: 4px solid #c4cad2; border-radius: var(--radius); padding: .85rem .95rem; box-shadow: var(--shadow-1); }
.task-card:hover { color: var(--ink); border-color: #b9bec5; box-shadow: var(--shadow-2); }
.task-card.status-in_progress { border-left-color: var(--info); }
.task-card.status-completed { border-left-color: var(--ok); }
.task-card.status-paused { border-left-color: var(--gold-500); }
.task-card.status-cancelled { border-left-color: #4b5563; }
.task-card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.task-code { font-size: .78rem; color: var(--muted); }
.task-card-content { font-weight: 600; line-height: 1.4; margin-bottom: .55rem; }
.task-card-due { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .88rem; margin-bottom: .45rem; }
.task-card-progress { height: 6px; margin-bottom: .55rem; }
.task-card-people { display: grid; grid-template-columns: auto 1fr; gap: .15rem .6rem; font-size: .85rem; margin: 0; }
.task-card-people dt { color: var(--muted); font-weight: 400; }
.task-card-people dd { margin: 0; }
.task-card-flags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .55rem; }
.progress { background: var(--line-2); border-radius: 999px; }
.progress-bar { background: var(--info); }

/* ---------- Chi tiết nhiệm vụ ---------- */
.detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 575.98px) {
  .detail-actions > * { flex: 1 1 calc(50% - .5rem); }
  .detail-actions > form > .btn, .detail-actions > .btn { width: 100%; }
}
.timeline { list-style: none; padding-left: 0; }
.timeline li { border-left: 2px solid var(--line); padding: 0 0 1rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #adb5bd; box-shadow: 0 0 0 3px var(--surface); }
.timeline li.t-directive::before { background: var(--info); }
.timeline li.t-status::before { background: var(--red-600); }
.timeline li.t-extension::before { background: var(--gold-500); }
.timeline li.t-progress::before { background: var(--ok); }
.subtask-done { text-decoration: line-through; color: var(--muted); }
.modal-content { border-radius: var(--radius); border: 0; box-shadow: var(--shadow-2); }
.modal-header { border-bottom-color: var(--line-2); }
.modal-footer { border-top-color: var(--line-2); }

/* ---------- Trang khác ---------- */
.acct-actions { min-width: 170px; }
.acct-actions .btn, .acct-actions form { margin-bottom: .25rem; }
.form-select.match-missing { border: 2px solid var(--danger); }
.form-select.match-suggested { border: 2px solid var(--gold-500); }
.notif-unread { background: var(--red-50); box-shadow: inset 3px 0 0 var(--red-600); }
.audit-json { background: #f6f7f9; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: .8rem; }

/* ---------- Trang đăng nhập ---------- */
.auth { flex: 1 0 auto; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth { grid-template-columns: minmax(380px, 46%) 1fr; } }
.auth-hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 0% 0%, var(--red-700) 0%, var(--red-800) 55%, var(--red-900) 100%);
  border-bottom: 4px solid var(--gold-500);
  padding: 2rem 1.5rem;
  display: flex; flex-direction: column; justify-content: center;
}
@media (min-width: 992px) { .auth-hero { border-bottom: 0; border-right: 4px solid var(--gold-500); padding: 3rem 3.5rem; } }
.auth-hero::after { /* ngôi sao vàng lớn, mờ — chi tiết trang trí duy nhất */
  content: ""; position: absolute; right: -90px; bottom: -110px; width: 360px; height: 360px; opacity: .09;
  background: var(--gold-300);
  clip-path: polygon(50% 0%, 61.8% 35.4%, 100% 35.4%, 69.1% 57.3%, 80.9% 92.7%, 50% 70.8%, 19.1% 92.7%, 30.9% 57.3%, 0% 35.4%, 38.2% 35.4%);
}
.auth-hero .brand-star { width: 56px; height: 56px; margin-bottom: 1.25rem; }
.auth-hero .brand-star svg { width: 32px; height: 32px; }
.auth-kicker { font-size: .95rem; color: rgba(255, 255, 255, .85); font-weight: 500; }
.auth-title { color: #fff; font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.15; margin: .35rem 0 .9rem; text-transform: uppercase; letter-spacing: .01em; }
.auth-desc { max-width: 34rem; color: rgba(255, 255, 255, .86); margin: 0; }
@media (max-width: 991.98px) { .auth-desc { display: none; } .auth-hero .brand-star { margin-bottom: .75rem; } }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: .25rem; }
.auth-card .form-control { min-height: 46px; }
.auth-card .btn { min-height: 46px; }
.no-shell .app-main { max-width: none; padding: 0; display: flex; flex-direction: column; }
.login-box { max-width: 420px; margin: 4vh auto 0; padding: 0 1rem; }

/* ---------- Chân trang ---------- */
.app-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .82rem; text-align: center; }
.app-footer-inner { max-width: 1560px; margin-inline: auto; padding: .9rem 1rem; line-height: 1.55; }
.app-footer-title { color: var(--red-600); font-weight: 600; letter-spacing: .01em; }

/* ---------- Điện thoại ---------- */
@media (max-width: 575.98px) {
  .page-title { font-size: 1.25rem; }
  .page-actions { width: 100%; }
  .page-actions > .btn, .page-actions > a { flex: 1 1 auto; }
  .btn-sm { padding: .45rem .75rem; min-height: 40px; }
  .form-select-sm, .form-control-sm { font-size: 1rem; min-height: 42px; }
  .modal-dialog { margin: .5rem; }
  .table-responsive { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print {
  .sidebar, .topbar, .app-footer, .page-actions, .filter-panel, .filter-toggle { display: none !important; }
  .has-shell .shell { margin-left: 0; }
}

/* ---------- Bảng danh sách nhiệm vụ (PC): 5 cột, tự co giãn, không cuộn ngang ----------
   Cột phụ (TT, người phụ trách, thời hạn, tiến độ) có độ rộng cố định vừa đủ nội dung;
   cột "Nội dung nhiệm vụ" nhận toàn bộ phần còn lại để ít phải xuống dòng. */
.tl-table { table-layout: fixed; width: 100%; }
.tl-table td, .tl-table th { overflow-wrap: anywhere; vertical-align: top; }
.tl-table th { white-space: normal; line-height: 1.3; }
.tl-table > tbody > tr > td { padding-top: .8rem; padding-bottom: .8rem; }
.tl-c-tt { width: 44px; }
col.tl-c-people { width: 248px; }
.tl-c-due { width: 120px; }
.tl-c-status { width: 152px; }
@media (min-width: 1600px) { col.tl-c-people { width: 264px; } .tl-c-due { width: 128px; } .tl-c-status { width: 168px; } }
.tl-title { display: block; color: var(--ink); font-weight: 600; line-height: 1.45; text-decoration: none; max-width: 80ch; }
.tl-title:hover { color: var(--red-600); text-decoration: underline; }
.tl-meta { color: var(--muted); font-size: .8125rem; margin-top: .2rem; }
/* Ngày hạn luôn nằm trên một dòng, không bị ngắt giữa các chữ số. */
.tl-date { display: inline-block; font-weight: 600; white-space: nowrap; overflow-wrap: normal; }
.tl-flags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
/* Nhãn LĐVP / LĐP / Chủ trì / Phối hợp có độ rộng cố định để các hàng thẳng cột với nhau. */
.tl-people { display: grid; grid-template-columns: 4.6em 1fr; gap: .1rem .4rem; margin: 0; font-size: .85rem; line-height: 1.45; }
.tl-people dt { color: var(--muted); font-weight: 400; }
.tl-people dd { margin: 0; }
.tl-status { margin-bottom: .45rem; }
.tl-progress { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--ink-2); }
.tl-progress .progress { flex: 1 1 auto; height: 6px; }
.tl-progress span { min-width: 2.6em; text-align: right; }
/* PC màn hình vừa (1200–1279px): đưa người phụ trách vào dưới nội dung để cột nội dung đủ rộng. */
.tl-people-inline { display: none; margin-top: .55rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
@media (max-width: 1279.98px) {
  .tl-table .tl-c-people { display: none; }
  .tl-people-inline { display: block; }
  .tl-people-inline .tl-people { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem 0; }
  .tl-people-inline .tl-people dt { margin-right: .3rem; }
  .tl-people-inline .tl-people dd { margin-right: 1rem; }
}

/* ---------- Ô chọn cán bộ dạng danh sách thả xuống ---------- */
.staff-picker-toggle { display: block; width: 100%; min-height: 42px; text-align: left; background-color: var(--surface); cursor: pointer; }
.staff-picker-toggle .staff-picker-text { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-right: 1rem; }
.staff-picker-toggle.is-empty .staff-picker-text { color: #6b7280; }
.staff-picker-menu { width: 100%; max-width: 100%; padding: .5rem; box-shadow: var(--shadow-2); }
.staff-picker-search { margin-bottom: .4rem; }
.staff-picker-options { max-height: 260px; overflow-y: auto; }
.staff-option { display: flex; align-items: flex-start; gap: .55rem; padding: .5rem .55rem; border-radius: 5px; cursor: pointer; line-height: 1.35; font-size: .9rem; }
.staff-option:hover { background: var(--line-2); }
.staff-option input { flex: none; width: 1.05rem; height: 1.05rem; margin-top: .1rem; accent-color: var(--red-600); }
.staff-option[hidden] { display: none; }
.staff-picker-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.staff-picker-chips:empty { display: none; }
.staff-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .25rem .15rem .6rem; border-radius: 999px; background: var(--red-50); color: var(--red-800); font-size: .82rem; font-weight: 500; border: 1px solid #f0cfd0; }
.staff-chip-remove { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1rem; line-height: 1; }
.staff-chip-remove:hover { background: rgba(164, 22, 26, .12); }
/* Khi JS chưa chạy: hiện thẳng danh sách ô tích để vẫn chọn được. */
.staff-picker:not(.is-ready) .staff-picker-toggle { display: none; }
.staff-picker:not(.is-ready) .staff-picker-menu { display: block; position: static; box-shadow: none; border: 1px solid var(--line); }
@media (max-width: 575.98px) { .staff-option { padding: .65rem .55rem; } .staff-picker-options { max-height: 50vh; } }
