/* Design tokens (docs/UI_UX_AUDIT.md → Hướng thiết kế). Area stylesheets (ui-*.css) use these, never raw hex.
   Teal is darker than before so white text on it passes WCAG AA; violet marks numbers proposed by AI. */
:root {
  color-scheme: light;
  --navy: #142033;
  --navy2: #1b2a40;
  --ink: #17212b;
  --muted: #5a6770;
  --line: #dde3e1;
  --bg: #f4f6f5;
  --pale: #f3f6f5;
  --card: #fff;
  --teal: #0e7a6e;
  --teal-dark: #0a6157;
  --teal2: #e3f2ef;
  --red: #b42318;
  --redbg: #fdecea;
  --amber: #9a5a06;
  --amberbg: #fff3df;
  --green: #157347;
  --greenbg: #e6f4ec;
  --blue: #175cd3;
  --ai: #5b4bc4;
  --aibg: #efedfb;
  --shadow: 0 1px 2px #17212b0f, 0 4px 12px #17212b0a;
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 24px;
}
[hidden] { display:none !important; }
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--fs)/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
:where(button, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
/* Icons: a CSS mask over /icons/<name>.svg painted in the text colour, so a button's text stays its name. */
.icon { display:inline-block; width:16px; height:16px; flex:none; vertical-align:-3px; background-color:currentColor; -webkit-mask:var(--i) center/contain no-repeat; mask:var(--i) center/contain no-repeat; }
.i-table{--i:url(/icons/table.svg)} .i-inbox{--i:url(/icons/inbox.svg)} .i-book{--i:url(/icons/book.svg)} .i-settings{--i:url(/icons/settings.svg)}
.i-message{--i:url(/icons/message.svg)} .i-user{--i:url(/icons/user.svg)} .i-logout{--i:url(/icons/logout.svg)} .i-menu{--i:url(/icons/menu.svg)}
.i-more{--i:url(/icons/more.svg)} .i-check{--i:url(/icons/check.svg)} .i-x{--i:url(/icons/x.svg)} .i-chevron-left{--i:url(/icons/chevron-left.svg)}
.i-chevron-right{--i:url(/icons/chevron-right.svg)} .i-chevron-down{--i:url(/icons/chevron-down.svg)} .i-arrow-left{--i:url(/icons/arrow-left.svg)}
.i-download{--i:url(/icons/download.svg)} .i-sparkles{--i:url(/icons/sparkles.svg)} .i-search{--i:url(/icons/search.svg)} .i-alert{--i:url(/icons/alert.svg)}
.i-plus{--i:url(/icons/plus.svg)} .i-trash{--i:url(/icons/trash.svg)} .i-refresh{--i:url(/icons/refresh.svg)} .i-lock{--i:url(/icons/lock.svg)}
.i-external{--i:url(/icons/external.svg)} .i-file{--i:url(/icons/file.svg)} .i-activity{--i:url(/icons/activity.svg)} .i-key{--i:url(/icons/key.svg)} .i-building{--i:url(/icons/building.svg)}
/* help(): a "?" that opens a short explanation instead of a paragraph that stays on the page. */
details.help { display:inline-block; position:relative; vertical-align:middle; margin-left:4px; font-weight:400; }
details.help > summary { list-style:none; display:inline-grid; place-items:center; width:18px; height:18px; border:1px solid var(--line); border-radius:50%; color:var(--muted); background:var(--card); font-size:11px; font-weight:700; cursor:pointer; }
details.help > summary::-webkit-details-marker { display:none; }
details.help[open] > summary { color:var(--card); background:var(--ink); border-color:var(--ink); }
details.help:not([open]) > p { display:none; }
@media (max-width:720px) { details.help > p { position:fixed !important; inset:auto 16px 16px 16px !important; width:auto !important; } }
details.help > p { position:absolute; z-index:20; top:24px; left:-8px; width:min(320px, 80vw); margin:0; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius); background:var(--card); color:var(--ink); box-shadow:var(--shadow); font-size:var(--fs-sm); line-height:1.5; text-transform:none; letter-spacing:normal; white-space:normal; }
/* tabs(): one row of filter/section tabs, each with an optional count. */
.tabs { display:flex; gap:2px; overflow-x:auto; border-bottom:1px solid var(--line); margin:0 0 14px; }
.tabs > button { flex:none; padding:8px 12px; border:0; border-bottom:2px solid transparent; background:none; color:var(--muted); font:inherit; font-weight:500; white-space:nowrap; cursor:pointer; }
.tabs > button:hover { color:var(--ink); }
.tabs > button[aria-selected="true"] { color:var(--ink); border-bottom-color:var(--teal); font-weight:600; }
.tabs .tab-count { margin-left:6px; padding:0 6px; border-radius:99px; background:var(--pale); color:var(--ink); font-size:var(--fs-xs); font-weight:600; }
.tabs > button[aria-selected="true"] .tab-count { background:var(--teal2); color:var(--teal-dark); }
/* Values proposed by AI and not yet saved by a person. */
.ai-value { color:var(--ai); }
.badge.ai, .pill.ai { background:var(--aibg); color:var(--ai); }
.notice { position:relative; }
.notice .notice-close { position:absolute; top:6px; right:6px; border:0; background:none; color:inherit; font-size:18px; line-height:1; cursor:pointer; padding:2px 6px; }
.btn.danger { color:var(--red); border-color:#f3c2bd; }
.btn.danger:hover { background:var(--redbg); }
.btn[aria-busy="true"] { cursor:progress; opacity:.7; }
.modal:focus { outline:none; }
/* Text for screen readers and button lookups only; icon-only buttons keep a readable name this way. */
.sr-only { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.icon-btn { display:inline-grid; place-items:center; min-width:30px; height:30px; padding:0 6px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--card); color:var(--ink); cursor:pointer; }
.icon-btn:hover { background:var(--pale); }
.icon-btn[aria-pressed="true"] { background:var(--greenbg); border-color:var(--green); color:var(--green); }
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.app {
  min-height: 100vh;
}
.loading {
  text-align: center;
  padding: 20vh;
  color: var(--muted);
}
.shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  overflow-y: auto;
  width: 252px;
  flex: 0 0 252px;
  background: var(--navy);
  color: #dce5f5;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 28px;
  color: white;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--teal);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.brand small {
  display: block;
  color: #8ea0bd;
  font-size: 11px;
}
.nav {
  display: grid;
  gap: 5px;
}
.nav button {
  background: transparent;
  border: 0;
  color: #aebbd0;
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.nav button:hover,
.nav button.active {
  background: var(--navy2);
  color: #fff;
}
.nav button .icon { opacity: .85; }
.company-switch { padding: 0 4px 18px; }
.company-switch label { display: block; margin: 0 0 4px 8px; color: #8ea0bd; font-size: var(--fs-xs); }
.company-switch select { width: 100%; padding: 8px 10px; border: 1px solid #ffffff26; border-radius: var(--radius-sm); background: var(--navy2); color: #fff; font: inherit; }
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #ffffff1a;
  padding-top: 10px;
  display: grid;
  gap: 2px;
}
.sidebar-bottom > button, .sidebar-user-actions > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: #aebbd0; font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
.sidebar-bottom > button:hover, .sidebar-bottom > button.active, .sidebar-user-actions > button:hover { background: var(--navy2); color: #fff; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--amber); color: #fff; font-size: var(--fs-xs); font-weight: 700; text-align: center; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 12px 12px 4px; border-top: 1px solid #ffffff1a; min-width: 0; }
.sidebar-user .user-name { color: #fff; font-size: var(--fs-sm); }
.sidebar-user .user-email { color: #8ea0bd; font-size: var(--fs-xs); overflow-wrap: anywhere; }
.sidebar-user-actions { display: flex; gap: 2px; }
.main {
  flex: 1;
  min-width: 0;
}
/* Phones only: menu button, product name and the current company. */
.topbar { display: none; }
.topbar-company { color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.content {
  max-width: 1450px;
  margin: auto;
  padding: 28px 32px 60px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.toolbar h2 {
  font-size: 24px;
  margin: 0;
}
.toolbar p {
  margin: 3px 0 0;
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.btn {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}
.btn:hover {
  border-color: #aab5c8;
}
.btn.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.btn.primary.btn-ai, .review-ai-banner .btn.primary {
  background: var(--ai);
  border-color: var(--ai);
}
.btn.danger {
  color: var(--red);
  border-color: #f2c3bf;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.grid {
  display: grid;
  gap: 17px;
}
.tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 19px;
}
.tile-label {
  color: var(--muted);
  font-size: 13px;
}
.tile-value {
  font-size: 28px;
  font-weight: 750;
  margin: 9px 0 0;
}

.two {
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
}
.table-wrap {
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.draft,
.badge.pending {
  background: #f2f4f7;
  color: #475467;
}
.badge.ready_for_review {
  background: #eff8ff;
  color: #175cd3;
}
.badge.approved,
.badge.eligible {
  background: var(--greenbg);
  color: var(--green);
}
.badge.rejected,
.badge.ineligible {
  background: var(--redbg);
  color: var(--red);
}
.badge.needs_input,
.badge.warning {
  background: var(--amberbg);
  color: var(--amber);
}
.badge.not_applicable {
  background: #f2f4f7;
  color: #667085;
}
.muted {
  color: var(--muted);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 35px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field {
  display: grid;
  gap: 5px;
}
.field.full {
  grid-column: 1/-1;
}
.field label {
  font-weight: 650;
  font-size: 13px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d8dee9;
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}
.field textarea {
  min-height: 78px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid #99f6e4;
  border-color: var(--teal);
}
.notice {
  border-radius: 8px;
  padding: 11px 13px;
  margin: 0 0 15px;
}
.notice.error {
  background: var(--redbg);
  color: var(--red);
  border: 1px solid #f4c7c3;
}
.notice.info {
  background: #eff8ff;
  color: #175cd3;
}
.notice.success {
  background: var(--greenbg);
  color: var(--green);
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow: auto;
}
.tab {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  font-weight: 700;
}
.detail {
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.35fr);
}
.source-list {
  display: grid;
  gap: 8px;
}
.source {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.source.selected {
  border-color: var(--teal);
  background: #f0fdfa;
}
.source-name {
  font-weight: 650;
  word-break: break-word;
}
.source-meta {
  font-size: 12px;
  color: var(--muted);
}
.source-cards {
  display: grid;
  gap: 14px;
}
.operations-toolbar { align-items:flex-end; }
.operations-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:10px; }
.operation-metric { display:grid; gap:4px; padding:14px 16px; }
.operation-metric strong { font-size:23px; }
.operations-metering-note { margin:4px 0 18px; font-size:12px; }
.operations-section { margin:0 0 16px; }
.operations-section > h3, .operations-limits h3 { margin:0 0 8px; font-size:15px; }
.operations-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:9px; background:#fff; box-shadow:var(--shadow); }
.operations-table td { max-width:340px; }
.operation-subline { display:block; margin-top:3px; }
.operation-trace summary { cursor:pointer; color:var(--blue); font-size:12px; font-weight:650; }
.operation-trace small { display:block; margin-top:4px; overflow-wrap:anywhere; }
.operations-config-grid { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(240px,.5fr); gap:16px; }
.operations-limits { align-self:start; }
.operations-limits dl { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px 14px; margin:0; }
.operations-limits dt { color:var(--muted); }
.operations-limits dd { margin:0; font-weight:700; }
.operations-pager { margin-top:4px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.source-config-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.source-config h3 {
  margin: 0 0 3px;
}
.source-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
}
.cohort-banner { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:10px 18px; align-items:center; margin:0 0 14px; border-color:#99d9d1; background:#f0fdfa; }
.cohort-banner-compact { margin-top:0; }
.cohort-banner-copy { min-width:0; }
.cohort-banner-title { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.cohort-banner-title strong { font-size:15px; }
.cohort-banner-actions { margin:0; justify-content:flex-end; }
.cohort-banner-history { position:relative; justify-self:end; }
.cohort-banner-history summary { list-style:none; cursor:pointer; }
.cohort-banner-history summary::-webkit-details-marker { display:none; }
.cohort-banner-history-content { position:absolute; z-index:12; right:0; top:100%; width:min(390px,90vw); padding:12px; border:1px solid var(--line); border-radius:7px; background:#fff; box-shadow:var(--shadow); color:var(--ink); font-size:12px; white-space:normal; }
.cohort-banner-history-content div + div { margin-top:6px; }
.cohort-progress { grid-column:1 / -1; width:100%; height:7px; accent-color:var(--teal); }
.source-isolated-option small { display:block; margin-top:3px; }
.source-timing {
  font-size: 12px;
}
.source-status.running,
.source-status.scanning,
.source-status.inventory,
.source-status.processing,
.source-status.pending { background: var(--amberbg); color: var(--amber); }
.source-status.complete,
.source-status.completed,
.source-status.done,
.source-status.success { background: var(--greenbg); color: var(--green); }
.source-status.healthy { background: var(--greenbg); color: var(--green); }
.source-status.paused { background: #f2f4f7; color: #475467; }
.source-status.blocked,
.source-status.error { background: var(--redbg); color: var(--red); }
.source-status.partial { background: #eff8ff; color: var(--blue); }
.source-issue { margin: 8px 0 0; }
.source-issue-line { display: flex; flex-wrap: wrap; gap: 5px 9px; align-items: baseline; }
.source-issue-line strong { flex: 0 0 auto; }
.source-issue-path { color: var(--muted); overflow-wrap: anywhere; }
.source-issue-line a { color: var(--blue); font-weight: 650; }
.source-skip-summary { margin-top: 10px; }
.source-issue-more { margin-top: 8px; }
.source-issue-more summary { cursor: pointer; color: var(--blue); font-weight: 650; }
.source-issue-more .source-issue { margin-left: 0; }
.source-access-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin-top:10px; }
.source-access { background:#f2f4f7; color:#475467; }
.source-access.connected { background:var(--greenbg); color:var(--green); }
.source-access.checking { background:var(--amberbg); color:var(--amber); }
.source-access.blocked { background:var(--redbg); color:var(--red); }
.next-steps { margin-bottom:16px; background:#f8fafc; }
.next-steps ol { margin:8px 0 0; padding-left:22px; color:var(--muted); }
.next-steps li { margin:3px 0; }
.locked-documents { margin-top:16px; }
.locked-document-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 0; border-top:1px solid var(--line); }
.locked-document-row:first-of-type { margin-top:8px; }
.source-inline-action { display:flex; justify-content:flex-end; margin:-3px 0 8px; }
.btn-small { padding:6px 9px; font-size:12px; }
.source-doc-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:4px; }

.unlock-note { padding:9px 11px; border-radius:6px; background:#f0fdfa; color:#147d6e; font-size:13px; }
@media (max-width: 640px) {
  .operations-metrics, .operations-config-grid { grid-template-columns:1fr; }
  .locked-document-row { align-items:flex-start; flex-direction:column; }
  .cohort-banner { grid-template-columns:1fr; align-items:start; }
  .cohort-banner-actions { justify-content:flex-start; }
}
.automatic-proposal { margin-bottom: 16px; }
.automatic-proposal h3 { margin: 0; }
.proposal-facts { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 12px; }
.proposal-facts div { display: grid; gap: 2px; min-width: 120px; }
.preview {
  margin-top: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 180px;
  padding: 12px;
  white-space: pre-wrap;
  overflow: auto;
  max-height: 420px;
}
.preview img {
  max-width: 100%;
  max-height: 390px;
  display: block;
  margin: auto;
}
.decision-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0;
}
.decision {
  border: 1px solid var(--line);
  padding: 13px;
  border-radius: 8px;
}
.decision h4 {
  margin: 0 0 8px;
}
.check {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.check strong {
  font-size: 13px;
}
.journal {
  min-width: 680px;
}
.journal input {
  border: 1px solid #d8dee9;
  border-radius: 5px;
  padding: 6px;
  width: 100%;
}
.account-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.account-row > * {
  flex: 1;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #10182880;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 5;
}
.modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 20px 70px #10182840;
}
.modal h3 {
  margin: 0 0 16px;
}

.avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal2);
  color: #0f766e;
  font-weight: 750;
}
.user-name {
  font-weight: 650;
}
.user-email {
  font-size: 12px;
  color: var(--muted);
}
.remember-device { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:13px; }
.remember-device input { accent-color:var(--teal); }

.review-draft { white-space:nowrap; color:var(--muted); }
.review-followup { max-width:260px; }
.review-followup-title { color:var(--amber); font-weight:650; font-size:12px; margin-bottom:5px; }
.review-followup-title.ok { color:var(--green); }
.doc-present, .doc-missing { display:inline-flex; border-radius:999px; padding:3px 7px; white-space:nowrap; font-size:12px; }
.doc-present { color:var(--green); background:var(--greenbg); }
.doc-missing { color:var(--red); background:var(--redbg); }
.review-proposal-cell { overflow-wrap:anywhere; }

.review-proposal-summary, .review-uncertainty { margin-top:4px; font-size:12px; line-height:1.35; }
.review-reference { margin-top:5px; color:var(--blue); font-size:12px; }
.review-uncertainty { color:var(--amber); }
.review-policy-note { margin-top:5px; color:var(--blue); font-size:12px; }
.review-missing-item + .review-missing-item { margin-top:4px; }
.review-decisions { margin-top:8px; padding-top:7px; border-top:1px solid var(--line); color:var(--muted); font-size:11px; line-height:1.4; }
.review-tax-caption { display:block; margin-top:5px; line-height:1.35; }
.review-row-details { margin-top:6px; font-size:12px; color:var(--muted); }
.review-row-details summary { cursor:pointer; color:var(--blue); }
.review-row-details div { margin-top:5px; line-height:1.4; white-space:pre-wrap; }

.review-treatment-reason { margin:6px 0; font-size:12px; color:var(--amber); }
.review-approval-note { display:block; margin:5px 0 8px; line-height:1.35; }
.review-inline-error { margin:7px 0; padding:7px 8px; border-radius:6px; color:var(--red); background:var(--redbg); font-size:12px; line-height:1.35; }
.review-note-input, .review-reason-input { width:100%; min-height:58px; resize:vertical; margin:8px 0 6px; padding:7px 8px; border:1px solid var(--line); border-radius:6px; font:inherit; color:var(--ink); background:#fff; }
.review-reason-input { min-height:48px; font-size:12px; }

.journal-field { display:grid; gap:3px; min-width:0; color:var(--muted); font-size:10px; font-weight:650; }
.journal-field input { width:100%; min-width:0; padding:6px 7px; border:1px solid var(--line); border-radius:5px; background:#fff; color:var(--ink); font:inherit; font-size:12px; }
.journal-field input::placeholder { color:#98a2b3; }
.journal-description-field { grid-column:1 / -1; }
.journal-remove { grid-column:1 / -1; justify-self:start; width:auto !important; margin:0 !important; color:var(--red); }
.review-context-note { padding:8px 12px; background:#f5f7fb; border-radius:7px; font-size:12px; }
.review-scope-select { min-height:38px; padding:7px 9px; border:1px solid var(--line); border-radius:7px; background:#fff; color:var(--ink); font:inherit; }

.review-teachings { margin:8px 0 12px; padding:12px 14px; }
.review-teachings > summary { cursor:pointer; font-weight:650; }
.review-teachings > p { margin:8px 0; font-size:12px; }

.btn-compact { padding:5px 8px; font-size:12px; }
.btn-link { border:0; background:transparent; color:var(--blue); padding:4px 2px; font-size:12px; }
.review-pager { display:flex; justify-content:space-between; align-items:center; padding:12px; border-top:1px solid var(--line); }
.review-run { margin:8px 0; border-radius:8px; padding:9px 11px; font-size:13px; }
.review-run.running { color:var(--blue); background:#eff8ff; }
.review-run.done { color:var(--green); background:var(--greenbg); }
.review-run.error { color:var(--red); background:var(--redbg); }
/* A running AI batch: spinner, bar of transactions done, time run and time left (owner 29/11/2026). */
.review-run-progress { display:flex; align-items:flex-start; gap:10px; }
.review-run-body { display:grid; gap:4px; flex:1 1 auto; min-width:0; }
.review-run-body progress { width:100%; height:6px; accent-color:var(--blue); }
.review-run-time { font-size:12px; opacity:.85; }
.review-run-spinner { flex:none; width:14px; height:14px; margin-top:2px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:review-run-spin .9s linear infinite; }
@keyframes review-run-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .review-run-spinner { animation:none; border-right-color:currentColor; opacity:.6; } }
.mobile-toggle {
  display: none;
}

@media (max-width: 1000px) {
  .tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  .detail {
    grid-template-columns: 1fr;
  }
  .two {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .sidebar {
    position: fixed;
    z-index: 4;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: none;
  }
  .mobile-toggle {
    display: inline-grid;
  }
  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 16px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .content {
    padding: 20px 16px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .decision-grid {
    grid-template-columns: 1fr;
  }
  .tiles {
    gap: 10px;
  }
  .card {
    padding: 14px;
  }
  .review-pager { align-items:flex-start; gap:8px; flex-direction:column; }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .toolbar .actions {
    width: 100%;
  }
}
.evidence-choice {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  word-break: break-word;
  margin: 8px 0;
}
.decision select,
.decision textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}
.decision textarea {
  min-height: 100px;
  margin-top: 9px;
}
.decision-grid {
  grid-template-columns: 1fr;
}
.source-meta {
  overflow-wrap: anywhere;
}
.preview iframe {
  width: 100%;
  min-height: 380px;
  border: 0;
}
.toolbar {
  flex-wrap: wrap;
}
.toolbar .actions {
  max-width: 680px;
}
.reference-modal {
  width: min(900px, 100%);
}
.account-modal { width: min(460px, 100%); }
.account-password-form { display: grid; gap: 12px; }
.account-modal h4 { margin: 0; font-size: var(--fs); }
.account-section { display: grid; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.modal-footer { justify-content: flex-end; margin-top: 18px; }
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 56px; }
.password-field .password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: var(--fs-sm); }
.auth-help { margin: 0; font-size: var(--fs-sm); }
.auth-google { display: grid; gap: 12px; margin-bottom: 4px; }
.google-login { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 44px; background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.google-login:hover { background: var(--pale); }
.google-login img { flex: none; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: var(--fs-sm); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth {
  max-width: 480px;
  margin: 9vh auto;
  padding: 20px;
}
.auth-form {
  display: grid;
  gap: 16px;
}
.auth-brand {
  color: var(--ink);
  padding-bottom: 14px;
}

/* Dense ledger review */
.boot-shell { width:min(420px,calc(100% - 32px)); margin:12vh auto; display:grid; gap:18px; padding:22px; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); }
.boot-shell .brand { padding:0; color:var(--ink); }
.ledger-status { display:inline-flex; border-radius:999px; padding:3px 7px; font-size:11px; font-weight:700; color:var(--green); background:var(--greenbg); }
.ledger-status.needs_confirmation { color:var(--amber); background:var(--amberbg); }
.ledger-status.rejected, .ledger-status.missing { color:var(--red); background:var(--redbg); }

.review-edit-details, .review-note-details { margin-top:6px; }
.review-edit-details > summary, .review-note-details > summary { cursor:pointer; color:var(--blue); font-size:11px; }

.review-edit-details .journal-description-field, .review-edit-details .journal-remove { grid-column:1; }
.review-edit-details .review-reason-input { min-height:34px; margin:6px 0; }
.review-followup-item { padding:5px 0; border-bottom:1px solid var(--line); }
.review-followup-item:last-child { border-bottom:0; }
.review-followup-item.decision-up .followup-copy { color:var(--green); }
.review-followup-item.decision-down .followup-copy { color:var(--muted); text-decoration:line-through; }
.followup-copy { line-height:1.35; }
.followup-controls { display:flex; align-items:center; gap:3px; margin-top:3px; }
.followup-vote { border:1px solid var(--line); border-radius:5px; padding:2px 6px; background:#fff; cursor:pointer; filter:grayscale(.35); opacity:.9; font-size:14px; line-height:1.25; }
.followup-vote:hover, .followup-vote.active { border-color:var(--line); background:#f2f4f7; filter:none; opacity:1; }
.followup-vote:disabled { cursor:not-allowed; filter:grayscale(1); opacity:.35; }
.followup-undo { margin-left:3px; }
.followup-reason-row { display:flex; gap:5px; margin-top:4px; }
.followup-reason { flex:1; min-width:0; border:1px solid var(--line); border-radius:5px; padding:5px 6px; font:inherit; font-size:11px; }
.review-note-input { min-height:44px; margin:5px 0; }
.review-source-panel { position:fixed; z-index:7; inset:0 0 0 auto; width:min(620px,92vw); display:grid; grid-template-rows:auto 1fr; background:#fff; border-left:1px solid var(--line); box-shadow:-14px 0 40px #10182825; }
.review-source-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-bottom:1px solid var(--line); }
.review-source-panel-head strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.review-source-preview-body { overflow:auto; padding:12px; }
.review-source-preview-body img { display:block; max-width:100%; margin:auto; }
.review-source-preview-body iframe { width:100%; height:100%; min-height:calc(100vh - 76px); border:0; }
.review-source-preview-body pre { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font:12px/1.45 ui-monospace,Consolas,monospace; }
.sheet-preview { padding:10px; min-width:0; }
.sheet-preview-notice { margin:0 0 10px; font-size:12px; }
.sheet-preview-controls { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:10px; }
.sheet-preview-controls select { max-width:100%; }
.sheet-preview-scroll { overflow:auto; max-height:65vh; border:1px solid var(--line); }
.sheet-preview-grid { border-collapse:collapse; width:max-content; min-width:100%; font:12px/1.45 ui-monospace,Consolas,monospace; }
.sheet-preview-grid th, .sheet-preview-grid td { border:1px solid var(--line); padding:6px; min-width:80px; max-width:280px; white-space:pre-wrap; overflow-wrap:anywhere; vertical-align:top; }
.sheet-preview-grid thead th { position:sticky; top:0; background:var(--pale,#f3f6fa); z-index:1; }
.sheet-preview-grid th:first-child { min-width:45px; background:#f3f6fa; }
.document-rules { margin:0 0 12px; }
.document-rule-list { display:grid; gap:4px; margin:8px 0; }
.document-rule-line { display:flex; gap:7px; font-size:12px; }
.document-rule-proposal { display:grid; gap:5px; margin-top:10px; padding:9px 10px; border:1px solid var(--line); border-radius:7px; background:#f8fafc; font-size:12px; }
.document-rule-proposal .btn { justify-self:start; margin-top:3px; }
.document-rule-change { color:var(--amber); }
.document-rule-editor { margin-top:10px; }
.document-rule-editor > summary { cursor:pointer; color:var(--blue); font-size:12px; font-weight:650; }
.document-rule-form { display:grid; gap:7px; margin-top:8px; }
.document-rule-check { display:flex; gap:7px; align-items:flex-start; font-size:12px; }
.document-rule-check input { margin-top:2px; accent-color:var(--teal); }
.document-rule-form textarea { min-height:58px; resize:vertical; border:1px solid var(--line); border-radius:6px; padding:7px 8px; font:inherit; }
.document-rule-form .btn { justify-self:start; }
.xml-readable-preview { display:grid; gap:12px; }
.xml-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 14px; }
.xml-facts div { display:grid; gap:2px; min-width:0; }
.xml-facts span { color:var(--muted); font-size:11px; }
.xml-facts strong { overflow-wrap:anywhere; }
.xml-lines-wrap { overflow:auto; border:1px solid var(--line); border-radius:7px; }
.xml-lines { width:100%; min-width:560px; border-collapse:collapse; font-size:12px; }
.xml-lines th, .xml-lines td { padding:6px 7px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.xml-lines th { color:var(--muted); background:#f8fafc; }
.xml-raw > summary { cursor:pointer; color:var(--blue); font-size:12px; font-weight:650; }
.xml-raw pre { max-height:45vh; overflow:auto; margin-top:7px; padding:9px; border:1px solid var(--line); border-radius:7px; background:#f8fafc; }
.pdf-preview-meta { margin-bottom:8px; color:var(--muted); font-size:12px; font-weight:650; }
.pdf-preview-page { margin:0 0 12px; border:1px solid var(--line); border-radius:7px; overflow:hidden; background:#f2f4f7; }
.pdf-preview-page figcaption { padding:5px 8px; color:var(--muted); background:#f8fafc; border-bottom:1px solid var(--line); font-size:11px; }
.pdf-preview-page img, .preview .pdf-preview-page img { display:block; width:100%; max-width:100%; max-height:none; margin:0; background:#fff; }
.pdf-original-link { display:inline-flex; margin-top:4px; }
.pdf-password-form { display:grid; gap:8px; margin:10px 0; }
.pdf-password-form label { display:grid; gap:6px; color:var(--muted); font-size:12px; }
.pdf-password-form input { width:100%; border:1px solid var(--line); border-radius:6px; padding:8px 9px; color:var(--ink); background:#fff; font:inherit; }
.pdf-password-form .btn { justify-self:start; }

/* Result and check badges (table and transaction page); the table itself is styled in ui-table.css. */
.result-badge, .check-badge { display:inline-flex; width:max-content; border-radius:999px; padding:3px 8px; font-size:11px; font-weight:750; }
.result-ok { color:var(--green); background:var(--greenbg); }
.result-warning { color:var(--amber); background:var(--amberbg); }
.result-missing { color:var(--red); background:var(--redbg); }
.check-badge.unchecked { color:#344054; background:#eaecf0; }
.check-badge.checked { color:var(--blue); background:#eff8ff; }
/* "Đã kiểm tra" removed because the journal, amount, a date, the type or a journal account changed (25/11/2026). */
.check-badge.lost { color:var(--amber); background:var(--amberbg); }
.check-lost-note { margin:0 0 12px; padding:8px 12px; border-left:3px solid var(--amber); border-radius:6px; color:var(--ink); background:var(--amberbg); font-size:13px; }

.accountant-detail-header { position:sticky; top:0; z-index:5; display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:18px; align-items:center; margin:-28px -32px 16px; padding:12px 22px; color:#fff; background:var(--navy2); box-shadow:0 3px 14px #10182825; }
.accountant-detail-header .btn-link { color:#fff; }
.accountant-detail-header .btn { color:#fff; background:#ffffff12; border-color:#ffffff35; }
.accountant-detail-title { display:flex; flex-wrap:wrap; align-items:center; gap:7px; min-width:0; }
.accountant-detail-title > span:not(.result-badge):not(.check-badge) { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.detail-navigation { display:flex; gap:7px; }
.accountant-detail-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(560px,1.05fr); min-height:calc(100vh - 130px); border:1px solid var(--navy2); border-radius:9px; overflow:hidden; background:#fff; }
.accountant-document-pane { display:grid; grid-template-rows:auto auto minmax(0,1fr); min-width:0; border-right:1px solid var(--line); background:#f8fafc; }
.document-tabs { display:flex; gap:6px; overflow:auto; padding:10px 12px; background:#fff; border-bottom:1px solid var(--line); }
.document-tabs button { flex:0 0 auto; max-width:230px; overflow:hidden; padding:7px 10px; border:1px solid var(--line); border-radius:6px; color:var(--ink); background:#fff; text-overflow:ellipsis; white-space:nowrap; }
.document-tabs button.active { color:#fff; background:var(--navy2); border-color:var(--navy2); }
.document-toolbar { display:flex; flex-wrap:wrap; gap:6px; padding:8px 12px; border-bottom:1px solid var(--line); background:#fff; }
.accountant-preview { min-height:560px; overflow:auto; padding:12px; }
.accountant-preview .review-source-preview-body { width:calc(100% / var(--preview-zoom)); min-height:100%; padding:0; transform:scale(var(--preview-zoom)); transform-origin:top left; }
.accountant-preview .pdf-preview-page { background:#fff; box-shadow:var(--shadow); }
.accountant-process-pane { min-width:0; overflow:auto; padding:14px 16px 24px; }
.no-journal-reason { display:grid; gap:3px; margin-bottom:12px; padding:10px 12px; border-left:4px solid #f04438; color:#912018; background:var(--redbg); }
.accountant-warnings { margin-bottom:14px; }
.accountant-warnings h3, .accountant-warnings h4 { margin:0 0 8px; }
.accountant-warnings h4 { margin-top:10px; font-size:12px; }
.warning-card { display:grid; gap:2px; margin:6px 0; padding:9px 11px; border-left:4px solid #f79009; border-radius:6px; background:var(--amberbg); }
.warning-card.info { border-color:#98a2b3; background:#f8fafc; }
.journal-copy-suggestions { display:grid; justify-items:start; gap:3px; margin:10px 0; }
.original-proposal { display:grid; justify-items:start; gap:4px; margin:10px 0; padding:0 12px 10px; border:1px solid var(--line); border-radius:8px; font-size:12px; } .original-proposal .detail-section-heading { justify-self:stretch; padding:10px 0 2px; } .original-proposal h3 { margin:0; font-size:15px; }
.accountant-journal-editor { margin-top:8px; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.detail-section-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px; }
.detail-section-heading h3 { margin:0; font-size:15px; }
.journal-booked-amount { display:grid; gap:4px; margin-top:8px; color:var(--ink); font-size:12px; font-weight:700; }
.journal-fx { display:grid; gap:8px; margin:8px; padding:12px; border:1px solid #e6bd69; border-radius:7px; background:#fffaf0; }
.journal-fx-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.journal-fx-grid label { display:grid; gap:4px; min-width:0; font-size:12px; }
.journal-fx-grid input, .journal-fx-grid select { box-sizing:border-box; width:100%; min-width:0; padding:7px; border:1px solid var(--line); border-radius:5px; background:#fff; }
.fx-status { font-size:12px; color:#794209; }
.accountant-facts { display:grid; gap:9px; margin-bottom:16px; padding:12px; border:1px solid var(--line); border-radius:8px; }
.accountant-facts h3 { margin:0; font-size:15px; }
.accountant-facts-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.accountant-facts label { display:grid; gap:4px; min-width:0; font-size:12px; }
.accountant-facts input, .warning-resolution input, .warning-resolution select { box-sizing:border-box; width:100%; min-width:0; padding:7px; border:1px solid var(--line); border-radius:5px; }
.accountant-fact-history { margin:0 0 16px; }
.accountant-fact-history > div { padding:5px 0; }
.accountant-related-reviews { margin:0 0 16px; }
.accountant-related-review { display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; padding:4px 0; }
.accountant-dossier { margin:0 0 16px; }
.accountant-dossier h4 { margin:8px 0 4px; }
.accountant-dossier-case { display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; padding:4px 0; }
.accountant-dossier-files ul { margin:4px 0 0; padding-left:18px; overflow-wrap:anywhere; }
.accountant-facts .btn { justify-self:start; }
.warning-resolution { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; min-width:0; margin-top:8px; }
.warning-resolution .btn { justify-self:start; }
.accountant-history { margin-top:15px; font-size:12px; }
.accountant-history h3 { margin:0 0 6px; }
.sheet-preview-highlight td, .sheet-preview-highlight th { background:#fff2b5; outline:1px solid #d29a10; }
.sheet-preview-focus-note { margin:4px 0; font-weight:700; }
.journal-delete { color:var(--red); font-size:18px; }
.add-journal-line { margin:6px 10px; }
.journal-totals { padding:10px 12px; border-top:1px solid var(--line); background:#f2f4f7; font-weight:750; }
.journal-totals.invalid { color:var(--red); }
.journal-totals.valid { color:var(--green); }
.journal-balance-message { padding:0 12px 10px; color:var(--muted); background:#f2f4f7; font-size:12px; }
.journal-save-options { display:grid; gap:7px; margin:14px 0 10px; padding-top:12px; border-top:1px solid var(--line); }
.journal-save-options label { display:flex; align-items:center; gap:5px; }
.remember-keywords { max-width:520px; padding:8px 9px; border:1px solid var(--line); border-radius:6px; }
.remember-disabled-reason { margin:-3px 0 0 22px; color:var(--amber); font-size:inherit; line-height:1.45; }
.review-rule-person { color:var(--amber); line-height:1.45; }
/* Objects a remembered rule does not fix: [nhân viên] per transaction, or typed before activation (25/11/2026). */
.review-rule-objects { display:grid; gap:4px; margin-top:4px; }
.review-rule-object { line-height:1.45; }
.review-rule-object.warning-text { color:var(--amber); }
.review-rule-object-input { display:grid; gap:2px; font-size:12px; }
.review-rule-object-input input { max-width:280px; border:1px solid var(--line); border-radius:6px; padding:5px 8px; font:inherit; }
.remember-rule-descriptions { display:grid; gap:6px; max-width:520px; }
.remember-rule-descriptions input { padding:8px 9px; border:1px solid var(--line); border-radius:6px; }
.review-rule-conditions { grid-column:1 / -1; display:grid; grid-template-columns:max-content minmax(0,1fr); gap:3px 10px; margin:0; padding:8px 10px; border-radius:6px; background:#f8fafc; font-size:12px; }
.review-rule-conditions dt { color:var(--muted); font-weight:700; }
.review-rule-conditions dd { margin:0; overflow-wrap:anywhere; }
.detail-save-actions { display:flex; gap:8px; }
.review-rules-panel { margin-top:16px; border:1px solid var(--line); border-radius:8px; }
.review-rule-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; padding:10px 12px; border-top:1px solid var(--line); }
.review-rule-row small { display:block; margin-top:3px; }
.rule-label { border-radius:999px; padding:3px 7px; color:var(--blue); background:#eff8ff; font-size:11px; }

@media (max-width:1200px) {
  .accountant-detail-layout { grid-template-columns:1fr; }
  .accountant-document-pane { min-height:65vh; border-right:0; border-bottom:1px solid var(--line); }
}
@media (max-width:720px) {
  .review-summary-groups { grid-template-columns:1fr; }
  .review-summary-buttons { grid-template-columns:1fr; }

  .accountant-detail-header { position:static; grid-template-columns:1fr; margin:-20px -16px 14px; }
  .detail-navigation { width:100%; }
  .detail-navigation .btn { flex:1; }
  .accountant-detail-layout { border-radius:0; margin:0 -16px; border-left:0; border-right:0; }
  .accountant-process-pane { padding:12px; }
  .journal-fx-grid, .accountant-facts-grid { grid-template-columns:1fr; }
  .review-rule-conditions { grid-template-columns:1fr; }
}
.currency-notice { padding:8px 10px; margin-bottom:8px; border-left:3px solid #bf6b12; background:#fff5df; color:#794209; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.currency-notice strong { display:block; }
.kdtm-flag, .fx-proposal-note { padding:6px 10px; margin-top:6px; border-left:3px solid var(--blue); background:#eff8ff; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.kdtm-flag.overdue { border-left-color:#b42318; background:#fef3f2; color:#912018; }
.kdtm-flag.paid { border-left-color:#067647; background:#ecfdf3; }
.fx-proposal-note.provisional { border-left-color:#bf6b12; background:#fff5df; color:#794209; }

.statement-sync { display: grid; gap: 10px; }
.statement-sync-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.statement-sync-status .done { color: var(--green, #137a3a); }
.statement-sync-status .todo { color: var(--muted, #667085); }
.statement-sync-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.statement-sync-row input:not([type=checkbox]) { flex: 1 1 260px; min-width: 0; }
.statement-sync-last { border-top: 1px solid var(--line, #e4e7ec); padding-top: 8px; display: grid; gap: 4px; }
.statement-sync-last.failed strong { color: var(--red, #b42318); }
.statement-sync-error { font-size: 13px; color: var(--red, #b42318); }
.statement-sync-row input:not([type=checkbox]), .statement-sync-row select { box-sizing:border-box; padding:7px 8px; border:1px solid var(--line); border-radius:6px; font:inherit; color:var(--ink); background:#fff; }
/* Dossier chain and 331/141 balances (report 22/10, A-26/B-10). */
.dossier-chain-panel, .dossier-balances-panel { margin-top:16px; padding:0 12px 12px; border:1px solid var(--line); border-radius:8px; overflow-wrap:anywhere; }
.dossier-balances-panel { margin-bottom:16px; background:#fff; }
.dossier-chain-steps { margin:8px 0; padding-left:20px; display:grid; gap:6px; }
.dossier-chain-step.missing_journal strong, .dossier-chain-step.missing_transaction strong { color:var(--amber); }
.dossier-chain-warning { margin:6px 0; padding:6px 10px; border-left:3px solid var(--amber); background:var(--amberbg); }
.dossier-balance-table { width:100%; border-collapse:collapse; font-size:12px; }
.dossier-balance-table th, .dossier-balance-table td { padding:5px 6px; border-top:1px solid var(--line); text-align:left; }
.dossier-balance-table th { color:var(--muted); background:#f8fafc; }
.dossier-balance-table tr.open td:last-child { color:var(--amber); font-weight:700; }
.dossier-balance-dossier { margin:6px 0; }
.dossier-balance-total { margin:6px 0; font-weight:700; }
/* Contractor-tax / import dossier panel (22/10 report: B-11, B-13, B-14, A-67). */
.tax-dossier { display:grid; gap:6px; margin:0 0 16px; padding:0 12px 10px; border:1px solid var(--line); border-radius:8px; font-size:12px; }
.tax-dossier .detail-section-heading { padding:10px 0 2px; }
.tax-dossier h3 { margin:0; font-size:15px; }
.tax-dossier-checklist { margin:0; padding:0; list-style:none; display:grid; gap:2px; }
.tax-dossier-checklist .present { color:#067647; }
.tax-dossier-checklist .partial { color:#794209; }
.tax-dossier-checklist .missing { color:var(--red, #b42318); }
.tax-dossier-expected, .tax-dossier-item, .tax-dossier-adjustment { display:grid; gap:2px; }
.tax-dossier-adjustment { padding:6px 8px; border:1px dashed var(--line); border-radius:6px; }
/* Company rulebook (docs/FEEDBACK_CHANNELS.md) */

.rule-row, .question-card, .feedback-row, .guidance-rule { display:grid; gap:4px; padding:10px 12px; border-top:1px solid var(--line); }
.rule-row.draft { background:var(--amberbg); }
.rule-row.disabled { opacity:.7; }
.rule-row-head { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; }
.rule-text { white-space:pre-wrap; }
.rule-journal-text { color:var(--teal); font-weight:600; }
.rule-impact { padding:6px 10px; border-radius:6px; background:#f8fafc; }
.rule-editor { display:grid; gap:10px; margin:10px 0; border:1px solid var(--teal); }
.rule-field { display:grid; gap:4px; }
.rule-field > span { color:var(--muted); font-size:13px; }
.rule-field input, .rule-field textarea, .rule-field select { width:100%; }
.rule-scope, .rule-journal { display:grid; gap:8px; border:1px solid var(--line); border-radius:8px; padding:10px 12px; }
.rule-types { display:flex; flex-wrap:wrap; gap:12px; }
.rule-journal-line { display:grid; grid-template-columns:140px repeat(4,minmax(0,1fr)); gap:6px; align-items:center; }
.question-card.answered { opacity:.85; }
.question-answer { padding:6px 10px; border-left:3px solid var(--teal); background:var(--greenbg); white-space:pre-wrap; }
.question-card textarea, .accountant-company-guidance textarea { width:100%; }
.config-section { padding:8px 0; border-top:1px solid var(--line); }
.config-section > summary { cursor:pointer; font-weight:600; }
.config-section .rule-field { margin:8px 0; }
.config-inline { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.config-fraction { display:inline-flex; gap:4px; align-items:center; }
.feedback-row.resolved { opacity:.7; }
.feedback-scope { display:grid; gap:4px; margin:6px 0; }
.accountant-company-guidance { margin-top:16px; padding:12px; border:1px solid var(--line); border-radius:8px; display:grid; gap:6px; }
.accountant-company-guidance h3 { margin:0; }
.chief-toggle { display:inline-flex; gap:4px; align-items:center; margin-left:8px; white-space:nowrap; }
.rulebook-metrics { width:100%; border-collapse:collapse; }
.rulebook-metrics th, .rulebook-metrics td { padding:6px 8px; border-bottom:1px solid var(--line); text-align:right; }
.rulebook-metrics th:first-child, .rulebook-metrics td:first-child { text-align:left; }
@media (max-width: 720px) { .rule-journal-line { grid-template-columns:1fr 1fr; } }
.table-scroll { overflow-x:auto; }
.rule-editor :is(input:not([type=checkbox]):not([type=radio]), textarea, select), .question-card :is(textarea, input:not([type=checkbox])), .rulebook-config :is(input:not([type=checkbox]), select),
.accountant-company-guidance textarea, .rulebook-question-new input { padding:7px 9px; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--ink); font:inherit; }

.question-card .btn, .feedback-row .btn, .accountant-company-guidance > .actions .btn { justify-self:start; }
.rule-editor input[type=checkbox], .question-card input[type=checkbox], .rulebook-config input[type=checkbox], .feedback-scope input, .chief-toggle input { accent-color:var(--teal); }
.product-feedback-modal { max-width: 640px; }
.product-feedback-history h4 { margin: 16px 0 6px; }
.product-feedback-item { border-top: 1px solid var(--line); padding: 6px 0; }
.product-feedback-item summary { cursor: pointer; }
.product-feedback-text, .product-feedback-comment div { white-space: pre-wrap; overflow-wrap: anywhere; }
.product-feedback-text { margin: 6px 0; }
.product-feedback-thread { display: grid; gap: 6px; margin-top: 6px; }
.product-feedback-thread textarea { box-sizing: border-box; width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.product-feedback-thread .btn { justify-self: start; }
.product-feedback-comment { padding: 6px 10px; border-left: 3px solid var(--line); }
.product-feedback-comment.mine { border-left-color: #94a3b8; background: #f8fafc; }
.github-steps { padding-left: 20px; }
/* Issue #7: the company's accounting guide (Quy tắc công ty → Hướng dẫn) and the folder line of a source card. */
.rulebook-guide-line { margin: 0 0 12px; }
.guide-row.replaced, .guide-row.disabled { opacity: .7; }
.guide-sections ul { margin: 6px 0 0; padding-left: 20px; max-height: 240px; overflow: auto; }
.guide-upload { margin-top: 8px; }
.source-folder { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: var(--fs-xs); }
