﻿/* =============================================================================
   Giao và quản lý công việc — xã Sông Lũy — giao diện
   Quy ước (skill giao-dien-ui): MỌI màu khai ở :root bên dưới; chữ thường theo câu (không IN HOA);
   bo góc 6px (ô nhập, nút) / 8px (khung); không bóng ở khung nội dung; không gradient; không hiệu ứng tự chạy.
   Sửa file này xong nhớ tăng ?v=N ở Site.master và Pages/Login.aspx.
   ============================================================================= */

:root {
    --ink: #1b2430;
    --ink-2: #46515f;
    --paper: #f4f5f2;
    --surface: #ffffff;
    --line: #d8dcd5;
    --line-strong: #b9bfb5;
    --on-dark: #ffffff;
    --on-dark-2: #c9d0d8;

    --ag-dang-uy: #a3231b;
    --ag-hdnd: #1d6a4e;
    --ag-ubnd: #1f4f8a;
    --ag-mttq: #8a5a00;
    --ag: var(--ink);

    --ok: #1d7347;      --ok-soft: #e1f1e8;
    --soon: #8a5a00;    --soon-soft: #fbefcf;
    --late: #a3231b;    --late-soft: #f9e0dd;
    --idle: #56606c;    --idle-soft: #e8ebe6;
    --prog: #2c5476;    --prog-soft: #e3ecf4;

    --rate-1: var(--late);
    --rate-2: #4d6a8a;
    --rate-3: #2f8a5a;
    --rate-4: #14573a;

    --focus: #f2b705;
    --pop-shadow: 0 6px 24px rgba(27, 36, 48, .18);

    --r-ctl: 6px;
    --r-box: 8px;
    --font-title: "Noto Serif", Georgia, "Times New Roman", serif;
    --font-base: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

body.ag-DANG_UY { --ag: var(--ag-dang-uy); }
body.ag-HDND    { --ag: var(--ag-hdnd); }
body.ag-UBND    { --ag: var(--ag-ubnd); }
body.ag-MTTQ    { --ag: var(--ag-mttq); }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-base);
    font-size: 16px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--ag); }
a:hover { color: var(--ink); }
h1, h2, h3, .page-title, .modal-title { font-family: var(--font-title); }

/* ---------- Khung trang ---------- */
.app-header { background: var(--ink); color: var(--on-dark); padding: .55rem 0; }
.app-brand { display: flex; align-items: center; gap: .75rem; color: var(--on-dark); text-decoration: none; min-width: 0; }
.app-brand:hover { color: var(--on-dark); }
.app-logo { height: 40px; width: 40px; object-fit: contain; background: var(--surface); border-radius: 50%; padding: 2px; flex: none; }
.app-logo-fallback { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); font-size: 1.15rem; }
.app-brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.app-brand-name { font-weight: 600; font-size: 1rem; }
.app-brand-org { font-size: .8125rem; color: var(--on-dark-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-user, .btn-bell { color: var(--on-dark); border: 1px solid var(--ink-2); display: inline-flex; align-items: center; gap: .5rem; font-size: .9375rem; background: transparent; min-height: 40px; }
.btn-user:hover, .btn-user:focus, .btn-user.show, .btn-bell:hover, .btn-bell:focus, .btn-bell.show { color: var(--on-dark); background: var(--ink-2); border-color: var(--on-dark-2); }
.btn-bell { position: relative; width: 42px; justify-content: center; padding: 0; }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--late); color: var(--on-dark); font-size: .75rem; font-weight: 700; line-height: 20px; text-align: center; }
.dropdown-menu { border-radius: var(--r-box); border-color: var(--line); box-shadow: var(--pop-shadow); }
.bell-menu { width: min(380px, 92vw); padding: 0; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
.bell-list { max-height: 60vh; overflow-y: auto; }
.bell-item { display: block; padding: .65rem .9rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9375rem; }
.bell-item:hover { background: var(--paper); color: var(--ink); }
.bell-item.is-unread { font-weight: 600; box-shadow: inset 3px 0 0 var(--ag); }
.bell-item small { display: block; color: var(--ink-2); font-weight: 400; }
.bell-empty { padding: 1.25rem .9rem; color: var(--ink-2); text-align: center; }
.bell-foot { display: block; padding: .6rem .9rem; text-align: center; font-weight: 500; text-decoration: none; }

.agency-bar { background: var(--surface); border-bottom: 1px solid var(--line); border-left: 6px solid var(--ag); }
.agency-bar-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; padding-top: .6rem; }
.agency-bar-name { font-family: var(--font-title); font-weight: 700; font-size: 1.125rem; color: var(--ag); }
.agency-switch { font-size: .875rem; text-decoration: none; }
.agency-switch i { margin-right: .35rem; }
.app-nav-list { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; gap: .25rem; }
.app-nav .nav-link { color: var(--ink); padding: .65rem .9rem; white-space: nowrap; border-bottom: 3px solid transparent; font-weight: 500; }
.app-nav .nav-link:hover { color: var(--ag); }
.app-nav .nav-link.active { color: var(--ag); font-weight: 600; border-bottom-color: var(--ag); }

.app-main { flex: 1 0 auto; padding-top: 1.25rem; padding-bottom: 2.5rem; }
.app-footer { background: var(--ink); color: var(--on-dark-2); padding: 1.25rem 0; font-size: .875rem; }
.app-footer-title { color: var(--on-dark); font-weight: 600; }
.app-footer-contact { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.app-footer-contact i { margin-right: .4rem; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; margin-bottom: 1rem; }
.page-head .ms-auto { display: flex; gap: .5rem; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.3; }
.page-sub { color: var(--ink-2); font-size: .9375rem; margin-top: .15rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.toolbar .form-select, .toolbar .form-control { width: auto; min-width: 9rem; }

/* ---------- Khung nội dung phẳng ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); }
.panel + .panel { margin-top: 1rem; }
.panel-head { padding: .7rem 1rem; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--font-base); font-size: 1rem; font-weight: 600; margin: 0; }
.panel-body { padding: 1rem; }
.empty-state { text-align: center; color: var(--ink-2); padding: 2.5rem 1rem; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: .25rem; }
.is-loading { opacity: .55; pointer-events: none; }
.skeleton { height: 14px; border-radius: 4px; background: var(--idle-soft); }

/* ---------- Nút, ô nhập ---------- */
.btn { border-radius: var(--r-ctl); font-weight: 500; min-height: 40px; }
.btn-sm { min-height: 34px; }
.btn-primary { --bs-btn-bg: var(--ag); --bs-btn-border-color: var(--ag); --bs-btn-color: var(--on-dark); --bs-btn-hover-bg: color-mix(in srgb, var(--ag), var(--ink) 25%); --bs-btn-hover-border-color: color-mix(in srgb, var(--ag), var(--ink) 25%); --bs-btn-hover-color: var(--on-dark); --bs-btn-active-bg: color-mix(in srgb, var(--ag), var(--ink) 35%); --bs-btn-active-border-color: color-mix(in srgb, var(--ag), var(--ink) 35%); --bs-btn-disabled-bg: var(--ag); --bs-btn-disabled-border-color: var(--ag); }
.btn-outline-primary { --bs-btn-color: var(--ag); --bs-btn-border-color: var(--ag); --bs-btn-hover-bg: var(--ag); --bs-btn-hover-border-color: var(--ag); --bs-btn-hover-color: var(--on-dark); --bs-btn-active-bg: var(--ag); --bs-btn-active-border-color: var(--ag); }
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--idle-soft); --bs-btn-hover-border-color: var(--line-strong); }
.btn-danger { --bs-btn-bg: var(--late); --bs-btn-border-color: var(--late); --bs-btn-hover-bg: color-mix(in srgb, var(--late), var(--ink) 25%); --bs-btn-hover-border-color: color-mix(in srgb, var(--late), var(--ink) 25%); }
.form-control, .form-select { border-radius: var(--r-ctl); border-color: var(--line-strong); min-height: 40px; }
.form-control:focus, .form-select:focus { border-color: var(--ag); box-shadow: 0 0 0 .2rem var(--idle-soft); }
.form-label { font-weight: 500; margin-bottom: .25rem; }
.form-text { color: var(--ink-2); }
.form-check-input:checked { background-color: var(--ag); border-color: var(--ag); }
.req::after { content: " *"; color: var(--late); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 9999; background: var(--focus); color: var(--ink); padding: .5rem 1rem; font-weight: 600; }
.skip-link:focus { left: 0; }
.modal-content { border-radius: var(--r-box); border-color: var(--line); }
.modal-title { font-size: 1.25rem; }
.dlg-intro:empty { display: none; }
.dlg-intro { color: var(--ink-2); font-size: .9375rem; }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink-2); padding: .35rem .6rem; min-height: 36px; }

/* ---------- Thẻ trạng thái ---------- */
.badge-st { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 4px; font-size: .8125rem; font-weight: 600; background: var(--idle-soft); color: var(--idle); white-space: nowrap; }
.badge-st.st-ok { background: var(--ok-soft); color: var(--ok); }
.badge-st.st-soon { background: var(--soon-soft); color: var(--soon); }
.badge-st.st-late { background: var(--late-soft); color: var(--late); }
.badge-st.st-prog { background: var(--prog-soft); color: var(--prog); }
.rate { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .9375rem; }
.rate::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--idle); flex: none; }
.rate.rt-1 { color: var(--rate-1); } .rate.rt-1::before { background: var(--rate-1); }
.rate.rt-2 { color: var(--rate-2); } .rate.rt-2::before { background: var(--rate-2); }
.rate.rt-3 { color: var(--rate-3); } .rate.rt-3::before { background: var(--rate-3); }
.rate.rt-4 { color: var(--rate-4); } .rate.rt-4::before { background: var(--rate-4); }

/* ---------- Thước hạn ---------- */
.deadline { min-width: 160px; }
.deadline-bar { position: relative; height: 6px; background: var(--idle-soft); border-radius: 3px; margin: 7px 0 4px; }
.deadline-fill { position: absolute; inset: 0 auto 0 0; background: var(--ok); border-radius: 3px; }
.deadline.is-soon .deadline-fill { background: var(--soon); }
.deadline.is-late .deadline-fill { background: var(--late); }
.deadline.is-idle .deadline-fill { background: var(--idle); }
.deadline-today { position: absolute; top: -4px; width: 2px; height: 14px; background: var(--ink); transform: translateX(-1px); }
.deadline-meta { display: flex; gap: .6rem; font-size: .8125rem; color: var(--ink-2); }
.deadline-text { margin-left: auto; color: var(--ink); font-weight: 600; }
.deadline.is-soon .deadline-text { color: var(--soon); }
.deadline.is-late .deadline-text { color: var(--late); }
.deadline.is-ok .deadline-text { color: var(--ok); }

/* ---------- Tab "Việc của tôi" ---------- */
.tabs-line { display: flex; gap: .25rem; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--line-strong); margin-bottom: 1rem; scrollbar-width: thin; }
.tabs-line button { border: 0; background: transparent; padding: .65rem 1rem; white-space: nowrap; font-weight: 500; color: var(--ink); border-bottom: 3px solid transparent; margin-bottom: -1px; min-height: 44px; }
.tabs-line button:hover { color: var(--ag); }
.tabs-line button.active { color: var(--ag); font-weight: 600; border-bottom-color: var(--ag); }
.tab-count { display: inline-block; min-width: 1.5rem; margin-left: .35rem; padding: 0 .4rem; border-radius: 10px; background: var(--idle-soft); color: var(--ink); font-size: .8125rem; font-weight: 600; }
.tabs-line button.active .tab-count { background: var(--ag); color: var(--on-dark); }
.tab-count.is-alert { background: var(--late); color: var(--on-dark); }

/* ---------- Danh sách công việc ---------- */
.task-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); }
.task-item { display: grid; grid-template-columns: minmax(0, 1fr) 210px 150px; gap: .5rem 1.25rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); align-items: center; color: var(--ink); text-decoration: none; }
.task-item:last-child { border-bottom: 0; }
.task-item:hover { background: var(--paper); color: var(--ink); }
.task-code { font-size: .8125rem; color: var(--ink-2); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.task-title { font-weight: 600; margin: .1rem 0; overflow-wrap: anywhere; }
.task-meta { font-size: .875rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: .1rem 1rem; }
.task-side { text-align: right; }
.task-side .progress-line { font-size: .875rem; color: var(--ink-2); margin-top: .25rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 0; flex-wrap: wrap; color: var(--ink-2); font-size: .9375rem; }
.summary-line { font-size: 1rem; margin-bottom: 1rem; }
.summary-line strong { font-weight: 700; }
.summary-line .is-late { color: var(--late); }

/* ---------- Cây danh mục ---------- */
.tree-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.tree { list-style: none; margin: 0; padding: .5rem; }
.tree ul { list-style: none; padding-left: 1rem; margin: 0; }
.tree button { display: flex; width: 100%; justify-content: space-between; gap: .5rem; border: 0; background: transparent; text-align: left; padding: .45rem .6rem; border-radius: var(--r-ctl); min-height: 40px; color: var(--ink); }
.tree button:hover { background: var(--paper); }
.tree button.active { background: var(--ag); color: var(--on-dark); font-weight: 600; }
.tree .tree-group { font-weight: 600; }
.tree .tree-n { font-size: .8125rem; opacity: .75; }

/* ---------- Trang chi tiết ---------- */
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.task-hero { margin-bottom: 1rem; }
.task-hero .task-code { margin-bottom: .25rem; }
.task-hero h1 { font-size: 1.5rem; margin: 0 0 .5rem; overflow-wrap: anywhere; }
.action-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.info-grid { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .5rem 1rem; margin: 0; }
.info-grid dt { color: var(--ink-2); font-weight: 500; }
.info-grid dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.files { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.file-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface); font-size: .875rem; text-decoration: none; color: var(--ink); max-width: 100%; }
.file-chip:hover { border-color: var(--ag); color: var(--ag); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip small { color: var(--ink-2); }

.chain { list-style: none; margin: 0; padding: 0 0 0 1.25rem; position: relative; }
.chain::before { content: ""; position: absolute; left: .4rem; top: .5rem; bottom: .5rem; width: 2px; background: var(--line-strong); }
.chain-node { position: relative; padding: .5rem 0 .85rem .75rem; }
.chain-node::before { content: ""; position: absolute; left: -1.1rem; top: .95rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.chain-node.is-current::before { border-color: var(--ag); background: var(--ag); }
.chain-node.is-replaced { color: var(--ink-2); }
.chain-node.is-replaced .chain-who { text-decoration: line-through; }
.chain-who { font-weight: 600; }
.chain-title { color: var(--ink-2); font-weight: 400; margin-left: .35rem; font-size: .875rem; }
.chain-state { font-size: .875rem; color: var(--ink-2); }
.chain-flag { font-weight: 700; color: var(--ag); margin-right: .35rem; }
.chain-watch { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .75rem; font-size: .9375rem; }

.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-head { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; }
.tl-head .tl-when { margin-left: auto; font-size: .8125rem; color: var(--ink-2); }
.tl-body { margin-top: .25rem; white-space: pre-line; overflow-wrap: anywhere; }
.tl-note { color: var(--ink-2); font-size: .875rem; }
.fb-item { border: 1px solid var(--line); border-left: 4px solid var(--soon); border-radius: var(--r-ctl); padding: .75rem 1rem; margin-bottom: .75rem; }
.fb-item.is-answered { border-left-color: var(--ok); }
.fb-answer { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--line-strong); }

/* ---------- Chọn cơ quan ---------- */
.agency-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.agency-tile { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--ag); border-radius: var(--r-box); padding: 1.25rem 1.5rem; color: var(--ink); text-decoration: none; text-align: left; width: 100%; }
.agency-tile:hover, .agency-tile:focus-visible { border-color: var(--ag); color: var(--ink); }
.agency-tile.ag-DANG_UY { --ag: var(--ag-dang-uy); }
.agency-tile.ag-HDND { --ag: var(--ag-hdnd); }
.agency-tile.ag-UBND { --ag: var(--ag-ubnd); }
.agency-tile.ag-MTTQ { --ag: var(--ag-mttq); }
.agency-name { font-family: var(--font-title); font-size: 1.375rem; font-weight: 700; margin: 0 0 .25rem; color: var(--ag); }
.agency-desc { color: var(--ink-2); margin: 0 0 .85rem; }
.agency-count { margin: 0; font-size: .9375rem; }
.agency-count .is-late { color: var(--late); font-weight: 600; }

/* ---------- Bảng dữ liệu ---------- */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .9375rem; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: .55rem .75rem; vertical-align: top; }
.data-table thead th { background: var(--paper); font-weight: 600; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line-strong); }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table tbody tr:hover td { background: var(--paper); }
.data-table .muted, .muted { color: var(--ink-2); }
.row-off td { color: var(--ink-2); }

/* ---------- Báo cáo ---------- */
.report-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; padding: 1rem; }
.fig-main { font-family: var(--font-title); font-size: 2.75rem; font-weight: 700; line-height: 1; }
.kv-table { width: 100%; border-collapse: collapse; }
.kv-table td { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.kv-table td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.kv-table tr:last-child td { border-bottom: 0; }
.chart-box { position: relative; height: 300px; }
.stack-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--idle-soft); min-width: 140px; }
.stack-bar span { display: block; height: 100%; }
.stack-bar .rt-1 { background: var(--rate-1); } .stack-bar .rt-2 { background: var(--rate-2); }
.stack-bar .rt-3 { background: var(--rate-3); } .stack-bar .rt-4 { background: var(--rate-4); }
.legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .875rem; color: var(--ink-2); }
.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.legend .rt-1 i { background: var(--rate-1); } .legend .rt-2 i { background: var(--rate-2); }
.legend .rt-3 i { background: var(--rate-3); } .legend .rt-4 i { background: var(--rate-4); }

/* ---------- Biểu mẫu công việc ---------- */
.form-narrow { max-width: 820px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: .5rem 1.1rem; cursor: pointer; background: var(--surface); min-height: 40px; display: inline-flex; align-items: center; }
.seg label + input + label, .seg input + label + input + label { border-left: 1px solid var(--line-strong); }
.seg input:checked + label { background: var(--ag); color: var(--on-dark); font-weight: 600; }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }
.file-list { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .35rem; }
.file-list li { display: flex; align-items: center; gap: .5rem; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: var(--r-ctl); font-size: .9375rem; }
.file-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li.is-error { border-color: var(--late); color: var(--late); }
.watch-pick { max-height: 220px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); padding: .25rem .75rem; }
.watch-pick .form-check { margin: .35rem 0; }
.watch-pick .grp { font-size: .8125rem; color: var(--ink-2); margin-top: .5rem; }
.rating-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.rating-pick label { border: 1px solid var(--line-strong); border-radius: var(--r-ctl); padding: .6rem .75rem; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: .5rem; }
.rating-pick input:checked + span { font-weight: 700; }
.rating-pick label:has(input:checked) { border-color: var(--ag); box-shadow: inset 0 0 0 1px var(--ag); }

/* ---------- Cài đặt ---------- */
.settings-group { margin-bottom: 1rem; }
.setting-row { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: .5rem 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); align-items: start; }
.setting-row:last-child { border-bottom: 0; }
.setting-label { font-size: .9rem; color: var(--ink-2); padding-top: .4rem; }
.setting-image { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.setting-image img { max-height: 64px; max-width: 160px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 4px; }
.save-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: .75rem 1rem; display: flex; justify-content: flex-end; gap: .5rem; }

/* ---------- Đăng nhập ---------- */
.login-page { background: var(--ink); align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--r-box); padding: 2rem 1.75rem; }
.login-head { text-align: center; margin-bottom: 1.5rem; }
.login-head .app-logo { height: 68px; width: 68px; margin-bottom: .75rem; border: 1px solid var(--line); }
.login-org { font-family: var(--font-title); font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.login-app { color: var(--ink-2); font-size: .9375rem; }

/* ---------- Biểu tượng quản trị (nhãn nhỏ cạnh số) ---------- */
.chip { display: inline-block; padding: .05rem .5rem; border-radius: 4px; background: var(--idle-soft); color: var(--ink); font-size: .8125rem; font-weight: 500; }
.chip.is-admin { background: var(--ag); color: var(--on-dark); }

/* ---------- Đáp ứng ---------- */
@media (max-width: 991.98px) {
    .tree-layout { grid-template-columns: 1fr; }
    .task-layout { grid-template-columns: 1fr; }
    .task-layout .col-side { order: -1; }
    .task-item { grid-template-columns: minmax(0, 1fr); }
    .task-side { text-align: left; }
}
@media (max-width: 767.98px) {
    .app-brand-text .app-brand-org { display: none; }
    .setting-row { grid-template-columns: 1fr; }
    .agency-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; gap: 0 1rem; }
    .info-grid dd { margin-bottom: .6rem; }
    .page-title { font-size: 1.3rem; }
    .action-bar .btn { flex: 1 1 100%; }
    .toolbar .form-select, .toolbar .form-control { width: 100%; }
    .rating-pick { grid-template-columns: 1fr; }
}

@media print {
    .app-header, .agency-bar, .app-footer, .toolbar, .no-print, .toast-container, .action-bar { display: none !important; }
    body { background: var(--surface); font-size: 12px; }
    .panel { border-color: var(--line-strong); }
    .chart-box { height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Cải tiến trải nghiệm ---------- */
/* Edge tự vẽ biểu tượng hiện/ẩn mật khẩu và nút xóa: ẩn để không trùng với nút của hệ thống. */
input::-ms-reveal, input::-ms-clear { display: none; }
.agency-bar-head { align-items: center; }
.quick-search { margin-left: auto; }
.quick-search input { width: 17rem; max-width: 100%; min-height: 36px; }
.task-next { font-size: .875rem; font-weight: 600; color: var(--ag); margin-top: .15rem; }
.back-link { display: inline-block; margin-bottom: .5rem; font-size: .9375rem; text-decoration: none; }
.toolbar input[type="search"] { min-width: 15rem; }
@media (max-width: 767.98px) { .quick-search { margin-left: 0; width: 100%; } .quick-search input { width: 100%; } }
