/*
 * The Silvergre-style theme on top of the portal's own styles (loaded last):
 *   1. the dark theme's colours (html[data-theme="dark"], the default; tokens.css holds the light ones)
 *   2. glass panels and metric cards, buttons, inputs, tables, pill tabs and badges, menus, pop-ups
 *   3. the dark/light switch in the top bar
 *   4. motion: smooth colour changes, a press effect, panels fading up as a screen opens
 *   5. dark versions of the areas whose colours are written into screens.css, access.css and shell.css
 * The theme is chosen by js/tailwind-config.js before the page draws (saved per browser) and switched in the top bar.
 */

/* ─── 1. Dark theme colours ─── */
html[data-theme="dark"] {
  color-scheme: dark;
  --color-text: #e5e7eb;
  --color-text-strong: #f9fafb;
  --color-text-muted: #6b7280;
  --color-text-subtle: #9ca3af;
  --color-page: #0b0f17;
  --color-surface: #111827;
  --color-surface-raised: #111827;
  --color-surface-sunken: #0f1623;
  --color-control: #0d1320;
  --color-border: #1f2937;
  --color-border-strong: #374151;
  --color-border-header: rgb(31 41 55 / 80%);
  --color-border-input: #1f2937;
  --color-table-head: #0f1623;
  --color-table-head-border: #1f2937;
  --color-table-row-hover: rgb(20 184 166 / 8%);
  --color-row-line: rgb(255 255 255 / 5%);
  --color-header-bg: rgb(11 15 23 / 85%);

  --color-sidebar: #0b0f17;
  --color-sidebar-active: rgb(20 184 166 / 16%);
  --color-sidebar-hover: rgb(255 255 255 / 5%);
  --color-sidebar-text: #d1d5db;
  --color-sidebar-text-muted: #6b7280;
  --color-sidebar-text-active: #ffffff;
  --color-sidebar-line: rgb(255 255 255 / 8%);
  --color-sidebar-leaf: #94a3b8;
  --color-sidebar-search: rgb(255 255 255 / 6%);
  --color-sidebar-search-text: #e2e8f0;

  --color-success: #14b8a6;
  --color-success-strong: #2dd4bf;
  --color-success-soft: rgb(20 184 166 / 15%);
  --color-warning: #f59e0b;
  --color-warning-soft: rgb(245 158 11 / 14%);
  --color-danger: #f43f5e;
  --color-danger-soft: rgb(244 63 94 / 14%);
  --color-primary: #6366f1;
  --color-primary-soft: rgb(99 102 241 / 18%);
  --color-info: #0ea5e9;
  --color-info-soft: rgb(14 165 233 / 15%);
  --color-default: #6b7280;
  --color-default-soft: #1f2937;

  --shadow-card: 0 4px 32px rgb(0 0 0 / 40%), inset 0 1px 0 rgb(255 255 255 / 10%);
  --shadow-card-hover: 0 8px 40px rgb(0 0 0 / 50%), 0 0 0 1px rgb(20 184 166 / 12%), inset 0 1px 0 rgb(255 255 255 / 14%);
  --shadow-menu: 0 16px 40px rgb(0 0 0 / 55%);
  --shadow-modal: 0 24px 72px rgb(0 0 0 / 65%);
}

html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-sans);
}
html[data-theme="dark"] body {
  background: var(--color-page);
  color: var(--color-text);
}
::selection {
  background: var(--color-brand);
  color: #ffffff;
}

#app {
  position: relative;
  z-index: 1;
}

/* Thin scrollbars. */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #cbd5e1;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #374151;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* ─── 2. Glass panels and metric cards ─── */
.panel {
  border: 1px solid var(--color-border-strong);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.panel:hover {
  border-color: #94a3b8;
  box-shadow: var(--shadow-card-hover);
}
html[data-theme="dark"] .panel,
html[data-theme="dark"] .co-hero {
  border-color: rgb(255 255 255 / 13%);
  background: rgb(13 18 30 / 60%);
  backdrop-filter: blur(20px) saturate(180%) brightness(1.08);
  -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.08);
}
html[data-theme="dark"] .panel:hover {
  border-color: rgb(20 184 166 / 30%);
}
.panel-heading {
  min-height: 50px;
  padding: 10px 18px;
}
.panel-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.panel-body {
  padding: 18px;
}

/* Metric cards (dashboard and any screen that uses .metric-card). */
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 5%);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.2s var(--ease);
}
.metric-card:hover {
  border-color: var(--color-brand-strong);
  box-shadow: 0 4px 12px rgb(0 0 0 / 6%);
  transform: translateY(-2px);
}
html[data-theme="dark"] .metric-card {
  border-color: rgb(255 255 255 / 10%);
  background: rgb(25 35 52 / 50%);
  backdrop-filter: blur(16px) saturate(160%) brightness(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(160%) brightness(1.05);
  box-shadow: 0 2px 16px rgb(0 0 0 / 30%), inset 0 1px 0 rgb(255 255 255 / 8%);
}
html[data-theme="dark"] .metric-card:hover {
  border-color: rgb(20 184 166 / 35%);
  box-shadow: 0 8px 28px rgb(0 0 0 / 40%);
}
.metric-label {
  color: var(--color-text-subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.metric-value {
  color: var(--color-text-strong);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}
.metric-detail {
  color: var(--color-text-subtle);
  font-size: 11px;
}
.metric-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}
.metric-card[data-tone] {
  border-color: var(--tone-border);
}
.metric-card[data-tone] .metric-label,
.metric-card[data-tone] .metric-icon {
  color: var(--tone-text);
}
.metric-card[data-tone] .metric-icon {
  background: var(--tone-soft);
}
[data-tone="teal"] {
  --tone-text: #0f766e;
  --tone-soft: #ccfbf1;
  --tone-border: #99f6e4;
}
[data-tone="sky"] {
  --tone-text: #0369a1;
  --tone-soft: #e0f2fe;
  --tone-border: #bae6fd;
}
[data-tone="violet"] {
  --tone-text: #6b21a8;
  --tone-soft: #f3e8ff;
  --tone-border: #e9d5ff;
}
[data-tone="rose"] {
  --tone-text: #be123c;
  --tone-soft: #ffe4e6;
  --tone-border: #fecdd3;
}
[data-tone="amber"] {
  --tone-text: #b45309;
  --tone-soft: #fef3c7;
  --tone-border: #fde68a;
}
html[data-theme="dark"] [data-tone="teal"] {
  --tone-text: #5eead4;
  --tone-soft: rgb(20 184 166 / 15%);
  --tone-border: rgb(20 184 166 / 30%);
}
html[data-theme="dark"] [data-tone="sky"] {
  --tone-text: #7dd3fc;
  --tone-soft: rgb(14 165 233 / 15%);
  --tone-border: rgb(14 165 233 / 30%);
}
html[data-theme="dark"] [data-tone="violet"] {
  --tone-text: #d8b4fe;
  --tone-soft: rgb(168 85 247 / 15%);
  --tone-border: rgb(168 85 247 / 30%);
}
html[data-theme="dark"] [data-tone="rose"] {
  --tone-text: #fda4af;
  --tone-soft: rgb(244 63 94 / 15%);
  --tone-border: rgb(244 63 94 / 30%);
}
html[data-theme="dark"] [data-tone="amber"] {
  --tone-text: #fcd34d;
  --tone-soft: rgb(245 158 11 / 15%);
  --tone-border: rgb(245 158 11 / 30%);
}

/* ─── Buttons: rounded, bold, teal gradient for the main action ─── */
.btn {
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    opacity 0.2s var(--ease),
    transform 0.18s var(--ease);
}
.btn-md {
  padding: 8px 14px;
}
.btn:active:not(:disabled) {
  transform: scale(0.96);
  opacity: 0.88;
  transition-duration: 0.08s;
}
.btn-success {
  border-color: transparent;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
}
.btn-success:hover:not(:disabled) {
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  border-color: transparent;
}
.btn-primary {
  border-color: transparent;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
}
.btn-danger {
  border-color: transparent;
  background: linear-gradient(90deg, #e11d48, #f43f5e);
  box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
}
.btn-warning {
  border-color: transparent;
  background: linear-gradient(90deg, #d97706, #f59e0b);
  box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
}
.btn-info {
  border-color: transparent;
  background: linear-gradient(90deg, #0284c7, #0ea5e9);
}
html[data-theme="dark"] .btn-default {
  border-color: #374151;
  background: #1f2937;
  color: #d1d5db;
}
html[data-theme="dark"] .btn-default:hover:not(:disabled) {
  background: #374151;
  color: #ffffff;
}

/* ─── Inputs and drop-downs ─── */
.control {
  border-radius: var(--radius-md);
  font-size: 12px;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 5%);
}
html[data-theme="dark"] .control {
  border-color: #1f2937;
  background: #0d1320;
  color: #e5e7eb;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 30%);
}
html[data-theme="dark"] .control:disabled,
html[data-theme="dark"] .control[readonly] {
  background: #111827;
  color: #6b7280;
}
.control:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgb(20 184 166 / 20%);
}
html[data-theme="dark"] select.control option {
  background: #111827;
  color: #e5e7eb;
}
.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-subtle);
  letter-spacing: 0.01em;
}
.checkbox input {
  accent-color: var(--color-brand);
}

/* Drop-down menus: glass in the dark theme. */
.menu {
  border-radius: var(--radius-md);
  animation: pop-in 0.16s var(--ease-spring);
}
html[data-theme="dark"] .menu {
  border-color: rgb(255 255 255 / 10%);
  background: rgb(17 24 39 / 92%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
html[data-theme="dark"] .menu-item:hover:not(:disabled),
html[data-theme="dark"] .menu-item:focus-visible {
  background: rgb(20 184 166 / 12%);
  color: #ffffff;
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

/* ─── Tables ─── */
.table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
/* Compact rows: little padding, and buttons and badges in a cell no taller than its text. */
.table td {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.35;
}
.table th {
  padding: 7px 10px;
}
.table td .btn {
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 11px;
  box-shadow: none;
}
.table td .badge {
  padding: 1px 7px;
  font-size: 9.5px;
}
/* Action buttons in a row sit side by side, not stacked (stacked buttons doubled every row's height). */
.table td .row-actions {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.table td .inspect-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.table tbody tr td {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--color-brand);
}
html[data-theme="dark"] .table {
  background: transparent;
}
html[data-theme="dark"] .table th {
  background: rgb(15 22 35 / 80%);
  color: #9ca3af;
}
html[data-theme="dark"] .table td {
  color: #d1d5db;
}

/* ─── Pills: tabs as a segmented pill bar, badges as soft pills ─── */
.tab-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100% - 24px);
  margin: 10px 12px 0;
  padding: 4px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: #e2e8f0;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 6%);
}
.tab {
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #475569;
  font-size: 11px;
  font-weight: 500;
  transition: background-color 0.28s var(--ease-spring), color 0.25s var(--ease-spring), box-shadow 0.28s var(--ease-spring);
}
.tab:hover {
  background: rgb(255 255 255 / 60%);
  color: var(--color-text-strong);
}
.tab[aria-selected="true"] {
  border-color: var(--color-border-strong);
  background: #ffffff;
  color: var(--color-text-strong);
  font-weight: 700;
  box-shadow: 0 1px 3px rgb(0 0 0 / 10%), 0 1px 2px rgb(0 0 0 / 6%);
}
html[data-theme="dark"] .tab-list {
  border-color: rgb(31 41 55 / 90%);
  background: rgb(17 24 39 / 90%);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 35%);
}
html[data-theme="dark"] .tab {
  color: #9ca3af;
}
html[data-theme="dark"] .tab:hover {
  background: transparent;
  color: #e5e7eb;
}
html[data-theme="dark"] .tab[aria-selected="true"] {
  border-color: rgb(255 255 255 / 9%);
  background: #1f2937;
  color: #ffffff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 35%), inset 0 1px 0 rgb(255 255 255 / 8%);
}
.tab-panel {
  animation: fade-in 0.3s var(--ease) both;
}

.badge {
  padding: 2px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
}
html[data-theme="dark"] .badge-success {
  background: rgb(20 184 166 / 15%);
  color: #5eead4;
  box-shadow: inset 0 0 0 1px rgb(20 184 166 / 35%);
}
html[data-theme="dark"] .badge-warning {
  background: rgb(245 158 11 / 15%);
  color: #fcd34d;
  box-shadow: inset 0 0 0 1px rgb(245 158 11 / 35%);
}
html[data-theme="dark"] .badge-danger {
  background: rgb(244 63 94 / 15%);
  color: #fda4af;
  box-shadow: inset 0 0 0 1px rgb(244 63 94 / 35%);
}
html[data-theme="dark"] .badge-primary {
  background: rgb(99 102 241 / 18%);
  color: #a5b4fc;
  box-shadow: inset 0 0 0 1px rgb(99 102 241 / 35%);
}
html[data-theme="dark"] .badge-info {
  background: rgb(14 165 233 / 15%);
  color: #7dd3fc;
  box-shadow: inset 0 0 0 1px rgb(14 165 233 / 35%);
}
html[data-theme="dark"] .badge-default {
  background: #1f2937;
  color: #d1d5db;
  box-shadow: inset 0 0 0 1px #374151;
}

/* Alerts in the dark theme. */
html[data-theme="dark"] .alert-info {
  border-color: rgb(14 165 233 / 30%);
  border-left-color: #0ea5e9;
  background: rgb(14 165 233 / 10%);
  color: #bae6fd;
}
html[data-theme="dark"] .alert-success {
  border-color: rgb(20 184 166 / 30%);
  border-left-color: #14b8a6;
  background: rgb(20 184 166 / 10%);
  color: #99f6e4;
}
html[data-theme="dark"] .alert-warning {
  border-color: rgb(245 158 11 / 30%);
  border-left-color: #f59e0b;
  background: rgb(245 158 11 / 10%);
  color: #fde68a;
}
html[data-theme="dark"] .alert-danger {
  border-color: rgb(244 63 94 / 30%);
  border-left-color: #f43f5e;
  background: rgb(244 63 94 / 10%);
  color: #fecdd3;
}

/* Pop-ups. */
/* The pop-up fades in and its content slides up. Only the content moves: a moving pop-up would shift the drop-down
   lists opened inside it (ui/custom-select.js), which are placed on the screen, not in the pop-up. */
.modal {
  animation: fade-in 0.22s ease;
}
.modal-content {
  animation: modal-in 0.22s var(--ease-spring);
}
.modal-header {
  border-top-color: var(--color-brand);
}
html[data-theme="dark"] .modal {
  border: 1px solid rgb(255 255 255 / 10%);
  background: #111827;
}
html[data-theme="dark"] .modal-header {
  background: #111827;
}
html[data-theme="dark"] .modal-footer {
  background: #0f1623;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* Page heading. */
.page-title {
  font-size: 20px;
  font-weight: 700;
}

/* ─── Top bar and side menu in the theme ─── */
html[data-theme="dark"] .header {
  box-shadow: 0 4px 24px -2px rgb(0 0 0 / 45%);
}
html[data-theme="dark"] .header-brand .brand-name {
  color: #f9fafb;
}
html[data-theme="dark"] .header-toggle:hover,
html[data-theme="dark"] .user-button:hover,
html[data-theme="dark"] .user-button[aria-expanded="true"] {
  background: #1f2937;
}
.avatar {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #ffffff;
}
.sidebar {
  border-right: 1px solid var(--color-sidebar-line);
}
html[data-theme="dark"] .sidebar {
  background: rgb(11 15 23 / 82%);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.brand-mark {
  background: linear-gradient(135deg, #0d9488, #2dd4bf);
  box-shadow: none;
}
.side-link.active > .icon,
.side-link.active > .fa-icon {
  color: var(--color-brand-light);
}
a.side-link.active,
.leaf.active {
  background: rgb(20 184 166 / 16%);
  box-shadow: inset 2px 0 0 var(--color-brand);
}

/* ─── 3. Dark / light switch (sun and moon pill) ─── */
.theme-switch {
  position: relative;
  display: flex;
  align-items: center;
  width: 52px;
  height: 28px;
  flex: none;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 10%);
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.theme-switch-icons {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  pointer-events: none;
}
.theme-switch-icons .fa-icon {
  font-size: 11px !important;
  transition: color 0.3s ease;
}
.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 1;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f172a;
  box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
  transition: transform 0.3s var(--ease), background-color 0.3s;
}
.theme-switch .fa-sun {
  color: #fbbf24;
}
.theme-switch .fa-moon {
  color: #94a3b8;
}
html[data-theme="dark"] .theme-switch {
  border-color: #1e293b;
  background: #0f172a;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 20%);
}
html[data-theme="dark"] .theme-switch-thumb {
  background: #ffffff;
  transform: translateX(24px);
}
html[data-theme="dark"] .theme-switch .fa-moon {
  color: #0f172a;
}

/* ─── 4. Motion ─── */
a,
button,
input,
select,
textarea,
[role="button"] {
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease,
    transform 0.18s var(--ease);
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
/* A screen fades in, and its panels slide up one after another. */
.screen {
  animation: fade-in 0.35s ease both;
}
.screen > .panel,
.screen > * > .panel,
.screen .metric-card {
  animation: slide-up 0.3s var(--ease) both;
}
.screen > :nth-child(2) > .panel,
.screen > .panel:nth-child(2) {
  animation-delay: 40ms;
}
.screen > :nth-child(3) > .panel,
.screen > .panel:nth-child(3) {
  animation-delay: 80ms;
}
.screen > .panel:nth-child(n + 4) {
  animation-delay: 120ms;
}
.screen .metric-card:nth-child(2) {
  animation-delay: 40ms;
}
.screen .metric-card:nth-child(3) {
  animation-delay: 80ms;
}
.screen .metric-card:nth-child(4) {
  animation-delay: 120ms;
}
/* Switching themes changes every colour at once: nothing fades (not even elements with their own transitions). */
html.theme-changing,
html.theme-changing *,
html.theme-changing *::before,
html.theme-changing *::after {
  transition: none !important;
}

/* ─── 5. Dark versions of areas with written-in light colours ─── */
html[data-theme="dark"] :is(
    .co-code,
    .cs-ring-inner,
    .cs-grade-choice,
    .cash-note,
    .cash-coins,
    .br-flat-card,
    .br-flat-code,
    .br-flat-stats,
    .ac-meter,
    .level-tag,
    .level-switch,
    .ua-card-foot,
    .ua-btn,
    .sms-control-strip,
    .sms-strip-select,
    .sms-composer-panel,
    .sms-preset-pill,
    .sms-token-dock,
    .sms-token-chip,
    .sms-composer-textarea,
    .sms-composer-footer,
    .sms-stat-pill,
    .sms-simulator-panel,
    .sms-sim-head,
    .sms-sim-lang-switch,
    .sms-sim-viewport,
    .sms-device-topbar,
    .sms-device-body,
    .sms-sim-metrics,
    .sms-metric-card,
    .sms-card,
    .queue-popup,
    .queue-popup-item,
    .queue-popup-step,
    .queue-popup-badge,
    .access-denied-view,
    .access-denied-badge
  ) {
  border-color: #1f2937;
  background: #111827;
  color: #d1d5db;
}
html[data-theme="dark"] :is(.br-flat-card:hover, .ua-btn:hover, .sms-preset-pill:hover, .sms-token-chip:hover, .queue-popup-item:hover, .level-option:hover:not(:disabled), .match:hover, .client-option:hover) {
  background: #1f2937;
}
html[data-theme="dark"] .queue-popup::before {
  border-color: #1f2937;
  background: #111827;
}
html[data-theme="dark"] :is(.queue-popup-title, .queue-popup-item-label, .access-denied-heading, .access-denied-message) {
  color: #f9fafb;
}
html[data-theme="dark"] :is(.credit-success, .credit-info, .credit-warning, .credit-danger, .credit-default) {
  background: rgb(255 255 255 / 4%);
}
html[data-theme="dark"] .cs-ring-inner {
  box-shadow: none;
}
html[data-theme="dark"] .cs-hero-text {
  color: #e5e7eb;
}
html[data-theme="dark"] .co-avatar {
  background: #1f2937;
}
html[data-theme="dark"] .offline-bar {
  border-color: rgb(245 158 11 / 30%);
  background: rgb(120 53 15 / 70%);
  color: #fde68a;
}
html[data-theme="dark"] .client-search-list {
  border-color: #1f2937;
  background: #111827;
}
/* Printable documents (letters, centre sheets, slips) stay white with dark text in both themes. */
html[data-theme="dark"] :is(.letter-holder, .letter-sheet, .center-sheet, .settle-slip, .receipt-slip, .invoice-sheet) {
  color: #0f172a;
}
html[data-theme="dark"] :is(.letter-sheet, .center-sheet, .settle-slip) :is(td, th, p, span, h1, h2, h3, dt, dd) {
  color: #0f172a;
}
/* ─── 6. Closer to the reference design (design/reference-silvergre.html) ─── */
/* Rounder panels with more room. */
.panel,
.metric-card {
  border-radius: 22px;
}
.panel-heading {
  border-radius: 22px 22px 0 0;
}
.panel-body {
  padding: 20px 22px;
}
.modal {
  border-radius: 22px;
}
.modal-header {
  border-radius: 22px 22px 0 0;
}
.modal-footer {
  border-radius: 0 0 22px 22px;
}

.brand-name {
  white-space: nowrap;
}

/* Small bold UPPERCASE labels. */
.field-label {
  color: var(--color-text-subtle);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.facts dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Filled inputs in the light theme; monospace for dates and numbers everywhere. */
html:not([data-theme="dark"]) .control {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
html:not([data-theme="dark"]) .control:focus {
  background: #ffffff;
}
input.control[type="date"],
input.control[type="number"],
input.control[inputmode="decimal"],
input.control[inputmode="numeric"] {
  font-family: var(--font-mono);
}
.table .align-end,
.table tfoot td {
  font-family: var(--font-mono);
}

/* Quiet buttons are grey in the light theme. */
html:not([data-theme="dark"]) .btn-default {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #0f172a;
}
html:not([data-theme="dark"]) .btn-default:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #cbd5e1;
}

/* Metric cards: label and figure in the card's colour, a plain icon, tinted mini pills. */
.metric-card[data-tone] .metric-value {
  color: var(--tone-text);
}
.metric-card[data-tone] .metric-icon {
  width: auto;
  height: auto;
  background: none;
}
.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border: 1px solid var(--tone-border, var(--color-border));
  border-radius: 6px;
  background: var(--tone-soft, var(--color-surface-sunken));
  color: var(--tone-text, var(--color-text-subtle));
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

/* Pager: rounded Prev / Next, the current page a teal square. */
.pager {
  font-family: var(--font-mono);
  font-size: 11px;
}
.pager button {
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
}
html[data-theme="dark"] .pager button {
  border-color: #1f2937;
  background: #111827;
  color: #9ca3af;
}
html[data-theme="dark"] .pager button:hover:not(:disabled) {
  background: #1f2937;
  color: #ffffff;
}
.pager button[aria-current="page"] {
  border-color: transparent;
  background: var(--color-brand-strong);
  color: #ffffff;
}

/* Online / offline pill in the top bar. */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #047857;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.status-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}
.status-pill.is-offline {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}
.status-pill.is-offline .status-pill-dot {
  background: #f59e0b;
}
html[data-theme="dark"] .status-pill {
  border-color: rgb(16 185 129 / 30%);
  background: rgb(16 185 129 / 10%);
  color: #6ee7b7;
}
html[data-theme="dark"] .status-pill.is-offline {
  border-color: rgb(245 158 11 / 30%);
  background: rgb(245 158 11 / 10%);
  color: #fcd34d;
}
@keyframes pulse-dot {
  50% {
    opacity: 0.35;
  }
}
@media (max-width: 640px) {
  .status-pill {
    display: none;
  }
}

/* The dark page: plain, no glow. */
html[data-theme="dark"] body {
  background: var(--color-page);
}

/* ─── Data Explorer cards (screens/portfolio/explorer.js) ─── */
.explorer-ribbon {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: var(--space-5);
}
@media (max-width: 1280px) {
  .explorer-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .explorer-ribbon .metric-wide {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .explorer-ribbon {
    grid-template-columns: minmax(0, 1fr);
  }
}
.explorer-ribbon .metric-card {
  justify-content: space-between;
  min-height: 132px;
}
.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.metric-value.plain {
  color: var(--color-text-strong) !important;
}
.metric-detail.amber {
  color: var(--tone-text, #b45309);
}
[data-tone="teal"] .metric-detail.amber {
  --tone-text: #b45309;
}
html[data-theme="dark"] [data-tone="teal"] .metric-detail.amber {
  --tone-text: #fcd34d;
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.pill-row.apart {
  justify-content: space-between;
}
.pill-row.split {
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}
.mini-pill.neutral {
  border-color: var(--color-border-strong);
  background: var(--color-surface-sunken);
  color: var(--color-text-subtle);
}
.mini-pill.neutral b {
  color: var(--color-text-strong);
}
.mini-pill[data-tone] {
  border-color: var(--tone-border);
  background: var(--tone-soft);
  color: var(--tone-text);
}
.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.metric-card .mini-pill:has(.pill-dot) {
  border-radius: 999px;
  padding: 1px 9px;
}
.status-rows {
  display: grid;
  gap: 5px;
}
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 9px;
  border: 1px solid var(--tone-border);
  border-left: 3px solid var(--tone-text);
  border-radius: 7px;
  background: var(--tone-soft);
  color: var(--color-text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.status-row i {
  margin-right: 5px;
  color: var(--tone-text);
}
.status-count {
  color: var(--tone-text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
}
html:not([data-theme="dark"]) .status-row {
  border-color: #e2e8f0;
  border-left-color: var(--tone-text);
  background: #ffffff;
}
/* Filter pill groups (OC Status, Category, Inactive): a sunken bar of pills, the chosen one teal. */
.pill-group {
  gap: 4px;
  padding: 4px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #e2e8f0;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 6%);
}
.pill-label {
  padding: 0 8px;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}
.pill {
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.28s var(--ease-spring), color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease, transform 0.18s var(--ease-spring);
}
.pill:hover:not([aria-pressed="true"]) {
  background: #f1f5f9;
  color: #0f172a;
}
.pill[aria-pressed="true"] {
  border-color: transparent;
  background: #0d9488;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
  transform: translateY(-1px);
}
html[data-theme="dark"] .pill-group {
  border-color: #1f2937;
  background: rgb(17 24 39 / 90%);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 35%);
}
html[data-theme="dark"] .pill-label {
  color: #9ca3af;
}
html[data-theme="dark"] .pill {
  border-color: #374151;
  background: #1f2937;
  color: #d1d5db;
}
html[data-theme="dark"] .pill:hover:not([aria-pressed="true"]) {
  background: #374151;
  color: #ffffff;
}
html[data-theme="dark"] .pill[aria-pressed="true"] {
  border-color: transparent;
  background: #0d9488;
  color: #ffffff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
}

/* Multi-choice drop-downs (Credit Officer, Center, Due Day, Columns): the same box and list as the others. */
.multi-select > summary.control {
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border-color: #cbd5e1;
  background: #ffffff;
  color: var(--color-text-strong);
  font-size: 12px;
  font-weight: 600;
}
html[data-theme="dark"] .multi-select > summary.control {
  border-color: #1f2937;
  background: #0d1320;
  color: #e5e7eb;
}
.multi-select > summary .multi-summary {
  flex: 1;
}
.multi-select > summary .fa-icon {
  color: var(--color-text-subtle);
  font-size: 10px !important;
  transition: transform 0.25s var(--ease-spring);
}
.multi-select[open] > summary .fa-icon {
  transform: rotate(180deg);
}
.multi-select[open] > summary.control {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgb(20 184 166 / 20%);
}
.multi-menu {
  top: calc(100% + 6px);
  padding: 8px;
  border-color: #cbd5e1;
  border-radius: 14px;
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px -6px rgb(15 23 42 / 22%);
  animation: cselect-in 0.18s var(--ease-spring);
}
html[data-theme="dark"] .multi-menu {
  border-color: rgb(255 255 255 / 10%);
  background: rgb(17 24 39 / 94%);
  box-shadow: 0 18px 44px rgb(0 0 0 / 60%);
}
.multi-option {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
}
.multi-option:hover {
  background: var(--color-table-row-hover);
}
.multi-option input {
  accent-color: var(--color-brand);
}
.link-btn {
  color: var(--color-brand-strong);
}
html[data-theme="dark"] .link-btn {
  color: #2dd4bf;
}

/* Active filter chips. */
.chips-bar {
  font-size: 12px;
}
.chips-bar > .muted:first-child {
  font-weight: 600;
}
.chip {
  padding: 3px 6px 3px 10px;
  border: 1px solid #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
  font-weight: 600;
  animation: pop-in 0.15s ease;
}
html[data-theme="dark"] .chip {
  border-color: rgb(20 184 166 / 35%);
  background: rgb(20 184 166 / 15%);
  color: #5eead4;
}

/* ─── Data Explorer filters: three clear rows (screens/portfolio/explorer.js) ─── */
/* 1. Search with its magnifier, then the pill groups. */
.filter-top {
  gap: 10px;
  margin-bottom: 0;
}
.filter-search {
  position: relative;
  display: flex;
  flex: 1 1 320px;
  align-items: center;
  max-width: 480px;
}
.filter-search .fa-magnifying-glass {
  position: absolute;
  left: 13px;
  color: var(--color-text-muted);
  font-size: 12px;
  pointer-events: none;
}
.filter-search .control {
  height: 38px;
  padding-left: 36px;
}
/* 2. One row of pick lists, set off by a line above. */
.filter-picks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}
@media (max-width: 1100px) {
  .filter-picks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .filter-picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .filter-picks {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* 3. Dates and amounts as small labelled boxes, Search at the end. */
.filter-ranges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}
.range-box {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}
html[data-theme="dark"] .range-box {
  border-color: #1f2937;
  background: rgb(17 24 39 / 90%);
}
.range-box > .fa-solid {
  color: var(--color-brand-strong);
  font-size: 11px;
}
html[data-theme="dark"] .range-box > .fa-solid {
  color: #2dd4bf;
}
.range-label {
  color: var(--color-text-subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.range-hint,
.range-to {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}
.range-box .control {
  width: auto;
  min-height: 26px;
  height: 26px;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 11px;
}
.range-box input[type="date"].control {
  width: 128px;
}
.range-box input[type="number"].control {
  width: 86px;
}
.filter-search-button {
  margin-left: auto;
}
.filter-search-button .btn {
  padding: 8px 22px;
}

/* The Portfolio table's heading: title, loan count and every table control on one line. */
.portfolio-results .panel-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.panel-title-note {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.portfolio-results .panel-actions {
  gap: 10px;
}
.portfolio-results .inline-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.portfolio-results .inline-field .cselect {
  width: 78px;
}
/* Portfolio rows on one line each (the table scrolls sideways): no wrapped names or branches stretching rows. */
.portfolio-results .table td {
  white-space: nowrap;
}
.portfolio-results .pill-group {
  padding: 3px;
}
.portfolio-results .pill {
  padding: 3px 9px;
  font-size: 11px;
}

/* ─── Work-queue strip: one segmented pill bar, like the reference's top tabs ─── */
.queue-list {
  gap: 3px;
  padding: 3px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #e2e8f0;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 6%);
}
html[data-theme="dark"] .queue-list {
  border-color: rgb(31 41 55 / 90%);
  background: rgb(17 24 39 / 90%);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 35%);
}
.queue-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: 28px;
  padding: 0 8px 0 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  transition:
    background-color 0.28s var(--ease-spring),
    color 0.25s var(--ease-spring),
    border-color 0.28s var(--ease-spring),
    box-shadow 0.28s var(--ease-spring);
}
html[data-theme="dark"] .queue-step {
  color: #9ca3af;
}
.queue-step .queue-icon {
  color: var(--tone);
}
.queue-short {
  white-space: nowrap;
}
/* The count: a small pill in the queue's colour beside the name (no corner dot). */
.queue-step .queue-count {
  position: static;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 16%, transparent);
  color: var(--tone);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
}
.queue-step[data-state="waiting"] .queue-count {
  background: var(--tone);
  color: #ffffff;
  box-shadow: none;
}
.queue-step[data-state="empty"] .queue-count {
  display: inline-block;
  background: transparent;
  color: var(--color-text-muted);
}
.queue-step[data-state="empty"] .queue-icon {
  opacity: 0.55;
}
.queue-step:hover,
.queue-step.queue-step-open {
  background: rgb(255 255 255 / 60%);
  color: var(--color-text-strong);
}
html[data-theme="dark"] .queue-step:hover,
html[data-theme="dark"] .queue-step.queue-step-open {
  background: transparent;
  color: #e5e7eb;
}
/* The queue being worked on: raised, like the reference's active tab. */
.queue-step[aria-current="page"],
.queue-step[aria-current="page"]:hover {
  border-color: #cbd5e1;
  background: #ffffff;
  color: var(--color-text-strong);
  box-shadow: 0 1px 3px rgb(0 0 0 / 10%), 0 1px 2px rgb(0 0 0 / 6%);
}
html[data-theme="dark"] .queue-step[aria-current="page"],
html[data-theme="dark"] .queue-step[aria-current="page"]:hover {
  border-color: rgb(255 255 255 / 9%);
  background: #1f2937;
  color: #ffffff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 35%), inset 0 1px 0 rgb(255 255 255 / 8%);
}
.queue-popup {
  top: calc(100% + 12px);
}
/* Narrower screens: icon and count only. */
@media (max-width: 1100px) {
  .queue-short {
    display: none;
  }
  .queue-step {
    padding: 0 6px;
  }
}

/* ─── Side menu open / close: the same motion as the Not Paid Matrix's Filters toggle ─── */
.header-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-brand-strong);
  box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}
html[data-theme="dark"] .header-toggle {
  border-color: #374151;
  background: #111827;
  color: #2dd4bf;
}
.header-toggle:hover {
  border-color: rgb(20 184 166 / 50%);
}
.header-toggle .fa-icon {
  transition: transform 0.3s var(--ease);
}
/* Points left (close) while the menu is open, right (open) while it is closed. */
.header-toggle[aria-expanded="true"] .fa-icon {
  transform: rotate(180deg);
}
.sidebar {
  transition: transform 0.5s var(--ease);
}
.main {
  transition: margin-left 0.5s var(--ease);
}
.header {
  transition: left 0.5s var(--ease);
}
.offline-bar {
  transition: left 0.5s var(--ease);
}
/* The menu's contents slide and fade in behind it, as the Filters do. */
.sidebar > * {
  opacity: 0;
  transform: translateX(-24px);
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease);
}
.shell.sidebar-open .sidebar > * {
  opacity: 1;
  transform: none;
}

/* ─── Not Paid Matrix (Payment Status → Matrix) ─── */
.matrix-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
  color: #4338ca;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.matrix-btn:hover {
  border-color: #818cf8;
  background: #e0e7ff;
}
html[data-theme="dark"] .matrix-btn {
  border-color: rgb(99 102 241 / 40%);
  background: rgb(30 27 75 / 60%);
  color: #a5b4fc;
}
html[data-theme="dark"] .matrix-btn:hover {
  border-color: #818cf8;
  color: #ffffff;
}
.matrix-btn i {
  font-size: 9px;
}

.matrix-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Compact while the filters are closed; wide enough for Filters, Branch and Range on one line when they open. */
.matrix-modal {
  --modal-width: 560px;
  transition: width 0.5s var(--ease);
}
.matrix-modal.filters-open {
  --modal-width: 860px;
}
.matrix-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.matrix-title {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-sunken);
}
.matrix-title h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.matrix-title h3 i {
  color: var(--color-brand);
}
.matrix-toggle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-brand-strong);
  cursor: pointer;
}
.matrix-toggle i {
  font-size: 11px;
  transition: transform 0.3s var(--ease);
}
.matrix-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}
/* The filters slide out from behind the title. */
.matrix-filters {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    max-width 0.5s var(--ease),
    opacity 0.5s var(--ease);
}
.matrix-filters.is-open {
  max-width: 100%;
  opacity: 1;
  pointer-events: auto;
}
.matrix-filters-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: max-content;
  transform: translateX(-100%);
  transition: transform 0.5s var(--ease);
}
.matrix-filters.is-open .matrix-filters-inner {
  transform: none;
}
.matrix-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgb(20 184 166 / 30%);
  border-radius: 12px;
  background: var(--color-surface-sunken);
}
.matrix-chip > i {
  color: var(--color-brand);
  font-size: 11px;
}
.matrix-chip-label {
  color: var(--color-brand-strong);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
html[data-theme="dark"] .matrix-chip-label {
  color: #5eead4;
}
.matrix-chip {
  flex: none;
  white-space: nowrap;
}
.matrix-chip .cselect {
  width: 160px;
}
.matrix-chip .cselect-button {
  min-height: 26px;
  padding: 2px 8px;
}
.matrix-chip input[type="date"].control {
  width: 120px;
  min-height: 26px;
  height: 26px;
  padding: 2px 6px;
  font-size: 11px;
}
.matrix-clear {
  border: 0;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.matrix-clear:hover {
  color: var(--color-text-strong);
}
.matrix-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-sunken);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 5%);
}
.matrix-summary-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgb(20 184 166 / 25%);
  border-radius: 8px;
  background: rgb(20 184 166 / 10%);
  color: var(--color-brand);
  font-size: 12px;
}
.matrix-summary-text {
  display: flex;
  flex: 1;
  flex-direction: column;
}
.matrix-summary-text span {
  color: var(--color-text-subtle);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.matrix-summary-text strong {
  color: #059669;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 900;
}
html[data-theme="dark"] .matrix-summary-text strong {
  color: #34d399;
}
.matrix-table-wrap {
  max-height: 55vh;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: opacity 0.2s ease;
}
.matrix-table-wrap.is-loading {
  opacity: 0.45;
}
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
.matrix-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 10px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-table-head);
  color: var(--color-text-subtle);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.matrix-table thead tr:nth-child(2) th {
  top: 27px;
}
.matrix-table td {
  padding: 4px 10px;
  border-bottom: 1px solid var(--color-row-line);
}
.matrix-table tbody tr {
  transition: background-color 0.15s ease;
}
.matrix-table tbody tr:hover td {
  background: var(--color-table-row-hover);
}
.matrix-officer {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 180px;
  max-width: 240px;
  overflow: hidden;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
}
.matrix-table th.matrix-officer {
  z-index: 3;
  background: var(--color-table-head);
}
.matrix-center,
.matrix-num {
  text-align: center;
}
.matrix-period {
  border-left: 1px solid var(--color-border);
  color: var(--color-text-strong) !important;
  text-align: center;
}
.matrix-notpaid-head {
  color: #e11d48 !important;
}
.matrix-ratio-head {
  color: #059669 !important;
}
.matrix-num {
  color: var(--color-text-strong);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}
.matrix-notpaid {
  background: rgb(244 63 94 / 3%);
  color: #e11d48;
}
html[data-theme="dark"] .matrix-notpaid {
  color: #fb7185;
}
.matrix-ratio {
  text-align: right;
}
.matrix-table tfoot td {
  border-top: 1px solid var(--color-border-strong);
  background: var(--color-table-head);
  font-weight: 900;
  text-transform: uppercase;
}
.matrix-table tfoot .matrix-notpaid {
  background: rgb(244 63 94 / 10%);
}
.matrix-empty {
  margin: 0;
  padding: 24px;
  color: var(--color-text-muted);
  text-align: center;
}
.pct-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 62px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgb(0 0 0 / 12%);
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}
.pct-pill:hover {
  transform: translateY(-0.5px);
  filter: brightness(1.05);
}
.pct-pill .pct-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  box-shadow: none;
}
.pct-pill-emerald {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}
.pct-pill-lime {
  border-color: #d9f99d;
  background: #f7fee7;
  color: #4d7c0f;
}
.pct-pill-amber {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}
.pct-pill-rose {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}
html[data-theme="dark"] .pct-pill-emerald {
  border-color: rgb(16 185 129 / 30%);
  background: rgb(16 185 129 / 12%);
  color: #34d399;
}
html[data-theme="dark"] .pct-pill-lime {
  border-color: rgb(132 204 22 / 30%);
  background: rgb(132 204 22 / 12%);
  color: #a3e635;
}
html[data-theme="dark"] .pct-pill-amber {
  border-color: rgb(245 158 11 / 30%);
  background: rgb(245 158 11 / 12%);
  color: #fbbf24;
}
html[data-theme="dark"] .pct-pill-rose {
  border-color: rgb(244 63 94 / 30%);
  background: rgb(244 63 94 / 12%);
  color: #fb7185;
}

/* ─── 7. Custom drop-downs (js/ui/custom-select.js) ─── */
.cselect {
  position: relative;
  width: 100%;
  min-width: 0;
}
/* The real select stays for forms and screen readers, out of sight. */
.cselect-native {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  pointer-events: none;
}
.cselect-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--control-height);
  padding: 6px 10px 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--color-text-strong);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
}
.cselect-button:hover:not(:disabled) {
  border-color: #94a3b8;
}
.cselect-button:focus-visible,
.cselect.is-open .cselect-button {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgb(20 184 166 / 20%);
  outline: none;
}
.cselect-button[aria-invalid="true"] {
  border-color: var(--color-danger);
}
.cselect-button:disabled {
  background: #f1f5f9;
  color: var(--color-text-muted);
  cursor: not-allowed;
  box-shadow: none;
}
.cselect-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cselect-text.is-placeholder {
  color: var(--color-text-muted);
  font-weight: 500;
}
.cselect-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #10b981;
  box-shadow: none;
}
.cselect-dot.is-empty {
  background: #94a3b8;
  box-shadow: none;
}
.cselect-button:disabled .cselect-dot {
  opacity: 0.5;
}
.cselect-tag {
  flex: none;
  padding: 1px 5px;
  border: 1px solid #a7f3d0;
  border-radius: 5px;
  background: #ecfdf5;
  color: #047857;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.cselect-chevron {
  flex: none;
  color: var(--color-text-subtle);
  font-size: 10px;
  transition: transform 0.25s var(--ease-spring);
}
.cselect.is-open .cselect-chevron {
  transform: rotate(180deg);
}

/* The list. */
.cselect-menu {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  max-width: min(420px, calc(100vw - 16px));
  max-height: 320px;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px -6px rgb(15 23 42 / 22%), 0 4px 12px -2px rgb(15 23 42 / 8%);
  animation: cselect-in 0.18s var(--ease-spring);
  transform-origin: top center;
}
.cselect-menu.is-above {
  transform-origin: bottom center;
}
@keyframes cselect-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
.cselect-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}
.cselect-search-wrap .fa-magnifying-glass {
  position: absolute;
  left: 10px;
  color: var(--color-text-muted);
  font-size: 11px;
}
.cselect-search {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 30px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--color-text-strong);
  font: inherit;
  font-size: 12px;
  outline: none;
}
.cselect-search:focus {
  border-color: var(--color-brand);
}
.cselect-list {
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cselect-group {
  padding: 8px 10px 4px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1px 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.cselect-option .cselect-dot {
  width: 6px;
  height: 6px;
  background: #cbd5e1;
  box-shadow: none;
}
.cselect-option-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cselect-option.is-active {
  background: #f1f5f9;
}
.cselect-option[aria-selected="true"] {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
  font-weight: 700;
}
.cselect-option[aria-selected="true"] .cselect-dot {
  background: #14b8a6;
}
.cselect-option[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.cselect-tick {
  color: #0d9488;
  font-size: 11px;
}
.cselect-empty {
  padding: 12px;
  color: var(--color-text-muted);
  font-size: 12px;
  text-align: center;
}

/* Dark theme. */
html[data-theme="dark"] .cselect-button {
  border-color: #1f2937;
  background: #0d1320;
  color: #e5e7eb;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 30%);
}
html[data-theme="dark"] .cselect-button:hover:not(:disabled) {
  border-color: #374151;
}
html[data-theme="dark"] .cselect-button:disabled {
  background: #111827;
  color: #6b7280;
}
html[data-theme="dark"] .cselect-tag {
  border-color: rgb(16 185 129 / 35%);
  background: rgb(16 185 129 / 12%);
  color: #6ee7b7;
}
html[data-theme="dark"] .cselect-menu {
  border-color: rgb(255 255 255 / 10%);
  background: rgb(17 24 39 / 94%);
  box-shadow: 0 18px 44px rgb(0 0 0 / 60%);
}
html[data-theme="dark"] .cselect-search {
  border-color: #1f2937;
  background: #0d1320;
  color: #e5e7eb;
}
html[data-theme="dark"] .cselect-option {
  color: #d1d5db;
}
html[data-theme="dark"] .cselect-option .cselect-dot {
  background: #374151;
}
html[data-theme="dark"] .cselect-option.is-active {
  background: #1f2937;
}
html[data-theme="dark"] .cselect-option[aria-selected="true"] {
  border-color: rgb(20 184 166 / 35%);
  background: rgb(20 184 166 / 15%);
  color: #5eead4;
}
html[data-theme="dark"] .cselect-tick {
  color: #2dd4bf;
}

@media print {
  html[data-theme="dark"] body::before,
  html[data-theme="dark"] body::after {
    display: none;
  }
}

/* ─── Loan Details (eye button): the MACS-MF tool's account inspector ─── */
.inspect-btn,
.table td .inspect-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #0d9488;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.inspect-btn .icon {
  font-size: 11px !important;
}
.inspect-btn:hover,
.inspect-btn:focus-visible,
.table td .inspect-btn:hover {
  border-color: #0d9488;
  background: #0d9488;
  color: #ffffff;
}
html[data-theme="dark"] .inspect-btn,
html[data-theme="dark"] .table td .inspect-btn {
  border-color: #374151;
  background: #1f2937;
  color: #9ca3af;
}
html[data-theme="dark"] .inspect-btn:hover,
html[data-theme="dark"] .inspect-btn:focus-visible {
  border-color: #14b8a6;
  background: #14b8a6;
  color: #ffffff;
}

.inspector-modal {
  --modal-width: 672px;
  --ins-panel: #ffffff;
  --ins-panel-border: #cbd5e1;
  --ins-head: #f8fafc;
  --ins-head-border: #e2e8f0;
  --ins-hero: #f8fafc;
  --ins-sub: #f1f5f9;
  --ins-chip: #ffffff;
  --ins-track: #e2e8f0;
  --ins-text: #0f172a;
  --ins-muted: #475569;
  --ins-faint: #64748b;
  --ins-brand: #0d9488;
  --ins-brand-soft: #0f766e;
}
html[data-theme="dark"] .inspector-modal {
  --ins-panel: rgb(17 24 39 / 92%);
  --ins-panel-border: rgb(55 65 81 / 80%);
  --ins-head: linear-gradient(90deg, #030712, #111827, #030712);
  --ins-head-border: rgb(31 41 55 / 90%);
  --ins-hero: rgb(13 20 36 / 90%);
  --ins-sub: rgb(17 24 39 / 70%);
  --ins-chip: #030712;
  --ins-track: #060b13;
  --ins-text: #ffffff;
  --ins-muted: #9ca3af;
  --ins-faint: #6b7280;
  --ins-brand: #2dd4bf;
  --ins-brand-soft: #5eead4;
}
.inspector-modal .modal-content {
  overflow: hidden;
  border: 1px solid var(--ins-panel-border);
  border-radius: 16px;
  background: var(--ins-panel);
  box-shadow: 0 20px 60px rgb(0 0 0 / 55%);
}
.inspector-modal .modal-header {
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--ins-head-border);
  background: var(--ins-head);
}
.inspector-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid rgb(20 184 166 / 30%);
  border-radius: 12px;
  background: rgb(20 184 166 / 15%);
  color: var(--ins-brand);
  font-size: 14px;
}
.inspector-modal .modal-title {
  flex: 1;
  margin: 0;
  color: var(--ins-text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.inspector-modal .modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--ins-panel-border);
  border-radius: 12px;
  background: var(--ins-sub);
  color: var(--ins-muted);
}
.inspector-modal .modal-close:hover {
  color: var(--ins-text);
}
.inspector-modal .modal-body {
  padding: 16px 20px;
}
.inspector {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--ins-text);
  font-size: 12px;
}
.inspector-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--ins-panel-border);
  border-radius: 16px;
  background: var(--ins-hero);
}
.inspector-hero-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ins-head-border);
}
.inspector-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.inspector-who {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.inspector-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 1px solid rgb(20 184 166 / 40%);
  border-radius: 16px;
  background: var(--ins-chip);
  color: var(--ins-brand);
  font-size: 17px;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 25%);
}
.inspector-name-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.inspector-eyebrow {
  margin-bottom: 4px;
  color: var(--ins-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.inspector-name {
  margin: 0;
  color: var(--ins-text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.inspector-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.inspector-loan-no,
.inspector-category,
.inspector-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid;
  border-radius: 12px;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.inspector-loan-no {
  border-color: var(--ins-panel-border);
  background: var(--ins-chip);
  color: var(--ins-text);
  font-size: 12px;
  font-weight: 900;
}
.inspector-loan-no .fa-hashtag {
  color: var(--ins-brand);
  font-size: 10px;
}
.inspector-copy {
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ins-muted);
  font-size: 11px;
  cursor: pointer;
}
.inspector-copy:hover {
  color: var(--ins-text);
}
.inspector-category,
.inspector-state {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.inspector-category-MF {
  border-color: rgb(217 70 239 / 40%);
  background: rgb(217 70 239 / 20%);
  color: #a21caf;
}
.inspector-category-DL {
  border-color: rgb(249 115 22 / 40%);
  background: rgb(249 115 22 / 20%);
  color: #c2410c;
}
.inspector-category-other {
  border-color: rgb(163 230 53 / 40%);
  background: rgb(163 230 53 / 20%);
  color: #4d7c0f;
}
.inspector-state {
  font-family: inherit;
}
.inspector-state-active {
  border-color: rgb(16 185 129 / 30%);
  background: rgb(16 185 129 / 15%);
  color: #047857;
}
.inspector-state-oc {
  border-color: rgb(244 63 94 / 30%);
  background: rgb(244 63 94 / 15%);
  color: #be123c;
}
html[data-theme="dark"] .inspector-category-MF {
  color: #f0abfc;
}
html[data-theme="dark"] .inspector-category-DL {
  color: #fdba74;
}
html[data-theme="dark"] .inspector-category-other {
  color: #bef264;
}
html[data-theme="dark"] .inspector-state-active {
  color: #34d399;
}
html[data-theme="dark"] .inspector-state-oc {
  color: #fb7185;
}
.inspector-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid;
  border-radius: 12px;
}
.inspector-banner-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.inspector-banner-main > div {
  display: flex;
  flex-direction: column;
}
.inspector-banner-title {
  font-weight: 800;
}
.inspector-banner-sub,
.inspector-banner-days {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  white-space: nowrap;
}
.inspector-banner-sub {
  font-weight: 700;
}
.inspector-banner-days {
  font-weight: 700;
}
.inspector-banner-action {
  padding: 4px 8px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.inspector-banner-severe {
  border-color: #fda4af;
  background: #fff1f2;
  color: #9f1239;
}
.inspector-banner-severe .fa-triangle-exclamation {
  color: #e11d48;
}
.inspector-banner-severe .inspector-banner-days {
  color: #be123c;
}
.inspector-banner-severe .inspector-banner-action {
  border-color: #f43f5e;
  background: #ffe4e6;
}
.inspector-banner-critical {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}
.inspector-banner-critical .fa-triangle-exclamation {
  color: #d97706;
}
.inspector-banner-critical .inspector-banner-days {
  color: #b45309;
}
.inspector-banner-critical .inspector-banner-action {
  border-color: #f59e0b;
  background: #fef3c7;
}
html[data-theme="dark"] .inspector-banner-severe {
  border-color: rgb(244 63 94 / 50%);
  background: rgb(76 5 25 / 50%);
  color: #fda4af;
}
html[data-theme="dark"] .inspector-banner-severe .inspector-banner-title,
html[data-theme="dark"] .inspector-banner-critical .inspector-banner-title {
  color: #ffffff;
}
html[data-theme="dark"] .inspector-banner-severe .fa-triangle-exclamation {
  color: #fb7185;
}
html[data-theme="dark"] .inspector-banner-severe .inspector-banner-days {
  color: #fda4af;
}
html[data-theme="dark"] .inspector-banner-severe .inspector-banner-action {
  border-color: rgb(244 63 94 / 50%);
  background: rgb(244 63 94 / 25%);
  color: #fecdd3;
}
html[data-theme="dark"] .inspector-banner-critical {
  border-color: rgb(245 158 11 / 40%);
  background: rgb(69 26 3 / 40%);
  color: #fcd34d;
}
html[data-theme="dark"] .inspector-banner-critical .fa-triangle-exclamation {
  color: #fbbf24;
}
html[data-theme="dark"] .inspector-banner-critical .inspector-banner-days {
  color: #fcd34d;
}
html[data-theme="dark"] .inspector-banner-critical .inspector-banner-action {
  border-color: rgb(245 158 11 / 40%);
  background: rgb(245 158 11 / 20%);
  color: #fcd34d;
}
.inspector-address {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--ins-panel-border);
  border-radius: 12px;
  background: var(--ins-chip);
  color: var(--ins-muted);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
}
.inspector-address .fa-location-dot {
  margin-top: 3px;
  color: var(--ins-brand);
}
.inspector-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inspector-progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.inspector-progress-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #047857;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
html[data-theme="dark"] .inspector-progress-label {
  color: #34d399;
}
.inspector-progress-figures {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inspector-commitment {
  color: var(--ins-muted);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
}
.inspector-progress-track {
  height: 10px;
  padding: 2px;
  border: 1px solid var(--ins-panel-border);
  border-radius: 999px;
  background: var(--ins-track);
}
.inspector-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d9488, #10b981);
  transition: width 0.5s ease;
}
html[data-theme="dark"] .inspector-progress-fill {
  background: linear-gradient(90deg, #22d3ee, #34d399, #2dd4bf);
}
.inspector-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 4px;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.inspector-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--card-color);
}
.inspector-card-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--card-color);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.inspector-card-label i {
  font-size: 10px;
}
.inspector-card-value {
  overflow: hidden;
  color: var(--card-color);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inspector-card-agreed { --card-bg: #f0fdfa; --card-border: #5eead4; --card-color: #0f766e; }
.inspector-card-paid { --card-bg: #ecfdf5; --card-border: #6ee7b7; --card-color: #047857; }
.inspector-card-balance { --card-bg: #fffbeb; --card-border: #fcd34d; --card-color: #b45309; }
.inspector-card-due { --card-bg: #f0f9ff; --card-border: #7dd3fc; --card-color: #0369a1; }
.inspector-card-lastpaid { --card-bg: #fff1f2; --card-border: #fda4af; --card-color: #be123c; }
.inspector-card-lastdate { --card-bg: #faf5ff; --card-border: #d8b4fe; --card-color: #7e22ce; }
html[data-theme="dark"] .inspector-card-agreed { --card-bg: rgb(0 242 254 / 4%); --card-border: rgb(0 242 254 / 30%); --card-color: #00f2fe; }
html[data-theme="dark"] .inspector-card-paid { --card-bg: rgb(0 255 135 / 4%); --card-border: rgb(0 255 135 / 30%); --card-color: #00ff87; }
html[data-theme="dark"] .inspector-card-balance { --card-bg: rgb(255 183 3 / 4%); --card-border: rgb(255 183 3 / 30%); --card-color: #ffb703; }
html[data-theme="dark"] .inspector-card-due { --card-bg: rgb(56 189 248 / 4%); --card-border: rgb(56 189 248 / 30%); --card-color: #38bdf8; }
html[data-theme="dark"] .inspector-card-lastpaid { --card-bg: rgb(251 113 133 / 4%); --card-border: rgb(251 113 133 / 30%); --card-color: #fb7185; }
html[data-theme="dark"] .inspector-card-lastdate { --card-bg: rgb(192 132 252 / 4%); --card-border: rgb(192 132 252 / 30%); --card-color: #c084fc; }
html[data-theme="dark"] .inspector-card-label {
  opacity: 0.85;
}
.inspector-routing {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--ins-panel-border);
  border-radius: 16px;
  background: var(--ins-sub);
}
.inspector-routing > .inspector-section-title {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ins-panel-border);
}
.inspector-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ins-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.inspector-section-title i {
  color: var(--ins-brand);
}
.inspector-routing-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.inspector-span-2 { grid-column: span 2; }
.inspector-span-3 { grid-column: span 3; }
.inspector-span-5 { grid-column: span 5; }
.inspector-route {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.inspector-route-label {
  color: var(--ins-faint);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.inspector-route-value {
  color: var(--ins-text);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.inspector-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}
.inspector-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.inspector-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--ins-panel-border);
  border-radius: 12px;
  background: var(--ins-sub);
  transition: background-color 0.15s ease;
}
.inspector-tile:hover {
  background: var(--ins-chip);
}
.inspector-tile-label {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  color: var(--ins-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.inspector-tile-label i {
  color: var(--ins-brand);
  opacity: 0.8;
}
.inspector-tile-value {
  overflow: hidden;
  color: var(--ins-text);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inspector-tone-brand { color: var(--ins-brand-soft); }
.inspector-tone-cyan { color: #0891b2; }
.inspector-tone-purple { color: #7e22ce; }
html[data-theme="dark"] .inspector-tone-cyan { color: #67e8f9; }
html[data-theme="dark"] .inspector-tone-purple { color: #d8b4fe; }
.inspector-modal .modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--ins-head-border);
  background: var(--ins-head);
}
html[data-theme="dark"] .inspector-modal .modal-footer {
  background: rgb(3 7 18 / 80%);
}
.inspector-footer {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.inspector-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ins-faint);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
}
.inspector-verified i {
  color: var(--ins-brand);
  font-size: 12px;
}
.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.inspector-print,
.inspector-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.inspector-print {
  border: 0;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  color: #ffffff;
  box-shadow: 0 4px 6px rgb(20 184 166 / 20%);
}
.inspector-print:hover {
  background: linear-gradient(90deg, #14b8a6, #0d9488);
}
.inspector-close {
  border: 1px solid var(--ins-panel-border);
  background: var(--ins-sub);
  color: var(--ins-text);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 6%);
}
@media (max-width: 640px) {
  .inspector-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .inspector-routing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inspector-span-2,
  .inspector-span-3,
  .inspector-span-5 {
    grid-column: span 1;
  }
  .inspector-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ─── Print Letter: Letter Guarantors Setup (as the MACS-MF tool's) ─── */
.inspector-modal.letter-setup-modal {
  --modal-width: 512px;
}
.letter-setup {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 12px;
}
.letter-setup-sub {
  margin: -8px 0 0;
  overflow: hidden;
  color: var(--ins-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.letter-lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--ins-panel-border);
  border-radius: 12px;
  background: var(--ins-sub);
  color: var(--ins-muted);
  font-weight: 500;
}
.letter-lang-group {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ins-panel-border);
  border-radius: 8px;
  background: var(--ins-chip);
}
.letter-lang-btn {
  padding: 4px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ins-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.letter-lang-btn:hover {
  color: var(--ins-text);
}
.letter-lang-btn.is-active {
  background: #14b8a6;
  color: #ffffff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
}
.letter-guarantors {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
}
.letter-guarantors-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  color: var(--ins-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.letter-add-guarantor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ins-brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.letter-add-guarantor i {
  font-size: 10px;
}
.letter-guarantor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.letter-guarantor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--ins-panel-border);
  border-radius: 12px;
  background: var(--ins-sub);
}
.letter-guarantor-no {
  width: 20px;
  flex-shrink: 0;
  color: var(--ins-brand);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.letter-guarantor-name,
.letter-guarantor-details {
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--ins-panel-border);
  border-radius: 8px;
  background: var(--ins-chip);
  color: var(--ins-text);
  font-size: 12px;
}
.letter-guarantor-name {
  flex: 1;
}
.letter-guarantor-details {
  width: 176px;
  flex-shrink: 0;
  color: var(--ins-muted);
}
.letter-guarantor-name:focus,
.letter-guarantor-details:focus {
  border-color: #14b8a6;
  outline: none;
}
.letter-guarantor-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--ins-panel-border);
  border-radius: 8px;
  background: var(--ins-sub);
  color: var(--ins-muted);
  font-size: 12px;
  cursor: pointer;
}
.letter-guarantor-remove:hover {
  border-color: #fda4af;
  background: #fff1f2;
  color: #e11d48;
}
html[data-theme="dark"] .letter-guarantor-remove:hover {
  border-color: rgb(244 63 94 / 40%);
  background: rgb(136 19 55 / 50%);
  color: #fb7185;
}
.letter-setup-footer {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.letter-setup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.letter-btn-plain,
.letter-btn-cancel,
.letter-btn-print {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.letter-btn-plain {
  border: 1px solid var(--ins-panel-border);
  background: var(--ins-sub);
  color: var(--ins-text);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 6%);
}
.letter-btn-cancel {
  padding: 8px 12px;
  border: 1px solid var(--ins-panel-border);
  background: var(--ins-chip);
  color: var(--ins-muted);
}
.letter-btn-print {
  padding: 8px 16px;
  border: 0;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 6px rgb(20 184 166 / 20%);
}
.letter-btn-print:hover {
  background: linear-gradient(90deg, #14b8a6, #0d9488);
}
@media (max-width: 640px) {
  .letter-guarantor-row {
    flex-wrap: wrap;
  }
  .letter-guarantor-details {
    width: 100%;
  }
  .letter-setup-footer,
  .letter-setup-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
/* ─── Date picker (ui/date-picker.js), as the MACS-MF tool's calendar ─── */
.dpick {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}
.dpick.dpick-block {
  display: block;
  width: 100%;
}
.dpick > input[type="date"] {
  padding-right: 30px;
}
.dpick.dpick-block > input[type="date"] {
  width: 100%;
}
.dpick > input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
}
.dpick-button {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-subtle);
  font-size: 12px;
  cursor: pointer;
  transform: translateY(-50%);
}
.dpick-button:hover,
.dpick.is-open .dpick-button {
  color: #14b8a6;
}
.dpick.is-open > input[type="date"] {
  border-color: #14b8a6;
}
.dpick-panel {
  position: fixed;
  z-index: 1300;
  width: 288px;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 10%), 0 8px 10px -6px rgb(0 0 0 / 10%);
  font-size: 12px;
  transform-origin: top center;
  animation: dpickIn 0.35s cubic-bezier(0.25, 1, 0.35, 1) both;
}
.dpick-panel.is-above {
  transform-origin: bottom center;
}
@keyframes dpickIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
html[data-theme="dark"] .dpick-panel {
  border-color: rgb(55 65 81 / 80%);
  background: #1d222d;
  color: #e5e7eb;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 60%);
  backdrop-filter: blur(12px);
}
.dpick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.dpick-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}
html[data-theme="dark"] .dpick-title {
  color: #ffffff;
}
.dpick-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  cursor: pointer;
}
.dpick-nav:hover {
  border-color: #14b8a6;
  color: #0f766e;
}
html[data-theme="dark"] .dpick-nav {
  border-color: #374151;
  background: #1f2937;
  color: #d1d5db;
}
html[data-theme="dark"] .dpick-nav:hover {
  border-color: #14b8a6;
  color: #2dd4bf;
}
.dpick-weekdays,
.dpick-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}
.dpick-weekdays {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}
html[data-theme="dark"] .dpick-weekdays {
  color: #9ca3af;
}
.dpick-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #0f172a;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 500;
  user-select: none;
}
button.dpick-day {
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
button.dpick-day:hover:not(:disabled):not(.is-selected) {
  background: #ccfbf1;
  color: #0f766e;
}
html[data-theme="dark"] .dpick-day {
  color: #e5e7eb;
}
html[data-theme="dark"] button.dpick-day:hover:not(:disabled):not(.is-selected) {
  background: #1f2937;
  color: #2dd4bf;
}
.dpick-outside {
  color: #94a3b8;
  opacity: 0.45;
}
html[data-theme="dark"] .dpick-outside {
  color: #4b5563;
  opacity: 0.4;
}
.dpick-day.is-today {
  border-color: rgb(20 184 166 / 60%);
  background: #f0fdfa;
  color: #0d9488;
  font-weight: 700;
}
html[data-theme="dark"] .dpick-day.is-today {
  background: #1f2937;
  color: #2dd4bf;
}
.dpick-day.is-selected {
  background: #14b8a6;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 6px -1px rgb(20 184 166 / 30%);
}
html[data-theme="dark"] .dpick-day.is-selected {
  color: #ffffff;
}
.dpick-day:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.dpick-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
}
html[data-theme="dark"] .dpick-foot {
  border-color: #1f2937;
}
.dpick-today,
.dpick-clear {
  padding: 2px 4px;
  border: 0;
  background: none;
  font-size: 11px;
  cursor: pointer;
}
.dpick-today {
  color: #0d9488;
  font-weight: 600;
}
html[data-theme="dark"] .dpick-today {
  color: #2dd4bf;
}
.dpick-today:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.dpick-clear {
  color: #64748b;
}
html[data-theme="dark"] .dpick-clear {
  color: #9ca3af;
}
.dpick-today:hover:not(:disabled),
.dpick-clear:hover {
  text-decoration: underline;
}
/* A panel with an open multi-choice list (Credit Officer, Center, Due Day, Columns) is lifted above the panels after
   it: each glass panel is its own layer (backdrop blur), so the next one would otherwise cover the list. */
.panel:has(details.multi-select[open]),
.metric-card:has(details.multi-select[open]),
.range-box:has(details.multi-select[open]) {
  position: relative;
  z-index: 30;
}
/* ─── Data Explorer filters, compact: a tight row of pick lists, then the four date and amount boxes in one even
   row, each on a single line (the boxes' inputs share the width). ─── */
.filter-picks {
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
}
.filter-picks .field {
  gap: 3px;
}
.filter-picks .field-label,
.filter-picks label {
  font-size: 10px;
  letter-spacing: 0.05em;
}
.filter-picks .cselect-button,
.filter-picks .multi-select > summary.control {
  min-height: 30px;
  height: 30px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 12px;
}
.filter-ranges {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 0.8fr;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
}
.filter-ranges .range-box {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 8px;
}
.filter-ranges .range-label {
  font-size: 9.5px;
  letter-spacing: 0.04em;
}
.filter-ranges .range-to {
  flex-shrink: 0;
}
.filter-ranges .range-box .control,
.filter-ranges .range-box input[type="date"].control,
.filter-ranges .range-box input[type="number"].control {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  height: 26px;
  min-height: 26px;
}
.filter-ranges .range-box .dpick {
  flex: 1 1 0;
  min-width: 0;
}
.filter-ranges .range-box .dpick > input[type="date"] {
  width: 100%;
  padding-left: 6px;
  padding-right: 26px;
}
.filter-ranges .range-box .dpick-button {
  right: 3px;
}
.filter-ranges + * {
  margin-top: 8px;
}
@media (max-width: 1180px) {
  .filter-ranges {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .filter-ranges {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ─── HR Portal (screens/hr, domain/hr.js) ─── */
.hr-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hr-checkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}
.hr-checkbar-date {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hr-checkbar-times {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  font-size: 13px;
}
.hr-checkbar-times b {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 15px;
}
.hr-balances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.hr-balance {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}
.hr-balance-name {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hr-balance-left {
  color: var(--color-brand-strong);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}
html[data-theme="dark"] .hr-balance-left {
  color: #2dd4bf;
}
.hr-balance-detail {
  color: var(--color-text-muted);
  font-size: 11px;
}
.hr-notices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hr-notice {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-left: 3px solid #14b8a6;
  border-radius: 10px;
  background: var(--color-surface);
}
.hr-notice header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.hr-notice p {
  margin: 6px 0;
  white-space: pre-line;
}
.hr-pay-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 10px;
}
.hr-pay-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 130px auto auto;
  align-items: center;
  gap: 6px;
}
.hr-mark {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}
.hr-mark .control,
.hr-mark .cselect-button {
  min-height: 28px;
  height: 28px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 12px;
}
.hr-mark input[type="time"] {
  width: 92px;
}
.hr-mark input:not([type]),
.hr-mark input[type="text"] {
  width: 120px;
}
.hr-mark .cselect {
  min-width: 110px;
}
.payslip {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 20px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
}
.payslip-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 2px solid #0d9488;
  font-size: 15px;
}
.payslip-who {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 12px 0;
}
.payslip-who div {
  display: flex;
  gap: 8px;
}
.payslip-who dt {
  min-width: 96px;
  color: #475569;
}
.payslip-who dd {
  margin: 0;
  font-weight: 600;
}
.payslip-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.payslip-table {
  width: 100%;
  border-collapse: collapse;
}
.payslip-table th {
  padding: 6px 8px;
  border-bottom: 1px solid #cbd5e1;
  background: #f1f5f9;
  text-align: left;
}
.payslip-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #e2e8f0;
}
.payslip-table .align-end {
  text-align: right;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.payslip-strong td {
  font-weight: 700;
}
.payslip-net {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 15px;
}
.payslip-net strong {
  font-size: 18px;
}
.payslip-note {
  margin: 10px 0 0;
  color: #475569;
  font-size: 11px;
}
@media (max-width: 640px) {
  .hr-pay-item,
  .payslip-columns,
  .payslip-who {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ─── My HR dashboard (screens/hr/my-hr.js) ─── */
.hrd {
  --hrd-card: #ffffff;
  --hrd-border: #e2e8f0;
  --hrd-soft: #f8fafc;
  --hrd-text: #0f172a;
  --hrd-muted: #64748b;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
html[data-theme="dark"] .hrd {
  --hrd-card: rgb(17 24 39 / 85%);
  --hrd-border: #1f2937;
  --hrd-soft: rgb(31 41 55 / 55%);
  --hrd-text: #f1f5f9;
  --hrd-muted: #94a3b8;
}
.hrd-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(120deg, #0f766e 0%, #0d9488 45%, #14b8a6 100%);
  color: #ffffff;
  box-shadow: 0 10px 25px -10px rgb(13 148 136 / 55%);
}
html[data-theme="dark"] .hrd-hero {
  background: linear-gradient(120deg, #134e4a 0%, #115e59 50%, #0f766e 100%);
  box-shadow: none;
}
.hrd-who {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.hrd-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border: 2px solid rgb(255 255 255 / 45%);
  border-radius: 18px;
  background: rgb(255 255 255 / 18%);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.hrd-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0.8;
  text-transform: uppercase;
}
.hrd-name {
  margin: 2px 0;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
}
.hrd-job {
  font-size: 12.5px;
  opacity: 0.9;
}
.hrd-today {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 18px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 14px;
  background: rgb(255 255 255 / 12%);
}
.hrd-times {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.hrd-times div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hrd-times span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.85;
  text-transform: uppercase;
}
.hrd-times b {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 20px;
}
.hrd-check-btn {
  min-width: 132px;
  border: 0 !important;
  background: #ffffff !important;
  color: #0f766e !important;
  font-weight: 800;
  box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
}
.hrd-check-btn:hover {
  background: #f0fdfa !important;
}
.hrd-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.hrd-balances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.hrd-balance {
  --tone: #0d9488;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--hrd-border);
  border-top: 3px solid var(--tone);
  border-radius: 14px;
  background: var(--hrd-card);
}
.hrd-tone-sky { --tone: #0284c7; }
.hrd-tone-violet { --tone: #7c3aed; }
.hrd-tone-amber { --tone: #d97706; }
.hrd-balance-name {
  color: var(--hrd-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hrd-balance-figure {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hrd-balance-figure strong {
  color: var(--tone);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}
.hrd-balance-figure span,
.hrd-balance-note {
  color: var(--hrd-muted);
  font-size: 11.5px;
}
.hrd-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--hrd-soft);
}
.hrd-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--tone);
}
.hrd-bar-empty {
  opacity: 0.5;
}
.hrd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}
.hrd-main,
.hrd-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.hrd-card {
  overflow: hidden;
  border: 1px solid var(--hrd-border);
  border-radius: 16px;
  background: var(--hrd-card);
}
.hrd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hrd-border);
}
.hrd-card-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--hrd-text);
  font-size: 13px;
  font-weight: 800;
}
.hrd-card-head h3 i {
  color: #0d9488;
}
html[data-theme="dark"] .hrd-card-head h3 i {
  color: #2dd4bf;
}
.hrd-card-body {
  padding: 14px 16px;
}
.hrd-empty {
  margin: 4px 0;
  color: var(--hrd-muted);
}
.hrd-small {
  font-size: 11px;
}
.hrd-requests {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hrd-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--hrd-border);
  border-radius: 12px;
  background: var(--hrd-soft);
}
.hrd-request-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hrd-request-main strong {
  color: var(--hrd-text);
}
.hrd-request-note {
  overflow: hidden;
  color: var(--hrd-muted);
  font-size: 11.5px;
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hrd-request-side {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}
.hrd-weekdays,
.hrd-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  text-align: center;
}
.hrd-weekdays {
  margin-bottom: 6px;
  color: var(--hrd-muted);
  font-size: 11px;
  font-weight: 700;
}
.hrd-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid var(--hrd-border);
  border-radius: 10px;
  background: var(--hrd-soft);
  color: var(--hrd-text);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 600;
}
.hrd-day-blank {
  border-color: transparent;
  background: transparent;
}
.hrd-day-sunday {
  color: var(--hrd-muted);
  opacity: 0.6;
}
.hrd-day-future {
  opacity: 0.55;
}
.hrd-day-today {
  outline: 2px solid #0d9488;
  outline-offset: 1px;
}
.hrd-day-present { border-color: #86efac; background: #dcfce7; color: #166534; }
.hrd-day-late { border-color: #fcd34d; background: #fef3c7; color: #92400e; }
.hrd-day-half_day { border-color: #93c5fd; background: #dbeafe; color: #1e40af; }
.hrd-day-absent { border-color: #fda4af; background: #ffe4e6; color: #9f1239; }
.hrd-day-leave { border-color: #c4b5fd; background: #ede9fe; color: #5b21b6; }
html[data-theme="dark"] .hrd-day-present { border-color: rgb(34 197 94 / 40%); background: rgb(34 197 94 / 15%); color: #86efac; }
html[data-theme="dark"] .hrd-day-late { border-color: rgb(245 158 11 / 40%); background: rgb(245 158 11 / 15%); color: #fcd34d; }
html[data-theme="dark"] .hrd-day-half_day { border-color: rgb(59 130 246 / 40%); background: rgb(59 130 246 / 15%); color: #93c5fd; }
html[data-theme="dark"] .hrd-day-absent { border-color: rgb(244 63 94 / 40%); background: rgb(244 63 94 / 15%); color: #fda4af; }
html[data-theme="dark"] .hrd-day-leave { border-color: rgb(139 92 246 / 40%); background: rgb(139 92 246 / 15%); color: #c4b5fd; }
.hrd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--hrd-muted);
  font-size: 11.5px;
}
.hrd-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hrd-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px solid;
  border-radius: 3px;
}
.hrd-notices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hrd-notice {
  padding: 10px 12px;
  border-left: 3px solid #0d9488;
  border-radius: 8px;
  background: var(--hrd-soft);
}
.hrd-notice strong {
  color: var(--hrd-text);
}
.hrd-notice p {
  margin: 4px 0;
  color: var(--hrd-text);
  white-space: pre-line;
}
.hrd-payslips {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hrd-payslip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hrd-border);
  border-radius: 12px;
  background: var(--hrd-soft);
  color: var(--hrd-text);
  text-align: left;
  cursor: pointer;
}
.hrd-payslip > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hrd-payslip:hover {
  border-color: #14b8a6;
}
.hrd-payslip-net {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0d9488;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 800;
}
html[data-theme="dark"] .hrd-payslip-net {
  color: #2dd4bf;
}
.hrd-details {
  display: flex;
  flex-direction: column;
  margin: 0;
}
.hrd-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--hrd-border);
}
.hrd-details div:last-child {
  border-bottom: 0;
}
.hrd-details dt {
  color: var(--hrd-muted);
  font-size: 12px;
}
.hrd-details dd {
  margin: 0;
  color: var(--hrd-text);
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}
@media (max-width: 980px) {
  .hrd-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .hrd-hero,
  .hrd-today {
    flex-direction: column;
    align-items: stretch;
  }
  .hrd-day {
    height: 30px;
  }
  .hrd-request {
    flex-direction: column;
    align-items: stretch;
  }
}
/* ─── Loan category badges (MF, DL, CA, GL, LE … and any new one): one hue each (domain/portfolio.js categoryHue) ─── */
.badge.cat-badge,
.inspector-category.cat-badge {
  border: 1px solid hsl(var(--cat-h, 200) 75% 72% / 70%);
  background: hsl(var(--cat-h, 200) 90% 94%);
  color: hsl(var(--cat-h, 200) 65% 32%);
  box-shadow: none;
  font-weight: 800;
  letter-spacing: 0.04em;
}
html[data-theme="dark"] .badge.cat-badge,
html[data-theme="dark"] .inspector-category.cat-badge {
  border-color: hsl(var(--cat-h, 200) 80% 60% / 40%);
  background: hsl(var(--cat-h, 200) 80% 55% / 16%);
  color: hsl(var(--cat-h, 200) 90% 78%);
}
/* ─── Admin → Loan Product list, compact ─── */
.lp-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  line-height: 1.3;
}
.lp-main {
  color: var(--color-text-strong, #0f172a);
  font-weight: 600;
  white-space: nowrap;
}
html[data-theme="dark"] .lp-main {
  color: #f1f5f9;
}
.lp-sub {
  color: var(--color-text-muted, #64748b);
  font-size: 11px;
  white-space: nowrap;
}
.lp-ids {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.lp-ids .badge {
  padding: 0 6px;
  font-size: 9.5px;
  line-height: 16px;
}
.lp-num {
  font-family: var(--font-mono, ui-monospace, monospace);
}
.lp-clip {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lp-template {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 999px;
  background: var(--color-surface-raised, #f8fafc);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.lp-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}
.lp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
}
.lp-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.lp-icon-edit:hover:not(:disabled) {
  border-color: #0d9488;
  background: #0d9488;
  color: #ffffff;
}
.lp-icon-off:hover:not(:disabled) {
  border-color: #e11d48;
  background: #e11d48;
  color: #ffffff;
}
.lp-icon-on:hover:not(:disabled) {
  border-color: #16a34a;
  background: #16a34a;
  color: #ffffff;
}
/* ─── My HR, compact ─── */
.hrd {
  gap: 10px;
}
.hrd-hero {
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
}
.hrd-who {
  gap: 10px;
}
.hrd-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 15px;
}
.hrd-eyebrow {
  display: none;
}
.hrd-name {
  margin: 0;
  font-size: 16px;
}
.hrd-job {
  font-size: 11.5px;
}
.hrd-today {
  gap: 12px;
  padding: 6px 8px 6px 12px;
  border-radius: 12px;
}
.hrd-times {
  gap: 14px;
}
.hrd-times span {
  font-size: 9px;
}
.hrd-times b {
  font-size: 15px;
}
.hrd-check-btn {
  min-width: 110px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.hrd-balances {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.hrd-balance {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 8px;
  padding: 8px 12px;
  border-top-width: 1px;
  border-left: 3px solid var(--tone);
  border-radius: 10px;
}
.hrd-balance-name {
  grid-column: 1 / -1;
  font-size: 10px;
}
.hrd-balance-figure strong {
  font-size: 20px;
}
.hrd-balance-figure span {
  font-size: 10.5px;
}
.hrd-bar {
  grid-column: 1 / -1;
  height: 4px;
}
.hrd-balance-note {
  grid-column: 1 / -1;
  font-size: 10.5px;
}
.hrd-grid,
.hrd-main,
.hrd-side {
  gap: 10px;
}
.hrd-card {
  border-radius: 12px;
}
.hrd-card-head {
  padding: 7px 12px;
}
.hrd-card-head h3 {
  font-size: 12px;
}
.hrd-card-head .btn {
  padding-top: 4px;
  padding-bottom: 4px;
}
.hrd-card-body {
  padding: 10px 12px;
}
.hrd-requests,
.hrd-notices,
.hrd-payslips {
  gap: 6px;
}
.hrd-request,
.hrd-payslip,
.hrd-notice {
  padding: 6px 10px;
  border-radius: 9px;
}
.hrd-weekdays {
  margin-bottom: 4px;
  font-size: 10px;
}
.hrd-weekdays,
.hrd-calendar {
  gap: 4px;
}
.hrd-day {
  height: 26px;
  border-radius: 7px;
  font-size: 11px;
}
.hrd-legend {
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
}
.hrd-details div {
  padding: 4px 0;
}
.hrd-details dt,
.hrd-details dd {
  font-size: 11.5px;
}.lp-product {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}
.lp-product > .cat-badge,
.lp-product > .lp-no-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  padding: 0;
  border-radius: 7px;
  font-size: 10.5px;
}
.lp-no-code {
  border: 1px dashed var(--color-border, #cbd5e1);
  color: var(--color-text-muted, #94a3b8);
}
.lp-product .lp-cell {
  flex: 1;
}
/* ─── My HR: narrower page, three columns, summary tiles ─── */
.hrd {
  max-width: 1180px;
  margin: 0 auto;
}
.hrd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.hrd-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  font-size: 10.5px;
  font-weight: 600;
}
.hrd-chip i {
  font-size: 9px;
  opacity: 0.85;
}
.hrd-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}
.hrd-tile {
  --tone: #0d9488;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  border: 1px solid var(--hrd-border);
  border-left: 3px solid var(--tone);
  border-radius: 10px;
  background: var(--hrd-card);
}
.hrd-tone-green { --tone: #16a34a; }
.hrd-tone-orange { --tone: #ea580c; }
.hrd-tile-label {
  overflow: hidden;
  color: var(--hrd-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.hrd-tile-value {
  color: var(--tone);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.15;
}
.hrd-tile-note {
  color: var(--hrd-muted);
  font-size: 10.5px;
  white-space: nowrap;
}
.hrd-tile .hrd-bar {
  height: 3px;
  margin-top: 4px;
}
.hrd-grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.hrd-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.hrd-recent {
  display: flex;
  flex-direction: column;
}
.hrd-recent-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--hrd-border);
  font-size: 12px;
}
.hrd-recent-row:last-child {
  border-bottom: 0;
}
.hrd-recent-date {
  color: var(--hrd-muted);
  font-size: 11.5px;
}
.hrd-recent-times {
  color: var(--hrd-text);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 600;
}
.hrd-holiday-name {
  grid-column: 2 / -1;
  color: var(--hrd-text);
  font-weight: 600;
}
.hrd-request {
  padding: 6px 8px;
}
.hrd-request-side .btn {
  padding: 3px 8px;
}
.hrd-legend {
  gap: 8px;
  font-size: 10.5px;
}
@media (max-width: 1100px) {
  .hrd-grid3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hrd-grid3 > .hrd-col:last-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .hrd-grid3 {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ─── My HR: compact tabs (one card) ─── */
.hrt {
  max-width: 1000px;
}
.hrt-shell {
  overflow: hidden;
  border: 1px solid var(--hrd-border);
  border-radius: 14px;
  background: var(--hrd-card);
}
.hrt .hrd-hero {
  padding: 12px 16px;
  border-radius: 0;
  border-bottom: 1px solid var(--hrd-border);
  background: var(--hrd-card);
  color: var(--hrd-text);
  box-shadow: none;
}
.hrt .hrd-avatar {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #0d9488;
  color: #ffffff;
  font-size: 14px;
}
.hrt .hrd-name {
  color: var(--hrd-text);
  font-size: 15px;
}
.hrt .hrd-job {
  color: var(--hrd-muted);
  opacity: 1;
}
.hrt .hrd-chip {
  border-color: var(--hrd-border);
  background: var(--hrd-soft);
  color: var(--hrd-muted);
}
.hrt .hrd-today {
  padding: 0;
  border: 0;
  background: none;
}
.hrt .hrd-times span {
  color: var(--hrd-muted);
  opacity: 1;
}
.hrt .hrd-times b {
  color: var(--hrd-text);
  font-size: 15px;
}
.hrt .hrd-check-btn {
  border: 0 !important;
  background: #0d9488 !important;
  color: #ffffff !important;
  box-shadow: none;
}
.hrt .hrd-check-btn:hover {
  background: #0f766e !important;
}
.hrt .hrd-done {
  color: #0d9488;
}
.hrt .hrd-tiles {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--hrd-border);
  background: var(--hrd-soft);
}
.hrt .hrd-tile {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 14px;
  border: 0;
  border-right: 1px solid var(--hrd-border);
  border-radius: 0;
  background: transparent;
}
.hrt .hrd-tile:last-child {
  border-right: 0;
}
.hrt .hrd-tile-value {
  font-size: 17px;
}
.hrt .hrd-tile .hrd-bar {
  display: none;
}
.hrt .tabs {
  padding: 0 14px 14px;
}
.hrt .tab-list {
  margin: 0 -14px 12px;
  padding: 0 14px;
}
.hrt .hrd-card {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.hrt .hrd-card-head {
  padding: 0 0 8px;
  border: 0;
}
.hrt .hrd-card-body {
  padding: 0;
}
.hrt-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .hrt .hrd-tiles {
    flex-wrap: wrap;
  }
  .hrt .hrd-tile {
    flex-basis: 33%;
    border-bottom: 1px solid var(--hrd-border);
  }
  .hrt-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ─── Admin → Branches: setup chips, tabbed form, staff and regions ─── */
.br-setup {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.br-setup-chip {
  padding: 1px 7px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 999px;
  background: var(--color-surface-raised, #f8fafc);
  color: var(--color-text-muted, #64748b);
  font-size: 10.5px;
  white-space: nowrap;
}
.br-form .tabs .tab-list {
  margin-bottom: 12px;
}
.br-days {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 4px 0 10px;
}
.br-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  max-height: 300px;
  margin-top: 10px;
  padding: 10px 12px;
  overflow-y: auto;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
}
.br-products.is-disabled {
  opacity: 0.5;
}
.br-staff-add {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.br-staff-add .cselect,
.br-staff-add select {
  flex: 1;
}
.br-staff-list {
  display: flex;
  flex-direction: column;
  max-height: 380px;
  overflow-y: auto;
}
.br-staff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.br-staff-row.is-inactive {
  opacity: 0.6;
}
.br-staff-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #0d9488;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}
.br-staff-who {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.br-staff-who .muted {
  font-size: 11px;
}
.br-region-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) auto auto auto;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.br-region-count {
  font-size: 11px;
  white-space: nowrap;
}
.br-region-new {
  margin-top: 10px;
  padding-top: 6px;
}
.br-region-new .br-region-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) auto;
  border-bottom: 0;
}
@media (max-width: 640px) {
  .br-products,
  .br-region-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ─── My HR: HR app layout (profile and menu on the left, the chosen page on the right) ─── */
.hra {
  --hrd-card: #ffffff;
  --hrd-border: #e2e8f0;
  --hrd-soft: #f8fafc;
  --hrd-text: #0f172a;
  --hrd-muted: #64748b;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}
html[data-theme="dark"] .hra {
  --hrd-card: rgb(17 24 39 / 85%);
  --hrd-border: #1f2937;
  --hrd-soft: rgb(31 41 55 / 55%);
  --hrd-text: #f1f5f9;
  --hrd-muted: #94a3b8;
}
.hra-side {
  position: sticky;
  top: 72px;
  overflow: hidden;
  border: 1px solid var(--hrd-border);
  border-radius: 16px;
  background: var(--hrd-card);
}
.hra-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--hrd-border);
  background: linear-gradient(180deg, rgb(13 148 136 / 10%), transparent 70%);
  text-align: center;
}
.hra-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border: 3px solid var(--hrd-card);
  border-radius: 50%;
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 6px 16px -6px rgb(13 148 136 / 60%);
}
.hra-name {
  color: var(--hrd-text);
  font-size: 15px;
}
.hra-job {
  color: var(--hrd-muted);
  font-size: 12px;
}
.hra-empno {
  margin-top: 4px;
  padding: 1px 8px;
  border: 1px solid var(--hrd-border);
  border-radius: 999px;
  color: var(--hrd-muted);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
}
.hra-today {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--hrd-border);
  border-radius: 12px;
  background: var(--hrd-card);
  text-align: left;
}
.hra-today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--hrd-muted);
  font-size: 11px;
  font-weight: 600;
}
.hra-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.hra-times div {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--hrd-soft);
}
.hra-times span {
  color: var(--hrd-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.hra-times b {
  color: var(--hrd-text);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 16px;
}
.hra-check-btn {
  justify-content: center;
  width: 100%;
}
.hra-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #0d9488;
  font-size: 12px;
  font-weight: 700;
}
.hra-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}
.hra-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--hrd-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.hra-menu-item i {
  width: 16px;
  text-align: center;
}
.hra-menu-item:hover {
  background: var(--hrd-soft);
  color: var(--hrd-text);
}
.hra-menu-item.is-active {
  background: rgb(13 148 136 / 12%);
  color: #0f766e;
}
html[data-theme="dark"] .hra-menu-item.is-active {
  color: #2dd4bf;
}
.hra-count {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--hrd-soft);
  color: var(--hrd-muted);
  font-size: 11px;
  line-height: 18px;
}
.hra-menu-item.is-active .hra-count {
  background: #0d9488;
  color: #ffffff;
}
.hra-content {
  min-width: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--hrd-border);
  border-radius: 16px;
  background: var(--hrd-card);
}
.hra-title {
  margin: 0 0 14px;
  color: var(--hrd-text);
  font-size: 17px;
  font-weight: 800;
}
.hra-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hra-content .hrd-card {
  border: 1px solid var(--hrd-border);
}
.hra-greeting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hra-greeting strong {
  display: block;
  color: var(--hrd-text);
  font-size: 15px;
}
.hra-greeting span {
  color: var(--hrd-muted);
  font-size: 12px;
}
.hra-summaries {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hra-summary {
  --tone: #0d9488;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--hrd-border);
  border-radius: 14px;
  background: var(--hrd-card);
  color: var(--hrd-text);
  text-align: left;
  cursor: pointer;
}
.hra-summary:hover {
  border-color: var(--tone);
}
.hrd-tone-sky { --tone: #0284c7; }
.hra-summary-icon {
  grid-row: 1 / 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  color: var(--tone);
}
.hra-summary-label {
  color: var(--hrd-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hra-summary strong {
  color: var(--tone);
  font-size: 19px;
  line-height: 1.25;
}
.hra-summary-note {
  overflow: hidden;
  color: var(--hrd-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hra .hrd-tiles {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}
@media (max-width: 900px) {
  .hra {
    grid-template-columns: minmax(0, 1fr);
  }
  .hra-side {
    position: static;
  }
  .hra-menu {
    flex-direction: row;
    overflow-x: auto;
  }
  .hra-summaries {
    grid-template-columns: minmax(0, 1fr);
  }
}
.hra .hra-check-btn,
.hra .hra-greeting .btn {
  border-color: #0d9488 !important;
  background: #0d9488 !important;
  color: #ffffff !important;
}
.hra .hra-check-btn .btn-label,
.hra .hra-greeting .btn .btn-label {
  color: #ffffff !important;
}
/* ─── My HR, compact: a slim side panel (profile row, today, menu), a header row and dense content ─── */
.hra {
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 12px;
  max-width: 1120px;
}
.hra-side {
  border-radius: 12px;
}
.hra-profile {
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  text-align: left;
  background: linear-gradient(180deg, rgb(13 148 136 / 9%), transparent);
}
.hra-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.hra-who > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hra-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  margin: 0;
  border-width: 2px;
  font-size: 14px;
  box-shadow: 0 4px 10px -4px rgb(13 148 136 / 60%);
}
.hra-name {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hra-job {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hra-empno {
  align-self: flex-start;
  margin-top: 3px;
  padding: 0 6px;
  font-size: 10px;
}
.hra-today {
  gap: 6px;
  margin: 0;
  padding: 8px;
  border-radius: 10px;
}
.hra-today-head span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hra-today-head i {
  color: #f59e0b;
}
.hra-times {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--hrd-soft);
}
.hra-times span {
  font-size: 10px;
}
.hra-times b {
  margin-left: 3px;
  font-size: 13px;
}
.hra .hra-check-btn {
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 12px;
}
.hra-menu {
  gap: 1px;
  padding: 6px;
}
.hra-menu-item {
  gap: 9px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12.5px;
}
.hra-content {
  padding: 12px 14px 14px;
  border-radius: 12px;
}
.hra-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hrd-border);
}
.hra-head .hra-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
}
.hra-head .hra-title i {
  color: #0d9488;
  font-size: 13px;
}
.hra-sub {
  display: block;
  margin-top: 1px;
  color: var(--hrd-muted);
  font-size: 11.5px;
}
.hra .hra-apply {
  min-height: 30px;
  padding: 4px 12px;
  border-color: #0d9488 !important;
  background: #0d9488 !important;
  color: #ffffff !important;
  font-size: 12px;
}
.hra .hra-apply .btn-label {
  color: #ffffff !important;
}
.hra-stack {
  gap: 12px;
}
.hra-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--hrd-border);
  border-radius: 12px;
}
.hra-stat {
  --tone: #0d9488;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-left: 1px solid var(--hrd-border);
  background: transparent;
  color: var(--hrd-text);
  text-align: left;
  cursor: pointer;
}
.hra-stat:first-child {
  border-left: 0;
}
.hra-stat:hover {
  background: var(--hrd-soft);
}
.hra-stat-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--tone) 13%, transparent);
  color: var(--tone);
  font-size: 13px;
}
.hra-stat-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hra-stat-label {
  color: var(--hrd-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hra-stat strong {
  color: var(--tone);
  font-size: 15px;
  line-height: 1.3;
}
.hra-stat-note {
  overflow: hidden;
  color: var(--hrd-muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hra-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.hra-feed-item + .hra-feed-item {
  border-top: 1px solid var(--hrd-border);
}
.hra-feed-head {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 12px;
  border: 0;
  background: var(--hrd-soft);
  color: var(--hrd-text);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.hra-feed-head i:first-child {
  color: #0d9488;
}
.hra-feed-head i:last-child {
  margin-left: auto;
  color: var(--hrd-muted);
  font-size: 10px;
}
.hra-feed-head:hover span {
  color: #0d9488;
}
.hra-feed-list {
  display: flex;
  flex-direction: column;
}
.hra-feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
}
.hra-feed-list .hra-feed-row + .hra-feed-row {
  border-top: 1px dashed var(--hrd-border);
}
.hra-feed-row > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hra-feed-row b,
.hra-feed-notice b {
  color: var(--hrd-text);
  font-size: 12.5px;
}
.hra-feed-row small,
.hra-feed-notice small {
  color: var(--hrd-muted);
  font-size: 11px;
}
.hra-feed-notice {
  padding: 7px 12px 8px;
}
.hra-feed-notice p {
  display: -webkit-box;
  overflow: hidden;
  margin: 2px 0;
  color: var(--hrd-text);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.hra-feed-empty {
  margin: 0;
  padding: 8px 12px;
  color: var(--hrd-muted);
  font-size: 12px;
}
.hra .hrd-day {
  height: 24px;
}
.hra .hrd-tiles {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}
.hra .hrd-legend {
  font-size: 11px;
}
@media (max-width: 1000px) {
  .hra-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hra-stat:nth-child(3) {
    border-left: 0;
  }
  .hra-stat:nth-child(n + 3) {
    border-top: 1px solid var(--hrd-border);
  }
  .hra-overview {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .hra {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ─── My HR (new): a profile banner with a live clock, a tab bar, then a grid of cards ─── */
.hrx {
  --hrd-card: #ffffff;
  --hrd-border: #e5e9f0;
  --hrd-soft: #f6f8fb;
  --hrd-text: #0f172a;
  --hrd-muted: #64748b;
  --hrx-accent: #0d9488;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1160px;
  margin: 0 auto;
}
html[data-theme="dark"] .hrx {
  --hrd-card: rgb(17 24 39 / 85%);
  --hrd-border: #1f2937;
  --hrd-soft: rgb(31 41 55 / 55%);
  --hrd-text: #f1f5f9;
  --hrd-muted: #94a3b8;
}
.hrd-tone-rose { --tone: #e11d48; }
.hrx-banner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  padding: 18px 22px;
  border-radius: 16px;
  background: radial-gradient(120% 140% at 100% 0%, #14b8a6 0%, transparent 55%), linear-gradient(120deg, #0f3d3a 0%, #0f766e 55%, #0d9488 100%);
  color: #ffffff;
  box-shadow: 0 12px 28px -18px rgb(13 148 136 / 80%);
}
.hrx-banner::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  border: 40px solid rgb(255 255 255 / 6%);
  border-radius: 50%;
  pointer-events: none;
}
.hrx-id {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.hrx-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 2px solid rgb(255 255 255 / 45%);
  border-radius: 16px;
  background: rgb(255 255 255 / 14%);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}
.hrx-greet {
  display: block;
  color: rgb(255 255 255 / 72%);
  font-size: 11.5px;
  font-weight: 600;
}
.hrx-name {
  display: block;
  font-size: 19px;
  line-height: 1.2;
}
.hrx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.hrx-chips span {
  padding: 1px 9px;
  border-radius: 999px;
  background: rgb(255 255 255 / 14%);
  font-size: 11px;
  font-weight: 600;
}
.hrx-today {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 14px;
  background: rgb(0 0 0 / 14%);
  backdrop-filter: blur(6px);
}
.hrx-clock {
  display: flex;
  flex-direction: column;
}
.hrx-now {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 24px;
  line-height: 1.1;
}
.hrx-clock span {
  color: rgb(255 255 255 / 72%);
  font-size: 11px;
}
.hrx-punch {
  display: flex;
  gap: 14px;
  padding-left: 16px;
  border-left: 1px solid rgb(255 255 255 / 18%);
}
.hrx-punch span {
  display: flex;
  flex-direction: column;
}
.hrx-punch small {
  color: rgb(255 255 255 / 65%);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.hrx-punch b {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 15px;
}
.hrx-act {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.hrx-act .badge {
  align-self: center;
}
.hrx .hrx-check {
  min-height: 30px;
  padding: 4px 14px;
  border-color: #ffffff !important;
  background: #ffffff !important;
  color: #0f766e !important;
  font-size: 12px;
  font-weight: 700;
}
.hrx .hrx-check .btn-label,
.hrx .hrx-check i {
  color: #0f766e !important;
}
.hrx-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}
.hrx-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px;
  border: 1px solid var(--hrd-border);
  border-radius: 12px;
  background: var(--hrd-card);
}
.hrx-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
}
.hrx-tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--hrd-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.hrx-tab:hover {
  background: var(--hrd-soft);
  color: var(--hrd-text);
}
.hrx-tab.is-active {
  background: var(--hrx-accent);
  color: #ffffff;
  box-shadow: 0 4px 10px -6px rgb(13 148 136 / 90%);
}
.hrx-tab-count {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hrd-soft);
  color: var(--hrd-muted);
  font-size: 10.5px;
  line-height: 16px;
}
.hrx-tab.is-active .hrx-tab-count {
  background: rgb(255 255 255 / 25%);
  color: #ffffff;
}
.hrx .hrx-apply {
  flex: none;
  min-height: 30px;
  padding: 4px 12px;
  border-color: var(--hrx-accent) !important;
  background: transparent !important;
  color: var(--hrx-accent) !important;
  font-size: 12px;
}
.hrx .hrx-apply .btn-label {
  color: var(--hrx-accent) !important;
}
.hrx .hrx-apply:hover {
  background: rgb(13 148 136 / 10%) !important;
}
.hrx-page > .hra-stack,
.hrx-page > .hrt-pair {
  gap: 12px;
}
.hrx .hrd-tiles {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.hrx .hrd-day {
  height: 26px;
}
/* Overview grid */
.hrx-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}
.hrx-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--hrd-border);
  border-radius: 14px;
  background: var(--hrd-card);
}
.hrx-leave { grid-column: span 5; }
.hrx-week { grid-column: span 7; }
.hrx-slip { grid-column: span 4; }
.hrx-waiting { grid-column: span 4; }
.hrx-notice { grid-column: span 4; }
.hrx-holiday { grid-column: span 4; }
.hrx-grid > .hrx-slip ~ .hrx-notice { grid-column: span 4; }
.hrx-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 4px;
  border: 0;
  background: transparent;
  color: var(--hrd-text);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.hrx-card-head i:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgb(13 148 136 / 12%);
  color: var(--hrx-accent);
  font-size: 11px;
}
.hrx-card-head i:last-child {
  margin-left: auto;
  color: var(--hrd-muted);
  font-size: 11px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s, transform 0.15s;
}
.hrx-card:hover .hrx-card-head i:last-child {
  opacity: 1;
  transform: none;
}
.hrx-card > :not(.hrx-card-head) {
  padding: 8px 14px 14px;
}
.hrx-empty {
  margin: 0;
  color: var(--hrd-muted);
  font-size: 12px;
}
.hrx-rings {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 12px;
}
.hrx-ring-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--hrd-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.hrx-ring-item small {
  color: #d97706;
  font-size: 10px;
}
.hrx-ring {
  --p: 0;
  --tone: #0d9488;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--hrd-card) 76%, transparent 78%), conic-gradient(var(--tone) calc(var(--p) * 1%), var(--hrd-soft) 0);
  border: 1px solid var(--hrd-border);
}
.hrx-ring b {
  color: var(--tone);
  font-size: 19px;
  line-height: 1;
}
.hrx-ring small {
  color: var(--hrd-muted);
  font-size: 10px;
}
.hrx-days {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.hrx-day {
  --tone: var(--hrd-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px;
  border: 1px solid var(--hrd-border);
  border-radius: 10px;
  background: var(--hrd-soft);
  color: var(--hrd-muted);
}
.hrx-day span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.hrx-day b {
  color: var(--hrd-text);
  font-size: 16px;
}
.hrx-day small {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
}
.hrx-day.is-present { --tone: #16a34a; }
.hrx-day.is-late { --tone: #ea580c; }
.hrx-day.is-half_day { --tone: #0284c7; }
.hrx-day.is-absent,
.hrx-day.is-none { --tone: #e11d48; }
.hrx-day.is-leave { --tone: #7c3aed; }
.hrx-day[class*="is-"]:not(.is-today) {
  border-color: color-mix(in srgb, var(--tone) 35%, transparent);
  background: color-mix(in srgb, var(--tone) 8%, transparent);
}
.hrx-day[class*="is-"] small {
  color: var(--tone);
}
.hrx-day.is-none small {
  opacity: 0.6;
}
.hrx-day.is-today {
  border: 2px solid var(--hrx-accent);
  background: rgb(13 148 136 / 8%);
}
.hrx-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.hrx-figure {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border-left: 3px solid var(--tone);
  border-radius: 6px;
  background: var(--hrd-soft);
}
.hrx-figure b {
  color: var(--tone);
  font-size: 16px;
}
.hrx-figure span {
  color: var(--hrd-muted);
  font-size: 11px;
}
.hrx-slip {
  justify-content: space-between;
  gap: 3px;
  padding: 14px 16px !important;
  border: 0;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: rgb(255 255 255 / 70%);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
}
.hrx-slip > * {
  padding: 0 !important;
}
.hrx-slip-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5eead4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hrx-slip strong {
  margin-top: 6px;
  color: #ffffff;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 24px;
}
.hrx-slip-open {
  margin-top: 8px;
  color: #5eead4;
  font-weight: 700;
}
.hrx-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hrx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--hrd-soft);
}
.hrx-row > span,
.hrx-holiday-body > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hrx-row b,
.hrx-note b,
.hrx-holiday-body b {
  color: var(--hrd-text);
  font-size: 12.5px;
}
.hrx-row small,
.hrx-note small,
.hrx-holiday-body small {
  color: var(--hrd-muted);
  font-size: 11px;
}
.hrx-note {
  margin: 0 14px 14px;
  padding: 8px 10px !important;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  background: rgb(245 158 11 / 8%);
}
.hrx-note p {
  display: -webkit-box;
  overflow: hidden;
  margin: 2px 0;
  color: var(--hrd-text);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.hrx-holiday-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hrx-cal {
  display: flex;
  flex: none;
  flex-direction: column;
  overflow: hidden;
  width: 46px;
  border: 1px solid var(--hrd-border);
  border-radius: 9px;
  text-align: center;
}
.hrx-cal small {
  padding: 1px 0;
  background: #e11d48;
  color: #ffffff !important;
  font-size: 9.5px !important;
  font-weight: 700;
  text-transform: uppercase;
}
.hrx-cal b {
  padding: 3px 0;
  font-size: 17px !important;
}
@media (max-width: 1000px) {
  .hrx-leave,
  .hrx-week {
    grid-column: span 12;
  }
  .hrx-slip,
  .hrx-waiting,
  .hrx-notice,
  .hrx-holiday {
    grid-column: span 6;
  }
}
@media (max-width: 640px) {
  .hrx-grid > * {
    grid-column: span 12 !important;
  }
  .hrx-today {
    flex-wrap: wrap;
    width: 100%;
  }
  .hrx-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .hrx-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.hrx-leave-summary {
  display: grid !important;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}
.hrx-leave-summary > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 14px !important;
}
.hrx-leave-month {
  justify-content: flex-start;
  border-left: 1px solid var(--hrd-border);
}
.hrx-leave-month .hrx-figures {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}
.hrx-mini-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hrd-text);
  font-size: 12.5px;
  font-weight: 700;
}
.hrx-mini-head i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgb(13 148 136 / 12%);
  color: var(--hrx-accent);
  font-size: 11px;
}
.hrx-ring-item small.is-muted {
  color: var(--hrd-muted);
}
.hrx-rings {
  justify-content: flex-start;
  gap: 18px;
}
@media (max-width: 760px) {
  .hrx-leave-summary {
    grid-template-columns: minmax(0, 1fr);
  }
  .hrx-leave-month {
    border-top: 1px solid var(--hrd-border);
    border-left: 0;
  }
}
.hrx-month {
  margin-top: 12px;
}
.hrx-stack-bar {
  display: flex;
  gap: 2px;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--hrd-soft);
}
.hrx-stack-bar span {
  flex-basis: 0;
  min-width: 6px;
}
.hrx-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.hrx-key {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--hrd-muted);
  font-size: 11.5px;
}
.hrx-key i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.hrx-key b {
  margin-left: auto;
  color: var(--hrd-text);
  font-size: 13px;
}
.hrx-leave-month .hrx-month {
  margin-top: 4px;
}
.hrx-leave-month .hrx-keys {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 8px;
}
.hrx .hrx-card-head,
.hrx .hrx-card-head span {
  color: var(--hrd-text) !important;
  opacity: 1 !important;
}
.hrx-slip,
.hrx-waiting,
.hrx-notice,
.hrx-holiday,
.hrx-grid > .hrx-slip ~ .hrx-notice {
  grid-column: span 3;
}
@media (max-width: 1000px) {
  .hrx-slip,
  .hrx-waiting,
  .hrx-notice,
  .hrx-holiday,
  .hrx-grid > .hrx-slip ~ .hrx-notice {
    grid-column: span 6;
  }
}
/* My HR on one page */
.hrx-span-5 { grid-column: span 5; }
.hrx-span-7 { grid-column: span 7; }
.hrx-span-12 { grid-column: span 12; }
.hrx .hrx-card-head {
  cursor: default;
  padding: 10px 14px 6px;
}
.hrx .hrx-card-head > span {
  flex: 1;
}
.hrx .hrx-card-head i:last-child {
  margin-left: 0;
  opacity: 1;
  transform: none;
}
.hrx .hrx-card-head .btn i {
  width: auto;
  height: auto;
  background: transparent;
  color: inherit;
}
.hrx-card > .hrx-list,
.hrx-card > .hrx-empty {
  max-height: 260px;
  overflow-y: auto;
}
.hrx-list .hrx-note {
  margin: 0;
}
.hrx-row-side {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
}
.hrx-row-side i {
  color: var(--hrd-muted);
  font-size: 10px;
}
.hrx .hrx-mini-btn {
  min-height: 24px;
  padding: 2px 9px;
  font-size: 11px;
}
.hrx-row-link {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.hrx-row-link:hover {
  background: rgb(13 148 136 / 9%);
}
.hrx-net {
  color: var(--hrx-accent);
  font-family: var(--font-mono, ui-monospace, monospace);
}
.hrx-card .hrx-list .hrx-holiday-body {
  padding: 4px 0;
}
.hrx-details {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}
.hrx-details div {
  min-width: 0;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--hrd-soft);
}
.hrx-details dt {
  color: var(--hrd-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hrx-details dd {
  overflow: hidden;
  margin: 1px 0 0;
  color: var(--hrd-text);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1000px) {
  .hrx-span-5,
  .hrx-span-7 {
    grid-column: span 12;
  }
  .hrx-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* My HR: quick figures, month calendar, check-in history, contacts */
.hrx-span-3 { grid-column: span 3; }
.hrx-span-6 { grid-column: span 6; }
.hrx-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.hrx-kpi {
  --tone: #0d9488;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--hrd-border);
  border-radius: 14px;
  background: var(--hrd-card);
}
.hrx-kpi-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hrx-kpi-text > span {
  color: var(--hrd-muted);
  font-size: 11px;
  font-weight: 600;
}
.hrx-kpi strong {
  color: var(--hrd-text);
  font-size: 20px;
  line-height: 1.25;
}
.hrx-kpi small {
  overflow: hidden;
  color: var(--hrd-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hrx-kpi-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  color: var(--tone);
  font-size: 15px;
}
.hrx-cal-head,
.hrx-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}
.hrx-cal-head {
  margin-bottom: 4px;
  color: var(--hrd-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.hrx-cell {
  --tone: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  border-radius: 8px;
  background: var(--hrd-soft);
  color: var(--hrd-text);
  font-size: 11.5px;
  font-weight: 600;
}
.hrx-cell.is-blank {
  background: transparent;
}
.hrx-cell.is-sunday,
.hrx-cell.is-future {
  color: var(--hrd-muted);
  opacity: 0.6;
}
.hrx-cell.is-present { --tone: #16a34a; }
.hrx-cell.is-late { --tone: #ea580c; }
.hrx-cell.is-half_day { --tone: #0284c7; }
.hrx-cell.is-absent { --tone: #e11d48; }
.hrx-cell.is-leave { --tone: #7c3aed; }
.hrx-cell.is-present,
.hrx-cell.is-late,
.hrx-cell.is-half_day,
.hrx-cell.is-absent,
.hrx-cell.is-leave {
  background: var(--tone);
  color: #ffffff;
}
.hrx-cell.is-none {
  box-shadow: inset 0 0 0 1px rgb(225 29 72 / 35%);
  color: #e11d48;
}
.hrx-cell.is-today {
  box-shadow: 0 0 0 2px var(--hrd-card), 0 0 0 4px var(--hrx-accent);
}
.hrx-history {
  display: flex;
  flex-direction: column;
}
.hrx-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 0.8fr 0.8fr 0.8fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--hrd-border);
  color: var(--hrd-text);
  font-size: 12px;
}
.hrx-history-row:last-child {
  border-bottom: 0;
}
.hrx-history-row b {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 600;
}
.hrx-history-row.is-head {
  padding-top: 0;
  color: var(--hrd-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hrx-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.hrx-contact > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hrx-contact small {
  overflow: hidden;
  color: var(--hrd-muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hrx-contact b {
  overflow: hidden;
  color: var(--hrd-text);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hrx-contact-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgb(13 148 136 / 12%);
  color: var(--hrx-accent);
  font-size: 11px;
  font-weight: 800;
}
@media (max-width: 1000px) {
  .hrx-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hrx-span-6 {
    grid-column: span 12;
  }
  .hrx-span-3 {
    grid-column: span 6;
  }
}
@media (max-width: 640px) {
  .hrx-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* My HR: overview links to the separate pages */
.hrx-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.hrx-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--hrd-border);
  border-radius: 14px;
  background: var(--hrd-card);
  color: var(--hrd-text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.hrx-link:hover {
  border-color: var(--hrx-accent);
  box-shadow: 0 8px 20px -14px rgb(13 148 136 / 70%);
  transform: translateY(-1px);
}
.hrx-link-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgb(13 148 136 / 12%);
  color: var(--hrx-accent);
  font-size: 15px;
}
.hrx-link-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.hrx-link-text b {
  font-size: 13.5px;
}
.hrx-link-text small {
  overflow: hidden;
  color: var(--hrd-muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hrx-link-count {
  padding: 0 7px;
  border-radius: 999px;
  background: var(--hrx-accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}
.hrx-link > i {
  color: var(--hrd-muted);
  font-size: 11px;
}
.hrx-span-12 > .hrx-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  max-height: none;
}
/* My HR: the way back from a separate page */
.hrx-back {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--hrd-border);
  border-radius: 999px;
  background: var(--hrd-card);
  color: var(--hrd-text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.hrx-back i {
  color: var(--hrx-accent);
  font-size: 11px;
}
.hrx-back:hover {
  border-color: var(--hrx-accent);
  color: var(--hrx-accent);
}
/* Staff performance: score pills (My Performance, Staff Targets) */
.kpi-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.kpi-pill.is-good { background: rgb(22 163 74 / 13%); color: #15803d; }
.kpi-pill.is-near { background: rgb(217 119 6 / 14%); color: #b45309; }
.kpi-pill.is-behind { background: rgb(225 29 72 / 12%); color: #be123c; }
.kpi-pill.is-none { background: rgb(100 116 139 / 12%); color: #64748b; font-weight: 600; }
html[data-theme="dark"] .kpi-pill.is-good { color: #4ade80; }
html[data-theme="dark"] .kpi-pill.is-near { color: #fbbf24; }
html[data-theme="dark"] .kpi-pill.is-behind { color: #fb7185; }
.kpi-cell {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.25;
}
.kpi-cell small {
  color: var(--text-muted, #64748b);
  font-size: 11px;
}
/* My HR → My Performance */
.hrx .hrx-month-pick {
  width: auto;
  min-height: 28px;
  padding: 2px 36px 2px 12px;
  font-size: 12px;
}
/* A set width with room on the right for the calendar button, clear of the round end (beats the .dpick > input
   padding). */
.hrx .dpick > input.hrx-month-pick {
  width: 146px;
  padding-right: 36px;
}
.hrx .dpick:has(> .hrx-month-pick) .dpick-button {
  right: 10px;
  color: var(--color-brand-strong);
}
html[data-theme="dark"] .hrx .dpick:has(> .hrx-month-pick) .dpick-button { color: #5eead4; }
.hrx-score {
  display: flex;
  align-items: center;
  gap: 18px;
}
.hrx-score-ring {
  width: 104px;
  height: 104px;
  margin: 0;
}
.hrx-score-ring.is-good { --tone: #16a34a; }
.hrx-score-ring.is-near { --tone: #d97706; }
.hrx-score-ring.is-behind { --tone: #e11d48; }
.hrx-score-ring.is-none { --tone: #94a3b8; }
.hrx-score-ring b {
  font-size: 24px;
}
.hrx-score-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hrx-score-text b {
  color: var(--hrd-text);
  font-size: 16px;
}
.hrx-score-text small {
  color: var(--hrd-muted);
  font-size: 12px;
}
.hrx-trend {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  height: 140px;
}
.hrx-trend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 0;
  color: var(--hrd-muted);
  font-size: 11px;
}
.hrx-trend-item small {
  color: var(--hrd-text);
  font-size: 11px;
  font-weight: 700;
}
.hrx-trend-track {
  display: flex;
  flex: 1;
  align-items: flex-end;
  width: 100%;
  max-width: 44px;
  min-height: 0;
  border-radius: 8px;
  background: var(--hrd-soft);
}
.hrx-trend-bar {
  width: 100%;
  border-radius: 8px;
  background: #94a3b8;
}
.hrx-trend-bar.is-good,
.hrx-progress-fill.is-good { background: #16a34a; }
.hrx-trend-bar.is-near,
.hrx-progress-fill.is-near { background: #d97706; }
.hrx-trend-bar.is-behind,
.hrx-progress-fill.is-behind { background: #e11d48; }
.hrx-trend-item.is-current > span:last-child {
  color: var(--hrx-accent);
  font-weight: 800;
}
.hrx-kpi-table {
  display: flex;
  flex-direction: column;
}
.hrx-kpi-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr) 90px;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--hrd-border);
  color: var(--hrd-text);
  font-size: 12.5px;
}
.hrx-kpi-row:last-child {
  border-bottom: 0;
}
.hrx-kpi-row.is-head {
  padding-top: 0;
  color: var(--hrd-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hrx-kpi-row > span:first-child {
  display: flex;
  flex-direction: column;
}
.hrx-kpi-row small {
  color: var(--hrd-muted);
  font-size: 10.5px;
}
.hrx-num {
  font-family: var(--font-mono, ui-monospace, monospace);
}
.hrx-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--hrd-soft);
}
.hrx-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #94a3b8;
}
@media (max-width: 760px) {
  .hrx-kpi-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 80px;
  }
  .hrx-progress {
    display: none;
  }
  .hrx-kpi-row.is-head span:nth-child(4) {
    display: none;
  }
}
/* My Performance, in detail */
.hrx-span-4 { grid-column: span 4; }
.hrx-span-8 { grid-column: span 8; }
.hrx-rank {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgb(217 119 6 / 12%);
  color: #b45309;
  font-size: 11.5px;
  font-weight: 700;
}
html[data-theme="dark"] .hrx-rank { color: #fbbf24; }
.hrx-pace {
  display: flex;
  flex-direction: column;
}
.hrx-pace-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)) 84px;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--hrd-border);
  color: var(--hrd-text);
  font-size: 12.5px;
}
.hrx-pace-row:last-child { border-bottom: 0; }
.hrx-pace-row.is-head,
.hrx-detail-row.is-head {
  padding-top: 0;
  color: var(--hrd-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hrx-kpi-table.is-wide .hrx-kpi-row {
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)) minmax(0, 1.3fr) 90px;
}
.hrx-kpi-row.is-link {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.hrx-kpi-row.is-link:hover {
  background: var(--hrd-soft);
}
.hrx-bars-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hrx-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(90px, auto);
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.hrx-bar-row > span:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hrx-bar-row b { color: var(--hrd-text); }
.hrx-bar-row small { color: var(--hrd-muted); font-size: 10.5px; }
.hrx-bar-row .hrx-num { color: var(--hrd-text); font-weight: 700; text-align: right; }
.hrx-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--hrd-soft);
}
.hrx-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--hrx-accent);
}
.hrx-bar-fill.is-age-0 { background: #f59e0b; }
.hrx-bar-fill.is-age-1 { background: #ea580c; }
.hrx-bar-fill.is-age-2 { background: #e11d48; }
.hrx-bar-fill.is-age-3 { background: #9f1239; }
.hrx-weeks {
  display: flex;
  align-items: stretch;
  gap: 12px;
  height: 130px;
}
.hrx-week-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--hrd-muted);
  font-size: 11px;
}
.hrx-week-bars {
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--hrd-soft);
}
.hrx-week-bars span {
  width: 14px;
  border-radius: 4px 4px 0 0;
}
.hrx-weeks .is-disbursed,
.hrx-week-key .is-disbursed { background: var(--hrx-accent); }
.hrx-weeks .is-collected,
.hrx-week-key .is-collected { background: #0284c7; }
.hrx-week-key,
.hrx-kpi-key {
  display: flex;
  gap: 14px;
  margin: 8px 0 0;
  color: var(--hrd-muted);
  font-size: 11px;
}
.hrx-week-key span,
.hrx-kpi-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hrx-week-key i,
.hrx-kpi-key i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.hrx-follow-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) minmax(0, 1.2fr) 0.8fr 0.9fr;
}
.hrx-follow-row > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hrx-follow-row small { color: var(--hrd-muted); font-size: 10.5px; }
.hrx-loan {
  color: var(--hrx-accent);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}
a.hrx-loan:hover { text-decoration: underline; }
.hrx-late {
  justify-self: start;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgb(245 158 11 / 14%);
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
}
.hrx-late.is-30 { background: rgb(234 88 12 / 14%); color: #c2410c; }
.hrx-late.is-90 { background: rgb(225 29 72 / 14%); color: #be123c; }
/* KPI detail pop-up */
.hrx-kpi-detail {
  max-width: none;
  margin: 0;
}
.hrx-kpi-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.hrx-kpi-facts div {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--hrd-soft);
}
.hrx-kpi-facts small {
  color: var(--hrd-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.hrx-kpi-facts b {
  color: var(--hrd-text);
  font-size: 14px;
}
.hrx-kpi-key .is-achieved { background: var(--hrx-accent); }
.hrx-kpi-key .is-target { height: 3px !important; background: #0f172a; }
html[data-theme="dark"] .hrx-kpi-key .is-target { background: #f1f5f9; }
.hrx-kpi-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  height: 150px;
  margin: 8px 0 14px;
}
.hrx-kpi-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 0;
  color: var(--hrd-muted);
  font-size: 10.5px;
}
.hrx-kpi-chart-col small {
  color: var(--hrd-text);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.hrx-kpi-chart-col.is-current > span:last-child {
  color: var(--hrx-accent);
  font-weight: 800;
}
.hrx-kpi-chart-track {
  position: relative;
  display: flex;
  flex: 1;
  align-items: flex-end;
  width: 100%;
  max-width: 46px;
  border-radius: 8px;
  background: var(--hrd-soft);
}
.hrx-kpi-chart-track .is-achieved {
  width: 100%;
  border-radius: 8px;
  background: var(--hrx-accent);
}
.hrx-kpi-chart-track .is-achieved.is-good { background: #16a34a; }
.hrx-kpi-chart-track .is-achieved.is-near { background: #d97706; }
.hrx-kpi-chart-track .is-achieved.is-behind { background: #e11d48; }
.hrx-kpi-chart-track .is-target {
  position: absolute;
  left: -4px;
  right: -4px;
  height: 3px;
  border-radius: 2px;
  background: #0f172a;
}
html[data-theme="dark"] .hrx-kpi-chart-track .is-target { background: #f1f5f9; }
.hrx-detail-table {
  --cols: 5;
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}
.hrx-detail-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--hrd-border);
  color: var(--hrd-text);
  font-size: 12px;
}
.hrx-detail-row.is-head {
  position: sticky;
  top: 0;
  padding-top: 6px;
  background: var(--hrd-card);
}
.hrx-new {
  min-width: 0;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 10px;
}
@media (max-width: 1000px) {
  .hrx-span-4,
  .hrx-span-8 {
    grid-column: span 12;
  }
  .hrx-kpi-table.is-wide .hrx-kpi-row {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)) 80px;
  }
  .hrx-kpi-table.is-wide .hrx-kpi-row > :nth-child(4),
  .hrx-kpi-table.is-wide .hrx-kpi-row > :nth-child(5),
  .hrx-kpi-table.is-wide .hrx-kpi-row > :nth-child(6) {
    display: none;
  }
  .hrx-pace-row {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)) 80px;
  }
  .hrx-pace-row > :nth-child(4),
  .hrx-pace-row > :nth-child(5) {
    display: none;
  }
  .hrx-kpi-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.hrx .hrx-kpi-row.is-link {
  min-height: 0;
  padding: 9px 4px;
  border: 0;
  border-bottom: 1px solid var(--hrd-border);
  box-shadow: none;
  color: var(--hrd-text);
  font: inherit;
  font-size: 12.5px;
  opacity: 1;
}
.hrx .hrx-kpi-row.is-link:last-child {
  border-bottom: 0;
}
.hrx .hrx-kpi-row.is-link b {
  color: var(--hrd-text);
}
.hrx .hrx-kpi-row.is-link:hover,
.hrx .hrx-kpi-row.is-link:focus-visible {
  background: rgb(13 148 136 / 7%);
  color: var(--hrd-text);
  outline: none;
}
.hrx .hrx-kpi-row.is-link:hover b {
  color: var(--hrx-accent);
}
/* HR → Staff Targets: the filter row */
.st-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}
.st-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 240px;
  max-width: 100%;
}
.st-toolbar label:nth-child(2) {
  width: 180px;
}
/* My KPIs with the pace columns merged in */
.hrx .hrx-kpi-table.is-wide .hrx-kpi-row {
  grid-template-columns: minmax(0, 1.4fr) repeat(6, minmax(0, 0.9fr)) minmax(0, 1fr) 84px;
  gap: 10px;
}
.hrx-on-track { color: #15803d; font-weight: 700; }
.hrx-off-track { color: #be123c; font-weight: 700; }
html[data-theme="dark"] .hrx-on-track { color: #4ade80; }
html[data-theme="dark"] .hrx-off-track { color: #fb7185; }
.hrx-on-track i,
.hrx-off-track i { margin-left: 5px; font-size: 10px; }
.hrx-dim { color: var(--hrd-muted); }
.hrx-span-4 .hrx-bar-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}
@media (max-width: 1000px) {
  .hrx .hrx-kpi-table.is-wide .hrx-kpi-row {
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)) 80px;
  }
  .hrx .hrx-kpi-table.is-wide .hrx-kpi-row > :nth-child(5),
  .hrx .hrx-kpi-table.is-wide .hrx-kpi-row > :nth-child(6),
  .hrx .hrx-kpi-table.is-wide .hrx-kpi-row > :nth-child(7),
  .hrx .hrx-kpi-table.is-wide .hrx-kpi-row > :nth-child(8) {
    display: none;
  }
  .hrx .hrx-kpi-table.is-wide .hrx-kpi-row > :nth-child(4) {
    display: block;
  }
}
/* My KPIs, compact: one line per KPI */
.hrx .hrx-kpi-table.is-wide .hrx-kpi-row {
  grid-template-columns: minmax(0, 1.5fr) repeat(6, minmax(0, 0.85fr)) minmax(0, 0.9fr) 76px;
  gap: 8px;
  padding: 5px 6px;
  font-size: 12px;
}
.hrx .hrx-kpi-table.is-wide .hrx-kpi-row.is-head {
  padding: 0 6px 5px;
  font-size: 9.5px;
}
.hrx .hrx-kpi-table.is-wide .hrx-kpi-row.is-link:nth-child(even) {
  background: var(--hrd-soft);
}
.hrx .hrx-kpi-table.is-wide .hrx-kpi-row.is-link:hover {
  background: rgb(13 148 136 / 9%);
}
.hrx .hrx-kpi-table.is-wide .hrx-kpi-row.is-link {
  border-bottom: 0;
  border-radius: 7px;
}
.hrx .hrx-kpi-name {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.hrx .hrx-kpi-name b {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hrx .hrx-kpi-name i {
  color: var(--hrd-muted);
  font-size: 10px;
}
.hrx .hrx-kpi-table.is-wide .hrx-progress {
  height: 6px;
}
.hrx .hrx-kpi-table.is-wide .kpi-pill {
  min-width: 0;
  padding: 1px 7px;
  font-size: 10.5px;
}
/* ─── Header bell: today's brief (layout/notification-bell.js) ─── */
.bell {
  position: relative;
  --bell-card: #ffffff;
  --bell-soft: #f6f8fb;
  --bell-border: #e5e9f0;
  --bell-text: #0f172a;
  --bell-muted: #64748b;
}
html[data-theme="dark"] .bell {
  --bell-card: #111827;
  --bell-soft: #1f2937;
  --bell-border: #273244;
  --bell-text: #f1f5f9;
  --bell-muted: #94a3b8;
}
.bell-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #0f766e;
  cursor: pointer;
}
.bell-button:hover,
.bell-button[aria-expanded="true"] {
  border-color: #0d9488;
  background: rgb(13 148 136 / 8%);
}
html[data-theme="dark"] .bell-button {
  border-color: rgb(45 212 191 / 30%);
  background: rgb(45 212 191 / 8%);
  color: #5eead4;
}
.bell-count {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--bell-card);
  border-radius: 999px;
  background: #e11d48;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 13px;
  text-align: center;
}
.bell-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -60px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 420px;
  max-width: calc(100vw - 24px);
  max-height: min(640px, calc(100vh - 90px));
  overflow: hidden;
  border: 1px solid var(--bell-border);
  border-radius: 16px;
  background: var(--bell-card);
  color: var(--bell-text);
  box-shadow: 0 24px 48px -20px rgb(15 23 42 / 45%);
}
.bell-panel[hidden] { display: none; }
.bell-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.bell-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 14px 12px 16px;
  background: linear-gradient(120deg, #0f3d3a 0%, #0f766e 60%, #0d9488 100%);
  color: #ffffff;
}
.bell-head > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.bell-head b { font-size: 14px; }
.bell-head small { color: rgb(255 255 255 / 75%); font-size: 11.5px; }
.bell-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: rgb(255 255 255 / 14%);
  color: #ffffff;
  cursor: pointer;
}
.bell-icon-btn:hover { background: rgb(255 255 255 / 26%); }
.bell-scroll {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 14px 14px;
  overflow-y: auto;
}
.bell-muted {
  margin: 0;
  color: var(--bell-muted);
  font-size: 11.5px;
}
.bell-error {
  margin: 14px;
  color: #be123c;
  font-size: 12px;
}
.bell-alerts {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bell-alert {
  --tone: #0284c7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-left: 3px solid var(--tone);
  border-radius: 8px;
  background: color-mix(in srgb, var(--tone) 9%, transparent);
  color: var(--bell-text);
  font-size: 12px;
  text-align: left;
}
button.bell-alert { cursor: pointer; }
button.bell-alert:hover { background: color-mix(in srgb, var(--tone) 16%, transparent); }
.bell-alert i { color: var(--bell-muted); font-size: 10px; }
.bell-alert.is-warning { --tone: #d97706; }
.bell-alert.is-danger { --tone: #e11d48; }
.bell-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bell-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
}
.bell-section-head i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgb(13 148 136 / 12%);
  color: #0d9488;
  font-size: 11px;
}
.bell-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.bell-figures.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bell-figure {
  --tone: var(--bell-text);
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 9px;
  background: var(--bell-soft);
}
.bell-figure small {
  color: var(--bell-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.bell-figure b {
  overflow: hidden;
  color: var(--tone);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bell-figure.is-good { --tone: #15803d; }
.bell-figure.is-warning { --tone: #b45309; }
.bell-figure.is-danger { --tone: #be123c; }
html[data-theme="dark"] .bell-figure.is-good { --tone: #4ade80; }
html[data-theme="dark"] .bell-figure.is-warning { --tone: #fbbf24; }
html[data-theme="dark"] .bell-figure.is-danger { --tone: #fb7185; }
.bell-progress {
  height: 6px;
  margin: 8px 0 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bell-soft);
}
.bell-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #16a34a;
}
.bell-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bell-center,
.bell-loan,
.bell-branch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--bell-soft);
  font-size: 12px;
}
.bell-time {
  flex: none;
  min-width: 46px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgb(13 148 136 / 12%);
  color: #0f766e;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
html[data-theme="dark"] .bell-time { color: #5eead4; }
.bell-center-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.bell-center-main b,
.bell-center-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bell-center small,
.bell-loan small,
.bell-branch small {
  color: var(--bell-muted);
  font-size: 10.5px;
}
.bell-center-money {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
}
.bell-loan-no {
  flex: none;
  color: #0f766e;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
}
.bell-branch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
}
.bell-branch > span {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.bell-branch .is-warning { color: #b45309; font-weight: 700; }
.bell-foot {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--bell-border);
  background: var(--bell-soft);
}
.bell-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--bell-border);
  border-radius: 999px;
  background: var(--bell-card);
  color: var(--bell-text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.bell-link i { color: #0d9488; font-size: 11px; }
.bell-link:hover { border-color: #0d9488; }
@media (max-width: 768px) {
  .bell-panel {
    position: fixed;
    top: 60px;
    right: 12px;
    left: 12px;
    width: auto;
  }
  .bell-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ─── Loan picker (domain/loan-picker.js), compact: five boxes a row ─── */
.lp-compact .lp-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 10px;
  /* Lined up by the top, so a field's error message grows down without lifting its box above the others. */
  align-items: start;
}
.lp-compact .lp-keyword {
  grid-column: span 2;
}
.lp-compact .field {
  gap: 3px;
  margin: 0;
}
.lp-compact .field-label {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.04em;
}
.lp-compact .control,
.lp-compact .cselect-button {
  min-height: 32px;
  height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: 9px;
  font-size: 12.5px;
}
.lp-compact .cselect-tag {
  padding: 0 5px;
  font-size: 9px;
  line-height: 15px;
}
.lp-compact .cselect-dot {
  width: 6px;
  height: 6px;
}
.lp-compact .field-hint,
.lp-compact .field-message {
  font-size: 10.5px;
}
.lp-compact .lp-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  /* Level with the boxes: below where the fields have their labels. */
  margin-top: var(--lp-label-room, 18px);
}
.lp-compact .lp-actions .btn {
  min-height: 32px;
  height: 32px;
  padding: 0 14px;
  font-size: 12.5px;
}
.lp-compact .match-list {
  margin-top: 8px;
}
@media (max-width: 1100px) {
  .lp-compact .lp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lp-compact .lp-keyword {
    grid-column: span 1;
  }
}
@media (max-width: 640px) {
  .lp-compact .lp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lp-compact .lp-actions {
    grid-column: 1 / -1;
  }
}
/* ─── Date picker: date-and-time, time and month boxes too (ui/date-picker.js) ─── */
.dpick > input[type="datetime-local"],
.dpick > input[type="time"],
.dpick > input[type="month"] {
  padding-right: 30px;
}
.dpick.dpick-block > input[type="datetime-local"],
.dpick.dpick-block > input[type="time"],
.dpick.dpick-block > input[type="month"] {
  width: 100%;
}
.dpick > input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.dpick > input[type="time"]::-webkit-calendar-picker-indicator,
.dpick > input[type="month"]::-webkit-calendar-picker-indicator {
  display: none;
}
.dpick.is-open > input {
  border-color: #14b8a6;
}
.dpick-panel.dpick-kind-datetime-local {
  width: auto;
}
.dpick-panel.dpick-kind-time {
  width: auto;
  min-width: 200px;
}
.dpick-panel.dpick-kind-month {
  width: 260px;
}
.dpick-body {
  display: flex;
  gap: 14px;
}
.dpick-calendar {
  width: 254px;
}
.dpick-kind-month .dpick-calendar {
  width: 100%;
}
.dpick-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.dpick-month {
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dpick-month:hover:not(:disabled):not(.is-selected) {
  background: #ccfbf1;
  color: #0f766e;
}
.dpick-month.is-today {
  border-color: rgb(20 184 166 / 60%);
  background: #f0fdfa;
  color: #0d9488;
}
.dpick-month.is-selected {
  background: #14b8a6;
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgb(20 184 166 / 30%);
}
.dpick-month:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
html[data-theme="dark"] .dpick-month {
  background: #1f2937;
  color: #e5e7eb;
}
html[data-theme="dark"] .dpick-month:hover:not(:disabled):not(.is-selected) {
  color: #2dd4bf;
}
html[data-theme="dark"] .dpick-month.is-selected {
  background: #14b8a6;
  color: #ffffff;
}
/* The time columns */
.dpick-time {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}
.dpick-kind-datetime-local .dpick-time {
  padding-left: 14px;
  border-left: 1px solid #e2e8f0;
}
html[data-theme="dark"] .dpick-kind-datetime-local .dpick-time {
  border-color: #1f2937;
}
.dpick-time-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  margin-bottom: 8px;
}
.dpick-time-label {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
}
html[data-theme="dark"] .dpick-time-label {
  color: #ffffff;
}
.dpick-readout {
  padding: 2px 8px;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0d9488;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 700;
}
html[data-theme="dark"] .dpick-readout {
  background: #1f2937;
  color: #2dd4bf;
}
.dpick-time-cols {
  display: flex;
  flex: 1;
  gap: 4px;
}
.dpick-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 44px;
}
.dpick-col-name {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}
.dpick-col-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 222px;
  padding: 2px;
  overflow-y: auto;
  border-radius: 10px;
  background: #f8fafc;
  scrollbar-width: thin;
}
.dpick-kind-time .dpick-col-list {
  height: 200px;
}
html[data-theme="dark"] .dpick-col-list {
  background: #161b25;
}
.dpick-cell {
  flex: none;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  cursor: pointer;
}
.dpick-cell:hover:not(.is-selected) {
  background: #ccfbf1;
  color: #0f766e;
}
.dpick-cell.is-selected {
  background: #14b8a6;
  color: #ffffff;
  font-weight: 700;
}
html[data-theme="dark"] .dpick-cell {
  color: #e5e7eb;
}
html[data-theme="dark"] .dpick-cell:hover:not(.is-selected) {
  background: #1f2937;
  color: #2dd4bf;
}
.dpick-foot-left {
  display: inline-flex;
  gap: 10px;
}
.dpick-done {
  padding: 4px 14px;
  border: 0;
  border-radius: 8px;
  background: #14b8a6;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.dpick-done:hover {
  background: #0d9488;
}
@media (max-width: 560px) {
  .dpick-kind-datetime-local .dpick-body {
    flex-direction: column;
  }
  .dpick-kind-datetime-local .dpick-time {
    padding: 10px 0 0;
    border-top: 1px solid #e2e8f0;
    border-left: 0;
  }
  .dpick-kind-datetime-local .dpick-col-list {
    height: 140px;
  }
}
/* ─── Admin → Agreement Letters (screens/admin/agreement-letters.js) ─── */
.al { display: flex; flex-direction: column; gap: 12px; }
.al-header {
  padding: 10px 14px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  background: var(--color-surface, #ffffff);
}
.al-header summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.al-header summary i { color: #0d9488; }
.al-header summary .muted { margin-left: auto; font-size: 12px; }
.al-header[open] summary { margin-bottom: 12px; }
.al-logo-row { display: flex; align-items: center; gap: 8px; }
.al-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 44px;
  overflow: hidden;
  border: 1px dashed var(--color-border, #cbd5e1);
  border-radius: 8px;
  font-size: 11px;
}
.al-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.al-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.al-main {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.al-docs {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  background: var(--color-surface, #ffffff);
}
.al-doc-name {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text, #0f172a);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.al-doc-name i { color: #64748b; }
.al-doc-name small {
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: rgb(100 116 139 / 12%);
  color: #64748b;
  font-size: 10.5px;
}
.al-doc-name:hover { background: rgb(13 148 136 / 7%); }
.al-doc.is-open > .al-doc-name { background: rgb(13 148 136 / 12%); color: #0f766e; }
.al-doc.is-open > .al-doc-name i { color: #0d9488; }
.al-versions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 6px 18px;
  padding-left: 8px;
  border-left: 2px solid rgb(13 148 136 / 25%);
}
.al-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text, #0f172a);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
}
.al-version:hover { background: rgb(13 148 136 / 7%); }
.al-version.is-active { background: #0d9488; color: #ffffff; }
.al-version small {
  padding: 0 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
}
.al-version small.is-builtin { background: rgb(100 116 139 / 14%); color: #64748b; }
.al-version small.is-saved { background: rgb(22 163 74 / 14%); color: #15803d; }
.al-version small.is-off { background: rgb(225 29 72 / 12%); color: #be123c; }
.al-version.is-active small { background: rgb(255 255 255 / 25%); color: #ffffff; }
.al-add { align-self: flex-start; margin-top: 4px; min-height: 26px; padding: 2px 10px; font-size: 11px; }
.al-work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.al-work form { display: flex; flex-direction: column; gap: 10px; }
.al-body {
  min-height: 220px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.55;
}
.al-chip-box { display: flex; flex-direction: column; gap: 5px; }
.al-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 112px;
  overflow-y: auto;
}
.al-chip {
  padding: 2px 8px;
  border: 1px solid rgb(13 148 136 / 30%);
  border-radius: 999px;
  background: rgb(13 148 136 / 6%);
  color: #0f766e;
  font-size: 11px;
  cursor: pointer;
}
.al-chip:hover:not(:disabled) { background: #0d9488; color: #ffffff; }
html[data-theme="dark"] .al-chip { color: #5eead4; }
.al-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.al-options fieldset {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
}
.al-options legend { padding: 0 4px; font-size: 11px; font-weight: 700; }
.al-preview {
  max-height: 900px;
  overflow: auto;
  padding: 14px;
  border-radius: 10px;
  background: #e2e8f0;
}
html[data-theme="dark"] .al-preview { background: #0b1220; }
.al-preview .document {
  margin: 0 auto 14px;
  padding: 28px 30px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 6px 18px -8px rgb(15 23 42 / 35%);
}
@media (max-width: 1200px) {
  .al-work { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .al-main { grid-template-columns: minmax(0, 1fr); }
  .al-docs { position: static; }
}
/* The printed letter (domain/loan-panels.js loanDocument) */
.letter-doc-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #0f172a;
}
.letter-doc-header > div { flex: 1; }
.letter-doc-logo { max-width: 110px; max-height: 60px; object-fit: contain; }
.letter-doc-contact { margin: 2px 0 0; font-size: 0.85em; color: #475569; }
.letter-doc-copy {
  padding: 2px 10px;
  border: 1px solid #0f172a;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
}
.letter-doc-body p { line-height: 1.6; text-align: justify; }
.letter-doc-footer {
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.85em;
  text-align: center;
}
.letter-doc-pages > .document + .document { break-before: page; page-break-before: always; }
/* Agreement Letters: the language and loan-type switch */
.al-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--color-default-soft, #f6f8fb);
}
.al-switch > div { display: flex; flex-direction: column; gap: 4px; }
.al-switch > div:last-child { min-width: 200px; }
.al-langs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  background: var(--color-surface, #ffffff);
}
.al-lang {
  position: relative;
  padding: 5px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text, #0f172a);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.al-lang:hover { background: rgb(13 148 136 / 8%); }
.al-lang.is-active { background: #0d9488; color: #ffffff; }
.al-lang-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
}
.al-lang.is-active .al-lang-dot { background: #ffffff; }
/* ─── Rich editor (ui/rich-editor.js) ─── */
.rte {
  overflow: hidden;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 10px;
  background: var(--color-surface, #ffffff);
}
.rte:focus-within { border-color: #14b8a6; box-shadow: 0 0 0 3px rgb(20 184 166 / 15%); }
.rte-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px 6px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-default-soft, #f6f8fb);
}
.rte-group {
  display: inline-flex;
  gap: 1px;
  padding-right: 4px;
  border-right: 1px solid var(--color-border, #e2e8f0);
}
.rte-group:last-child { border-right: 0; }
.rte-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text, #334155);
  font-size: 12px;
  cursor: pointer;
}
.rte-tool:hover { background: rgb(13 148 136 / 10%); color: #0f766e; }
.rte-tool.is-on { background: rgb(13 148 136 / 16%); color: #0f766e; }
.rte-block {
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 6px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0f172a);
  font-size: 12px;
}
.rte-page {
  min-height: 300px;
  max-height: 560px;
  overflow-y: auto;
  padding: 16px 20px;
  color: var(--color-text, #0f172a);
  font-size: 13px;
  line-height: 1.6;
  outline: none;
}
.rte-page p { margin: 0 0 0.7em; }
.rte-page h1 { margin: 0.4em 0; font-size: 1.5em; }
.rte-page h2 { margin: 0.4em 0; font-size: 1.25em; }
.rte-page h3 { margin: 0.4em 0; font-size: 1.1em; }
.rte-page blockquote { margin: 0.5em 0; padding-left: 12px; border-left: 3px solid #cbd5e1; color: #475569; }
.rte-page table,
.letter-doc-body table { width: 100%; margin: 0.5em 0; border-collapse: collapse; }
.rte-page td,
.rte-page th,
.letter-doc-body td,
.letter-doc-body th { padding: 4px 8px; border: 1px solid #94a3b8; vertical-align: top; }
.rte.is-disabled .rte-page { background: var(--color-default-soft, #f6f8fb); }
/* The paste review */
.al-find { display: flex; flex-direction: column; gap: 10px; }
.al-find-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 360px;
  overflow-y: auto;
}
.al-find-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1.1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--color-default-soft, #f6f8fb);
}
.al-find-row > i { color: #94a3b8; font-size: 11px; }
.al-find-text { display: flex; flex-direction: column; min-width: 0; }
.al-find-text b { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.al-find-text small { color: #64748b; font-size: 10.5px; }
.al-find-row .checkbox span:empty { display: none; }
/* Agreement Letters: one editable letter page beside a settings column */
.al .al-work {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.al-side {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  background: var(--color-surface, #ffffff);
}
.al-side-group { display: flex; flex-direction: column; gap: 6px; }
.al-side-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text, #0f172a);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.al-side-title i { color: #0d9488; font-size: 11px; }
.al-side .al-langs { align-self: flex-start; }
.al-status {
  margin: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgb(13 148 136 / 8%);
  color: #0f766e;
  font-size: 11.5px;
}
.al-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; font-size: 12px; }
.al-side .al-chips { max-height: 150px; }
.al-side-actions {
  position: sticky;
  bottom: -12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 -12px -12px;
  padding: 10px 12px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-surface, #ffffff);
}
.al-editor {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 14px;
  background: var(--color-surface, #ffffff);
}
.al-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  font-size: 13px;
}
.al-editor-head .muted { font-size: 11.5px; }
.al-editor > .rte {
  position: sticky;
  top: 60px;
  z-index: 3;
  border: 0;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0;
}
.al-editor > .rte:focus-within { box-shadow: none; }
.al-paper {
  padding: 22px;
  background: #e2e8f0;
}
html[data-theme="dark"] .al-paper { background: #0b1220; }
.al-paper .document {
  max-width: 820px;
  margin: 0 auto 18px;
  padding: 40px 48px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 28px -12px rgb(15 23 42 / 40%);
}
/* The wording, typed on the page: looks like the printed text */
.al-paper .letter-doc-body .rte-page {
  min-height: 160px;
  max-height: none;
  overflow: visible;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: inherit;
  outline: 1px dashed transparent;
  transition: outline-color 0.15s, background-color 0.15s;
}
.al-paper .letter-doc-body .rte-page:hover { outline-color: rgb(13 148 136 / 40%); }
.al-paper .letter-doc-body .rte-page:focus { outline: 2px solid rgb(13 148 136 / 55%); background: rgb(240 253 250 / 60%); }
.al-paper .letter-doc-body .rte-page p { line-height: 1.6; text-align: justify; }
.al-title-input {
  width: 100%;
  padding: 2px 6px;
  margin: 0 -6px;
  border: 1px dashed transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.45em;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.al-title-input:hover { border-color: rgb(13 148 136 / 40%); }
.al-title-input:focus { border-color: #14b8a6; outline: none; background: rgb(240 253 250 / 60%); }
.al-ph {
  display: inline-block;
  margin: 0 1px;
  padding: 0 6px;
  border-radius: 5px;
  background: rgb(13 148 136 / 14%);
  color: #0f766e;
  font-size: 0.88em;
  font-weight: 600;
  line-height: 1.45;
  cursor: default;
  user-select: all;
}
.al-editor-hint {
  margin: 0;
  padding: 8px 14px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  color: var(--color-text-subtle);
  font-size: 11.5px;
}
@media (max-width: 1100px) {
  .al .al-work { grid-template-columns: minmax(0, 1fr); }
  .al-side { position: static; max-height: none; }
}
.al-paper .document-title .al-title-input,
.al-paper .document-title .al-title-input.control {
  height: auto;
  min-height: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: inherit;
}
.al-paper .document-title .al-title-input:hover { border-color: rgb(13 148 136 / 40%); }
.al-paper .document-title .al-title-input:focus { border-color: #14b8a6; background: rgb(240 253 250 / 60%); }
/* Whole-page letters: blocks (filled from each loan) */
.letter-doc.is-full { position: relative; }
.letter-doc-copy.is-floating { position: absolute; top: 12px; right: 14px; }
.letter-doc-body .document-header { margin-bottom: 10px; }
.letter-doc-body h1 { margin: 0.3em 0 0.1em; font-size: 1.55em; font-weight: 500; letter-spacing: 0.02em; }
.letter-doc-body h2 { margin: 0.5em 0 0.2em; font-size: 1.3em; }
.letter-doc-body h3 { margin: 0.9em 0 0.35em; padding-bottom: 3px; border-bottom: 1px solid #94a3b8; font-size: 1.02em; }
.letter-doc-body table td:only-child,
.letter-doc-body table td { min-width: 0; }
.al-block {
  position: relative;
  margin: 6px -8px;
  padding: 18px 8px 6px;
  border: 1px dashed rgb(13 148 136 / 55%);
  border-radius: 6px;
  background: rgb(240 253 250 / 45%);
  cursor: default;
  user-select: none;
}
.al-block:hover { border-style: solid; }
.al-block-tag {
  position: absolute;
  top: -1px;
  left: -1px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 6px 0 6px 0;
  background: #0d9488;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
}
.al-block-body { pointer-events: none; }
.al-block-buttons { display: flex; flex-direction: column; gap: 4px; }
.al-block-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid rgb(13 148 136 / 30%);
  border-radius: 8px;
  background: rgb(13 148 136 / 5%);
  color: var(--color-text, #0f172a);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.al-block-button i { width: 14px; color: #0d9488; text-align: center; }
.al-block-button:hover:not(:disabled) { border-color: #0d9488; background: rgb(13 148 136 / 12%); }
/* Letters: a table drawn without lines (signature blocks side by side) */
.letter-doc-body table[style*="border: none"],
.letter-doc-body table[style*="border: none"] td,
.letter-doc-body table[style*="border: none"] th,
.rte-page table[style*="border: none"] td,
.rte-page table[style*="border: none"] th {
  border: 0;
}
.rte-page table[style*="border: none"] td { outline: 1px dashed rgb(148 163 184 / 45%); outline-offset: -2px; }
.letter-doc-body table[style*="border: none"] td { padding: 6px 8px 10px; vertical-align: top; }
.letter-doc-body ol { padding-left: 1.4em; }
.letter-doc-body li { margin-bottom: 0.45em; line-height: 1.55; text-align: justify; }
.letter-doc-body hr { margin: 14px 0; border: 0; border-top: 1px solid #cbd5e1; }
/* Printing a letter (domain/loan-panels.js printLetter → core/export.js printElement): the page's own A4 margins only */
@media print {
  html.is-printing .print-root .document {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }
  html.is-printing .print-root .document + .document { break-before: page; page-break-before: always; }
  html.is-printing .print-root .letter-doc-copy.is-floating { top: 0; right: 0; }
}
/* Loan Overview → Print Agreement */
.print-docs { display: flex; flex-direction: column; gap: 10px; }
/* One list panel: a numbered row a document, its name and note, and its Print button (the usual primary button). */
.print-docs-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  overflow: hidden;
}
.print-doc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-fast);
}
.print-doc:nth-child(odd) { border-right: 1px solid var(--color-border); }
.print-doc:nth-last-child(-n + 2):nth-child(odd),
.print-doc:last-child { border-bottom: 0; }
.print-doc:hover { background: var(--color-table-row-hover); }
.print-doc-no {
  flex: none;
  min-width: 22px;
  color: var(--color-brand-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
html[data-theme="dark"] .print-doc-no { color: #5eead4; }
.print-doc-text { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.35; }
.print-doc-text b { color: var(--color-text-strong); font-size: 13px; font-weight: 600; }
.print-doc-text small { color: var(--color-text-subtle); font-size: 11.5px; }
.print-doc-btn { flex: none; }
@media (max-width: 760px) {
  .print-docs-list { grid-template-columns: 1fr; }
  .print-doc:nth-child(odd) { border-right: 0; }
  .print-doc:nth-last-child(-n + 2):nth-child(odd) { border-bottom: 1px solid var(--color-border); }
  .print-doc:last-child { border-bottom: 0; }
}
/* ─── Colour fixes from the contrast check (every screen, light and dark) ─── */
/* Queue counts: white on the step's colour, darkened enough to read (the green and amber were too light). */
.queue-step[data-state="waiting"] .queue-count {
  background: color-mix(in srgb, var(--tone) 68%, #0f172a);
}
/* Users list: role names readable on the dark rows. */
html[data-theme="dark"] .ua-role-text { color: #a5b4fc; }
html[data-theme="dark"] .ua-role-text-system { color: #fda4af; }
/* Agreement Letters: the open document, its count and the status line on the dark panels; the tags on the active
   (teal) version. */
html[data-theme="dark"] .al-doc.is-open > .al-doc-name { color: #5eead4; }
html[data-theme="dark"] .al-doc.is-open > .al-doc-name i { color: #5eead4; }
html[data-theme="dark"] .al-doc-name small { background: rgb(148 163 184 / 16%); color: #cbd5e1; }
html[data-theme="dark"] .al-status { background: rgb(45 212 191 / 10%); color: #5eead4; }
html[data-theme="dark"] .al-version small.is-builtin { color: #cbd5e1; }
html[data-theme="dark"] .al-version small.is-saved { color: #4ade80; }
html[data-theme="dark"] .al-version small.is-off { color: #fda4af; }
.al-version.is-active small,
.al-version.is-active small.is-builtin,
.al-version.is-active small.is-saved,
.al-version.is-active small.is-off {
  background: rgb(0 0 0 / 22%);
  color: #ffffff;
}
/* SMS template preview: the "SMS Message" label on the phone's light top bar. */
html:not([data-theme="dark"]) .sms-device-topbar > span { color: #64748b; }
/* Print preview (core/export.js printPreview): each page on an A4 sheet with its 12 mm margins, as it prints, on the
   grey of .letter-holder; the sheets shrink together when the pop-up is narrower than a sheet. */
.a4-preview {
  --a4-scale: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.a4-sheet {
  box-sizing: border-box;
  flex: none;
  width: 210mm;
  height: 297mm;
  padding: 12mm;
  overflow: hidden;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 2px 10px rgb(15 23 42 / 22%);
  zoom: var(--a4-scale);
}
.a4-sheet > .document,
.a4-sheet > .print-area {
  position: static;
  width: auto;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}
.a4-sheet .letter-doc-copy.is-floating { top: 0; right: 0; }
html[data-theme="dark"] .a4-sheet,
html[data-theme="dark"] .a4-sheet :is(td, th, p, li, span, b, strong, h1, h2, h3, h4, dt, dd, div) {
  color: #000000;
}
html[data-theme="dark"] .a4-sheet .letter-doc-contact { color: #475569; }
/* My Performance → Overall: a half-circle gauge (domain/kpi.js scoreTone colours); the arc fills to the score. */
.hrx-gauge {
  --p: 0;
  --tone: #0d9488;
  position: relative;
  display: flex;
  flex: none;
  align-items: flex-end;
  justify-content: center;
  width: 128px;
  height: 74px;
}
.hrx-gauge.is-good { --tone: #16a34a; }
.hrx-gauge.is-near { --tone: #d97706; }
.hrx-gauge.is-behind { --tone: #e11d48; }
.hrx-gauge.is-none { --tone: var(--color-text-muted); }
.hrx-gauge-arc {
  position: absolute;
  inset: 0 0 auto;
  height: 128px;
  border-radius: 50%;
  background: conic-gradient(from 270deg, var(--tone) calc(var(--p) * 1.8deg), var(--color-surface-sunken) 0 180deg, transparent 0);
  -webkit-mask: radial-gradient(closest-side, transparent 74%, #000 75%);
  mask: radial-gradient(closest-side, transparent 74%, #000 75%);
}
html[data-theme="dark"] .hrx-gauge-arc {
  background: conic-gradient(from 270deg, var(--tone) calc(var(--p) * 1.8deg), rgb(148 163 184 / 18%) 0 180deg, transparent 0);
}
.hrx-gauge-value {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1;
}
.hrx-gauge-value b {
  color: var(--tone);
  font-size: 24px;
  font-weight: 700;
}
.hrx-gauge-value i {
  color: var(--color-text-muted);
  font-size: 18px;
}
.hrx-gauge-value small {
  color: var(--color-text-subtle);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
/* The gauge beside its summary, or above it where the panel is narrow. */
.hrx-score { flex-wrap: wrap; justify-content: center; }
.hrx-score > .hrx-score-text { flex: 1 1 150px; min-width: 0; }
/* Cashier → Group Payments: one section a group, a heading with its code and loan count, the group's payment total
   on its last row, and the CBO's total at the bottom. */
.gp-groups { display: flex; flex-direction: column; }
.gp-group + .gp-group { border-top: 1px solid var(--color-border); }
.gp-group-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 12px 16px 6px;
  font-size: 13px;
}
.gp-group-code {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgb(13 148 136 / 12%);
  color: var(--color-success-strong);
  font-weight: 700;
}
html[data-theme="dark"] .gp-group-code { background: rgb(45 212 191 / 14%); color: #5eead4; }
.gp-group-title small { color: var(--color-text-subtle); font-size: 11.5px; font-weight: 500; }
.gp-group .money-input { max-width: 180px; margin-left: auto; }
.gp-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 16px;
  padding: 12px 16px;
  border-top: 2px solid var(--color-border-strong);
  font-size: 14px;
}
.gp-total .gp-total-label { color: var(--color-text-subtle); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.gp-total > strong { color: var(--color-text-strong); font-variant-numeric: tabular-nums; }
.gp-empty { padding: 16px; margin: 0; }
.gp-group tfoot td { white-space: nowrap; font-weight: 600; }
/* Make Payment sits after the total; the number of payments it will post on the left. */
.gp-total { align-items: center; }
.gp-total .gp-total-count { margin-right: auto; color: var(--color-text-subtle); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.gp-total .btn { margin-left: 8px; }
/* ─── No shadows or glows anywhere: cards, menus, pop-ups, buttons, the focus glow on boxes, text. A focused box still
   shows its coloured border (and the keyboard outline from css/base.css). This comes last and wins over every earlier
   shadow; the few shadows that only draw a line (badge outlines, the active menu bar, row markers) are put back as
   plain lines below. ─── */
:root {
  --shadow-card: none;
  --shadow-card-hover: none;
  --shadow-menu: none;
  --shadow-modal: none;
}
*,
*::before,
*::after {
  box-shadow: none !important;
  text-shadow: none !important;
}
/* Badges keep their thin outline. */
.badge-success { box-shadow: inset 0 0 0 1px rgb(120 205 81 / 35%) !important; }
.badge-warning { box-shadow: inset 0 0 0 1px rgb(245 158 11 / 35%) !important; }
.badge-danger { box-shadow: inset 0 0 0 1px rgb(239 68 68 / 30%) !important; }
.badge-primary { box-shadow: inset 0 0 0 1px rgb(99 102 241 / 30%) !important; }
.badge-info { box-shadow: inset 0 0 0 1px rgb(14 165 233 / 30%) !important; }
.badge-default { box-shadow: inset 0 0 0 1px rgb(148 163 184 / 35%) !important; }
html[data-theme="dark"] .badge-success { box-shadow: inset 0 0 0 1px rgb(20 184 166 / 35%) !important; }
html[data-theme="dark"] .badge-warning { box-shadow: inset 0 0 0 1px rgb(245 158 11 / 35%) !important; }
html[data-theme="dark"] .badge-danger { box-shadow: inset 0 0 0 1px rgb(244 63 94 / 35%) !important; }
html[data-theme="dark"] .badge-primary { box-shadow: inset 0 0 0 1px rgb(99 102 241 / 35%) !important; }
html[data-theme="dark"] .badge-info { box-shadow: inset 0 0 0 1px rgb(14 165 233 / 35%) !important; }
html[data-theme="dark"] .badge-default { box-shadow: inset 0 0 0 1px #374151 !important; }
/* The bar beside the open menu item, the hovered table row's marker, a custom role row and an empty HR day. */
a.side-link.active,
.leaf.active { box-shadow: inset 2px 0 0 var(--color-brand) !important; }
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--color-brand) !important; }
.ac-row-custom { box-shadow: inset 3px 0 0 var(--color-primary) !important; }
.hrx-cell.is-none { box-shadow: inset 0 0 0 1px rgb(225 29 72 / 35%) !important; }
/* Print previews: the sheet keeps a plain edge on the grey instead of its shadow. */
.a4-sheet { outline: 1px solid #cbd5e1; }
/* ─── Auditor menu (screens/auditor/*) ─── */
.auditor-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .auditor-split { grid-template-columns: minmax(0, 1fr); } }
/* Findings: the detail pop-up's blocks. */
.af-detail { display: flex; flex-direction: column; gap: 12px; }
.af-block { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface-sunken); }
.af-block p { margin: 4px 0 0; white-space: pre-wrap; }
.af-label { color: var(--color-text-subtle); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.af-ref { font-weight: 500; }
/* Branch audit checklist: one row an item, its Pass / Fail / N/A buttons on the right. */
.audit-area + .audit-area { margin-top: 14px; }
.audit-area-title { margin: 0 0 6px; color: var(--color-text-subtle); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.audit-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-left-width: 1px;
  border-radius: 10px;
  background: var(--color-surface);
}
.audit-item + .audit-item { margin-top: 6px; }
.audit-item.is-pass { border-color: rgb(22 163 74 / 35%); }
.audit-item.is-fail { border-color: rgb(225 29 72 / 45%); background: rgb(225 29 72 / 4%); }
.audit-item.is-na { opacity: 0.8; }
.audit-item-no { color: var(--color-text-subtle); font-family: var(--font-mono); font-size: 12px; font-weight: 700; line-height: 1.6; }
.audit-item-text p { margin: 0 0 6px; color: var(--color-text-strong); }
.audit-item-text .control { min-height: 30px; font-size: 12px; }
.audit-item-results { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.audit-result {
  min-width: 46px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.audit-result:disabled { cursor: default; opacity: 0.6; }
.audit-result.tone-success.is-on { border-color: #16a34a; background: #16a34a; color: #ffffff; }
.audit-result.tone-danger.is-on { border-color: #e11d48; background: #e11d48; color: #ffffff; }
.audit-result.tone-default.is-on { border-color: #64748b; background: #64748b; color: #ffffff; }
@media (max-width: 760px) {
  .audit-item { grid-template-columns: 24px minmax(0, 1fr); }
  .audit-item-results { grid-column: 2; justify-content: flex-start; }
}
/* Exceptions: a count per kind, click to show only that kind. */
.exception-counts { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 4px; }
.exception-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 12px;
  cursor: pointer;
}
.exception-count b { color: var(--color-danger); }
.exception-count.is-on { border-color: var(--color-brand); background: rgb(20 184 166 / 10%); }
.exception-detail { display: inline-block; max-width: 340px; white-space: normal; }
.text-danger { color: var(--color-danger); }
/* Loan-file sampling: one card a loan, its checks as Yes / No. */
.file-cards { display: flex; flex-direction: column; gap: 10px; }
.file-card { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
.file-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
.file-card-title { display: flex; flex: 1; flex-direction: column; min-width: 200px; }
.file-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; padding: 10px 12px; }
.file-check { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--color-border); }
.file-card-foot { display: flex; align-items: center; gap: 8px; padding: 0 12px 12px; }
.file-card-foot .control { flex: 1; min-height: 30px; }
@media (max-width: 760px) { .file-checks { grid-template-columns: minmax(0, 1fr); } }
/* A note beside a panel title keeps a gap from it. */
.panel-title .panel-title-note { margin-left: 10px; }
/* Loan-file checks: Yes and No stay side by side. */
.file-check .audit-item-results { flex: none; flex-wrap: nowrap; }
/* Auditor summary cards: the dashboard's metric cards in an even row. */
.auditor-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.auditor-stats .metric-card { justify-content: space-between; gap: 10px; min-height: 120px; }
.auditor-stats .metric-detail { color: var(--color-text-subtle); font-size: 12px; }
/* ─── Helix Capital logo (layout/shell.js brand, ui/helix-mark.js) ─── */
.brand-mark { background: linear-gradient(140deg, #0f766e 0%, #14b8a6 55%, #84cc16 100%); color: #ffffff; }
.helix-mark { overflow: visible; }
.helix-strand { fill: none; stroke-linecap: round; stroke-width: 2.4; }
.helix-strand.a { stroke: #ffffff; }
.helix-strand.b { stroke: rgb(255 255 255 / 62%); }
.helix-rung { stroke: rgb(255 255 255 / 55%); stroke-width: 1.6; stroke-linecap: round; }
.brand-name { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; text-transform: none; }
.brand-name b { font-weight: 800; }
.brand-name-rest { color: var(--color-brand-strong); font-weight: 600; }
html[data-theme="dark"] .brand-name-rest { color: #5eead4; }
.brand-sub { margin-top: 2px; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; }
/* The mark turns once when the logo is hovered. */
.brand:hover .helix-mark { animation: helix-turn 0.9s cubic-bezier(0.5, 0, 0.2, 1); }
@keyframes helix-turn { 50% { transform: scaleX(-1); } }
@media (prefers-reduced-motion: reduce) { .brand:hover .helix-mark { animation: none; } }
/* ─── Printed payment receipts (domain/loan-panels.js receiptSlips): laid out like the customer's digital receipt
   (public/css/receipt-public.css). Always a light paper card, on screen and when printed. ─── */
.receipt-cards { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: none; color: #0f172a; }
.rcp-card { width: min(100%, 420px); overflow: hidden; border: 1px solid #e2e8f0; border-radius: 22px; background: #ffffff; color: #0f172a; -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
.rcp-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e2e8f0; }
.rcp-head > div { flex: 1; min-width: 0; }
.rcp-head b { display: block; color: #0f172a; font-size: 15px; }
.rcp-head small { color: #64748b; font-size: 12px; }
.rcp-mark { display: inline-grid; flex: none; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(140deg, #0f766e 0%, #14b8a6 55%, #84cc16 100%); }
.rcp-tag { padding: 3px 9px; border: 1px solid #cbd5e1; border-radius: 999px; color: #475569; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.rcp-hero { padding: 22px 20px 18px; background: #f0fdfa; text-align: center; }
.rcp-status { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px; color: #0f766e; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.rcp-status.is-reversed { color: #be123c; }
.rcp-tick { position: relative; display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: #14b8a6; }
.rcp-tick::after { content: ""; position: absolute; top: 4px; left: 7px; width: 5px; height: 9px; border: solid #ffffff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.rcp-amount { margin: 0; color: #0f172a; font-size: 36px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rcp-amount span { color: #64748b; font-size: 18px; font-weight: 600; }
.rcp-date { margin: 4px 0 0; color: #64748b; font-size: 13px; }
.rcp-tear { height: 12px; background: radial-gradient(circle at 6px 0, #f0fdfa 6px, transparent 6.5px) 0 0 / 12px 12px repeat-x; }
.rcp-details { margin: 0; padding: 4px 20px; }
.rcp-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed #e2e8f0; font-size: 13px; }
.rcp-row dt { color: #64748b; }
.rcp-row dd { margin: 0; color: #0f172a; font-weight: 600; text-align: right; }
.rcp-row.mono dd { font-family: var(--font-mono); font-size: 12.5px; }
.rcp-row.stacked dd small { display: block; margin-top: 2px; color: #64748b; font-size: 11.5px; font-weight: 500; }
.rcp-row.warn dd { color: #b45309; }
.rcp-row.ok dd { color: #0f766e; }
.rcp-row.strong { border-bottom: 0; }
.rcp-row.strong dd { color: #0f766e; font-size: 15px; font-weight: 800; }
.rcp-sign { display: flex; justify-content: space-between; gap: 24px; padding: 28px 20px 18px; }
.rcp-sign span { flex: 1; padding-top: 6px; border-top: 1px solid #94a3b8; color: #64748b; font-size: 11.5px; text-align: center; }
.rcp-card.is-reversed .rcp-hero { background: #fff1f2; }
.rcp-card.is-reversed .rcp-tear { background-image: radial-gradient(circle at 6px 0, #fff1f2 6px, transparent 6.5px); }
.rcp-card.is-reversed .rcp-amount { color: #94a3b8; text-decoration: line-through; text-decoration-color: #e11d48; }

/* ─── Micro Leasing valuation (domain/valuation.js) ─── */
.vl-attach { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.vl-file { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface-sunken); }
.vl-file > .fa-file-pdf { color: #dc2626; font-size: 16px; }
.vl-file-name { max-width: 260px; overflow: hidden; color: var(--color-text-strong); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.vl-file small { color: var(--color-text-subtle); }
.vl-file-saved { gap: 10px; padding: 8px 12px; }
.vl-file-saved a.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.vl-panel { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 14px; }
.vl-title { margin: 0 0 10px; font-size: 13px; }
.vl-pdf { margin-top: 12px; }
/* The valuation PDF preview pop-up: wide, with the PDF filling it. */
dialog.vl-modal { width: min(96vw, 1100px); max-width: none; }
.vl-preview { height: min(78vh, 900px); margin: -4px; border: 1px solid var(--color-border); border-radius: 10px; overflow: hidden; background: #525659; }
.vl-frame { display: block; width: 100%; height: 100%; border: 0; }
dialog.vl-modal .modal-footer a.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
/* Checklist pop-ups (domain/workflow-queue.js): the client, loan and guarantors to check against, above the ticks. */
.ck-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ck-card { padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface-sunken); }
.ck-card.ck-wide { grid-column: 1 / -1; }
.ck-card h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--color-text-strong); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.ck-card h4 i { color: var(--color-brand-strong); }
html[data-theme="dark"] .ck-card h4 i { color: #5eead4; }
.ck-card dl { margin: 0; }
.ck-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--color-border); font-size: 12.5px; }
.ck-row:last-child { border-bottom: 0; }
.ck-row dt { flex: none; color: var(--color-text-subtle); }
.ck-row dd { margin: 0; color: var(--color-text-strong); text-align: right; }
.ck-row.mono dd { font-family: var(--font-mono); font-size: 12px; }
.ck-phone { display: inline-flex; align-items: center; gap: 6px; color: var(--color-brand-strong); font-weight: 700; text-decoration: none; }
.ck-phone i { font-size: 11px; }
html[data-theme="dark"] .ck-phone { color: #5eead4; }
.ck-guarantors { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ck-guarantors li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); font-size: 12.5px; }
.ck-guarantors .mono { color: var(--color-text-subtle); font-family: var(--font-mono); font-size: 12px; }
.ck-heading { margin: 4px 0 8px; color: var(--color-text-strong); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
@media (max-width: 700px) { .ck-details { grid-template-columns: minmax(0, 1fr); } }

/* ─── Circulars: the board (department tiles, grouped list), the circular pop-up and Manage Circulars ─── */
[data-dept="ALL"] { --dept: #64748b; }
[data-dept="HEAD_OFFICE"] { --dept: #6366f1; }
[data-dept="CREDIT"] { --dept: #0d9488; }
[data-dept="RECOVERY"] { --dept: #e11d48; }
[data-dept="FINANCE"] { --dept: #0284c7; }
[data-dept="HR"] { --dept: #9333ea; }
[data-dept="AUDIT"] { --dept: #d97706; }
[data-dept="OPERATIONS"] { --dept: #16a34a; }
[data-dept="IT"] { --dept: #475569; }
html[data-theme="dark"] [data-dept="ALL"] { --dept: #94a3b8; }
html[data-theme="dark"] [data-dept="HEAD_OFFICE"] { --dept: #a5b4fc; }
html[data-theme="dark"] [data-dept="CREDIT"] { --dept: #5eead4; }
html[data-theme="dark"] [data-dept="RECOVERY"] { --dept: #fda4af; }
html[data-theme="dark"] [data-dept="FINANCE"] { --dept: #7dd3fc; }
html[data-theme="dark"] [data-dept="HR"] { --dept: #d8b4fe; }
html[data-theme="dark"] [data-dept="AUDIT"] { --dept: #fcd34d; }
html[data-theme="dark"] [data-dept="OPERATIONS"] { --dept: #86efac; }
html[data-theme="dark"] [data-dept="IT"] { --dept: #cbd5e1; }

.cir-board { display: grid; gap: 16px; }
.cir-dept-icon {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 10px;
  color: var(--dept); background: color-mix(in srgb, var(--dept) 14%, transparent);
  font-size: 15px;
}
.cir-dept-name { color: var(--dept); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.cir-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cir-stat {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface);
}
.cir-stat-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--tone-text); background: var(--tone-soft); font-size: 16px; }
.cir-stat-text { display: grid; line-height: 1.2; }
.cir-stat-text b { font-size: 22px; color: var(--color-text-strong); font-variant-numeric: tabular-nums; }
.cir-stat-text small { color: var(--color-text-subtle); font-size: 12px; }

.cir-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; }
.cir-tile {
  display: flex; align-items: center; gap: 10px; padding: 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface); color: var(--color-text);
  transition: border-color .15s, background-color .15s;
}
.cir-tile:hover { border-color: color-mix(in srgb, var(--dept) 45%, var(--color-border)); background: color-mix(in srgb, var(--dept) 5%, var(--color-surface)); }
.cir-tile.is-active { border-color: var(--dept); background: color-mix(in srgb, var(--dept) 10%, var(--color-surface)); }
.cir-tile:focus-visible { outline: 2px solid var(--dept); outline-offset: 2px; }
.cir-tile-text { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.cir-tile-label { font-weight: 700; color: var(--color-text-strong); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cir-tile-count { font-size: 12px; color: var(--color-text-subtle); }
.cir-tile-flags { display: flex; align-items: center; gap: 6px; }
.cir-unread-pill { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--dept); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
html[data-theme="dark"] .cir-unread-pill { color: #0b0f17; }
.cir-urgent-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-danger); }

.cir-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cir-toolbar > .control { width: auto; min-width: 170px; }
.cir-search-wrap { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.cir-search-wrap > i { position: absolute; left: 12px; color: var(--color-text-subtle); font-size: 13px; pointer-events: none; }
.cir-search-wrap .cir-search { padding-left: 34px; width: 100%; }

.cir-list { display: grid; gap: 14px; }
.cir-group { border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface); overflow: hidden; }
.cir-group-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: color-mix(in srgb, var(--dept) 6%, var(--color-surface)); border-bottom: 1px solid var(--color-border); }
.cir-group-head h3 { margin: 0; font-size: 15px; color: var(--color-text-strong); flex: 1; }
.cir-group-count { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--dept); background: color-mix(in srgb, var(--dept) 14%, transparent); }
.cir-items { list-style: none; margin: 0; padding: 0; }
.cir-items > li + li { border-top: 1px solid var(--color-row-line, var(--color-border)); }
.cir-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: left; cursor: pointer;
  border: 0; background: transparent; color: var(--color-text); transition: background-color .15s;
}
.cir-item:hover { background: var(--color-table-row-hover); }
.cir-item:focus-visible { outline: 2px solid var(--dept); outline-offset: -2px; }
.cir-item-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: transparent; }
.cir-item.is-unread .cir-item-dot { background: var(--dept); }
.cir-item-main { display: grid; gap: 3px; flex: 1; min-width: 0; }
.cir-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.cir-item-no { font-weight: 700; color: var(--dept); font-variant-numeric: tabular-nums; }
.cir-item-cat { color: var(--color-text-subtle); }
.cir-item-cat::before { content: "·"; margin-right: 6px; }
.cir-item-title { font-size: 14px; color: var(--color-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cir-item.is-unread .cir-item-title { font-weight: 700; }
.cir-item-sub { font-size: 12px; color: var(--color-text-subtle); }
.cir-item-side { display: flex; align-items: center; gap: 12px; flex: none; }
.cir-item-pdf { color: var(--color-danger); font-size: 16px; }
.cir-item-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--color-warning); white-space: nowrap; }
.cir-item-state.is-done { color: var(--color-success); }

.cir-modal .modal-body { padding-top: 6px; }
.cir-detail { display: grid; gap: 16px; }
.cir-detail-head { display: flex; gap: 14px; align-items: flex-start; }
.cir-detail-head .cir-dept-icon { width: 46px; height: 46px; border-radius: 13px; font-size: 20px; }
.cir-detail-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cir-detail-title { margin: 6px 0 0; font-size: 20px; line-height: 1.3; color: var(--color-text-strong); }
.cir-detail-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface-sunken); }
.cir-detail-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-subtle); }
.cir-detail-meta dd { margin: 2px 0 0; font-weight: 600; color: var(--color-text-strong); font-size: 13px; }
.cir-detail-body { white-space: pre-wrap; line-height: 1.65; font-size: 14px; color: var(--color-text); max-height: 46vh; overflow: auto; padding-right: 4px; }
.cir-attachment {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; cursor: pointer; text-align: left;
  border: 1px dashed var(--color-border-strong); border-radius: 12px; background: transparent; color: var(--color-text);
  transition: border-color .15s, background-color .15s;
}
.cir-attachment:hover { border-color: var(--color-danger); background: var(--color-danger-soft); }
.cir-attachment-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--color-danger); background: var(--color-danger-soft); font-size: 18px; }
.cir-attachment-text { display: grid; flex: 1; min-width: 0; }
.cir-attachment-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--color-text-strong); }
.cir-attachment-text small { color: var(--color-text-subtle); }
.cir-attachment-go { color: var(--color-text-subtle); }
.cir-ack-note { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-subtle); }
.cir-ack-done { color: var(--color-success); font-weight: 600; }

.cir-manage-filters { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
.cir-manage-filters label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--color-text-subtle); min-width: 200px; }
.cir-dept-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.cir-dept-cell .cir-dept-icon { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.cir-title-cell { display: grid; max-width: 340px; }
.cir-title-cell b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cir-reach { display: inline-flex; align-items: center; gap: 8px; }
.cir-reach-bar { width: 70px; height: 6px; border-radius: 999px; background: var(--color-default-soft); overflow: hidden; }
.cir-reach-bar > span { display: block; height: 100%; background: var(--color-success); border-radius: inherit; }
.cir-reach small { font-variant-numeric: tabular-nums; color: var(--color-text-subtle); }
.cir-pdf-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cir-readers-note { margin: 0 0 12px; color: var(--color-text-subtle); }
.cir-readers-note b { color: var(--color-text-strong); }

@media (max-width: 900px) {
  .cir-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cir-detail-meta { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cir-item { flex-wrap: wrap; }
  .cir-item-side { width: 100%; padding-left: 20px; }
  .cir-toolbar > .control { flex: 1 1 140px; min-width: 0; }
}

.cir-toolbar > .cselect { flex: 0 0 200px; width: 200px; min-width: 0; }
.cir-tiles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cir-manage-filters .cselect { width: 220px; }
@media (max-width: 560px) {
  .cir-toolbar > .cselect { flex: 1 1 140px; width: auto; }
}

.cir-title-cell { min-width: 240px; max-width: 380px; white-space: normal; gap: 2px; }
.cir-title-cell b { white-space: normal; overflow: visible; line-height: 1.35; }
.cir-title-cell small { display: inline-flex; align-items: center; gap: 8px; }
.cir-pdf-link { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border: 1px solid var(--color-border); border-radius: 6px; background: transparent; color: var(--color-danger); font-size: 11px; font-weight: 700; cursor: pointer; }
.cir-pdf-link:hover { background: var(--color-danger-soft); }
.cir-dates { display: grid; white-space: nowrap; }

.cir-actions { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px; }
.cir-actions .btn { justify-content: center; }

/* Circular Board: the department filter as one row of chips. */
.cir-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cir-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px 6px 12px; cursor: pointer;
  border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface);
  color: var(--color-text); font-size: 13px; font-weight: 600; transition: border-color .15s, background-color .15s;
}
.cir-chip:hover { border-color: color-mix(in srgb, var(--dept) 50%, var(--color-border)); }
.cir-chip.is-active { border-color: var(--dept); background: color-mix(in srgb, var(--dept) 14%, var(--color-surface)); color: var(--color-text-strong); }
.cir-chip:focus-visible { outline: 2px solid var(--dept); outline-offset: 2px; }
.cir-chip-count { min-width: 20px; padding: 1px 7px; border-radius: 999px; font-size: 11px; text-align: center; color: var(--dept); background: color-mix(in srgb, var(--dept) 14%, transparent); }
.cir-chip.is-active .cir-chip-count { background: var(--dept); color: #fff; }
html[data-theme="dark"] .cir-chip.is-active .cir-chip-count { color: #0b0f17; }
.cir-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dept); }

/* Circular Board: status chips beside the search box (a segmented control). */
.cir-views { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface); }
.cir-view {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--color-text-subtle); font-size: 13px; font-weight: 600; transition: background-color .15s, color .15s;
}
.cir-view:hover { color: var(--color-text-strong); }
.cir-view.is-active { background: var(--color-success-soft); color: var(--color-success-strong, var(--color-success)); }
html:not([data-theme="dark"]) .cir-view.is-active { color: #0f766e; }
.cir-view:focus-visible { outline: 2px solid var(--color-success); outline-offset: 1px; }
.cir-view-count { min-width: 18px; padding: 0 6px; border-radius: 999px; font-size: 11px; text-align: center; background: var(--color-default-soft); color: var(--color-text); }
@media (max-width: 560px) { .cir-views { width: 100%; justify-content: space-between; } }

/* Circulars as PDFs: the viewer pop-up and the simpler list rows. */
.cir-viewer { display: grid; gap: 10px; }
.cir-viewer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; }
.cir-viewer-meta .cir-dept-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.cir-frame { width: 100%; height: min(70vh, 760px); }
.cir-modal .modal-footer { flex-wrap: wrap; }
.cir-modal .cir-ack-note { margin-right: auto; }
.cir-item-title { display: flex; align-items: center; gap: 8px; }
.cir-title-cell small { gap: 4px; }

.cir-item-state.is-new { color: var(--color-info); }
.cir-item-state.is-new i { font-size: 8px; }
.cir-withdrawn { display: inline-flex; align-items: center; gap: 6px; color: var(--color-danger); font-weight: 600; }

/* Circular Board, simple: chips and search in one row, then one list. */
.cir-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cir-filter .cir-chips { flex: 1 1 auto; }
.cir-filter .cir-search-wrap { flex: 0 1 280px; }
.cir-flat { border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface); overflow: hidden; }
.cir-rows { list-style: none; margin: 0; padding: 0; }
.cir-rows > li + li { border-top: 1px solid var(--color-row-line, var(--color-border)); }
.cir-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: left; cursor: pointer;
  border: 0; background: transparent; color: var(--color-text); transition: background-color .15s;
}
.cir-row:hover { background: var(--color-table-row-hover); }
.cir-row:focus-visible { outline: 2px solid var(--dept); outline-offset: -2px; }
.cir-row-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.cir-row-title { font-size: 14px; color: var(--color-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cir-row.is-unread .cir-row-title { font-weight: 700; }
.cir-row-sub { font-size: 12px; color: var(--color-text-subtle); }
.cir-row-new { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; font-weight: 700; color: var(--color-info); }
.cir-row-new::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--color-info); }
.cir-flat > .state { padding: 32px 16px; }
@media (max-width: 560px) { .cir-filter .cir-search-wrap { flex: 1 1 100%; } }

/* Circular Board, plain: department headings and one line per circular. */
.cir-simple { border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface); overflow: hidden; }
.cir-simple-group + .cir-simple-group { border-top: 1px solid var(--color-border); }
.cir-simple-head { margin: 0; padding: 12px 16px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-subtle); }
.cir-simple-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; cursor: pointer; text-align: left;
  border: 0; background: transparent; color: var(--color-text-strong); font-size: 14px; transition: background-color .15s;
}
.cir-simple-row:hover { background: var(--color-table-row-hover); }
.cir-simple-row:focus-visible { outline: 2px solid var(--color-success); outline-offset: -2px; }
.cir-simple-row.is-unread { font-weight: 700; }
.cir-simple-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cir-simple-new { flex: none; font-size: 11px; font-weight: 700; color: var(--color-info); }
.cir-simple-date { flex: none; font-size: 12px; font-weight: 400; color: var(--color-text-subtle); font-variant-numeric: tabular-nums; }
.cir-simple-group:last-child { padding-bottom: 6px; }
.cir-simple > .state { padding: 32px 16px; }

/* Circular Board: each department in its own box. */
.cir-simple { display: grid; gap: 12px; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.cir-simple-group { border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface); overflow: hidden; padding-bottom: 4px; }
.cir-simple-group + .cir-simple-group { border-top: 1px solid var(--color-border); }
.cir-simple-head { padding: 10px 16px; margin-bottom: 2px; font-size: 12px; color: var(--color-text-strong); background: var(--color-surface-sunken); border-bottom: 1px solid var(--color-border); }
.cir-simple-row + .cir-simple-row { border-top: 1px solid var(--color-row-line, var(--color-border)); }
.cir-simple > .state { border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface); }

/* Circular Board: small department icon in each heading, a document icon before each circular. */
.cir-simple-head { display: flex; align-items: center; gap: 8px; }
.cir-simple-head .cir-dept-icon { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.cir-simple-bullet { flex: none; width: 14px; font-size: 13px; color: var(--color-text-subtle); text-align: center; }
.cir-simple-row.is-unread .cir-simple-bullet { color: var(--color-info); }

/* Bell: a red dot instead of a number, and the Circulars section. */
.bell-dot {
  position: absolute; top: -2px; right: -2px; width: 11px; height: 11px;
  border: 2px solid var(--bell-card, var(--color-surface)); border-radius: 50%; background: #e11d48;
}
.bell-dot[hidden] { display: none; }
.bell-section-link { margin-left: auto; padding: 0; border: 0; background: transparent; color: #0d9488; font-size: 12px; font-weight: 700; cursor: pointer; }
.bell-section-link:hover { text-decoration: underline; }
html[data-theme="dark"] .bell-section-link { color: #5eead4; }
.bell-circular {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 9px; text-align: left; cursor: pointer;
  border: 0; border-radius: 9px; background: var(--bell-soft); color: inherit; font-size: 12px; transition: background-color .15s;
}
.bell-circular:hover { background: rgb(13 148 136 / 10%); }
.bell-circular small { color: var(--bell-muted); }
.bell-circular > i { color: var(--bell-muted); font-size: 11px; }
.bell-circular-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #0ea5e9; }

/* Icon-only buttons (row actions): a small square with the icon centred; the label is the tooltip. */
.btn.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; min-width: 30px; padding: 0; gap: 0; }
.btn.btn-icon .icon, .btn.btn-icon i { margin: 0; }
.record-actions { gap: 6px; }
.cir-actions { display: inline-flex; grid-template-columns: none; gap: 6px; }

/* Icon-only buttons sized to sit with table text (12px). */
.btn.btn-icon { width: 24px; height: 24px; min-width: 24px; min-height: 24px; border-radius: 7px; line-height: 1; }
.record-actions, .cir-actions { gap: 4px; }
