:root {
  --ink: #11221f;
  --ink-soft: #203a34;
  --paper: #f3efe4;
  --panel: #fffdf7;
  --line: #d8d2c4;
  --line-dark: #b8b1a2;
  --mint: #bff47a;
  --mint-dark: #7ea940;
  --cyan: #78d7ca;
  --orange: #f1774f;
  --yellow: #f4c54d;
  --muted: #6f756f;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(17, 34, 31, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { min-width: 1180px; background: var(--ink); }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(17, 34, 31, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 34, 31, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Source Han Sans SC", sans-serif;
  font-size: 14px;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }

[hidden] { display: none !important; }

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #eef5e8;
  background:
    radial-gradient(circle at 14% 18%, rgba(191, 244, 122, 0.2), transparent 26%),
    radial-gradient(circle at 83% 82%, rgba(120, 215, 202, 0.14), transparent 27%),
    linear-gradient(145deg, #183b32 0%, #0d211c 52%, #081411 100%);
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 42px 42px;
}
.login-backdrop span { position: absolute; border: 1px solid rgba(191, 244, 122, 0.17); border-radius: 50%; }
.login-backdrop span:nth-child(1) { width: 360px; height: 360px; left: -110px; bottom: -150px; box-shadow: 0 0 0 42px rgba(191,244,122,0.02), 0 0 0 84px rgba(191,244,122,0.016); }
.login-backdrop span:nth-child(2) { width: 210px; height: 210px; right: 8%; top: -95px; }
.login-backdrop span:nth-child(3) { width: 10px; height: 10px; right: 42%; top: 19%; background: var(--mint); box-shadow: 0 0 25px rgba(191,244,122,0.7); }
.login-layout { position: relative; z-index: 1; width: min(1040px, calc(100vw - 110px)); display: grid; grid-template-columns: minmax(0, 1.15fr) 410px; gap: 100px; align-items: center; }
.login-intro { padding: 30px 0; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 70px; }
.login-brand strong { display: block; font-size: 18px; letter-spacing: 0.08em; }
.login-brand span { display: block; margin-top: 4px; color: #91aaa2; font: 10px/1.2 Bahnschrift, sans-serif; letter-spacing: 0.14em; }
.login-intro .eyebrow { color: var(--mint); }
.login-intro h1 { margin: 14px 0 20px; font-size: clamp(38px, 4vw, 58px); line-height: 1.16; letter-spacing: -0.055em; }
.login-intro > p:not(.eyebrow) { max-width: 570px; margin: 0; color: #a9bdb6; font-size: 15px; line-height: 1.9; }
.login-feature-list { display: flex; gap: 24px; margin-top: 48px; }
.login-feature-list span { display: grid; gap: 7px; color: #bdd0c9; font-size: 11px; }
.login-feature-list i { color: var(--mint); font: 700 10px/1 Bahnschrift, sans-serif; font-style: normal; letter-spacing: 0.14em; }
.login-card { padding: 37px 36px 32px; color: var(--ink); background: rgba(255, 253, 247, 0.97); border: 1px solid rgba(255,255,255,0.62); border-radius: 22px; box-shadow: 0 32px 90px rgba(0,0,0,0.34); backdrop-filter: blur(16px); }
.login-card-heading { margin-bottom: 28px; }
.login-card-heading > span { color: var(--mint-dark); font: 700 10px/1 Bahnschrift, sans-serif; letter-spacing: 0.2em; }
.login-card-heading h2 { margin: 10px 0 8px; font-size: 27px; letter-spacing: -0.04em; }
.login-card-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.login-field { display: grid; gap: 8px; margin-top: 17px; }
.login-field span { color: #52605b; font-size: 11px; font-weight: 700; }
.login-field input { width: 100%; height: 48px; padding: 0 14px; color: var(--ink); background: #fff; border: 1px solid #c9c5b9; border-radius: 9px; outline: none; transition: border-color 150ms ease, box-shadow 150ms ease; }
.login-field input:focus { border-color: #7ea940; box-shadow: 0 0 0 3px rgba(126,169,64,0.15); }
.login-error { min-height: 20px; margin: 10px 0 4px; color: #b13d32; font-size: 11px; line-height: 1.5; }
.login-submit { width: 100%; min-height: 48px; font-size: 14px; }
.login-security { display: block; margin-top: 17px; color: #8b908a; text-align: center; font-size: 9px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 22px 24px;
  overflow: hidden;
  color: #eef5e8;
  background:
    radial-gradient(circle at 12% 10%, rgba(191, 244, 122, 0.18), transparent 28%),
    linear-gradient(160deg, #17332c 0%, #0b1816 72%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: 74px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(191, 244, 122, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(191, 244, 122, 0.025), 0 0 0 56px rgba(191, 244, 122, 0.02);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 7px 15px 7px 15px;
  color: #10211e;
  background: var(--mint);
  font: 700 17px/1 Bahnschrift, "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
  box-shadow: inset 0 -4px 0 rgba(17, 34, 31, 0.14);
}

.brand strong { display: block; font-size: 17px; letter-spacing: 0.08em; }
.brand span { display: block; margin-top: 4px; color: #91aaa2; font: 10px/1.2 Bahnschrift, sans-serif; letter-spacing: 0.14em; }

.nav-list { display: grid; gap: 8px; margin-top: 34px; }
.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 12px;
  color: #b9cbc5;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
}
.nav-item.active {
  color: #10211e;
  background: var(--mint);
  border-color: #d8ff9f;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.17);
}
.nav-item.active i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.nav-item.disabled { opacity: 0.6; cursor: not-allowed; }
.nav-index { font: 700 11px/1 Bahnschrift, sans-serif; opacity: 0.7; }
.nav-item em { font-style: normal; font-size: 9px; color: #88a197; }

.sidebar-note {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: auto;
  padding: 15px 13px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}
.status-dot { width: 8px; height: 8px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 5px rgba(244, 197, 77, 0.12); }
.sidebar-note strong { display: block; font-size: 12px; }
.sidebar-note small { display: block; margin-top: 5px; color: #8fa49e; font-size: 10px; line-height: 1.5; }
.user-panel { align-items: center; padding: 12px; }
.user-avatar { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; color: #10211e; background: var(--mint); border-radius: 9px; font-size: 11px; font-weight: 800; }
.user-copy { min-width: 0; flex: 1; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { width: 28px; height: 28px; flex: 0 0 auto; color: #b6c8c2; background: transparent; border: 1px solid rgba(255,255,255,0.12); border-radius: 7px; cursor: pointer; }
.logout-button:hover { color: #10211e; background: var(--mint); border-color: var(--mint); }

.main-content { min-width: 0; padding: 34px 38px 46px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: #62756d; font: 700 10px/1.2 Bahnschrift, sans-serif; letter-spacing: 0.2em; }
.page-header h1 { margin: 0; font-size: 32px; line-height: 1.18; letter-spacing: -0.04em; font-weight: 800; }
.page-description { margin: 9px 0 0; color: var(--muted); }
.header-actions { display: flex; gap: 10px; }

.button {
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: 0.6; cursor: wait; transform: none; }
.button.primary { color: #0c1e1a; background: var(--mint); border-color: #9bcc5a; box-shadow: 0 6px 16px rgba(126, 169, 64, 0.22); }
.button.primary:hover { background: #cbff89; box-shadow: 0 9px 22px rgba(126, 169, 64, 0.28); }
.button.ghost { background: rgba(255,255,255,0.48); border-color: var(--line-dark); }
.button.ghost:hover { background: var(--white); border-color: var(--ink); }
.button.danger { color: white; background: #bb3e32; border-color: #a52f25; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card {
  position: relative;
  min-height: 128px;
  padding: 18px 19px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 7px 18px rgba(17, 34, 31, 0.045);
  animation: card-in 420ms both;
}
.summary-card:nth-child(2) { animation-delay: 50ms; }
.summary-card:nth-child(3) { animation-delay: 100ms; }
.summary-card:nth-child(4) { animation-delay: 150ms; }
.summary-card::before { content: ""; position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: var(--accent, var(--cyan)); }
.summary-card::after { content: ""; position: absolute; width: 86px; height: 86px; right: -34px; top: -34px; border: 18px solid color-mix(in srgb, var(--accent, var(--cyan)) 17%, transparent); border-radius: 50%; }
.summary-card.total { --accent: var(--cyan); }
.summary-card.unhandled { --accent: var(--yellow); }
.summary-card.risk { --accent: var(--orange); }
.summary-card.due { --accent: var(--mint-dark); }
.card-label { color: #50615b; font-size: 12px; font-weight: 700; }
.summary-card strong { display: block; margin: 9px 0 4px; font: 700 32px/1 Bahnschrift, sans-serif; letter-spacing: -0.03em; }
.summary-card small { color: #8a8c85; }

.workspace-panel { background: rgba(255, 253, 247, 0.92); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.filter-bar {
  display: grid;
  grid-template-columns: minmax(270px, 1.7fr) repeat(4, minmax(130px, 0.8fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 17px;
  background: #e8e4d9;
  border-bottom: 1px solid var(--line-dark);
}
.filter-bar label:not(.search-field) { display: grid; gap: 5px; color: #5f655f; font-size: 10px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid #c8c1b3;
  border-radius: 8px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
input, select { height: 38px; padding: 0 11px; }
textarea { min-height: 88px; padding: 10px 11px; resize: vertical; line-height: 1.65; }
input:focus, select:focus, textarea:focus { border-color: #4a7d70; box-shadow: 0 0 0 3px rgba(120, 215, 202, 0.21); background: #fff; }
input[readonly], textarea[readonly] { color: #737971; background: #e9e9e3; border-style: dashed; }
.search-field { position: relative; }
.search-field input { padding-left: 38px; }
.search-icon { position: absolute; left: 14px; top: 12px; width: 13px; height: 13px; border: 2px solid #61716c; border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -2px; transform: rotate(45deg); background: #61716c; }
.filter-button { height: 38px; min-height: 38px; color: #f4f7f2; background: var(--ink-soft); border-color: var(--ink-soft); }
.text-button { height: 38px; padding: 0 5px; color: #65716c; background: transparent; border: 0; cursor: pointer; }
.text-button:hover { color: var(--ink); text-decoration: underline; }

.table-heading { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px 12px; }
.table-heading strong { font-size: 16px; }
.table-heading span { margin-left: 10px; color: var(--muted); font-size: 12px; }
.page-size { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.page-size select { width: 68px; height: 32px; }

.table-frame { position: relative; min-height: 240px; margin: 0 16px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; background: #fffefa; }
th, td { height: 49px; padding: 12px 13px; text-align: left; vertical-align: middle; border-bottom: 1px solid #e6e1d7; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 3; color: #63716b; background: #f1eee6; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
tbody tr { transition: background 130ms ease; }
tbody tr:hover { background: #f7f9ef; }
tbody tr:last-child td { border-bottom: 0; }
td { color: #2b3935; font-size: 12px; }
.column-short { min-width: 112px; max-width: 112px; }
.column-normal { min-width: 150px; max-width: 150px; }
.column-wide { min-width: 190px; max-width: 190px; }
.column-long { min-width: 260px; max-width: 260px; }
.column-date { min-width: 132px; max-width: 132px; }
.column-datetime { min-width: 166px; max-width: 166px; }
.column-money { min-width: 145px; max-width: 145px; }
.column-entity { min-width: 260px; max-width: 260px; }
.column-account { min-width: 150px; max-width: 150px; }
.cell-text { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cell-multiline { overflow: visible; white-space: normal; overflow-wrap: anywhere; line-height: 1.65; text-overflow: clip; }
.cell-emphasis { color: var(--ink); font-weight: 700; font-size: 13px; }
.sticky-entity, .sticky-account { position: sticky; z-index: 2; background: #fffefa; }
.sticky-entity { left: 0; box-shadow: 8px 0 12px -12px rgba(17, 34, 31, 0.42); }
.sticky-account { left: 260px; box-shadow: 10px 0 14px -13px rgba(17, 34, 31, 0.5); }
th.sticky-entity, th.sticky-account { z-index: 5; background: #f1eee6; }
tbody tr:hover .sticky-entity, tbody tr:hover .sticky-account, tbody tr:hover .actions-cell { background: #f7f9ef; }
.secondary-text { color: #8a8d87; font-size: 11px; }
.number-cell { text-align: right; font-family: Bahnschrift, "Arial Narrow", sans-serif; font-variant-numeric: tabular-nums; }
.actions-cell { position: sticky; right: 0; z-index: 2; min-width: 126px; max-width: 126px; text-align: right; background: #fffefa; box-shadow: -8px 0 12px -12px rgba(17, 34, 31, 0.42); }
th.actions-cell { z-index: 5; background: #f1eee6; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.action-button { height: 29px; padding: 0 9px; color: #365b51; background: #edf4ee; border: 1px solid #cad9cd; border-radius: 6px; font-size: 11px; cursor: pointer; }
.action-button:hover { color: #11221f; background: #dff5d5; border-color: #88ae7d; }
.action-button.delete { color: #98473e; background: #fff1ed; border-color: #efc5bc; }
.action-button.delete:hover { background: #ffe2da; border-color: #da8e7e; }
.badge { display: inline-flex; align-items: center; min-height: 24px; max-width: 190px; padding: 3px 8px; overflow: hidden; color: #4d5c56; background: #edf0e8; border: 1px solid #d9ddd5; border-radius: 999px; text-overflow: ellipsis; font-size: 10px; }
.badge::before { content: ""; width: 6px; height: 6px; margin-right: 6px; flex: 0 0 auto; border-radius: 50%; background: #8b948e; }
.badge.risk { color: #8b332b; background: #fff0eb; border-color: #f0c0b4; }
.badge.risk::before { background: var(--orange); }
.badge.watch { color: #735c1c; background: #fff8dd; border-color: #ead997; }
.badge.watch::before { background: var(--yellow); }
.badge.trust { color: #37611f; background: #eff9e7; border-color: #c8dda9; }
.badge.trust::before { background: var(--mint-dark); }
.badge.done { color: #286356; background: #e8f8f4; border-color: #b5ded5; }
.badge.done::before { background: #42a78f; }
.table-state { position: absolute; inset: 39px 0 0; display: grid; place-items: center; padding: 40px; color: #737b75; background: rgba(255, 254, 250, 0.93); text-align: center; }
.table-state[hidden] { display: none; }
.table-state strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 16px; }

.pagination { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 12px 18px; color: var(--muted); font-size: 12px; }
.pagination-buttons { display: flex; align-items: center; gap: 5px; }
.page-button { min-width: 32px; height: 32px; padding: 0 8px; color: #48554f; background: #fff; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.page-button:hover:not(:disabled) { border-color: var(--ink-soft); }
.page-button.active { color: white; background: var(--ink-soft); border-color: var(--ink-soft); }
.page-button:disabled { opacity: 0.4; cursor: default; }

.record-dialog {
  width: min(1080px, calc(100vw - 72px));
  max-height: calc(100vh - 48px);
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid #9d9b90;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.38);
}
dialog::backdrop { background: rgba(5, 15, 13, 0.66); backdrop-filter: blur(5px); }
.record-dialog[open] { animation: dialog-in 190ms ease-out; }
.record-dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 26px 19px; color: #eef5e8; background: linear-gradient(135deg, #16342c, #0d201b); border-bottom: 4px solid var(--mint); }
.dialog-header h2 { margin: 0; font-size: 23px; letter-spacing: -0.03em; }
.dialog-header p:not(.eyebrow) { margin: 7px 0 0; color: #9fb5ad; font-size: 12px; }
.dialog-header .eyebrow { color: var(--mint); }
.icon-button { width: 37px; height: 37px; color: #d9e5df; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); border-radius: 50%; font-size: 24px; line-height: 1; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,0.16); }
.dialog-body { padding: 8px 26px 26px; overflow-y: auto; }
.form-section { padding: 22px 0 23px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.section-title { display: flex; align-items: baseline; gap: 9px; margin-bottom: 15px; }
.section-title span { color: var(--mint-dark); font: 700 11px/1 Bahnschrift, sans-serif; }
.section-title h3 { margin: 0; font-size: 15px; }
.section-title small { color: #898c85; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 13px; }
.form-field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.form-field.wide { grid-column: span 2; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #5f6762; font-size: 11px; font-weight: 700; }
.form-field label b { color: #c94b3d; }
.field-note { color: #93968f; font-size: 9px; }
.field-error { min-height: 13px; color: #c44436; font-size: 10px; }
.form-field.has-error input, .form-field.has-error select, .form-field.has-error textarea { border-color: #cc5d4f; box-shadow: 0 0 0 2px rgba(204,93,79,0.12); }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 26px; background: #eae6dc; border-top: 1px solid var(--line-dark); }
.dialog-footer > div { display: flex; gap: 9px; }
.dialog-footer span { color: #757b75; font-size: 11px; }
.dialog-footer b { color: #c94b3d; }

.confirm-dialog { width: 390px; padding: 30px; text-align: center; color: var(--ink); background: var(--panel); border: 1px solid #a29d90; border-radius: 18px; box-shadow: 0 26px 70px rgba(0,0,0,0.35); }
.confirm-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 16px; color: #9b3128; background: #ffe9e2; border: 1px solid #efb4a7; border-radius: 50%; font: 700 24px/1 Bahnschrift, sans-serif; }
.confirm-dialog h2 { margin: 0; font-size: 20px; }
.confirm-dialog p { color: #727873; line-height: 1.65; }
.confirm-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }

.toast { position: fixed; z-index: 100; right: 28px; bottom: 26px; max-width: 380px; padding: 13px 17px; color: white; background: #17362e; border-left: 4px solid var(--mint); border-radius: 9px; box-shadow: 0 14px 38px rgba(0,0,0,0.28); opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #712f29; border-left-color: #ff9d87; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1300px) {
  .main-content { padding-left: 26px; padding-right: 26px; }

  /* Browser zoom reduces the CSS viewport. Keep every ledger filter visible
     and place the synchronization date range on a second row. */
  #filterForm {
    grid-template-columns: repeat(4, minmax(120px, 1fr)) auto auto;
  }
  #filterForm .search-field { grid-column: 1 / span 2; grid-row: 1; }
  #filterForm label:nth-of-type(2) { grid-column: 3; grid-row: 1; }
  #filterForm label:nth-of-type(3) { grid-column: 4; grid-row: 1; }
  #filterForm .filter-button { grid-column: 5; grid-row: 1; }
  #filterForm #resetFilters { grid-column: 6; grid-row: 1; }
  #filterForm label:nth-of-type(4) { display: grid; grid-column: 1 / span 2; grid-row: 2; }
  #filterForm label:nth-of-type(5) { display: grid; grid-column: 3 / span 2; grid-row: 2; }
}

/* ===== 多工作台：当日巡查任务与规则中心 ===== */
.nav-item[type="button"] {
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  background: transparent;
  cursor: pointer;
}
.nav-item:not(.active):hover {
  color: #eef5e8;
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.1);
}
.source-note { margin-top: auto; }
.source-note + .user-panel { margin-top: 10px; }
.source-note { display: block; border-left: 3px solid rgba(191, 244, 122, 0.72); }
.source-note strong { color: #dcebd3; }

.header-action-group { display: flex; gap: 10px; }
.view-panel.active { animation: view-in 260ms ease-out both; }

.task-summary-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.task-summary-grid .summary-card { min-height: 119px; padding-right: 13px; }
.summary-card.running { --accent: var(--cyan); }
.summary-card.first-spend { --accent: #8f7ad8; }
.summary-card:nth-child(5) { animation-delay: 200ms; }
.summary-card:nth-child(6) { animation-delay: 250ms; }

.task-source-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
  color: #e8f1ec;
  background: linear-gradient(115deg, #142f28, #1f483d);
  border: 1px solid #284f45;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(17, 34, 31, 0.12);
}
.task-source-strip > div {
  position: relative;
  min-height: 104px;
  padding: 19px 22px 17px;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.task-source-strip > div:last-child { border-right: 0; }
.task-source-strip span { display: block; margin-bottom: 9px; color: var(--mint); font: 700 9px/1 Bahnschrift, sans-serif; letter-spacing: 0.16em; }
.task-source-strip strong { display: block; font-size: 14px; }
.task-source-strip small { display: block; margin-top: 8px; color: #9db2aa; font-size: 10px; line-height: 1.55; }

.task-filter-bar {
  grid-template-columns: minmax(145px, 0.65fr) minmax(310px, 1.65fr) minmax(130px, 0.65fr) auto auto;
}
.task-table-frame { min-height: 360px; }
.task-table th,
.task-table td {
  height: auto;
  min-height: 55px;
  white-space: normal;
  vertical-align: top;
  line-height: 1.55;
}
.task-table th { vertical-align: middle; }
.task-table td { padding-top: 14px; padding-bottom: 14px; }
.task-column-task-date { min-width: 122px; max-width: 122px; }
.task-column-task-account { min-width: 150px; max-width: 150px; }
.task-column-task-name { min-width: 180px; max-width: 180px; }
.task-column-task-license { min-width: 260px; max-width: 260px; }
.task-column-task-short { min-width: 105px; max-width: 105px; }
.task-column-task-province { min-width: 140px; max-width: 140px; }
.task-column-task-unit { min-width: 180px; max-width: 180px; }
.task-column-task-source { min-width: 145px; max-width: 145px; }
.task-column-task-governance { min-width: 190px; max-width: 190px; }
.task-column-task-confidence { min-width: 150px; max-width: 150px; }
.task-column-task-status { min-width: 112px; max-width: 112px; }
.task-column-task-datetime { min-width: 166px; max-width: 166px; }
.task-column-task-result { min-width: 280px; max-width: 280px; }
.task-wrapped-text { display: -webkit-box; overflow: hidden; white-space: normal; overflow-wrap: anywhere; -webkit-line-clamp: 4; -webkit-box-orient: vertical; line-height: 1.65; }
.task-actions-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 132px;
  max-width: 132px;
  text-align: right;
  background: #fffefa;
  box-shadow: -8px 0 12px -12px rgba(17, 34, 31, 0.42);
}
th.task-actions-cell { z-index: 5; background: #f1eee6; }
.task-table tbody tr:hover .task-actions-cell { background: #f7f9ef; }
.task-row-failed td:first-child { box-shadow: inset 4px 0 0 #e07258; }
.task-row-in_progress td:first-child { box-shadow: inset 4px 0 0 #58bfb1; }
.task-row-completed td:first-child { box-shadow: inset 4px 0 0 #83ad4c; }

.source-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.source-tag,
.task-status-badge,
.condition-tag,
.rule-match,
.rule-any,
.rule-value-list span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.35;
}
.source-tag { color: #355a50; background: #e7f5f0; border: 1px solid #b9dcd2; }
.source-first_spend { color: #5b488d; background: #f0ebff; border-color: #cfc2f3; }
.source-scheduled_10_percent { color: #506923; background: #f0f8e4; border-color: #cadca9; }
.task-status-badge::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.status-pending { color: #75601e; background: #fff7db; border: 1px solid #e7d28a; }
.status-in_progress { color: #246b60; background: #e5f7f3; border: 1px solid #addbd2; }
.status-completed { color: #456b24; background: #edf7e5; border: 1px solid #bfd7a4; }
.status-failed { color: #963c31; background: #ffede8; border: 1px solid #efb7aa; }
.status-cancelled { color: #69706c; background: #f0f0ed; border: 1px solid #d4d6d1; }

.task-dialog { width: min(980px, calc(100vw - 72px)); }
.task-dialog-header { border-bottom-color: var(--cyan); }
.task-dialog-body { padding-top: 22px; }
.task-detail-identity {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr 1.5fr 1fr;
  gap: 1px;
  overflow: hidden;
  color: #edf5f1;
  background: rgba(255,255,255,0.12);
  border: 1px solid #315148;
  border-radius: 12px;
}
.task-detail-identity > div { min-width: 0; padding: 15px 17px; background: #17352d; }
.task-detail-identity span,
.task-detail-item span { display: block; margin-bottom: 7px; color: #91aaa2; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; }
.task-detail-identity strong { display: block; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; }
.task-detail-identity .source-tags { margin-top: -2px; }
.task-detail-identity .source-tag { color: #dff2eb; background: rgba(120,215,202,0.12); border-color: rgba(120,215,202,0.3); }
.task-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.task-detail-item { min-height: 78px; padding: 13px 14px; background: #f4f1e8; border: 1px solid #ded8cb; border-radius: 9px; }
.task-detail-item.wide { grid-column: span 2; }
.task-detail-item strong { display: block; color: #273a34; overflow-wrap: anywhere; font-size: 11px; font-weight: 700; line-height: 1.65; }
.task-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.rule-intro {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.rule-intro > div {
  position: relative;
  min-height: 142px;
  padding: 23px 26px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 8px 24px rgba(17,34,31,0.06);
}
.rule-intro > div::after { content: ""; position: absolute; right: -42px; bottom: -62px; width: 150px; height: 150px; border: 24px solid rgba(120,215,202,0.12); border-radius: 50%; }
.rule-intro > div:nth-child(2)::after { border-color: rgba(191,244,122,0.19); }
.rule-intro-index { color: var(--mint-dark); font: 700 10px/1 Bahnschrift, sans-serif; letter-spacing: 0.16em; }
.rule-intro strong { display: block; margin-top: 13px; font-size: 18px; }
.rule-intro p { max-width: 640px; margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.rule-panel { margin-bottom: 18px; }
.rule-table-frame { min-height: 190px; margin-bottom: 17px; }
.rule-table { width: 100%; }
.rule-table th,
.rule-table td { min-width: 130px; height: auto; padding: 13px 15px; white-space: normal; line-height: 1.55; }
.rule-table th:first-child,
.rule-table td:first-child { min-width: 220px; }
.rule-value-list { display: flex; flex-wrap: wrap; gap: 4px; }
.rule-value-list span { color: #365f54; background: #e8f5f1; border: 1px solid #b9d9d0; }
.rule-any { color: #7b807b; background: #f0efeb; border: 1px dashed #cbc9c2; }
.condition-tag { margin: 2px 4px 2px 0; color: #74581d; background: #fff6d8; border: 1px solid #e5cf88; }
.rule-match { color: #395d52; background: #eaf3ef; border: 1px solid #c6d8d1; }
.frequency-mark { color: #426522; }
.handler-mark { color: #173e34; font-size: 13px; }

@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1450px) {
  .task-summary-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 1300px) {
  .task-filter-bar { grid-template-columns: minmax(140px, 0.6fr) minmax(280px, 1.4fr) minmax(120px, 0.6fr) auto auto; }
  .task-filter-bar label:nth-of-type(3) { display: grid; }
}

/* ========================================================================== 
   Modern inspection workspace visual system — September 2026
   Pure presentation overrides: no API, fields, imports or business logic.
   ========================================================================== */
:root {
  --ink: #172b4d;
  --ink-soft: #314867;
  --paper: #f4f7fb;
  --panel: #ffffff;
  --line: #dfe7ee;
  --line-dark: #c9d6e1;
  --mint: #73ddbf;
  --mint-dark: #159e78;
  --cyan: #71a5ff;
  --orange: #e8754d;
  --yellow: #d99a27;
  --muted: #6d7f90;
  --white: #ffffff;
  --blue: #2b6be8;
  --blue-deep: #102b45;
  --blue-dark: #173f6d;
  --blue-pale: #edf4ff;
  --shadow: 0 10px 30px rgba(26, 57, 94, 0.08);
  --radius: 14px;
}

html { background: var(--paper); }
body {
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  letter-spacing: 0.005em;
}
button, input, select, textarea { font-family: inherit; }
button { transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease; }
button:not(:disabled) { cursor: pointer; }
button:not(:disabled):active { transform: translateY(1px); }
::selection { color: #fff; background: var(--blue); }

/* Login */
.login-screen {
  color: #edf5ff;
  background:
    radial-gradient(circle at 12% 15%, rgba(67, 145, 255, 0.27), transparent 25%),
    radial-gradient(circle at 86% 78%, rgba(71, 199, 172, 0.18), transparent 27%),
    linear-gradient(135deg, #0b2035 0%, #102b45 52%, #183e67 100%);
}
.login-screen::before {
  opacity: .38;
  background-image: linear-gradient(rgba(195, 220, 255, .1) 1px, transparent 1px), linear-gradient(90deg, rgba(195, 220, 255, .1) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, #000, transparent 90%);
}
.login-backdrop span { border-color: rgba(154, 205, 255, .22); }
.login-backdrop span:nth-child(1) { box-shadow: 0 0 0 42px rgba(92,163,255,.035), 0 0 0 84px rgba(92,163,255,.025); }
.login-backdrop span:nth-child(3) { background: #67d9bd; box-shadow: 0 0 25px rgba(103,217,189,.64); }
.login-brand strong { font-size: 18px; letter-spacing: .08em; }
.login-brand span { color: #96abc2; }
.login-intro .eyebrow { color: #80d9ff; }
.login-intro h1 { letter-spacing: -.045em; }
.login-intro > p:not(.eyebrow) { color: #b4c5d8; }
.login-feature-list span { color: #c5d3e1; }
.login-feature-list i { color: #6fe1c3; }
.login-card {
  color: var(--ink);
  background: rgba(255,255,255,.98);
  border-color: rgba(255,255,255,.7);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(3, 19, 35, .36);
}
.login-card-heading > span { color: var(--blue); }
.login-card-heading h2 { color: var(--ink); }
.login-card-heading p { color: var(--muted); }
.login-field span { color: #4a6079; }
.login-field input,
.filter-bar input, .filter-bar select,
.task-filter-bar input, .task-filter-bar select,
.form-field input, .form-field select, .form-field textarea,
.month-input + input {
  color: var(--ink);
  background: #fff;
  border-color: #d8e3ed;
  border-radius: 8px;
  box-shadow: none;
}
.login-field input:focus,
.filter-bar input:focus, .filter-bar select:focus,
.task-filter-bar input:focus, .task-filter-bar select:focus,
.form-field input:focus, .form-field select:focus, .form-field textarea:focus,
.month-input + input:focus {
  outline: none;
  border-color: #7ca7f4;
  box-shadow: 0 0 0 3px rgba(43, 107, 232, .12);
}
.login-security { color: #8595a7; }

/* Application shell and navigation */
.app-shell { grid-template-columns: 252px minmax(0, 1fr); background: var(--paper); }
.sidebar {
  padding: 27px 18px 22px;
  color: #ecf5ff;
  background:
    radial-gradient(circle at 14% 8%, rgba(72, 157, 239, .25), transparent 23%),
    radial-gradient(circle at 82% 82%, rgba(47, 184, 141, .12), transparent 27%),
    linear-gradient(160deg, #102b45 0%, #0b2035 100%);
  border-right: 1px solid rgba(190, 221, 251, .1);
}
.sidebar::before { opacity: .2; background-image: linear-gradient(rgba(186,217,249,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(186,217,249,.13) 1px, transparent 1px); }
.brand { padding: 0 9px; }
.brand strong { color: #f3f8ff; }
.brand span { color: #9db3c8; }
.brand-mark {
  color: #102b45;
  background: linear-gradient(145deg, #f2fbff, #80d9ff);
  box-shadow: 0 6px 18px rgba(1, 15, 31, .28);
}
.nav-list { margin-top: 49px; gap: 8px; }
.nav-item {
  position: relative;
  min-height: 50px;
  color: #b5c6d8;
  border: 1px solid transparent;
  border-radius: 9px;
}
.nav-item:hover { color: #eff8ff; background: rgba(103, 159, 216, .1); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(62, 136, 232, .36), rgba(73, 154, 233, .16));
  border-color: rgba(143, 205, 255, .14);
  box-shadow: inset 0 1px rgba(255,255,255,.06);
}
.nav-item.active::before { content: ""; position: absolute; left: -19px; width: 3px; height: 25px; border-radius: 0 3px 3px 0; background: #67ddbd; box-shadow: 0 0 15px rgba(103,221,189,.5); }
.nav-index { color: #7692ad; }
.nav-item.active .nav-index { color: #75e2c4; }
.nav-item i { background: #78dfc5; }
.sidebar-note { border-color: rgba(175, 211, 244, .16); background: rgba(255,255,255,.055); }
.source-note strong { color: #cfe7fb; }
.source-note small { color: #95acc2; }
.user-panel { background: rgba(4, 23, 41, .28); }
.user-avatar { color: #d8ecff; background: rgba(100, 169, 233, .25); }
.user-copy strong { color: #f1f8ff; }
.user-copy small { color: #9bb0c4; }
.logout-button { color: #a8c4dc; }
.logout-button:hover { color: #fff; background: rgba(255,255,255,.12); }

.main-content { padding: 34px 38px 42px; background: var(--paper); }
.page-header { padding-bottom: 24px; border-bottom: 1px solid #e2eaf2; }
.eyebrow { color: #6282a5; font-size: 10px; letter-spacing: .14em; }
.page-header h1 { color: var(--ink); font-size: 29px; letter-spacing: -.035em; }
.page-description { color: var(--muted); }
.header-actions { gap: 10px; }
.header-action-group { gap: 9px; }
.month-input { color: #6d7f90; }
.month-input + input { height: 38px; }

/* Controls */
.button {
  min-height: 38px;
  padding: 0 15px;
  color: #405873;
  background: #fff;
  border: 1px solid #d7e2ec;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(22, 48, 76, .03);
  font-size: 12px;
  font-weight: 700;
}
.button:hover { border-color: #aebfce; background: #f9fbfd; box-shadow: 0 5px 12px rgba(28, 59, 93, .08); }
.button.primary { color: #fff; background: linear-gradient(135deg, #3477ec, #2b66d5); border-color: #2b66d5; box-shadow: 0 6px 14px rgba(43, 107, 232, .22); }
.button.primary:hover { background: linear-gradient(135deg, #4384f5, #2860cc); box-shadow: 0 8px 18px rgba(43,107,232,.3); }
.button.ghost { color: #3f5874; background: #fff; }
.button.danger { color: #fff; background: #d85b57; border-color: #d85b57; box-shadow: 0 5px 13px rgba(216,91,87,.2); }
.text-button { color: #4775c7; }
.text-button:hover { color: #245dc9; }

/* Cards, filters and tables */
.summary-grid, .task-summary-grid { gap: 16px; margin-bottom: 18px; }
.summary-card {
  min-height: 126px;
  padding: 19px 20px;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e0e8f0;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(26, 57, 94, .045);
}
.summary-card::after { right: -39px; bottom: -52px; width: 132px; height: 132px; border: 20px solid rgba(90, 148, 241, .09); }
.summary-card.unhandled::after { border-color: rgba(238, 173, 56, .12); }
.summary-card.risk::after { border-color: rgba(222, 99, 89, .11); }
.summary-card.due::after { border-color: rgba(49, 184, 138, .11); }
.summary-card strong { color: #172b4d; font-size: 31px; }
.card-label { color: #526b88; font-size: 12px; }
.summary-card small { color: #8291a2; }
.workspace-panel, .panel, .rule-panel {
  background: #fff;
  border: 1px solid #e0e8f0;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(26, 57, 94, .045);
}
.filter-bar, .task-filter-bar {
  padding: 15px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e4ebf2;
}
.filter-bar label > span:not(.sr-only), .task-filter-bar label > span:not(.sr-only) { color: #71839a; font-size: 11px; }
.filter-bar input, .filter-bar select, .task-filter-bar input, .task-filter-bar select { height: 38px; }
.search-field input { background: #fff; }
.search-icon { border-color: #91a4b7; }
.search-icon::after { background: #91a4b7; }
.filter-button { color: #fff; background: #234e87; border-color: #234e87; }
.filter-button:hover { color: #fff; background: #1e4476; }
.table-heading { padding: 17px 20px 13px; border-bottom: 1px solid #edf1f5; }
.table-heading h2 { color: #203958; font-size: 14px; }
.table-heading span { color: #8191a2; }

.table-heading-tools { display: flex; align-items: center; gap: 12px; }
.column-picker-button { min-height: 34px !important; height: 34px !important; padding: 0 12px !important; }
.column-picker-dialog {
  width: min(980px, calc(100vw - 48px));
  height: min(780px, calc(100vh - 48px));
  max-width: none;
  max-height: none;
  padding: 0;
  color: #244365;
  background: #f5f8fc;
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(18, 46, 76, .28);
}
.column-picker-dialog::backdrop { background: rgba(10, 30, 51, .5); backdrop-filter: blur(3px); }
.column-picker-dialog-content { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.column-picker-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 22px 26px 18px; background: linear-gradient(135deg, #f6f9ff, #fff); border-bottom: 1px solid #dce7f1; }
.column-picker-dialog-header .eyebrow { margin: 0 0 7px; color: #2f70d7; font-size: 9px; letter-spacing: .16em; }
.column-picker-dialog-header h2 { margin: 0; color: #1d385a; font-size: 21px; letter-spacing: -.02em; }
.column-picker-dialog-header p:not(.eyebrow) { margin: 7px 0 0; color: #74879b; font-size: 12px; }
.column-picker-dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 26px; background: #fff; border-bottom: 1px solid #e5edf4; }
.column-picker-dialog-toolbar strong { color: #264867; font-size: 13px; }
.column-picker-dialog-toolbar > div { display: flex; align-items: center; gap: 18px; }
.column-picker-dialog-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 14px; padding: 18px 22px; overflow-y: auto; }
.column-picker-group { min-width: 0; padding: 15px; background: #fff; border: 1px solid #dfe8f1; border-radius: 12px; box-shadow: 0 3px 10px rgba(31, 70, 112, .035); }
.column-picker-group > header { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; padding-bottom: 10px; border-bottom: 1px solid #edf2f7; }
.column-picker-group > header > span { display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px; color: #2f70d7; background: #edf4ff; border-radius: 7px; font: 700 10px/1 Bahnschrift, sans-serif; }
.column-picker-group > header div { min-width: 0; display: grid; gap: 2px; }
.column-picker-group > header strong { color: #274563; font-size: 13px; }
.column-picker-group > header small { color: #8a9aaa; font-size: 10px; }
.column-picker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.column-picker-item { display: flex; align-items: flex-start; gap: 8px; min-width: 0; min-height: 30px; padding: 6px 7px; color: #405873; font-size: 12px; line-height: 1.45; cursor: pointer; border: 1px solid transparent; border-radius: 7px; }
.column-picker-item:hover { color: #235c9f; background: #f2f7fe; border-color: #dce9f8; }
.column-picker-item:has(input:checked) { color: #204f88; background: #f5f9ff; }
.column-picker-item input { appearance: auto; flex: 0 0 16px; width: 16px !important; min-width: 16px; max-width: 16px; height: 16px !important; min-height: 16px; margin: 1px 0 0; padding: 0; border: 0; box-shadow: none; accent-color: #2b6be8; }
.column-picker-item span { flex: 1 1 auto; min-width: 0; width: auto; display: block; white-space: normal; overflow: visible; text-overflow: clip; word-break: normal; overflow-wrap: break-word; }
.column-picker-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 26px; background: #fff; border-top: 1px solid #dfe8f1; }
.column-picker-dialog-footer p { margin: 0; color: #7d8fa1; font-size: 11px; line-height: 1.5; }
.column-picker-dialog-footer > div { display: flex; flex: 0 0 auto; gap: 10px; }
@media (max-width: 760px) {
  .table-heading-tools { width: 100%; justify-content: space-between; }
  .column-picker-dialog { width: calc(100vw - 20px); height: calc(100vh - 20px); }
  .column-picker-dialog-header, .column-picker-dialog-toolbar, .column-picker-dialog-footer { padding-left: 16px; padding-right: 16px; }
  .column-picker-dialog-body { grid-template-columns: 1fr; padding: 12px; }
  .column-picker-list { grid-template-columns: 1fr; }
  .column-picker-dialog-footer { align-items: flex-end; }
  .column-picker-dialog-footer p { max-width: 52%; }
}
.table-frame, .task-table-frame, .rule-table-frame { border: 0; border-radius: 0; }
table { color: #344b66; }
thead th {
  color: #59708a;
  background: #f5f8fb;
  border-bottom-color: #dfe8f0;
  font-size: 11px;
  font-weight: 700;
}
tbody td { border-bottom-color: #ecf1f5; }
tbody tr:hover td { background: #f7faff; }
tbody tr:last-child td { border-bottom: 0; }
.sticky-account, .sticky-entity { background: #fff; }
tbody tr:hover .sticky-account, tbody tr:hover .sticky-entity { background: #f7faff; }
.cell-text { color: #314967; }
.cell-emphasis { color: #1b3659; }
.secondary-text { color: #a0adba; }
.row-actions { gap: 7px; }
.action-button { color: #356bc4; background: #eef5ff; border: 1px solid #cfe0fb; border-radius: 6px; }
.action-button:hover { color: #fff; background: #2b6be8; border-color: #2b6be8; }
.action-button.delete { color: #c94d4d; background: #fff3f2; border-color: #f4d4d1; }
.action-button.delete:hover { color: #fff; background: #d85b57; border-color: #d85b57; }
.badge { border-color: transparent; border-radius: 999px; font-weight: 700; }
.badge-confidence { color: #107d62; background: #e5f8f1; }
.badge-observe { color: #9a6a12; background: #fff5d9; }
.badge-risk { color: #c14343; background: #fff0ef; }
.badge-handling { color: #386fc4; background: #edf4ff; }
.badge-neutral { color: #63788e; background: #eff3f6; }
.pagination { border-top-color: #e6edf3; }
.pagination > span { color: #71839a; }
.page-size { color: #61758b; border-color: #d7e2eb; background: #fff; }
.page-button { color: #60758a; background: #fff; border-color: #d9e4ed; }
.page-button:hover:not(:disabled) { color: #fff; background: #2b6be8; border-color: #2b6be8; }
.page-button.active { color: #fff; background: #2b6be8; border-color: #2b6be8; }

/* Daily task workspace */
.task-source-strip {
  color: #3b6daf;
  background: #edf5ff;
  border: 1px solid #d4e5fd;
  border-radius: 10px;
}
.task-source-strip strong { color: #2c5eaa; }
.task-table tbody tr:hover .task-actions-cell { background: #f7faff; }
.task-row-failed td:first-child { box-shadow: inset 3px 0 0 #dc625d; }
.task-row-in_progress td:first-child { box-shadow: inset 3px 0 0 #2b6be8; }
.task-row-completed td:first-child { box-shadow: inset 3px 0 0 #31b88a; }
.source-tag, .task-status-badge, .condition-tag, .rule-match, .rule-any, .rule-value-list span { border-radius: 999px; font-weight: 700; }
.source-tag { color: #2e6ea8; background: #edf5ff; border-color: #cfe2fc; }
.source-first_spend { color: #6a51af; background: #f2edff; border-color: #ded2fb; }
.source-scheduled_10_percent { color: #168162; background: #e6f8f2; border-color: #c1eee0; }
.status-pending { color: #a16d12; background: #fff6dc; border-color: #f5df9e; }
.status-in_progress { color: #2867bc; background: #eaf2ff; border-color: #cddfff; }
.status-completed { color: #15815f; background: #e5f8f0; border-color: #beeada; }
.status-failed { color: #be4945; background: #fff0ef; border-color: #f3cac7; }
.status-cancelled { color: #697b8e; background: #f0f3f6; border-color: #dde4eb; }

/* Rules */
.rule-intro > div { background: #fff; border-color: #e0e8f0; box-shadow: 0 6px 18px rgba(26,57,94,.045); }
.rule-intro > div::after { border-color: rgba(73, 136, 237, .1); }
.rule-intro > div:nth-child(2)::after { border-color: rgba(49, 184, 138, .12); }
.rule-intro-index { color: #4778c9; }
.rule-intro strong { color: #213b5f; }
.rule-intro p { color: #6d7f90; }
.rule-value-list span { color: #2f6ea7; background: #edf5ff; border-color: #cfe1fa; }
.rule-any { color: #7e8c99; background: #f3f6f8; border-color: #dbe3e9; }
.condition-tag { color: #976716; background: #fff6df; border-color: #f2dfab; }
.rule-match { color: #187e61; background: #e7f8f2; border-color: #c5edde; }
.frequency-mark { color: #2363bb; }
.handler-mark { color: #223e62; }

/* Dialogs and feedback */
.record-dialog, .task-dialog, .confirm-dialog {
  color: var(--ink);
  background: #fff;
  border: 1px solid #dce6ef;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(18, 46, 76, .2);
}
.record-dialog::backdrop, .task-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(10, 30, 51, .46); backdrop-filter: blur(2px); }
.dialog-header { background: linear-gradient(135deg, #f6f9ff, #fff); border-bottom-color: #dce7f1; }
.dialog-header h2, .confirm-dialog h2 { color: #1d385a; }
.dialog-header p { color: #74879b; }
.icon-button { color: #66809d; }
.icon-button:hover { color: #1c579e; background: #edf4ff; }
.section-title { border-bottom-color: #e6edf3; }
.section-title span { color: #2f70d7; background: #edf4ff; }
.section-title h3 { color: #264261; }
.section-title small { color: #8090a0; }
.form-field label { color: #405975; }
.form-field label b { color: #d55450; }
.field-note { color: #8092a3; }
.field-error { color: #d55450; }
.dialog-footer { color: #75889d; background: #f8fafc; border-top-color: #e2eaf1; }
.confirm-mark { color: #ce4c49; background: #fff0ef; border-color: #f2cac7; }
.confirm-dialog p { color: #6f8295; }
.toast { color: #eff7ff; background: #183c63; border-color: rgba(168,213,255,.35); box-shadow: 0 12px 30px rgba(18,42,67,.24); }

@media (max-width: 1450px) {
  .main-content { padding: 28px 28px 36px; }
  .app-shell { grid-template-columns: 234px minmax(0, 1fr); }
}

/* Precision overrides for generated badge variants and sticky task/ledger columns. */
.summary-card::after { top: auto; }
.badge.risk { color: #c14343; background: #fff0ef; border-color: #f2cfcc; }
.badge.risk::before { background: #dc625d; }
.badge.watch { color: #9a6a12; background: #fff5d9; border-color: #f1dfad; }
.badge.watch::before { background: #d99a27; }
.badge.trust { color: #107d62; background: #e5f8f1; border-color: #c5ecde; }
.badge.trust::before { background: #31b88a; }
.badge.done { color: #2867bc; background: #eaf2ff; border-color: #cedfff; }
.badge.done::before { background: #2b6be8; }
th.sticky-entity, th.sticky-account, th.actions-cell { background: #f5f8fb; }
.actions-cell { background: #fff; box-shadow: -8px 0 12px -12px rgba(28, 59, 93, .32); }
tbody tr:hover .sticky-entity, tbody tr:hover .sticky-account, tbody tr:hover .actions-cell { background: #f7faff; }
.task-source-strip > div { border-right-color: #d7e7fb; }
.task-source-strip span { color: #4d82ca; }
.task-source-strip small { color: #7390ad; }

/* Screenshot cells */
.screenshot-preview {
  display: inline-flex;
  width: 78px;
  height: 52px;
  padding: 3px;
  overflow: hidden;
  vertical-align: middle;
  background: #f5f8fb;
  border: 1px solid #dbe5ee;
  border-radius: 7px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.screenshot-preview:hover {
  border-color: #7ca7f4;
  box-shadow: 0 5px 13px rgba(43, 107, 232, .16);
  transform: translateY(-1px);
}
.screenshot-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }

.import-job-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 360px;
  padding: 6px 10px;
  color: #355b87;
  font-size: 12px;
  line-height: 1.35;
  background: #eef5ff;
  border: 1px solid #d0e2fb;
  border-radius: 8px;
}
.import-job-status[data-status="completed"] { color: #14795d; background: #e8f8f2; border-color: #c5ebdf; }
.import-job-status[data-status="failed"] { color: #b84541; background: #fff0ef; border-color: #f1cbc8; }
.import-job-status[data-status="pending"] { color: #956613; background: #fff6df; border-color: #f0dfad; }

/* In-page screenshot lightbox: never navigate to the storage download URL. */
.screenshot-preview { cursor: zoom-in; }
.screenshot-preview:focus-visible { outline: 3px solid #2b6be8; outline-offset: 3px; }
.screenshot-dialog {
  width: min(1200px, 94vw);
  max-width: 94vw;
  max-height: 92vh;
  padding: 0;
  border: 1px solid #dbe5ee;
  border-radius: 16px;
  background: #fff;
  color: #1b3659;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(10, 25, 48, .36);
}
.screenshot-dialog::backdrop { background: rgba(10, 23, 43, .76); backdrop-filter: blur(5px); }
.screenshot-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid #e5edf5;
  background: #fff;
}
.screenshot-heading { min-width: 0; }
.screenshot-heading h2 { margin: 0 0 5px; font-size: 17px; overflow-wrap: anywhere; }
.screenshot-heading span { color: #7a899d; font-size: 12px; }
.screenshot-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.screenshot-tools button {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f5f8fc;
  color: #29486b;
  cursor: pointer;
}
.screenshot-tools button:hover:not(:disabled) { color: #2b6be8; border-color: #9abdf5; background: #edf4ff; }
.screenshot-tools button:focus-visible { outline: 2px solid #2b6be8; outline-offset: 2px; }
.screenshot-tools button:disabled { opacity: .4; cursor: not-allowed; }
#screenshotZoom { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
#closeScreenshotButton { margin-left: 8px; }
.screenshot-viewport { height: min(72vh, 850px); overflow: auto; background: #132238; overscroll-behavior: contain; }
.screenshot-canvas {
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#screenshotImage { display: block; max-width: none; flex-shrink: 0; background: #fff; box-shadow: 0 4px 28px rgba(0, 0, 0, .25); }
#screenshotStatus { color: #c3d2e5; text-align: center; }
@media (max-width: 700px) {
  .screenshot-toolbar { flex-wrap: wrap; padding: 12px; }
  .screenshot-tools { flex-wrap: wrap; gap: 5px; }
  .screenshot-heading span { display: none; }
}

/* Header actions keep labels intact; import month and upload form one visual group. */
.page-header { flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.page-header > :first-child { flex: 1 1 390px; min-width: 0; }
.header-actions { flex: 0 1 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-left: auto; max-width: 100%; gap: 12px; }
.header-action-group { align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; }
.header-actions .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 0 0 auto; height: 40px; min-height: 40px; padding: 0 16px; white-space: nowrap; line-height: 1; }
.header-actions .button > span[aria-hidden] { font-size: 16px; font-weight: 500; }
.governance-import-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 6px; border: 1px solid #dfe8f2; border-radius: 12px; background: #edf3fa; }
.governance-month-field { display: flex; align-items: center; gap: 10px; padding-left: 8px; }
.governance-month-field label { flex: 0 0 auto; color: #627995; font-size: 12px; font-weight: 600; white-space: nowrap; }
#governanceMetricMonth { width: 152px; min-width: 152px; height: 40px; padding: 0 10px; border: 1px solid #d8e3ef; border-radius: 8px; outline: none; color: #244365; background: #fff; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; color-scheme: light; transition: border-color 160ms ease, box-shadow 160ms ease; }
#governanceMetricMonth:focus-visible { border-color: #6e9eec; box-shadow: 0 0 0 3px rgba(43, 107, 232, .12); }
#importGovernanceButton { border-color: #c8d9ee; color: #2d5c98; box-shadow: none; }
#importGovernanceButton:hover:not(:disabled) { background: #f7faff; border-color: #8aafe0; }
#taskHeaderActions { gap: 12px; }
@media (max-width: 1450px) {
  .page-header:has(#taskHeaderActions:not([hidden])) > :first-child { flex-basis: 100%; }
  .page-header:has(#taskHeaderActions:not([hidden])) .header-actions { margin-left: 0; justify-content: flex-start; }
}
