/* Identidad visual de FMGTax. Se carga al final para aplicar la misma paleta en todas las pantallas. */
:root {
  --ink: #193b58;
  --muted: #56738a;
  --green: #176b98;
  --light: #f0f9ff;
  --line: #d7e7f2;
  --accent: #e7f8ff;
}

body { background: #f6fbff; }
button:hover { background: #e7f5fd; }
button.primary:hover { background: #11577d; }
input, select, textarea { border-color: #c7ddeb; }
input:focus, select:focus, textarea:focus { outline: 2px solid #74c3eb; }
a:hover { color: #11577d; }
.eyebrow { color: #276e99; }

.sidebar { background: #eaf6fd; }
.brand { color: #174b72; }
.brand-icon { background: #1673a6; color: #fff; }
.brand-logo { display: block; width: 100%; color: inherit; }
.brand-crop { position: relative; display: block; width: 100%; height: 128px; overflow: hidden; background: transparent; }
.brand-crop .brand-image { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; object-fit: contain; }
.brand-image-dark { display: none; }
.login-logo { width: 190px; max-width: 46vw; margin-bottom: 20px; }
.login-logo .brand-crop { width: 100%; height: auto; aspect-ratio: 1256 / 1231; }
@media (max-width: 1000px) { .sidebar .brand-crop { height: 109px; } }
@media (max-width: 650px) { .sidebar .brand-logo { width: 180px; } .sidebar .brand-crop { height: 82px; } .login-logo { width: 142px; max-width: 48vw; margin-bottom: 12px; } .login-logo .brand-crop { width: 100%; height: auto; } }
.sidebar-label { color: #5f8299; }
.nav-item { color: #426780; }
.nav-item.selected { background: #d5effd; color: #125b84; }
.saved-nav button:hover { background: #d5effd; }
.sidebar-bottom { color: #527590; }
.status-dot { background: #4ca9d6; }
.saved-nav { overflow: auto; min-height: 0; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #b7d7e9 transparent; }
.monthly-sidebar-label { margin-top: 20px !important; }
.monthly-sidebar-links { display: grid; gap: 12px; padding-bottom: 12px; }
.monthly-period-group { display: grid; gap: 5px; }
.monthly-period-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; color: #567d96; font-size: 10px; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
.monthly-period-heading small { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #d8edf9; color: #286f97; font-size: 9px; }
.monthly-period-items { display: grid; gap: 4px; }
.monthly-sidebar-item { display: grid; grid-template-columns: 7px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px 8px; border: 1px solid transparent; border-radius: 8px; color: #244f6c; }
.monthly-sidebar-item:hover, .monthly-sidebar-item.selected { background: #fff; border-color: #cce4f2; color: #125b84; box-shadow: 0 2px 8px #155d8420; }
.monthly-kind-dot { width: 7px; height: 29px; border-radius: 999px; background: #75b9dc; }
.monthly-kind-dot.kind-imposiciones { background: #6d91c7; }
.monthly-kind-dot.kind-sm { background: #5cafa4; }
.monthly-kind-dot.kind-boh { background: #c69667; }
.monthly-kind-dot.kind-acuse { background: #b8748e; }
.monthly-kind-dot.kind-f30_1 { background: #987fbd; }
.monthly-sidebar-copy { min-width: 0; display: grid; line-height: 1.25; }
.monthly-sidebar-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 680; }
.monthly-sidebar-copy small { margin-top: 2px; color: #7290a4; font-size: 9px; }
.monthly-link-arrow { color: #81a7bd; font-size: 17px; line-height: 1; }
.monthly-sidebar-empty { margin: 0 7px; padding: 10px; border: 1px dashed #bad8e9; border-radius: 8px; color: #68899e; font-size: 11px; }
.monthly-all-link { display: flex; align-items: center; justify-content: space-between; margin: 1px 5px 0; padding: 9px 10px; border-top: 1px solid #cfe4f0; color: #176b98; font-size: 10px; font-weight: 700; }
.monthly-all-link:hover { color: #104f72; }
.topbar { background: #fff; }
.divider { color: #a9c5d7; }
.text-button { color: #527590; }

.stat-label, .table-title .muted { color: #58758c; }
.stat-icon { background: #e2f4fe; color: #327fa8; }
.search span { color: #6c9fba; }
.hint, .table-footer, .app-footer { color: #6c879a; }
th { background: #f0f8fd; color: #52748b; }
td { border-bottom-color: #e9f1f7; }
tbody tr:hover { background: #f3faff; }
td .client-name { color: #1b4c70; }
.client-avatar { background: #e2f3fd; color: #24749f; }
.pill { background: #e5f5fe; color: #155c83; }
.pill.gray { background: #edf1f4; color: #697989; }
.pill[class*="option-color-"] { border-radius: 999px; padding: 4px 10px; font-weight: 650; }
.option-color-sky { background: #e1f4fc; color: #174f69; }
.option-color-blue { background: #e6eefa; color: #294775; }
.option-color-teal { background: #ddf3f0; color: #205c55; }
.option-color-green { background: #e5f2e5; color: #326343; }
.option-color-olive { background: #eff2df; color: #59632b; }
.option-color-sand { background: #f5eedf; color: #69552f; }
.option-color-amber { background: #fff0d9; color: #76501d; }
.option-color-coral { background: #fae7e1; color: #7b4638; }
.option-color-rose { background: #f7e7ef; color: #763e5b; }
.option-color-lavender { background: #eee9f8; color: #554478; }
.pill.gray[class*="option-color-"] { background: #edf1f4; color: #697989; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 8px; margin: 10px 0 18px; }
.color-choice { display: flex; align-items: center; gap: 7px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.color-choice:has(input:checked) { border-color: #4b9bc6; box-shadow: 0 0 0 2px #d9f1ff; }
.color-choice input { width: 16px; height: 16px; accent-color: var(--green); }
.color-choice .pill { margin: 0; }
.multiple-setting { display: block; background: #f0f9ff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 14px 0; }
.multiple-setting label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.multiple-setting small { display: block; margin: 5px 0 0 25px; }
.bundle-heading { margin: 24px 0 8px; border-top: 1px solid var(--line); padding-top: 20px; }
.bundle-heading h2 { margin: 0; }
.bundle-heading button { font-size: 12px; }
#bundle-options { display: grid; gap: 10px; margin: 16px 0; }
.category-option-row { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(115px, 1fr) minmax(110px, 1fr) 76px minmax(100px, 1fr); gap: 10px; align-items: end; border: 1px solid var(--line); background: #fbfdff; padding: 12px; border-radius: 9px; }
.category-option-row .field { min-width: 0; }
.category-option-row input, .category-option-row select { width: 100%; }
.option-preview { display: grid; gap: 7px; align-self: center; min-width: 0; }
.option-preview .pill { width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.option-active { display: flex; gap: 5px; align-items: center; padding-bottom: 8px; font-size: 12px; }
.option-active input { width: 16px; height: 16px; flex: 0 0 auto; }
.option-action { padding-bottom: 3px; }
.option-action button, .pending-delete button { font-size: 11px; padding: 5px 8px; }
.option-action small { font-size: 11px; }
.pending-delete { grid-column: 1 / -1; color: #7b4638; }
.is-deleted { background: #f4f6f8; }
.is-deleted .option-action { display: none; }
.is-deleted input, .is-deleted select { opacity: .55; }
@media (max-width: 760px) { .category-option-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .option-preview, .option-active, .option-action { align-self: end; } }
.checks { background: #f1f9fe; }
#filter-summary { color: #527c9b; }
#toast { background: #165d86; }

.login-brand { background: linear-gradient(145deg, #d8f1ff 0%, #eaf7ff 70%, #f8fcff 100%); }
.login-brand p:not(.eyebrow) { color: #426d8a; }
.login-line { border-top-color: #badced; color: #557b96; }
.login-form { background: #fff; }
.login-home-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; color: #176f9d; font-size: 13px; font-weight: 650; text-decoration: none; transition: color .15s ease, gap .15s ease; }
.login-home-link:hover { color: #104d70; gap: 11px; }
.login-home-link span { font-size: 17px; line-height: 1; }
.login-home-link:focus-visible { outline: 2px solid #f07845; outline-offset: 4px; border-radius: 2px; }

.details-grid dt, .classification-row > span:first-child,
.related-row small, .page-audit details { color: #597b92; }
.classification-row, .related-row { border-bottom-color: #e9f1f7; }
#client-dialog { box-shadow: 0 30px 90px #173d672b; }
#client-dialog::backdrop { background: #1d54725c; }
.notice { background: #e6f6ff; color: #185c84; }
.secret-value { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; }
.secret-text { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.secret-eye { border: 1px solid #bad8e9; background: #eaf6fd; color: #155c83; border-radius: 8px; padding: 3px 8px; cursor: pointer; }
.secret-eye:hover { background: #d5effd; }
.secret-eye:disabled { opacity: .55; cursor: wait; }
.credential-details { margin-top: 16px; }
.credential-details small { color: #597b92; }
.credential-clear { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.credential-clear input { width: 16px; height: 16px; }

/* Densidad de trabajo: prioriza datos y reduce espacios sin perder jerarquía. */
.sidebar { padding: 22px 16px; }
.sidebar-label { margin: 24px 8px 8px; }
.nav-item { margin: 2px 0; padding: 9px 10px; }
.saved-nav { margin-top: 16px; }
.saved-nav button { padding: 6px 8px; }
.topbar { height: 60px; padding: 0 28px; }
.workspace main#main { padding: 22px 28px; }
.workspace h1 { font-size: 28px; }
.workspace .page-heading { margin-bottom: 18px; }
.workspace .page-heading p { margin-bottom: 8px; }
.stats { gap: 12px; margin-bottom: 18px; }
.stat { padding: 13px 17px; }
.stat-value { font-size: 25px; }
.stat-icon { width: 38px; height: 38px; }
.table-title { padding: 16px 18px; }
.toolbar { padding: 0 18px 13px; }
#client-table th { padding: 9px 12px; }
#client-table .column-sort { display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:0;border:0;border-radius:2px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;box-shadow:none; }
#client-table .column-sort:hover { color:var(--accent, #24699a); }
#client-table .column-sort:focus-visible { outline:2px solid #24699a;outline-offset:4px; }
#client-table .column-sort span { opacity:.65; }
#client-table td { height: 42px; padding: 8px 12px; }
.table-footer { padding: 10px 18px; }
.cards { gap: 12px; margin: 12px 0 22px; }
.card { padding: 16px 18px; }
.section-heading { margin-top: 21px; }
.app-footer { padding: 3px 28px 14px; }
.modal-header { padding: 15px 20px; }
#modal-body, #dialog-body { padding: 18px 20px; }
.form-grid { gap: 12px; }
.form-section { margin: 19px 0 10px; padding-top: 13px; }
.form-actions { margin-top: 17px; padding-top: 13px; }
input, select, textarea { padding: 7px 9px; }
button { padding: 7px 11px; }

.monthly-card { padding: 15px 18px; margin-bottom: 14px; }
.monthly-main .back-link { margin-bottom: 12px; }
.monthly-create-form { gap: 10px; margin-top: 13px; }
.monthly-create-form button { min-height: 34px; }
.monthly-section-title { margin-bottom: 8px; }
.monthly-sheet-list { gap: 12px; }
.monthly-period-heading { padding: 10px 13px; }
.monthly-period-sheets { gap: 8px; padding: 9px; }
.monthly-sheet-card { min-height: 72px; }
.monthly-sheet-content { padding: 9px 8px 9px 10px; }
.monthly-sheet-arrow { padding: 9px; }
.monthly-header-card { gap: 15px; }
.monthly-toolbar { gap: 9px; margin-bottom: 10px; }
.candidate-row { padding: 7px 9px; }
.monthly-option-row { padding: 8px; }
.monthly-option-row, .monthly-option-form { margin: 6px 0; }

@media (max-width: 1000px) {
  .workspace main#main { padding: 19px 18px; }
  .topbar { padding: 0 18px; }
}

.stats{grid-template-columns:repeat(auto-fit,minmax(165px,1fr))}.stat-attention{background:#fff8e8!important;border-color:#ead8a7!important}.stat-attention .stat-icon{color:#99732d}.quality-flag{display:inline-block;margin-left:6px;padding:2px 6px;border-radius:999px;background:#fff2cf;color:#7e6122;font-size:9px;font-weight:700;vertical-align:middle}.client-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 12px;border-top:1px solid var(--line);color:var(--muted);font-size:11px}.client-pagination div{display:flex;gap:6px}.client-pagination button{padding:5px 9px;font-size:10px}@media(max-width:650px){.client-pagination{align-items:flex-start;flex-direction:column}}

/* Equipo: permisos por áreas, claros para administrar y discretos al consultar. */
.user-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.user-card-head p { margin-bottom: 8px; overflow-wrap: anywhere; }
.password-pending { background: #fff0d9; color: #76501d; }
.user-area-summary { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.user-area-summary small { padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 9px; }
.account-switch { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.account-switch input { flex: 0 0 auto; margin-top: 2px; }
.account-switch span { display: grid; gap: 2px; }
.account-switch small { line-height: 1.3; }
.user-access-fieldset { margin: 4px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.user-access-fieldset legend { padding: 0 7px; font-size: 13px; font-weight: 700; }
.user-access-fieldset > p { margin: 0 0 12px; color: var(--muted); font-size: 11px; }
.user-access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.user-access-option { --area-tint: #e5f5fe; --area-ink: #155c83; display: flex; align-items: flex-start; gap: 9px; min-height: 60px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.user-access-option:has(input:checked) { border-color: var(--area-ink); background: var(--area-tint); box-shadow: inset 3px 0 0 var(--area-ink); }
.user-access-option input { flex: 0 0 auto; margin-top: 3px; accent-color: var(--area-ink); }
.user-access-option span { display: grid; gap: 3px; min-width: 0; }
.user-access-option strong { color: var(--ink); font-size: 12px; }
.user-access-option small { color: var(--muted); font-size: 10px; line-height: 1.3; }
.user-access-option.area-control_mensual { --area-tint: #e5f1fb; --area-ink: #315f94; }
.user-access-option.area-tributaria { --area-tint: #e7f4ed; --area-ink: #2f7053; }
.user-access-option.area-acuses { --area-tint: #f7eaf0; --area-ink: #8b4a69; }
.user-access-option.area-laboral { --area-tint: #eef0fb; --area-ink: #5a5f99; }
.user-access-option.area-honorarios { --area-tint: #fbf0e3; --area-ink: #8b6033; }
.user-access-option.area-herramientas { --area-tint: #f1eafb; --area-ink: #6b4c91; }
.user-access-option input:disabled { cursor: not-allowed; }
.user-access-option:has(input:disabled) { opacity: .72; cursor: not-allowed; }
.user-access-admin-note { margin: 10px 0 0 !important; padding: 8px 10px; border-radius: 7px; background: var(--accent); color: var(--ink) !important; }
html[data-theme="dark"] .user-access-option:has(input:checked) { background: color-mix(in srgb, var(--area-ink) 24%, var(--surface)); border-color: color-mix(in srgb, var(--area-ink) 70%, white); }
html[data-theme="dark"] .password-pending { background: #4a361e; color: #ffd99c; }
@media(max-width:650px){.user-access-grid{grid-template-columns:1fr}}

/* En planillas, los nombres de clientes se presentan como razones sociales. */
.monthly-table td.name-col a,
.candidate-list .candidate-name,
.receipt-table .client-name a,
.receipt-dialog-row strong,
.receipt-result-clients .history-table td:first-child a,
#receipt-dialog .history-table td:first-child a,
.at-table .at-client-link > span:first-child,
.at-choice-list .at-choice strong,
.rel-table .rel-employer-cell strong,
.sv-employer-name a {
  text-transform: uppercase;
}

/* Sistema visual 2026: escritorio contable compacto, claro y consistente. */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --ink: #18394c;
  --muted: #647f8d;
  --green: #176f9d;
  --light: #f1f7fa;
  --line: #d4e3eb;
  --accent: #e4f4fb;
  --brand-orange: #f1763f;
  --page: #f4f8fa;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --surface-3: #edf5f8;
  --field: #ffffff;
  --shadow: 0 8px 24px rgba(30, 74, 98, .07);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8f4f8;
  --muted: #9bb5c0;
  --green: #63b8df;
  --light: #172b34;
  --line: #2b4652;
  --accent: #173b4d;
  --brand-orange: #f08a5c;
  --page: #0c1b22;
  --surface: #12262f;
  --surface-2: #172f39;
  --surface-3: #1d3945;
  --field: #10232c;
  --shadow: 0 12px 32px rgba(0, 0, 0, .24);
}

html { background: var(--page); }
body {
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI Variable Text", "Segoe UI", Aptos, Arial, sans-serif;
  text-rendering: optimizeLegibility;
}
h1 { font-size: clamp(25px, 2.25vw, 32px); font-weight: 720; letter-spacing: -.035em; }
h2 { font-weight: 700; letter-spacing: -.012em; }
small,.muted { color: var(--muted); }
a { color: var(--green); }
a:hover { color: color-mix(in srgb, var(--green) 78%, var(--ink)); }
button,input,select,textarea { font-family: inherit; }
button {
  border-color: var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 1px rgba(21, 54, 70, .03);
}
button:hover { background: var(--surface-3); }
button.primary { border-color: #176f9d; background: #176f9d; color: #fff; box-shadow: 0 3px 9px rgba(23, 111, 157, .16); }
button.primary:hover { background: #125d86; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline: 2px solid #56acd4;
  outline-offset: 2px;
}
input,select,textarea {
  border-color: var(--line);
  background: var(--field);
  color: var(--ink);
}
input::placeholder,textarea::placeholder { color: color-mix(in srgb, var(--muted) 76%, transparent); }
input:focus,select:focus,textarea:focus { border-color: #5cadcf; outline: 2px solid color-mix(in srgb, #5cadcf 30%, transparent); }

.sidebar {
  width: 216px;
  padding: 18px 14px 16px;
  border-right-color: var(--line);
  background: #eaf5fa;
}
.workspace { margin-left: 216px; }
.brand-crop { height: 116px; border-radius: 0; box-shadow: none; }
.sidebar-label { margin: 21px 8px 7px; color: #54798d; font-size: 9px; letter-spacing: 1.25px; }
.nav-item { min-height: 37px; margin: 1px 0; padding: 8px 9px; border-radius: 7px; color: #42687c; }
.nav-item:hover { background: rgba(255,255,255,.58); }
.nav-item.selected { background: #d8edf7; color: #145f86; box-shadow: inset 3px 0 0 #1c7eaa; }
.saved-nav { margin-top: 13px; }
.monthly-sidebar-links { gap: 7px; }
.monthly-sidebar-item { padding: 6px 7px; }
.monthly-kind-dot { height: 25px; }
.sidebar-bottom { line-height: 1.35; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 54px;
  padding: 0 24px;
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--muted);
  backdrop-filter: blur(14px);
}
.topbar strong { color: var(--ink); }
.user-menu { gap: 11px; }
.user-menu>a { font-weight: 650; }
.user-menu form { margin: 0; }
.text-button { color: var(--muted); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 8px 4px 5px;
  border-color: var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
  font-size: 10px;
  font-weight: 700;
}
.theme-toggle:hover { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); background: var(--surface-3); color: var(--ink); }
.theme-toggle:disabled { cursor: wait; opacity: .72; }
.theme-toggle-track { position: relative; display: inline-flex; width: 31px; height: 18px; border-radius: 999px; background: #d4e5ed; box-shadow: inset 0 0 0 1px rgba(37,91,116,.08); transition: background .18s ease; }
.theme-toggle-thumb { position: absolute; top: 2px; left: 2px; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: #fff; color: #2c6e8d; box-shadow: 0 1px 4px rgba(21,52,68,.28); transition: transform .18s ease,background .18s ease,color .18s ease; }
.theme-toggle-thumb>span { grid-area: 1/1; font-size: 10px; line-height: 1; }
.theme-icon-light { display: none; }
html[data-theme="dark"] .theme-toggle-track { background: #315a6b; }
html[data-theme="dark"] .theme-toggle-thumb { transform: translateX(13px); background: #f5d8a3; color: #72531f; }
html[data-theme="dark"] .theme-icon-light { display: block; }
html[data-theme="dark"] .theme-icon-dark { display: none; }

.facet-nav {
  grid-template-columns: repeat(7,minmax(0,1fr));
  gap: 6px;
  padding: 8px 24px 9px;
  border-bottom-color: var(--line);
  background: var(--surface);
}
.facet-tab {
  min-height: 48px;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  box-shadow: none;
}
.facet-tab:hover { transform: none; box-shadow: inset 0 0 0 1px var(--facet-ink); }
.facet-tab.active { box-shadow: inset 3px 0 0 var(--facet-ink); }
.facet-icon { flex-basis: 27px; width: 27px; height: 27px; border-radius: 7px; font-size: 14px; }
.facet-tab strong { font-size: 12px; }
.facet-tab small { margin-top: 2px; font-size: 8px; }

/* Alta de clientes: RUT y Clave SII son el primer bloque operativo. */
.client-create-priority { display:grid; grid-template-columns:minmax(180px,.75fr) minmax(250px,1.25fr); gap:10px; margin:0 0 15px; padding:12px; border:1px solid #acd3e5; border-left:4px solid #277ca6; border-radius:9px; background:#edf8fd; }
.client-create-priority>.field>span:first-child { display:flex; align-items:center; gap:6px; color:#225f7e; font-weight:800; }
.client-create-priority>.field>span:first-child b { display:inline-grid; place-items:center; width:18px; height:18px; border-radius:50%; background:#277ca6; color:#fff; font-size:9px; }
.client-create-priority input { width:100%; border-color:#9fc9dd; background:#fff; }
.client-create-priority>.field>.secret-editor { display:grid; grid-template-columns:minmax(0,1fr) 31px; gap:5px; }
.client-create-priority .reveal-input { display:grid; place-items:center; width:31px; padding:0; border-color:#9fc9dd; background:#f7fcff; color:#236e93; }
.client-create-priority>small { grid-column:1/-1; margin-top:-2px; color:#577d90; font-size:9px; }

.workspace main#main { padding: 19px 24px; }
.page-heading { margin-bottom: 15px; }
.page-heading p { margin-bottom: 6px; }
.eyebrow { color: #357c9f; font-size: 9px; letter-spacing: 1.25px; }
.tax-quick-access {
  display: grid;
  grid-template-columns: 165px minmax(0,1fr);
  gap: 13px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid #cfe3ee;
  border-radius: 9px;
  background: linear-gradient(110deg,#eef8fc,var(--surface) 46%);
}
.tax-quick-heading { display: flex; flex-direction: column; justify-content: center; padding: 2px 5px; }
.tax-quick-heading .eyebrow { margin: 0 0 2px; }
.tax-quick-heading h2 { margin: 0; font-size: 15px; }
.tax-quick-heading>a { margin-top: 5px; font-size: 10px; font-weight: 700; }
.tax-quick-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.tax-quick-card {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #cfe3ee;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.tax-quick-card:hover { border-color: #69afd0; background: #f3faff; color: var(--ink); }
.tax-quick-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #dff1f8; color: #176f9d; font-size: 20px; }
.tax-quick-card.kind-imposiciones .tax-quick-icon { background: #e4ecf8; color: #526f9e; }
.tax-quick-copy { display: grid; min-width: 0; line-height: 1.25; }
.tax-quick-copy strong { overflow: hidden; color:#176b98; font-size: 17px; line-height:1.1; text-overflow: ellipsis; white-space: nowrap; }
.tax-quick-card.kind-imposiciones .tax-quick-copy strong { color:#526f9e; }
.tax-quick-copy .monthly-quick-period { margin-top: 4px; color: var(--ink); font-size: 11px; font-weight:700; }
.tax-quick-copy small { margin-top:3px; color: var(--muted); font-size: 9px; font-weight:500; }
.tax-quick-card>b { color: #6c9fba; font-size: 20px; font-weight: 400; }
.stats { gap: 8px; margin-bottom: 14px; grid-template-columns: repeat(12,minmax(0,1fr)); }
.stats > .stat { grid-column: span 3; }
.stats:has(> :nth-child(7):last-child) > .stat { grid-column: span 3; }
.stats:has(> :nth-child(7):last-child) > :nth-child(n+5) { grid-column: span 4; }
.stat {
  min-height: 82px;
  padding: 11px 13px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(29,75,99,.04);
}
.stat-label { color: var(--muted); font-size: 11px; }
.stat-value { margin-top: 2px; color: var(--ink); font-size: 23px; font-variant-numeric: tabular-nums; }
.stat-icon { width: 34px; height: 34px; border-radius: 8px; background: #e3f2f8; color: #26779c; font-size: 16px; }
.stat-button:hover,.stat-button.selected { border-color: #d9897f; background: #fff5f3; }
.stat-warning { background: #fff2f0; }
.stat-attention { background: #fff8e8!important; }

.table-card,.card,.detail-card,.monthly-card,.facet-module,.facet-client-card,.receipt-card,.receipt-toolbar-card,.severance {
  border-color: var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 2px 9px rgba(24,70,94,.045);
}
.table-title { padding: 14px 16px; }
.toolbar { padding: 0 16px 11px; }
.search,.monthly-search,.receipt-search,.facet-client-search { border-color: var(--line); background: var(--surface-2); }
.search input,.monthly-search input,.receipt-search input,.facet-client-search input { background: transparent; }
.table-scroll { max-height: 67vh; }
th { padding: 8px 11px; border-color: var(--line); background: var(--surface-3); color: var(--muted); }
td { height: 40px; padding: 7px 11px; border-bottom-color: color-mix(in srgb,var(--line) 66%,transparent); }
tbody tr:hover { background: color-mix(in srgb,var(--surface-3) 72%,transparent); }
.table-footer,.client-pagination { border-color: var(--line); color: var(--muted); }
.app-footer { color: var(--muted); }

dialog,#client-dialog,#receipt-dialog,.sv-dialog { border-color: var(--line); background: var(--surface); color: var(--ink); }
.modal-header,.receipt-dialog-header { border-color: var(--line); background: var(--surface-2); }
.checks,.multiple-setting { border-color: var(--line); background: var(--surface-2); }
#toast,.copy-toast,#receipt-toast { border-color: color-mix(in srgb,var(--green) 45%,var(--line)); background: #145f86; color: #fff; }

.client-tabs,.client-section-nav { top: 59px; border-color: var(--line); background: color-mix(in srgb,var(--surface) 94%,transparent); box-shadow: var(--shadow); }
.client-tabs button { color: var(--muted); }
.client-tabs button:hover,.client-section-nav a:hover,.client-section-nav a:focus { background: var(--surface-3); color: var(--ink); }
.client-tabs button.active { border-color: #69afd0; background: #dff1f8; color: #145e83; }
.credentials-table,.classification-editor,.tax-table-scroll,.debt-table-scroll,.owner-projection,.compliance-check-list { border-color: var(--line); }
.credentials-head,.tax-summary-table thead th,.owner-projection-title { background: var(--surface-3); color: var(--muted); }
.classification-editor-row,.credentials-row,.page-relation,.related-row,.page-audit,.tax-summary-table th,.tax-summary-table td,.owner-projection th,.owner-projection td { border-color: var(--line); }
.relation-editor-row,.tax-preview-groups label,.tax-preview-relations p { border-color: var(--line); background: var(--surface-2); }
.data-save-bar,.compliance-print-bar { border-color: color-mix(in srgb,var(--green) 36%,var(--line)); background: color-mix(in srgb,var(--surface) 94%,transparent); }
.projection-inputs input,.projection-options input { border-color: var(--line); background: var(--field); color: var(--ink); }
.projection-options .projection-check,.projection-breakdown>div,.tax-preview-groups label,.tax-preview-relations p { background: var(--surface-2); }
.projection-breakdown { border-color: var(--line); background: var(--line); }
.projection-result { background: #e1f2f8!important; }

.monthly-card { padding: 13px 16px; margin-bottom: 12px; }
.monthly-overview,.monthly-period-group,.monthly-sheet-card,.candidate-row,.monthly-table-scroll,.progress-panel { border-color: var(--line); }
.monthly-overview { background: linear-gradient(120deg,var(--surface),var(--surface-3)); }
.monthly-period-group { background: var(--surface-2); }
.monthly-period-heading,.monthly-table th { border-color: var(--line); background: var(--surface-3); }
.monthly-sheet-card,.candidate-row,.progress-panel { background: var(--surface); }
.monthly-sheet-card:hover,.candidate-row:hover { background: var(--surface-2); }
.monthly-table td { border-bottom-color: var(--line); }
.monthly-table .name-col { background: var(--surface); }
.monthly-table th.name-col { background: var(--surface-3); }
.monthly-table tbody tr:hover .name-col { background: var(--surface-2); }
.monthly-table .monthly-input:focus,.monthly-table .monthly-select:focus { background-color: var(--field); }
.monthly-table .row-menu-popover { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow); }
body.sheet-focus-mode { background: var(--page); }

.facet-hero,.receipt-hero { border-radius: 10px; box-shadow: none; }
.facet-hero { padding: 18px 21px; background: linear-gradient(110deg,var(--facet-soft),var(--surface) 78%); }
.facet-hero-mark { width: 52px; height: 52px; border-radius: 13px; box-shadow: none; }
.facet-module,.facet-client-card { padding: 16px 18px; margin-bottom: 12px; }
.parameter-preview>div,.future-grid article,.tax-tool-history,.tax-history-row,.receipt-history-card,.receipt-result-grid>span { border-color: var(--line); background: var(--surface-2); }
.facet-client-row,.tax-history-row { border-color: var(--line); }
.facet-client-row:hover { background: var(--surface-2); }
.calculator-value,.accounting-tab,.severance-summary { border-color: var(--line); background: var(--surface); }
.calculator-value input,.tax-tool-form select,.tax-tool-form input,.severance-fields input,.severance-criteria-grid select { border-color: var(--line); background: var(--field); color: var(--ink); }
.severance-switches>label { border-color: var(--line); background: var(--surface-2); }
.service-years-strip { background: color-mix(in srgb,var(--facet-soft) 55%,var(--surface)); }
.severance-summary header { background: color-mix(in srgb,var(--facet-soft) 72%,var(--surface)); }
.severance-summary dl>div { border-color: var(--line); }

.receipt-hero { padding: 17px 20px; background: linear-gradient(110deg,var(--facet-soft),var(--surface) 78%); }
.receipt-period,.receipt-job,.receipt-history-card,.receipt-result-grid>span,.receipt-result-detail { border-color: var(--line); background: var(--surface-2); }
.receipt-table-scroll,.receipt-dialog-list { border-color: var(--line); }
.receipt-table th { background: color-mix(in srgb,#e5f6f2 76%,var(--surface)); color: #315f59; }
.receipt-table td { border-color: var(--line); }
.receipt-menu div { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow); }

#assistant-panel { border-color: var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#assistant-panel header { border-color: var(--line); background: var(--surface-3); }
#assistant-form { border-color: var(--line); }
.assistant-example { border-color: var(--line); background: var(--surface); }

html[data-theme="dark"] body { background: var(--page); color: var(--ink); }
html[data-theme="dark"] .brand-image-light { display: none; }
html[data-theme="dark"] .brand-image-dark { display: block; }
html[data-theme="dark"] .sidebar { border-color: var(--line); background: #102630; }
html[data-theme="dark"] .topbar,html[data-theme="dark"] .facet-nav { border-color: var(--line); background: color-mix(in srgb,var(--surface) 94%,transparent); }
html[data-theme="dark"] .nav-item { color: #a9c7d4; }
html[data-theme="dark"] .nav-item:hover { background: rgba(111,184,216,.08); }
html[data-theme="dark"] .nav-item.selected { background: #173d4d; color: #dff5ff; box-shadow: inset 3px 0 0 #5ab6df; }
html[data-theme="dark"] .sidebar-label,html[data-theme="dark"] .sidebar-bottom { color: #87acbd; }
html[data-theme="dark"] .monthly-sidebar-heading,html[data-theme="dark"] .monthly-period-heading { color: var(--muted); }
html[data-theme="dark"] .monthly-sidebar-item { color: #b8d3de; }
html[data-theme="dark"] .monthly-sidebar-copy small { color: #8eafbd; }
html[data-theme="dark"] .monthly-sidebar-item:hover,html[data-theme="dark"] .monthly-sidebar-item.selected { border-color: var(--line); background: var(--surface-3); color: var(--ink); box-shadow: none; }
html[data-theme="dark"] .tax-quick-access { border-color: var(--line); background: linear-gradient(110deg,#143542,var(--surface) 52%); }
html[data-theme="dark"] .tax-quick-card { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
html[data-theme="dark"] .tax-quick-card:hover { border-color: #4e8ba6; background: var(--surface-3); color: var(--ink); }
html[data-theme="dark"] .tax-quick-icon { background: #193d4d; color: #9fdcf3; }
html[data-theme="dark"] .tax-quick-card.kind-imposiciones .tax-quick-icon { background: #203651; color: #c4d9f7; }
html[data-theme="dark"] .tax-quick-copy strong { color:#9fdcf3; }
html[data-theme="dark"] .tax-quick-card.kind-imposiciones .tax-quick-copy strong { color:#c4d9f7; }
html[data-theme="dark"] .client-create-priority { border-color:#355e70; border-left-color:#67b5d7; background:#173441; }
html[data-theme="dark"] .client-create-priority>.field>span:first-child { color:#b9e2f2; }
html[data-theme="dark"] .client-create-priority>.field>span:first-child b { background:#67b5d7; color:#102b37; }
html[data-theme="dark"] .client-create-priority input { border-color:#466879; background:var(--field); color:var(--ink); }
html[data-theme="dark"] .client-create-priority .reveal-input { border-color:#466879; background:var(--surface-2); color:#b9e2f2; }
html[data-theme="dark"] .client-create-priority>small { color:#94b8c8; }
html[data-theme="dark"] .priority-glance-item,html[data-theme="dark"] .priority-fields { border-color:#355e70; border-left-color:#67b5d7; background:#173441; color:#b9e2f2; }
html[data-theme="dark"] .priority-glance-item>span:first-child { color:#8fb7c8; }
html[data-theme="dark"] .priority-glance-secret input { color:#d7f0fa; }
html[data-theme="dark"] .priority-field>span:first-child { color:#b9e2f2; }
html[data-theme="dark"] .priority-field>span:first-child b { background:#67b5d7; color:#102b37; }
html[data-theme="dark"] .priority-field input { border-color:#466879; background:var(--field); color:var(--ink); }
html[data-theme="dark"] .credential-managed-above { background:var(--surface-3); color:var(--muted); }

html[data-theme="dark"] body:has(.facet-database.active){--area-accent:#9bc5d5;--area-deep:#e4f4fa;--area-soft:#20343d;--area-sidebar:#192a31;--area-border:#3e5a66;--area-bot:#203239;--area-user:#29434e}
html[data-theme="dark"] body:has(.facet-monthly.active){--area-accent:#62b8df;--area-deep:#d8f3ff;--area-soft:#173846;--area-sidebar:#102832;--area-border:#315567;--area-bot:#163541;--area-user:#1d4758}
html[data-theme="dark"] body:has(.facet-tax.active),html[data-theme="dark"] body:has(.facet-accounting.active){--area-accent:#d2b66e;--area-deep:#f4e6bd;--area-soft:#39331f;--area-sidebar:#29271d;--area-border:#5c5233;--area-bot:#332f20;--area-user:#493f24}
html[data-theme="dark"] body:has(.facet-receipts.active){--area-accent:#79c8ba;--area-deep:#ddfaf4;--area-soft:#173a36;--area-sidebar:#142b29;--area-border:#315d56;--area-bot:#183632;--area-user:#214940}
html[data-theme="dark"] body:has(.facet-labor.active){--area-accent:#b8a1e2;--area-deep:#f1eaff;--area-soft:#302842;--area-sidebar:#251f31;--area-border:#51436c;--area-bot:#2b2639;--area-user:#3b3150}
html[data-theme="dark"] body:has(.facet-fees.active){--area-accent:#e0a17e;--area-deep:#ffe9dc;--area-soft:#422b23;--area-sidebar:#30221d;--area-border:#68483a;--area-bot:#39271f;--area-user:#503326}
html[data-theme="dark"] body:has(.facet-tools.active){--area-accent:#91cfa2;--area-deep:#e1f9e7;--area-soft:#203a28;--area-sidebar:#1a2d20;--area-border:#3a5d43;--area-bot:#203528;--area-user:#294731}
html[data-theme="dark"] .facet-database{--facet-bg:#20343d;--facet-border:#3e5a66;--facet-ink:#9bc5d5}
html[data-theme="dark"] .facet-monthly{--facet-bg:#173846;--facet-border:#315567;--facet-ink:#8dd4f1}
html[data-theme="dark"] .facet-tax,html[data-theme="dark"] .facet-accounting{--facet-bg:#39331f;--facet-border:#5c5233;--facet-ink:#d2b66e}
html[data-theme="dark"] .facet-receipts{--facet-bg:#173a36;--facet-border:#315d56;--facet-ink:#79c8ba}
html[data-theme="dark"] .facet-labor{--facet-bg:#302842;--facet-border:#51436c;--facet-ink:#b8a1e2}
html[data-theme="dark"] .facet-fees{--facet-bg:#422b23;--facet-border:#68483a;--facet-ink:#e0a17e}
html[data-theme="dark"] .facet-tools{--facet-bg:#203a28;--facet-border:#3a5d43;--facet-ink:#91cfa2}
html[data-theme="dark"] .facet-icon,html[data-theme="dark"] .facet-hero-mark { background: rgba(255,255,255,.06); }
html[data-theme="dark"] .facet-hero,
html[data-theme="dark"] .receipt-hero {
  border-color: var(--area-border,var(--line));
  background: linear-gradient(110deg,var(--area-soft,var(--surface-3)),var(--surface) 78%);
  color: var(--ink);
}
html[data-theme="dark"] .facet-hero h1,
html[data-theme="dark"] .receipt-hero h1 { color: var(--area-deep,var(--ink)); }
html[data-theme="dark"] .facet-hero .eyebrow,
html[data-theme="dark"] .receipt-hero .eyebrow,
html[data-theme="dark"] .facet-hero-mark,
html[data-theme="dark"] .receipt-period strong { color: var(--area-accent,var(--green)); }
html[data-theme="dark"] .facet-hero p:last-child,
html[data-theme="dark"] .receipt-hero p:last-child { color: var(--muted); }

html[data-theme="dark"] :is(.table-card,.card,.detail-card,.monthly-card,.monthly-sheet-card,.facet-module,.facet-client-card,.receipt-card,.receipt-toolbar-card,.severance,dialog,#client-dialog,#receipt-dialog,.sv-dialog,.progress-panel) { border-color: var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
html[data-theme="dark"] :is(.stat,.parameter-preview>div,.future-grid article,.candidate-row,.receipt-history-card,.receipt-result-grid>span,.relation-editor-row,.tax-preview-groups label,.tax-preview-relations p,.owner-projection) { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
html[data-theme="dark"] .candidate-row :is(.independent-add,.household-add) { border-color: var(--line); background: var(--surface-3); color: var(--ink); }
html[data-theme="dark"] :is(.search,.monthly-search,.receipt-search,.facet-client-search,.checks,.multiple-setting,.classification-editor,.credentials-table,.tax-table-scroll,.debt-table-scroll,.monthly-period-group,.monthly-table-scroll,.receipt-table-scroll,.receipt-dialog-list,.tax-tool-history,.compliance-check-list) { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
html[data-theme="dark"] :is(.modal-header,.receipt-dialog-header,.credentials-head,.tax-summary-table thead th,.owner-projection-title,.monthly-period-heading,.monthly-table th,.receipt-table th,.sv-columns,.tax-tool-history>summary) { border-color: var(--line); background: var(--surface-3); color: var(--muted); }
html[data-theme="dark"] :is(.classification-editor-row,.credentials-row,.facet-client-row,.tax-history-row,.receipt-dialog-row,.history-table th,.history-table td,.page-relation,.related-row,.page-audit,.receipt-table td,.monthly-table td,.tax-summary-table th,.tax-summary-table td,.owner-projection th,.owner-projection td) { border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] td .client-name,
html[data-theme="dark"] td .client-name a { color: #a9dff3; }
html[data-theme="dark"] tbody tr:hover,html[data-theme="dark"] .facet-client-row:hover,html[data-theme="dark"] .candidate-row:hover,html[data-theme="dark"] .monthly-sheet-card:hover { background: var(--surface-3); }
html[data-theme="dark"] .monthly-table .name-col { background: var(--surface); }
html[data-theme="dark"] .monthly-table th.name-col { background: var(--surface-3); }
html[data-theme="dark"] .monthly-table tbody tr:hover .name-col { background: var(--surface-2); }
html[data-theme="dark"] .monthly-row-sky td,html[data-theme="dark"] .monthly-row-sky .name-col{background:#142f3a}
html[data-theme="dark"] .monthly-row-blue td,html[data-theme="dark"] .monthly-row-blue .name-col{background:#182c3e}
html[data-theme="dark"] .monthly-row-teal td,html[data-theme="dark"] .monthly-row-teal .name-col{background:#163630}
html[data-theme="dark"] .monthly-row-green td,html[data-theme="dark"] .monthly-row-green .name-col{background:#193329}
html[data-theme="dark"] .monthly-row-olive td,html[data-theme="dark"] .monthly-row-olive .name-col{background:#303323}
html[data-theme="dark"] .monthly-row-sand td,html[data-theme="dark"] .monthly-row-sand .name-col{background:#352f24}
html[data-theme="dark"] .monthly-row-amber td,html[data-theme="dark"] .monthly-row-amber .name-col{background:#3a3020}
html[data-theme="dark"] .monthly-row-coral td,html[data-theme="dark"] .monthly-row-coral .name-col{background:#3a2926}
html[data-theme="dark"] .monthly-row-rose td,html[data-theme="dark"] .monthly-row-rose .name-col{background:#392731}
html[data-theme="dark"] .monthly-row-lavender td,html[data-theme="dark"] .monthly-row-lavender .name-col{background:#302a40}
html[data-theme="dark"] .monthly-table :is(.monthly-input,.monthly-select) { color: var(--ink); }
html[data-theme="dark"] .monthly-table :is(.monthly-input,.monthly-select):focus { background: var(--field); }
html[data-theme="dark"] .monthly-table .row-menu-popover,html[data-theme="dark"] .receipt-menu div { border-color: var(--line); background: var(--surface); }

html[data-theme="dark"] .stat-warning { border-color: #633e3c; background: #382526; }
html[data-theme="dark"] .stat-attention { border-color: #665738!important; background: #352f20!important; }
html[data-theme="dark"] .stat-button:hover,html[data-theme="dark"] .stat-button.selected { border-color: #87534a; background: #392727; }
html[data-theme="dark"] .tax-status { background: #18372a; color: #9ed9b2; }
html[data-theme="dark"] .tax-status.has-issues { background: #412726; color: #f2aaa3; }
html[data-theme="dark"] :is(.error,.tax-refresh-error,.tax-preview-alert,.folder-observations,#monthly-message.error,#sheet-message.error,#receipt-message.error) { background: #402724; color: #f0aaa1; }
html[data-theme="dark"] :is(.notice,#monthly-message,#sheet-message,.tgr-generation-status,.tgr-official-statement,.reconciliation-note) { background: #163747; color: #a9d9ec; }
html[data-theme="dark"] :is(.receipt-warning,.projection-note,.projection-disclaimer,.tax-preview-note) { border-color: #66573b; background: #372f20!important; color: #e3ca8b; }
html[data-theme="dark"] .projection-result { background: #173b49!important; color: #b9e5f5; }
html[data-theme="dark"] .projection-breakdown { border-color: var(--line); background: var(--line); }
html[data-theme="dark"] .projection-breakdown>div,html[data-theme="dark"] .projection-options .projection-check { background: var(--surface-2); color: var(--ink); }
html[data-theme="dark"] .tax-summary-table .tax-period-missing { background: #182a32; color: var(--muted); }
html[data-theme="dark"] .tax-summary-table tfoot th { background: #173846; color: #a7d9ed; }
html[data-theme="dark"] .receipt-table tr.status-success td { background: #183329; }
html[data-theme="dark"] .receipt-table tr.status-interrupted td { background: #392f20; }
html[data-theme="dark"] .receipt-table tr.status-processing td { background: #173735; }
html[data-theme="dark"] .receipt-table tbody tr:hover td { box-shadow: inset 0 0 0 9999px rgba(120,199,186,.05); }
html[data-theme="dark"] .sv-employer { background: linear-gradient(var(--surface-2),var(--surface-3)); }
html[data-theme="dark"] .sv-children { background: var(--surface); }
html[data-theme="dark"] .sv-totals { border-color: var(--line); background: var(--surface-2); }
html[data-theme="dark"] .sv-totals>div,html[data-theme="dark"] .sv-group+.sv-group { border-color: var(--line); }

html[data-theme="dark"] .option-color-sky{background:#193d4d;color:#b8e6f7}
html[data-theme="dark"] .option-color-blue{background:#203651;color:#c9dafa}
html[data-theme="dark"] .option-color-teal{background:#183f3a;color:#b8e7df}
html[data-theme="dark"] .option-color-green{background:#213b2b;color:#c0e4c8}
html[data-theme="dark"] .option-color-olive{background:#363b24;color:#dfe6aa}
html[data-theme="dark"] .option-color-sand{background:#403724;color:#ead6aa}
html[data-theme="dark"] .option-color-amber{background:#44351f;color:#f5cf8a}
html[data-theme="dark"] .option-color-coral{background:#452d27;color:#f0b7a7}
html[data-theme="dark"] .option-color-rose{background:#452a37;color:#efb6cf}
html[data-theme="dark"] .option-color-lavender{background:#382f4b;color:#d5c5f2}

html[data-theme="dark"] #assistant-panel { border-color: var(--area-border,var(--line)); background: var(--surface); color: var(--ink); }
html[data-theme="dark"] #assistant-panel header { background: var(--area-soft,var(--surface-3)); border-color: var(--line); }
html[data-theme="dark"] .assistant-message.bot { background: var(--area-bot,var(--surface-2)); color: var(--ink); }
html[data-theme="dark"] .assistant-message.user { background: var(--area-user,#1d4758); color: var(--ink); }
html[data-theme="dark"] .assistant-message.bot strong { color: var(--ink); }
html[data-theme="dark"] .assistant-example { border-color: var(--line); background: var(--surface-2); color: var(--ink); }

@media(max-width:1180px){
  .sidebar{width:202px;padding-inline:12px}.workspace{margin-left:202px}
  .facet-nav{display:flex;overflow-x:auto;padding-inline:18px}
  .facet-tab{flex:0 0 158px;gap:6px;padding-inline:7px}.facet-tab strong{font-size:11px}.facet-tab small{display:flex}.facet-icon{flex-basis:25px;width:25px;height:25px}
  .workspace main#main{padding-inline:18px}
}

/* IVA e Imposiciones: bandas de estado un poco más presentes, aún en tono pastel. */
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-sky td,
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-sky .name-col { background: #e4f5fc; }
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-blue td,
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-blue .name-col { background: #e7f0fb; }
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-teal td,
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-teal .name-col { background: #e5f7f4; }
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-green td,
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-green .name-col { background: #eaf5ea; }
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-olive td,
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-olive .name-col { background: #f2f5dd; }
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-sand td,
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-sand .name-col { background: #f7eedf; }
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-amber td,
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-amber .name-col { background: #ffedcd; }
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-coral td,
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-coral .name-col { background: #f9e3dc; }
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-rose td,
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-rose .name-col { background: #f7e1eb; }
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-lavender td,
.monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-lavender .name-col { background: #ece5f8; }
.monthly-main[data-kind="imposiciones"] .monthly-row-gray td,
.monthly-main[data-kind="imposiciones"] .monthly-row-gray .name-col { background: #edf1f3; }
.monthly-main[data-kind="imposiciones"] .choice-camouflaged:not(:focus) {
  border-color: transparent;
  background: transparent;
  color: transparent;
  box-shadow: none;
}
.monthly-main[data-kind="imposiciones"] .choice-camouflaged:not(:focus) option { color: var(--ink); background: var(--field); }
.monthly-main[data-kind="imposiciones"] .choice-camouflaged:hover { border-color: color-mix(in srgb,var(--muted) 22%,transparent); }
.monthly-main[data-kind="imposiciones"] .choice-camouflaged:focus { color: var(--ink); }
.monthly-main[data-kind="imposiciones"] .dnp-send-yes { font-weight: 750; box-shadow: inset 3px 0 0 color-mix(in srgb,currentColor 55%,transparent); }
.monthly-main[data-kind="imposiciones"] .dnp-status-pending {
  border-color: #c68b2b;
  background: #ffe2a8;
  color: #674208;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(198,139,43,.2), inset 3px 0 0 #c18422;
}
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-sky td,
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-sky .name-col { background: #123642; }
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-blue td,
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-blue .name-col { background: #152f45; }
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-teal td,
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-teal .name-col { background: #123d35; }
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-green td,
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-green .name-col { background: #153a28; }
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-olive td,
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-olive .name-col { background: #34391d; }
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-sand td,
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-sand .name-col { background: #3b3220; }
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-amber td,
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-amber .name-col { background: #423316; }
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-coral td,
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-coral .name-col { background: #422621; }
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-rose td,
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-rose .name-col { background: #41232f; }
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-lavender td,
html[data-theme="dark"] .monthly-main:is([data-kind="iva"],[data-kind="imposiciones"]) .monthly-row-lavender .name-col { background: #342946; }
html[data-theme="dark"] .monthly-main[data-kind="imposiciones"] .monthly-row-gray td,
html[data-theme="dark"] .monthly-main[data-kind="imposiciones"] .monthly-row-gray .name-col { background: #2b3439; }
html[data-theme="dark"] .monthly-select.option-color-gray { background: #38444a; color: #d5e0e5; }
html[data-theme="dark"] .monthly-main[data-kind="imposiciones"] .dnp-status-pending {
  border-color: #e1ad54;
  background: #5a401c;
  color: #ffe2a8;
  box-shadow: 0 0 0 2px rgba(225,173,84,.25), inset 3px 0 0 #e1ad54;
}
@media(max-width:820px){
  .facet-nav{display:flex;overflow-x:auto;padding:7px 12px}.facet-tab{flex:0 0 148px;min-height:50px}.facet-icon{display:none}
  .theme-toggle-label{display:none}.theme-toggle{padding-right:5px}
  .tax-quick-access{grid-template-columns:1fr}.tax-quick-heading{align-items:center;flex-direction:row;justify-content:space-between}.tax-quick-heading>a{margin-top:0}.tax-quick-heading .eyebrow{display:none}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}.stats>.stat,.stats:has(>:nth-child(7):last-child)>.stat,.stats:has(>:nth-child(7):last-child)>:nth-child(n+5){grid-column:span 1}
}
@media(max-width:650px){
  .sidebar{width:100%;padding:10px 12px}.workspace{margin-left:0}
  .brand-crop{height:52px;width:78px}
  .topbar{height:50px;padding:0 12px}.topbar>span{max-width:46vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-menu{gap:6px}.user-menu>a{max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .workspace main#main{padding:15px 12px}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.stat{min-height:72px}
  .tax-quick-grid{grid-template-columns:1fr}
  .facet-nav{padding-top:6px}.page-heading{align-items:flex-start}
  .client-create-priority{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}
