/* ============================================
   ERP-UI.CSS — Modern ERP interface layer
   Loads after base styles; preserves class API
   ============================================ */

/* ---- App shell ---- */
body {
  font-size: var(--font-size-base);
  background: var(--page-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.06), transparent),
    linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-subtle) 100%);
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-end) 100%);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: var(--shadow-sidebar);
}

.sidebar-header {
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--sidebar-border);
  background: rgba(255, 255, 255, 0.02);
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.logo-name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-tight);
}

.logo-tag {
  font-size: 10px;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.sidebar-nav {
  padding: var(--space-2) 0 var(--space-4);
}

.nav-section {
  margin-bottom: var(--space-1);
  padding: 0 var(--space-3);
}

.nav-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-2) var(--space-2) var(--space-1);
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

.nav-section-head .nav-label {
  padding: 0;
  flex: 1;
  text-align: left;
}

.nav-chevron {
  width: 14px;
  height: 14px;
  color: var(--sidebar-text);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.nav-section--collapsed .nav-chevron {
  transform: rotate(-90deg);
}

.nav-section-body {
  overflow: hidden;
  transition: max-height var(--transition-slow), opacity var(--transition);
  max-height: 600px;
}

.nav-sublabel {
  display: block;
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.85;
}

.nav-item--sub {
  padding-left: calc(var(--space-3) + 8px);
  font-size: 13px;
}

.nav-item--sub .nav-icon {
  display: none;
}

.nav-section--collapsed .nav-section-body {
  max-height: 0;
  opacity: 0;
}

.nav-label {
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.9px;
  color: var(--sidebar-text);
}

.nav-item {
  padding: 9px var(--space-3);
  border-radius: var(--radius);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: inset 3px 0 0 var(--sidebar-active-border);
}

.nav-item.active::before {
  display: none;
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.75;
}

.nav-item.active .nav-icon {
  color: var(--sidebar-active-border);
  opacity: 1;
}

.nav-badge {
  font-size: 10px;
  min-width: 20px;
  height: 20px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

.sidebar-footer {
  background: var(--sidebar-search-bg);
  border-top: 1px solid var(--sidebar-border);
}

.btn-backup {
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.btn-backup:hover {
  background: var(--sidebar-hover);
  border-color: var(--sidebar-border);
}

/* ---- Header ---- */
.top-header {
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  padding: 0 var(--space-6);
}

.top-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 50%, transparent 100%);
  opacity: 0.5;
  pointer-events: none;
}

.top-header {
  position: sticky;
}

.breadcrumb {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.breadcrumb-module {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  letter-spacing: var(--letter-tight);
  line-height: var(--line-height-tight);
}

.breadcrumb-path {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-date {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  padding: 6px 12px;
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
}

.backup-status {
  border: 1px solid rgba(5, 150, 105, 0.25);
  font-size: var(--font-size-xs);
}

.currency-badge {
  border: 1px solid var(--color-primary-muted);
  font-weight: var(--font-weight-bold);
}

.theme-toggle {
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ---- Page content ---- */
.page-content {
  padding: var(--space-6) var(--space-6) var(--space-10);
  max-width: var(--content-max-width);
}

/* ---- Page header ---- */
.page-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color-subtle);
}

.page-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: var(--letter-tight);
}

.page-subtitle {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ---- Cards ---- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(180deg, var(--card-bg) 0%, var(--page-bg-subtle) 100%);
}

.card-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
}

.card-footer {
  background: var(--page-bg-subtle);
}

/* ---- Dashboard hero ---- */
.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-6);
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, var(--color-primary) 0%, #1d4ed8 55%, #4f46e5 100%);
  border-radius: var(--radius-lg);
  color: white;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.28);
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.dashboard-hero-content {
  position: relative;
  z-index: 1;
}

.dashboard-hero-greeting {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: var(--space-1);
}

.dashboard-hero-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: var(--letter-tight);
  line-height: var(--line-height-tight);
}

.dashboard-hero-sub {
  font-size: var(--font-size-md);
  opacity: 0.9;
  margin-top: var(--space-2);
}

.dashboard-hero-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.dashboard-hero-actions .period-filter {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.dashboard-hero-actions .period-btn {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
}

.dashboard-hero-actions .period-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.dashboard-hero-actions .period-btn.active {
  background: white;
  color: var(--color-primary-dark);
}

/* Quick module links */
.module-shortcuts {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.module-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}

.module-shortcut:hover {
  border-color: var(--color-primary-muted);
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.module-shortcut-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.module-shortcut-icon svg {
  width: 20px;
  height: 20px;
}

.module-shortcut-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
}

.module-shortcut:hover .module-shortcut-label {
  color: var(--color-primary-dark);
}

/* ---- Stat cards ---- */
.stat-card {
  border-radius: var(--radius-md);
  padding: clamp(0.75rem, 2.5cqi + 0.5rem, var(--space-5));
  box-shadow: var(--shadow-card);
  border-left: 3px solid transparent;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card--revenue { border-left-color: var(--color-success); }
.stat-card--expenses { border-left-color: var(--color-danger); }
.stat-card--profit { border-left-color: var(--color-primary); }
.stat-card--cash { border-left-color: var(--color-info); }

.stat-card--blue { border-left-color: var(--color-info); }
.stat-card--green { border-left-color: var(--color-success); }
.stat-card--purple { border-left-color: var(--color-accent); }
.stat-card--orange { border-left-color: var(--color-warning); }
.stat-card--red { border-left-color: var(--color-danger); }

.stat-card--revenue::after,
.stat-card--expenses::after,
.stat-card--profit::after,
.stat-card--cash::after {
  display: none;
}

.stat-card-label {
  letter-spacing: 0.04em;
}

.stat-card-value {
  font-weight: var(--font-weight-extrabold);
}

.stat-card-value--sm {
  font-size: clamp(0.8125rem, 3.5cqi + 0.4rem, var(--font-size-lg));
}

.stat-card-value--positive { color: var(--color-success); }
.stat-card-value--negative { color: var(--color-danger); }

.stat-card-icon {
  border-radius: var(--radius);
}

/* ---- Tables ---- */
.data-table thead th {
  padding: 12px 16px;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  color: var(--text-secondary);
}

.data-table tbody tr:hover {
  background: var(--table-row-hover);
}

.data-table tbody tr:nth-child(even) {
  background: var(--table-row-stripe);
}

.table-sticky thead th {
  background: var(--card-bg);
  box-shadow: 0 1px 0 var(--border-color);
}

.cell-actions {
  opacity: 1;
  gap: 2px;
}

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
}

.page-btn {
  border-radius: var(--radius);
  min-width: 32px;
  height: 32px;
}

.page-btn.active {
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.page-ellipsis {
  border: none;
  background: none;
  cursor: default;
  pointer-events: none;
}

/* ---- Forms ---- */
.form-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.form-control {
  padding: 10px 14px;
  font-size: var(--font-size-md);
  background: var(--input-bg);
  border-radius: var(--radius);
  border-color: var(--border-color);
}

.form-control:hover:not(:disabled) {
  border-color: var(--border-color-strong);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-control:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--color-danger);
}

.form-group--error .form-control {
  border-color: var(--color-danger);
}

.form-group--error .form-error {
  display: block;
}

.form-error {
  display: none;
}

.form-section-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-color-subtle);
}

/* ---- Buttons ---- */
.btn {
  padding: 9px 18px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.btn--primary {
  background: linear-gradient(180deg, #3b82f6 0%, var(--color-primary) 100%);
  border-color: var(--color-primary-dark);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn--primary:hover {
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn--ghost {
  box-shadow: none;
}

.btn--ghost:hover {
  background: var(--page-bg-subtle);
}

/* ---- Filter bar ---- */
.filter-bar {
  padding: var(--space-3) var(--space-5);
  background: var(--page-bg-subtle);
  gap: var(--space-3);
}

.search-input {
  padding: 9px 14px 9px 36px;
  border-radius: var(--radius);
  background: var(--input-bg);
  border-color: var(--border-color);
}

.search-input:focus {
  background: var(--input-bg);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-select {
  padding: 8px 32px 8px 12px;
  border-radius: var(--radius);
  background: var(--input-bg);
  font-weight: var(--font-weight-medium);
}

.period-filter {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.period-btn {
  padding: 8px 14px;
  font-size: var(--font-size-sm);
}

/* ---- Tabs ---- */
.tab-list {
  background: var(--card-bg);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  padding: 0 var(--space-4);
  gap: var(--space-1);
}

.tab-btn {
  padding: 14px 18px;
  font-size: var(--font-size-md);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn.active {
  background: var(--color-primary-light);
  border-bottom-color: var(--color-primary);
  color: var(--color-primary-dark);
}

/* ---- Modals ---- */
.modal-overlay {
  background: var(--overlay-bg);
  backdrop-filter: blur(6px);
}

.modal-box {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: var(--space-5) var(--space-6) var(--space-4);
  background: var(--page-bg-subtle);
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.modal-body {
  padding: var(--space-5) var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  background: var(--page-bg-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

:root[data-theme="dark"] .modal-footer,
:root[data-theme="dark"] .modal-header {
  background: var(--page-bg-subtle);
}

/* ---- Toasts ---- */
.toast {
  border-radius: var(--radius-md);
  border-left-width: 4px;
  box-shadow: var(--shadow-lg);
}

/* ---- Confirm ---- */
.confirm-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

/* ---- Empty state ---- */
.empty-state {
  padding: var(--space-10) var(--space-6);
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-muted) 100%);
}

/* ---- Loading ---- */
.loading-spinner {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* ---- Activity ---- */
.activity-item:hover {
  background: var(--page-bg-subtle);
}

/* ---- Export bar ---- */
.export-bar .btn {
  box-shadow: none;
}

/* ---- Pagination ---- */
.pagination {
  background: var(--page-bg-subtle);
  padding: var(--space-3) var(--space-5);
}

/* ---- Alerts / banners ---- */
.overdue-banner {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.alert {
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.alert--info { border-color: rgba(2, 132, 199, 0.2); }
.alert--success { border-color: rgba(5, 150, 105, 0.2); }
.alert--warning { border-color: rgba(217, 119, 6, 0.2); }
.alert--danger { border-color: rgba(220, 38, 38, 0.2); }

/* ---- Inline loading ---- */
.loading-inline {
  min-height: 200px;
}

/* ---- Responsive ---- */
@media (max-width: 1280px) {
  .module-shortcuts {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-hero-actions {
    width: 100%;
    overflow-x: auto;
  }

  .module-shortcuts {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .top-header {
    padding: 0 var(--space-4);
  }

  .page-content {
    padding: var(--space-4);
  }

  .module-shortcuts {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-section-head {
    pointer-events: none;
  }

  .nav-chevron {
    display: none;
  }
}

@media (max-width: 480px) {
  .module-shortcuts {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-hero-title {
    font-size: var(--font-size-xl);
  }
}

/* ============================================
   ERP TREE NAVIGATION
   ============================================ */

.sidebar-search {
  position: relative;
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: var(--space-2);
  flex-shrink: 0;
}

.sidebar-search__icon {
  position: absolute;
  left: calc(var(--space-3) + 10px);
  top: 50%;
  transform: translateY(calc(-50% - 4px));
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  color: #64748b;
  pointer-events: none;
}

.sidebar-search__input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--sidebar-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.sidebar-search__input::placeholder { color: #64748b; }
.sidebar-search__input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

.erp-nav-tree {
  padding: var(--space-1) var(--space-2) var(--space-3);
  min-width: 0;
}

/* Base icon sizing — prevents SVG intrinsic dimensions from expanding */
.erp-nav-icon {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex-shrink: 0;
  display: block;
}

.erp-nav-group {
  margin-bottom: 1px;
  min-width: 0;
}

/* Level 1 — major sections */
.erp-nav-group--l1 {
  margin-bottom: 0;
  padding-top: var(--space-2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

.erp-nav-group--l1:first-child {
  border-top: none;
  padding-top: 0;
}

.erp-nav-group--l1 + .erp-nav-group--l1 {
  margin-top: var(--space-1);
}

.erp-nav-group__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: inherit;
  transition: background var(--transition-fast);
  position: relative;
  min-width: 0;
}

.erp-nav-group__head:hover {
  background: var(--sidebar-hover);
}

.erp-nav-group__head--l1 {
  padding: 8px var(--space-3);
  font-size: 13px;
  font-weight: 700;
  color: var(--sidebar-text-active);
  border-radius: var(--radius);
}

.erp-nav-group__head--l1 .erp-nav-icon {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  color: var(--sidebar-active-border);
}

/* Level 2 — book / submodule headers */
.erp-nav-group--l2 {
  margin: 1px 0;
}

.erp-nav-group__head--l2 {
  padding: 7px var(--space-2) 7px calc(var(--space-3) + 6px);
  font-size: 12px;
  font-weight: 600;
  color: var(--sidebar-text-active);
}

.erp-nav-group__head--l2 .erp-nav-icon {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  color: var(--sidebar-text);
}

/* Level 3+ — nested section headers */
.erp-nav-group__head--l3 {
  padding: 6px var(--space-2) 6px calc(var(--space-3) + 14px);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--sidebar-text);
}

.erp-nav-group__head--l4 {
  padding: 6px var(--space-2) 6px calc(var(--space-3) + 22px);
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-text);
}

.erp-nav-group__head--l3 .erp-nav-icon,
.erp-nav-group__head--l4 .erp-nav-icon,
.erp-nav-group__head--l5 .erp-nav-icon {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  color: var(--sidebar-text);
  opacity: 0.85;
}

.erp-nav-group__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.erp-nav-chevron {
  width: 12px;
  height: 12px;
  max-width: 12px;
  max-height: 12px;
  color: var(--sidebar-text);
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.22s ease;
}

.erp-nav-group--collapsed > .erp-nav-group__head .erp-nav-chevron {
  transform: rotate(-90deg);
}

.erp-nav-group__body {
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.22s ease;
}

.erp-nav-group--collapsed > .erp-nav-group__body {
  max-height: 0;
  opacity: 0;
}

.erp-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px var(--space-3);
  margin: 1px var(--space-1);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  min-width: 0;
  min-height: 32px;
}

.erp-nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.erp-nav-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  border-color: rgba(59, 130, 246, 0.25);
  box-shadow: inset 3px 0 0 var(--sidebar-active-border);
}

.erp-nav-link--l2 {
  padding-left: calc(var(--space-3) + 10px);
}

.erp-nav-link--l3 {
  padding-left: calc(var(--space-3) + 18px);
  font-size: 12px;
}

.erp-nav-link--l4 {
  padding-left: calc(var(--space-3) + 26px);
  font-size: 12px;
}

.erp-nav-link--l5,
.erp-nav-link--l6 {
  padding-left: calc(var(--space-3) + 34px);
  font-size: 12px;
}

.erp-nav-link .erp-nav-icon {
  width: 15px;
  height: 15px;
  max-width: 15px;
  max-height: 15px;
  flex-shrink: 0;
  opacity: 0.8;
}

.erp-nav-link.active .erp-nav-icon,
.erp-nav-link:hover .erp-nav-icon {
  opacity: 1;
}

/* Submenu tree connectors */
.erp-nav-link--tree::before {
  content: '├─';
  flex-shrink: 0;
  width: 18px;
  font-size: 11px;
  line-height: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: rgba(148, 163, 184, 0.7);
  margin-right: -2px;
}

.erp-nav-link--tree-last::before {
  content: '└─';
}

.erp-nav-link--tree.erp-nav-link--l3 {
  padding-left: calc(var(--space-3) + 8px);
}

.erp-nav-link--tree.erp-nav-link--l4 {
  padding-left: calc(var(--space-3) + 14px);
}

.erp-nav-link--tree.erp-nav-link--l5,
.erp-nav-link--tree.erp-nav-link--l6 {
  padding-left: calc(var(--space-3) + 20px);
}

.erp-nav-link__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.erp-nav-badge {
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--color-danger);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex-shrink: 0;
}

.erp-nav-badge:empty { display: none; }

.erp-nav--hidden { display: none !important; }

/* Collapsed sidebar — icon rail */
.sidebar.sidebar--collapsed .sidebar-search { display: none; }

.sidebar.sidebar--collapsed .erp-nav-tree {
  padding: var(--space-2) 8px;
}

.sidebar.sidebar--collapsed .erp-nav-group__body {
  display: none;
}

.sidebar.sidebar--collapsed .erp-nav-group__head {
  justify-content: center;
  padding: 9px 6px;
  gap: 0;
}

.sidebar.sidebar--collapsed .erp-nav-group__label,
.sidebar.sidebar--collapsed .erp-nav-chevron,
.sidebar.sidebar--collapsed .erp-nav-link__text,
.sidebar.sidebar--collapsed .erp-nav-badge,
.sidebar.sidebar--collapsed .erp-nav-link--tree::before {
  display: none;
}

.sidebar.sidebar--collapsed .erp-nav-group--l1 {
  margin-bottom: 2px;
  padding-top: 0;
  border-top: 1px solid var(--sidebar-border);
  border-radius: 0;
  background: none;
}

.sidebar.sidebar--collapsed .erp-nav-group--l1:first-child {
  border-top: none;
}

.sidebar.sidebar--collapsed .erp-nav-link {
  justify-content: center;
  padding: 9px 6px;
  gap: 0;
}

.sidebar.sidebar--collapsed .erp-nav-group__head[data-tooltip]::after,
.sidebar.sidebar--collapsed .erp-nav-link[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--sidebar-tooltip-bg);
  color: var(--sidebar-tooltip-text);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--sidebar-border);
  z-index: 300;
}

.sidebar.sidebar--collapsed .erp-nav-link[data-tooltip]:hover::after,
.sidebar.sidebar--collapsed .erp-nav-group__head[data-tooltip]:hover::after {
  opacity: 1;
}

.sidebar.sidebar--collapsed .sidebar-nav {
  overflow-x: visible;
}

.sidebar-search__input {
  background: var(--sidebar-search-bg);
  color: var(--sidebar-text-active);
  border: 1px solid var(--sidebar-border);
}

/* ---- Book accounting dashboard ---- */
.book-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.book-dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--page-bg-subtle) 100%);
}

.book-dash-header__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  letter-spacing: var(--letter-tight);
  margin: 0;
}

.book-dash-header__subtitle {
  margin: var(--space-1) 0 0;
  font-size: var(--font-size-md);
  color: var(--text-secondary);
}

.book-dash-header__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: var(--space-3) var(--space-5);
}

.book-dash-meta-label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.book-dash-meta-value {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.book-dash-status--active { color: var(--color-success); }
.book-dash-status--inactive { color: var(--text-muted); }

.book-dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, var(--space-4));
}

.book-dash-kpi {
  padding: clamp(0.75rem, 2.5cqi + 0.5rem, var(--space-5));
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: clamp(0.25rem, 1cqi + 0.15rem, var(--space-2));
  min-width: 0;
  overflow: hidden;
}

.book-dash-kpi--revenue { border-left-color: var(--color-success); }
.book-dash-kpi--profit { border-left-color: var(--color-primary); }
.book-dash-kpi--cash { border-left-color: var(--color-info); }
.book-dash-kpi--receivable { border-left-color: var(--color-warning); }
.book-dash-kpi--expense { border-left-color: var(--color-danger); }

/* ---- Operations Letter Management dashboard ---- */
.book-lm-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.book-lm-kpi--clickable {
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.book-lm-kpi--clickable:hover,
.book-lm-kpi--clickable:focus-visible {
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.book-lm-section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}
.book-lm-quick-actions__primary .btn--primary {
  min-width: 11rem;
}
.book-lm-attention-table th,
.book-lm-attention-table td {
  font-size: var(--font-size-sm);
}
.book-lm-empty-state h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}
@media (max-width: 1100px) {
  .book-lm-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .book-lm-kpi-grid { grid-template-columns: 1fr; }
}

/* ---- Operations Letter Register ---- */
.book-lm-reg-page .book-lm-reg-toolbar .book-lm-reg-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.book-lm-seg {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.book-lm-seg-btn {
  border: none;
  background: var(--surface-2, #f8fafc);
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  cursor: pointer;
}
.book-lm-seg-btn.is-active {
  background: var(--color-primary);
  color: #fff;
}
.book-lm-seg-btn:disabled {
  opacity: 0.7;
  cursor: default;
}
.book-lm-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.book-lm-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2, #f1f5f9);
  font-size: var(--font-size-sm);
}
.book-lm-filter-chip__x {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.book-lm-dir-fixed {
  padding-top: 6px;
}
.book-lm-reg-page--incoming .book-lm-reg-toolbar,
.book-lm-reg-page--outgoing .book-lm-reg-toolbar {
  border-left: 3px solid var(--color-info, #0ea5e9);
}
.book-lm-reg-page--drafts .book-lm-reg-toolbar {
  border-left: 3px solid var(--color-warning, #f59e0b);
}
.book-lm-reg-page--archived .book-lm-reg-toolbar {
  border-left: 3px solid var(--text-muted, #64748b);
}
.book-lm-page-header__group {
  margin: 0 0 4px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.book-lm-page-header .book-lm-page-header__panel {
  margin-bottom: 0;
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}
.book-lm-reg-toolbar__header .card-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}
.book-lm-filter-chip--locked {
  background: var(--surface-3, #e2e8f0);
  font-weight: var(--font-weight-medium);
}
.book-lm-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.book-lm-report-card .card-header {
  align-items: flex-start;
}
.book-lm-report-count {
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  white-space: nowrap;
}
.book-lm-fu-seg {
  flex-wrap: wrap;
}
.book-lm-fu-kpi {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  padding: 12px;
  background: var(--surface-1, #fff);
}
.book-lm-fu-kpi.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}
.book-lm-fu-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.book-lm-report-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.book-lm-month-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.book-lm-month-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-2, #f8fafc);
}
.book-lm-month-stat__label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.book-lm-month-stat__value {
  font-weight: var(--font-weight-semibold);
}
.book-lm-monthly-card {
  grid-column: 1 / -1;
}
.book-lm-fu-status {
  font-size: 10px;
  letter-spacing: 0.03em;
}
@media (max-width: 960px) {
  .book-lm-reports-grid { grid-template-columns: 1fr; }
}
.book-lm-reg-table-wrap {
  overflow-x: auto;
}
.book-lm-reg-table th .book-lm-sort-th {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  padding: 0;
}
.book-lm-reg-table th .book-lm-sort-th.is-active {
  color: var(--color-primary);
}
.book-lm-ref-link {
  padding: 0;
  font-weight: inherit;
}
.book-lm-dir-badge {
  font-size: 10px;
  letter-spacing: 0.03em;
}
.book-lm-fu-overdue {
  color: var(--color-danger);
}
.book-lm-row-actions .btn {
  white-space: nowrap;
}
.book-letter-subject-cell {
  max-width: 280px;
  white-space: normal;
  word-break: break-word;
  vertical-align: middle;
}
.book-lm-attention-empty {
  padding: 20px 16px;
}
.book-lm-reg-empty h3,
.book-el-reg-empty h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}
.book-lm-reg-search-row .book-export-actions,
.book-el-reg-search-row .book-export-actions {
  flex-shrink: 0;
}
.book-el-ver-current {
  background: var(--surface-2, #f8fafc);
}
.book-el-ver-current-badge {
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-left: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Employee Letter Management UI (book-el-*) */
.book-el-page-header__group {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.book-el-page-header .book-el-page-header__panel {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 20px;
  background: var(--surface-1, #fff);
}
.book-el-reg-toolbar__header .card-title {
  font-size: var(--font-size-sm);
}
.book-el-reg-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.book-el-reg-search-row .form-control {
  flex: 1;
  min-width: 0;
}
.book-el-reg-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.book-el-reg-table-wrap {
  overflow-x: auto;
}
.book-el-reg-table th,
.book-el-reg-table td {
  vertical-align: middle;
}
.book-el-row-actions {
  white-space: nowrap;
}
.book-el-row-actions .btn {
  margin-left: 4px;
}
.book-el-status-badge,
.book-el-default-badge {
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.book-el-reg-empty h3 {
  font-size: var(--font-size-lg);
}
.book-el-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
}
.book-el-preview-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius-md, 8px);
  padding: 10px 14px;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: #856404;
}
.book-el-workflow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.book-el-workflow-step {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color, #e5e7eb);
  font-size: var(--font-size-sm);
  background: var(--surface-2, #f8fafc);
  color: var(--text-muted);
}
.book-el-workflow-step.is-current {
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-primary, #2563eb);
  font-weight: var(--font-weight-semibold);
}
.book-el-workflow-step.is-done {
  border-color: var(--color-success, #16a34a);
  color: var(--color-success, #16a34a);
}
.book-el-doc-preview {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  padding: 16px;
  background: #fff;
  min-height: 120px;
}
.book-el-validation-blocked {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md, 8px);
  padding: 10px 14px;
}
.book-el-validation-level--ok { color: #15803d; font-weight: 600; }
.book-el-validation-level--warn { color: #b45309; font-weight: 600; }
.book-el-validation-level--fail { color: #b91c1c; font-weight: 600; }
.book-el-ver-current {
  background: rgba(37, 99, 235, 0.04);
}
.book-el-ver-current-badge {
  font-size: 9px;
  vertical-align: middle;
}
.book-el-ph-key {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 6px;
  background: #f1f5f9;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
}
.book-el-error-panel {
  border-left: 4px solid var(--color-danger, #dc2626);
}
@media (max-width: 960px) {
  .book-el-reg-filters { grid-template-columns: 1fr 1fr; }
  .book-el-row-actions .btn { display: inline-block; margin-bottom: 4px; }
}
@media (max-width: 640px) {
  .book-el-reg-filters { grid-template-columns: 1fr; }
}

/* Company Letter Management UI (book-cl-*) */
.book-cl-reg-table th,
.book-cl-reg-table td { vertical-align: middle; }
.book-cl-rich-editor__toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--surface-2, #f8fafc); border-bottom: 1px solid var(--border-color, #e5e7eb); }
.book-cl-rich-editor { border: 1px solid var(--border-color, #e5e7eb); border-radius: 8px; overflow: hidden; }
.book-cl-rich-editor__body { min-height: 280px; padding: 12px; background: #fff; line-height: 1.6; }
.book-cl-status-badge { font-size: 11px; }
.book-cl-row-actions .btn { margin-bottom: 4px; }
.book-cl-sample-badge { margin-left: 6px; }

.book-dash-kpi__label {
  font-size: clamp(0.625rem, 2cqi + 0.35rem, var(--font-size-xs));
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.book-dash-kpi__value {
  font-size: clamp(0.875rem, 4.5cqi + 0.5rem, 1.75rem);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  margin: 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-dash-kpi__sub {
  font-size: clamp(0.625rem, 2cqi + 0.3rem, var(--font-size-sm));
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-dash-kpi__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.25rem, 1cqi + 0.1rem, var(--space-2));
  font-size: clamp(0.625rem, 1.8cqi + 0.3rem, var(--font-size-xs));
  color: var(--text-secondary);
  min-width: 0;
  margin-top: auto;
}

.book-dash-kpi__footer > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-dash-trend {
  font-weight: var(--font-weight-bold);
  font-size: clamp(0.625rem, 1.8cqi + 0.28rem, var(--font-size-xs));
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.book-dash-trend--up { color: var(--color-success); }
.book-dash-trend--down { color: var(--color-danger); }

.book-dash-row {
  display: grid;
  gap: var(--space-4);
}

.book-dash-row--2 { grid-template-columns: repeat(2, 1fr); }
.book-dash-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.book-dash-health__status {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
}

.book-dash-health__status--ok {
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
  color: var(--color-success);
}

.book-dash-health__status--warn {
  background: color-mix(in srgb, var(--color-warning) 12%, transparent);
  color: var(--color-warning);
}

.book-dash-health__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.book-dash-health__metric {
  display: block;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
}

.book-dash-health__metric--status {
  font-size: var(--font-size-md);
  color: var(--color-success);
}

.book-dash-health__caption {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.book-dash-position__row + .book-dash-position__row {
  margin-top: var(--space-4);
}

.book-dash-position__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.book-dash-bar {
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--page-bg-subtle);
  overflow: hidden;
}

.book-dash-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition);
}

.book-dash-bar--assets .book-dash-bar__fill { background: var(--color-info); }
.book-dash-bar--liabilities .book-dash-bar__fill { background: var(--color-warning); }
.book-dash-bar--equity .book-dash-bar__fill { background: var(--color-primary); }

.book-dash-bar--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.book-dash-cashflow__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-dash-cashflow__item {
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--page-bg-subtle);
}

.book-dash-cashflow__label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.book-dash-cashflow__item--in strong { color: var(--color-success); }
.book-dash-cashflow__item--out strong { color: var(--color-danger); }
.book-dash-cashflow__item--net strong { color: var(--color-primary); }

.book-dash-bank__name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.book-dash-bank__balance,
.book-dash-bank__recon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.book-dash-bank__label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.book-dash-actions__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-dash-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
  font-family: inherit;
  text-align: left;
}

.book-dash-action-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.book-dash-action-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
}

.book-dash-scope {
  padding: var(--space-4) var(--space-5);
  border: 1px dashed var(--border-color);
  background: var(--page-bg-subtle);
}

.book-dash-scope__title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.book-dash-scope__book {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin: var(--space-1) 0;
}

.book-dash-scope__detail {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.book-dash-scope__warn {
  margin-top: var(--space-2);
  color: var(--color-warning);
}

.book-dash-chart-card {
  height: 100%;
}

@media (max-width: 1100px) {
  .book-dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-dash-health__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-dash-kpi-grid,
  .book-dash-row--2,
  .book-dash-cashflow__grid,
  .book-dash-actions__grid,
  .book-dash-header__meta {
    grid-template-columns: 1fr;
  }
}

/* ---- Book customers module ---- */
.book-cust-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-cust-header__desc {
  margin: var(--space-2) 0 0;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.book-cust-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-cust-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
}

.book-cust-toolbar__right {
  flex: 1;
  min-width: 280px;
}

.book-cust-toolbar__right .filter-bar {
  margin: 0;
}

.book-row-action--open {
  z-index: 40;
}

.book-export-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.book-export-dropdown {
  display: inline-block;
  flex-shrink: 0;
}

.book-export-dropdown__toggle {
  white-space: nowrap;
}

.book-export-dropdown__panel {
  min-width: 140px;
}

.book-export-dropdown__item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  color: var(--text-primary);
}

.book-export-dropdown__item:hover {
  background: var(--surface-2, #f8fafc);
}

.book-cust-export {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.book-cust-table-card .book-cust-cards {
  display: none;
}

.book-cust-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
}

.book-cust-card__name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.book-cust-card__line {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.book-cust-card__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-3) 0;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.book-cust-card__label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.book-cust-type-row {
  display: flex;
  gap: var(--space-4);
}

.book-cust-type-opt {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
}

.book-cust-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.book-cust-detail-field {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-cust-detail-field span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.book-cust-stmt-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-color);
}

.book-cust-stmt-grid {
  display: grid;
  gap: var(--space-2);
}

.book-cust-stmt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-cust-stmt-row--total {
  background: color-mix(in srgb, var(--color-primary) 8%, var(--page-bg-subtle));
  border-color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

@media (max-width: 1200px) {
  .book-cust-kpi { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .book-cust-kpi { grid-template-columns: repeat(2, 1fr); }
  .book-cust-table-wrap { display: none; }
  .book-cust-table-card .book-cust-cards { display: block; padding: var(--space-3); }
  .book-cust-contact-grid { grid-template-columns: 1fr; }
  .book-cust-toolbar { flex-direction: column; align-items: stretch; }
}

/* ---- Asset register (LKR) ---- */
.book-ast-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-ast-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.book-ast-status-kpi .book-ast-kpi-filter {
  cursor: pointer;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.book-ast-status-kpi .book-ast-kpi-filter:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.book-ast-toolbar {
  flex-wrap: wrap;
  gap: var(--space-3);
}

.book-ast-toolbar__filters .filter-bar {
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-ast-density {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.book-ast-density .btn {
  border-radius: 0;
  border: none;
}

.book-ast-density .btn.active {
  background: color-mix(in srgb, var(--color-primary) 12%, var(--card-bg));
  color: var(--color-primary);
}

.book-ast-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-ast-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 10%, var(--page-bg-subtle));
  border: 1px solid color-mix(in srgb, var(--color-primary) 25%, var(--border-color));
  font-size: 12px;
}

.book-ast-chip__clear {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  color: var(--text-muted);
}

.book-ast-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.book-ast-badge__dot {
  font-size: 10px;
  line-height: 1;
}

.book-ast-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.book-ast-icon-cell {
  width: 48px;
}

.book-ast-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-cust-table--compact td,
.book-cust-table--compact th {
  padding: 6px 10px;
  font-size: 12px;
}

.book-ast-menu {
  position: relative;
  display: inline-block;
}

.book-ast-menu summary {
  list-style: none;
  cursor: pointer;
}

.book-ast-menu summary::-webkit-details-marker {
  display: none;
}

.book-ast-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 120;
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
}

.book-ast-menu__panel button,
.book-ast-menu__item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  width: 100%;
}

.book-ast-menu__panel button:hover,
.book-ast-menu__item:hover {
  background: var(--page-bg-subtle);
}

.book-ast-row-menu .book-ast-menu__panel {
  right: 0;
}

.book-ast-row-menu .book-ast-menu__panel--fixed {
  position: fixed;
  right: auto;
}

.book-ast-table-card,
.book-cust-table-card.book-ast-table-card {
  overflow: visible;
}

.book-ast-table-wrap,
.book-hr-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.book-ast-actions-col,
.book-ast-actions-col .cell-actions {
  overflow: visible;
  position: relative;
}

.book-ast-row-menu[open] {
  z-index: 130;
}

/* SPA-safe row action dropdown */
.book-row-action {
  position: relative;
  display: inline-block;
}

.book-row-action__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: var(--space-1);
  flex-direction: column;
}

.book-row-action__panel[hidden] {
  display: none !important;
}

.book-row-action__panel:not([hidden]) {
  display: flex;
}

.book-row-action__panel--fixed {
  position: fixed;
  right: auto;
}

.book-row-action__item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  color: var(--text-primary);
}

.book-row-action__item:hover {
  background: var(--page-bg-subtle);
}

.book-row-action__item--danger {
  color: var(--color-danger, #dc2626);
}

.book-row-action__item--danger:hover {
  background: #fef2f2;
}

.book-row-action__hint {
  display: block;
  padding: 6px 12px;
}

.book-row-action__toggle--dots {
  min-width: 32px;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 8px;
}

.book-row-action--open {
  z-index: 210;
}

.book-ast-code-link {
  padding: 0;
  font-weight: 600;
}

.book-ast-mobile-card__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.book-ast-mobile-card__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.book-ast-table-card .book-ast-mobile-cards {
  display: none;
}

.book-ast-detail__hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
}

.book-ast-detail__identity {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  margin-top: var(--space-3);
}

.book-ast-detail__code {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.book-ast-detail__title {
  margin: 0 0 var(--space-2);
  font-size: 1.5rem;
}

.book-ast-detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-size: 13px;
  color: var(--text-secondary);
}

.book-ast-detail__hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-ast-info-card {
  padding: var(--space-4);
}

.book-ast-skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--page-bg-subtle) 25%, color-mix(in srgb, var(--border-color) 40%, var(--page-bg-subtle)) 50%, var(--page-bg-subtle) 75%);
  background-size: 200% 100%;
  animation: book-ast-shimmer 1.2s ease-in-out infinite;
}

.book-ast-skeleton--header { height: 120px; }
.book-ast-skeleton--kpi { height: 88px; }
.book-ast-skeleton--toolbar { height: 56px; }
.book-ast-skeleton--table { height: 320px; }
.book-ast-skeleton--card { height: 200px; }

@keyframes book-ast-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.book-ast-form-page .book-qt-form-layout {
  align-items: start;
}

.book-ast-assign-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.book-ast-assign-toggle .form-check {
  margin: 0;
}

.book-ast-filters {
  padding-bottom: var(--space-3);
}

.book-ast-filters .book-qt-section__title {
  padding: var(--space-3) var(--space-4) 0;
}

.book-ast-filters .book-cust-toolbar {
  border: none;
  box-shadow: none;
  background: transparent;
}

.book-ast-rpt-filters .book-qt-section__title {
  padding: var(--space-3) var(--space-4) 0;
}

@media (max-width: 768px) {
  .book-ast-table tbody tr {
    display: block;
    padding: var(--space-3);
    border-bottom: 1px solid var(--border-color);
  }

  .book-ast-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-1) 0;
    border: none;
    text-align: right !important;
  }

  .book-ast-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-align: left;
    flex: 1;
  }

  .book-ast-table thead { display: none; }
  .book-qt-form-layout { grid-template-columns: 1fr; }
}

@media (max-width: 1200px) {
  .book-ast-detail .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .book-ast-table-wrap { display: none; }
  .book-ast-table-card .book-ast-mobile-cards { display: block; }
  .book-ast-action-bar { flex-direction: column; align-items: stretch; }
  .book-ast-detail__hero { flex-direction: column; }
  .book-ast-detail__hero-actions { width: 100%; }
  .book-ast-detail__hero-actions .btn { flex: 1; }
  .book-ast-cat-table-card:not(.book-ast-cat-table-card--cards) .book-ast-table-wrap { display: none; }
  .book-ast-cat-grid--visible,
  .book-ast-cat-table-card:not(.book-ast-cat-table-card--cards) .book-ast-cat-grid {
    display: grid;
    padding: var(--space-3);
  }
}

/* ---- Asset categories (LKR) ---- */
.book-ast-cat-page .book-ast-desc-cell {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-ast-view-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2px;
}

.book-ast-view-switch__sep {
  color: var(--text-muted);
  font-size: 12px;
  user-select: none;
}

.book-ast-view-switch .btn.active {
  background: color-mix(in srgb, var(--color-primary) 12%, var(--card-bg));
  color: var(--color-primary);
}

.book-ast-cat-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

.book-ast-cat-grid--visible {
  display: grid;
  padding: var(--space-4);
}

.book-ast-cat-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.book-ast-cat-card__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.book-ast-cat-card__body {
  flex: 1;
  min-width: 0;
}

.book-ast-cat-card__desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-ast-cat-card__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
}

.book-ast-menu__hint {
  display: block;
  padding: 8px 12px;
  line-height: 1.35;
}

.book-ast-cat-detail .book-ast-detail__title {
  font-size: 1.35rem;
}

@media (max-width: 992px) {
  .book-ast-cat-page .book-ast-desc-cell,
  .book-ast-loc-page .book-ast-desc-cell {
    max-width: 160px;
  }
}

/* ---- Asset locations (LKR) ---- */
.book-ast-loc-dist {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.book-ast-loc-dist__row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 1fr auto;
  align-items: center;
  gap: var(--space-3);
}

.book-ast-loc-dist__label {
  font-size: 13px;
  font-weight: 500;
}

.book-ast-loc-dist__bar-wrap {
  height: 8px;
  background: var(--page-bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.book-ast-loc-dist__bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 999px;
  min-width: 4px;
  transition: width 0.3s ease;
}

.book-ast-loc-dist__count {
  font-weight: 600;
  font-size: 13px;
  min-width: 24px;
  text-align: right;
}

.book-ast-loc-detail .book-ast-detail__title {
  font-size: 1.35rem;
}

@media (max-width: 768px) {
  .book-ast-loc-page .book-ast-cat-table-card:not(.book-ast-cat-table-card--cards) .book-ast-table-wrap { display: none; }
  .book-ast-loc-page .book-ast-cat-grid--visible,
  .book-ast-loc-page .book-ast-cat-table-card:not(.book-ast-cat-table-card--cards) .book-ast-cat-grid {
    display: grid;
    padding: var(--space-3);
  }
  .book-ast-loc-dist__row {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
  .book-ast-asn-table-wrap { display: none; }
  .book-ast-asn-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
  }
  .book-ast-asn-filters .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .book-ast-asn-detail .grid-3 { grid-template-columns: 1fr; }
}

/* ---- Asset assignments (LKR) ---- */
.book-ast-asn-cards {
  display: none;
}

.book-ast-asn-toolbar .book-cust-toolbar__left {
  flex: 1;
  min-width: 0;
}

.book-ast-asn-filters .filter-select {
  min-width: 120px;
}

.book-ast-asn-employee-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: var(--space-2);
}

.book-ast-asn-asset-list {
  margin: 0;
  padding-left: var(--space-4);
  font-size: 13px;
}

.book-ast-asn-asset-list li {
  margin-bottom: var(--space-2);
}

.book-ast-asn-page .book-dash-kpi-grid {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1200px) {
  .book-ast-asn-page .book-dash-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .book-ast-asn-page .book-dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Asset transactions (LKR) ---- */
.book-ast-trx-page .book-dash-kpi-grid {
  grid-template-columns: repeat(5, 1fr);
}

.book-ast-trx-filters {
  padding: var(--space-4);
}

.book-ast-trx-filters__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.book-ast-trx-filters__actions {
  display: flex;
  gap: var(--space-2);
}

.book-ast-trx-cards {
  display: none;
}

.book-ast-trx-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.book-ast-trx-card__amount {
  font-weight: 600;
  font-size: 15px;
  margin: var(--space-2) 0 var(--space-3);
}

.book-ast-trx-modal__hero {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.book-ast-trx-journal {
  margin-top: var(--space-2);
}

@media (max-width: 1200px) {
  .book-ast-trx-page .book-dash-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .book-ast-trx-filters__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-ast-trx-page .book-dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .book-ast-trx-table-wrap { display: none; }
  .book-ast-trx-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
  }
  .book-ast-trx-filters__grid { grid-template-columns: 1fr; }
  .book-ast-trx-modal .grid-3,
  .book-ast-trx-modal .grid-2 { grid-template-columns: 1fr; }
}

/* ---- Asset depreciation (LKR) ---- */
.book-ast-dep-page .book-dash-kpi-grid {
  grid-template-columns: repeat(5, 1fr);
}

.book-ast-dep-workflow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.book-ast-dep-workflow__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 100px;
  opacity: 0.45;
}

.book-ast-dep-workflow__step--active,
.book-ast-dep-workflow__step--done { opacity: 1; }

.book-ast-dep-workflow__step--done .book-ast-dep-workflow__num {
  background: var(--color-success);
  color: #fff;
}

.book-ast-dep-workflow__step--active .book-ast-dep-workflow__num {
  background: var(--color-primary);
  color: #fff;
}

.book-ast-dep-workflow__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--page-bg-subtle);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.book-ast-dep-workflow__label {
  font-size: 12px;
  text-align: center;
  font-weight: 500;
}

.book-ast-dep-workflow__arrow {
  color: var(--text-muted);
  font-size: 14px;
}

.book-ast-dep-cards { display: none; }

.book-ast-dep-audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
  font-size: 13px;
}

.book-ast-dep-audit-empty { padding: var(--space-2) 0; }

@media (max-width: 1200px) {
  .book-ast-dep-page .book-dash-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .book-ast-dep-page .book-dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .book-ast-dep-table-wrap { display: none; }
  .book-ast-dep-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
  }
  .book-ast-dep-workflow { flex-direction: column; }
  .book-ast-dep-workflow__arrow { transform: rotate(90deg); }
}

/* ---- Asset maintenance (LKR) ---- */
.book-ast-maint-page .book-dash-kpi-grid,
.book-ast-maint-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-ast-maint-filters {
  padding: var(--space-4);
}

.book-ast-maint-filters__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.book-ast-maint-filters__actions {
  display: flex;
  gap: var(--space-2);
}

.book-ast-maint-cards {
  display: none;
}

.book-ast-maint-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.book-ast-maint-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.book-ast-maint-card__identity {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.book-ast-maint-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--space-2) 0;
  font-size: var(--font-size-sm);
}

@media (max-width: 1200px) {
  .book-ast-maint-page .book-dash-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .book-ast-maint-filters__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-ast-maint-page .book-dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .book-ast-maint-table-wrap { display: none; }
  .book-ast-maint-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
  }
  .book-ast-maint-filters__grid { grid-template-columns: 1fr; }
  .book-ast-maint-modal .form-row-2 { grid-template-columns: 1fr; }
}

/* ---- Asset reports (LKR) ---- */
.book-ast-rpt-page .book-dash-kpi-grid,
.book-ast-rpt-kpi {
  grid-template-columns: repeat(7, 1fr);
}

.book-ast-rpt-tabs {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.book-ast-rpt-filters {
  padding: var(--space-4);
}

.book-ast-rpt-filters__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.book-ast-rpt-filters__actions {
  display: flex;
  gap: var(--space-2);
}

.book-ast-rpt-cards {
  display: none;
}

.book-ast-rpt-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.book-ast-rpt-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.book-ast-rpt-card__amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin: var(--space-2) 0;
}

.book-ast-rpt-chart__row {
  display: grid;
  grid-template-columns: minmax(100px, 140px) 1fr minmax(90px, auto);
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}

.book-ast-rpt-chart__bar-wrap {
  height: 8px;
  background: var(--page-bg-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.book-ast-rpt-chart__bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  min-width: 2px;
}

.book-ast-rpt-chart__value {
  text-align: right;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .book-ast-rpt-page .book-dash-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .book-ast-rpt-filters__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-ast-rpt-page .book-dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .book-ast-rpt-table-wrap { display: none; }
  .book-ast-rpt-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
  }
  .book-ast-rpt-filters__grid { grid-template-columns: 1fr; }
  .book-ast-rpt-tabs { overflow-x: auto; flex-wrap: nowrap; }
}

@media print {
  .book-ast-rpt-page .book-ast-action-bar,
  .book-ast-rpt-tabs,
  .book-ast-rpt-filters,
  .book-cust-toolbar { display: none !important; }
}

/* ---- Human Resources — Employees ---- */
.book-hr-emp-page .book-dash-kpi-grid,
.book-hr-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-hr-filters {
  padding: var(--space-4);
}

.book-hr-filters__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.book-hr-filters__actions {
  display: flex;
  gap: var(--space-2);
}

.book-hr-emp-cards {
  display: none;
}

.book-hr-emp-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.book-hr-emp-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.book-hr-emp-tabs {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.book-hr-emp-detail .grid .stat-card {
  min-height: 108px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.book-hr-emp-detail .stat-card-header {
  align-items: flex-start;
  gap: var(--space-2);
}

.book-hr-emp-detail .stat-card-label {
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

.book-hr-emp-detail .stat-card-value {
  line-height: 1.25;
  word-break: break-word;
  margin-top: auto;
}

.book-hr-emp-detail .stat-card-value--sm {
  font-size: clamp(0.8125rem, 3.5cqi + 0.4rem, var(--font-size-md));
}

.book-hr-biometric-disabled {
  padding: var(--space-3);
  background: var(--page-bg-subtle);
  opacity: 0.85;
}

.book-hr-biometric-placeholder {
  border-style: dashed;
}

@media (max-width: 1200px) {
  .book-hr-emp-page .book-dash-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .book-hr-filters__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-hr-emp-page .book-dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .book-hr-table-wrap { display: none; }
  .book-hr-emp-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
  }
  .book-hr-filters__grid { grid-template-columns: 1fr; }
  .book-hr-emp-tabs { overflow-x: auto; flex-wrap: nowrap; }
}

/* ---- Book estimates module ---- */
.book-est-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-est-header__counts {
  grid-template-columns: repeat(4, minmax(100px, 1fr));
}

.book-est-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-est-table-card .book-est-cards {
  display: none;
}

.book-est-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
}

.book-est-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-est-card__name {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.book-est-card__meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-est-card__amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.book-est-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-est-report-item {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-est-report-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

@media (max-width: 1200px) {
  .book-est-kpi { grid-template-columns: repeat(2, 1fr); }
  .book-est-header__counts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-est-table-wrap { display: none; }
  .book-est-table-card .book-est-cards { display: block; padding: var(--space-3); }
  .book-est-reports-grid { grid-template-columns: 1fr; }
}

/* ---- Book invoices module ---- */
.book-inv-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-inv-table-card .book-inv-cards {
  display: none;
}

.book-inv-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
}

.book-inv-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-inv-card__name {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.book-inv-card__meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-inv-card__amounts {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.book-inv-card__amounts span:last-child {
  color: var(--text-muted);
}

.book-inv-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-inv-report-item {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-inv-report-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-inv-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-form .form-section-title {
  margin: var(--space-3) 0 var(--space-2);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-inv-form-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-form-page .book-inv-form-book {
  margin-top: var(--space-1);
}

.book-inv-form-summary .book-cust-detail-field strong {
  font-variant-numeric: tabular-nums;
}

.book-inv-dash-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-dash-header .book-cust-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-inv-dash-kpi {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1200px) {
  .book-inv-dash-kpi { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .book-inv-dash-kpi { grid-template-columns: repeat(2, 1fr); }
  .book-inv-items-header__actions,
  .book-inv-dash-header .book-cust-header__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 1200px) {
  .book-inv-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-inv-table-wrap { display: none; }
  .book-inv-table-card .book-inv-cards { display: block; padding: var(--space-3); }
  .book-inv-reports-grid { grid-template-columns: 1fr; }
}

/* ---- Book purchase orders module ---- */
.book-po-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-po-header__counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-po-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-po-table-card .book-po-cards {
  display: none;
}

.book-po-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  background: var(--surface-card);
}

.book-po-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-po-card__name {
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-1);
}

.book-po-card__meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-po-card__amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-3);
}

.book-po-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-po-report-item {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
}

.book-po-report-item span {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-po-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.book-po-timeline__item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.book-po-timeline__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  margin-top: 5px;
  flex-shrink: 0;
}

.book-po-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 1200px) {
  .book-po-kpi { grid-template-columns: repeat(2, 1fr); }
  .book-po-header__counts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-po-table-wrap { display: none; }
  .book-po-table-card .book-po-cards { display: block; padding: var(--space-3); }
  .book-po-reports-grid { grid-template-columns: 1fr; }
}

/* ---- Book bills module ---- */
.book-bill-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-bill-header__counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-bill-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-bill-table-card .book-bill-cards {
  display: none;
}

.book-bill-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  background: var(--surface-card);
}

.book-bill-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-bill-card__name {
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-1);
}

.book-bill-card__meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-bill-card__amounts {
  display: flex;
  justify-content: space-between;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-3);
}

.book-bill-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-bill-report-item {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
}

.book-bill-report-item span {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-bill-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 1200px) {
  .book-bill-kpi { grid-template-columns: repeat(2, 1fr); }
  .book-bill-header__counts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-bill-table-wrap { display: none; }
  .book-bill-table-card .book-bill-cards { display: block; padding: var(--space-3); }
  .book-bill-reports-grid { grid-template-columns: 1fr; }
}

/* ---- Book receipts module ---- */
.book-rcp-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-rcp-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-rcp-table-card .book-rcp-cards {
  display: none;
}

.book-rcp-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
}

.book-rcp-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-rcp-card__name {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.book-rcp-card__meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-rcp-card__amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.book-rcp-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-rcp-report-item {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-rcp-report-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-rcp-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-rcp-form .form-section-title {
  margin: var(--space-3) 0 var(--space-2);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

@media (max-width: 1200px) {
  .book-rcp-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-rcp-table-wrap { display: none; }
  .book-rcp-table-card .book-rcp-cards { display: block; padding: var(--space-3); }
  .book-rcp-reports-grid { grid-template-columns: 1fr; }
}

/* ---- Book bill payments module ---- */
.book-bpay-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-bpay-header__counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-bpay-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-bpay-table-card .book-bpay-cards {
  display: none;
}

.book-bpay-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
}

.book-bpay-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-bpay-card__name {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.book-bpay-card__meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-bpay-card__amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.book-bpay-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-bpay-report-item {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-bpay-report-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-bpay-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-bpay-form .form-section-title {
  margin: var(--space-3) 0 var(--space-2);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-bpay-form .bill-alloc-table {
  width: 100%;
  margin: var(--space-2) 0;
}

.book-bpay-form .bill-alloc-table th,
.book-bpay-form .bill-alloc-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-color);
}

@media (max-width: 1200px) {
  .book-bpay-kpi { grid-template-columns: repeat(2, 1fr); }
  .book-bpay-header__counts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-bpay-table-wrap { display: none; }
  .book-bpay-table-card .book-bpay-cards { display: block; padding: var(--space-3); }
  .book-bpay-reports-grid { grid-template-columns: 1fr; }
}

/* ---- Book expenses module ---- */
.book-exp-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-exp-header__counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-exp-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-exp-table-card .book-exp-cards {
  display: none;
}

.book-exp-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
}

.book-exp-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-exp-card__name {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.book-exp-card__meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-exp-card__amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.book-exp-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-exp-report-item {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-exp-report-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-exp-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-exp-form .form-section-title {
  margin: var(--space-3) 0 var(--space-2);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-exp-attachment {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
}

.book-exp-attachment__preview {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

@media (max-width: 1200px) {
  .book-exp-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-exp-table-wrap { display: none; }
  .book-exp-table-card .book-exp-cards { display: block; padding: var(--space-3); }
  .book-exp-reports-grid { grid-template-columns: 1fr; }
}

/* ---- Book bank accounts module ---- */
.book-bank-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-bank-header__counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-bank-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-bank-kpi__status {
  font-size: var(--font-size-lg);
}

.book-bank-table-card .book-bank-cards {
  display: none;
}

.book-bank-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
}

.book-bank-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-bank-card__type {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-bank-card__balance {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.book-bank-card__meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.book-bank-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-bank-report-item {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-bank-report-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-bank-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-bank-form .form-section-title {
  margin: var(--space-3) 0 var(--space-2);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

@media (max-width: 1200px) {
  .book-bank-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-bank-table-wrap { display: none; }
  .book-bank-table-card .book-bank-cards { display: block; padding: var(--space-3); }
  .book-bank-reports-grid { grid-template-columns: 1fr; }
}

/* ---- Book transactions module ---- */
.book-btx-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-btx-header__counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-btx-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-btx-kpi__status {
  font-size: var(--font-size-lg);
}

.book-btx-table-card .book-btx-cards {
  display: none;
}

.book-btx-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
}

.book-btx-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-btx-card__meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-btx-card__amount {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--space-1);
}

.book-btx-card__desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.book-btx-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-btx-report-item {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-btx-report-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-btx-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 1200px) {
  .book-btx-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-btx-table-wrap { display: none; }
  .book-btx-table-card .book-btx-cards { display: block; padding: var(--space-3); }
  .book-btx-reports-grid { grid-template-columns: 1fr; }
}

/* ── AUD Bank Transfers ── */
.book-trf-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-trf-header__counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-trf-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-trf-kpi__acct {
  font-size: var(--font-size-md);
}

.book-trf-table-card .book-trf-cards {
  display: none;
}

.book-trf-table .book-trf-arrow {
  width: 32px;
  text-align: center;
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

.book-trf-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
}

.book-trf-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-trf-card__flow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.book-trf-card__arrow {
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

.book-trf-card__amount {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--space-1);
}

.book-trf-card__meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.book-trf-detail-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--page-bg-subtle);
}

.book-trf-detail-flow__acct {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-align: center;
}

.book-trf-detail-flow__label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.book-trf-detail-flow__arrow {
  font-size: var(--font-size-2xl);
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

.book-trf-form__arrow {
  text-align: center;
  padding: var(--space-2) 0;
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.book-trf-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-trf-report-item {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-trf-report-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-trf-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 1200px) {
  .book-trf-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-trf-table-wrap { display: none; }
  .book-trf-table-card .book-trf-cards { display: block; padding: var(--space-3); }
  .book-trf-reports-grid { grid-template-columns: 1fr; }
  .book-trf-detail-flow { flex-direction: column; }
  .book-trf-detail-flow__arrow { transform: rotate(90deg); }
}

/* ── AUD Bank Reconciliation ── */
.book-brec-page,
.book-brec-work,
.book-brec-report {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-brec-header__counts {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.book-brec-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-brec-table-card .book-brec-cards {
  display: none;
}

.book-brec-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  margin-bottom: var(--space-3);
}

.book-brec-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-brec-card__meta,
.book-brec-card__period {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.book-brec-card__amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--space-3);
}

.book-brec-start-form {
  border: 1px solid var(--border-color);
}

.book-brec-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--page-bg-subtle);
}

.book-brec-preview__item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-brec-preview__diff--ok { color: var(--color-success); }
.book-brec-preview__diff--warn { color: var(--color-danger); }

.book-brec-form__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.book-brec-reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-brec-report-item {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-brec-report-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-brec-work-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.book-brec-work-stat {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.book-brec-work-stat span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.book-brec-diff--ok strong { color: var(--color-success); }
.book-brec-diff--warn strong { color: var(--color-danger); }

.book-brec-diff-banner {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.book-brec-diff-banner.book-brec-diff--ok {
  background: var(--color-success-light);
  color: var(--color-success-text);
  border: 1px solid var(--color-success);
}

.book-brec-diff-banner.book-brec-diff--warn {
  background: var(--color-warning-light);
  color: var(--color-warning-text);
  border: 1px solid var(--color-warning);
}

.book-brec-progress__header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-2);
}

.book-brec-progress__bar {
  height: 8px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.book-brec-progress__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.book-brec-work-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
}

.book-brec-work-toolbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.book-brec-dropzone {
  padding: var(--space-2) var(--space-4);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.book-brec-dropzone:hover,
.book-brec-dropzone--active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.book-brec-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.book-brec-split__scroll {
  max-height: 420px;
  overflow: auto;
}

.book-brec-row--selected {
  background: var(--color-primary-light) !important;
}

.book-brec-row--matched {
  opacity: 0.85;
}

.book-brec-matched-tag {
  color: var(--color-success);
  font-weight: var(--font-weight-bold);
}

.book-brec-match-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--page-bg-subtle);
  margin-bottom: var(--space-2);
}

.book-brec-match-pair__side {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
}

.book-brec-match-pair__date {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.book-brec-match-pair__badge {
  padding: var(--space-1) var(--space-2);
  background: var(--color-success-light);
  color: var(--color-success-text);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .book-brec-kpi,
  .book-brec-work-stats { grid-template-columns: repeat(2, 1fr); }
  .book-brec-split { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .book-brec-table-wrap { display: none; }
  .book-brec-table-card .book-brec-cards { display: block; padding: var(--space-3); }
  .book-brec-reports-grid { grid-template-columns: 1fr; }
  .book-brec-preview { grid-template-columns: 1fr; }
  .book-brec-match-pair { grid-template-columns: 1fr; text-align: center; }
}

/* ── Banking ERP drawer & enhanced cards ── */
.book-erp-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1200;
  display: flex;
  justify-content: flex-end;
}

.book-erp-drawer {
  width: min(420px, 100vw);
  height: 100%;
  background: var(--surface-card, #fff);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  animation: bookDrawerIn 0.22s ease;
}

@keyframes bookDrawerIn {
  from { transform: translateX(100%); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.book-erp-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.book-erp-drawer__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.book-erp-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

.book-erp-drawer__section {
  margin-bottom: var(--space-4);
}

.book-erp-drawer__section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-erp-drawer__grid {
  display: grid;
  gap: var(--space-3);
}

.book-erp-drawer__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.875rem;
}

.book-erp-drawer__row span { color: var(--text-muted); }

.book-bank-card-v2 {
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-4);
  background: var(--surface-card, #fff);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.book-bank-card-v2__name {
  font-size: 1.05rem;
  font-weight: 600;
}

.book-bank-card-v2__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-3);
  font-size: 0.8125rem;
}

.book-bank-card-v2__grid span { color: var(--text-muted); display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; }

.book-bank-card-v2__balance {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary, #2563eb);
}

.book-bank-card-v2__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.book-btx-badge--deposit { background: rgba(16, 185, 129, 0.12); color: #059669; }
.book-btx-badge--withdrawal { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.book-btx-badge--reconciled { background: rgba(16, 185, 129, 0.12); color: #059669; }
.book-btx-badge--unreconciled { background: rgba(245, 158, 11, 0.12); color: #d97706; }

.book-btx-journal-preview {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-color);
}

.book-btx-journal-preview__title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-btx-form .book-qt-summary .book-tax-journal-block {
  margin-top: 0;
}

/* ── Accounting ERP: unified detail views ── */
[class*="book-"][class*="-detail"] > .page-header,
.book-coa-detail > .page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.04));
}

[class*="book-"][class*="-detail"] > .page-header .page-title-group,
.book-coa-detail > .page-header .page-title-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

[class*="book-"][class*="-detail"] > .page-header .page-title,
.book-coa-detail > .page-header .page-title {
  margin: 0;
  font-size: 1.35rem;
}

[class*="book-"][class*="-detail"] > .page-header .page-subtitle,
.book-coa-detail > .page-header .page-subtitle {
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

[class*="book-"][class*="-detail"] > .page-header .page-actions,
.book-coa-detail > .page-header .page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  flex-shrink: 0;
}

[class*="book-"][class*="-detail"] > .card,
.book-coa-detail > .card {
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-subtle, #e5e7eb);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.04));
}

/* ── Accounting ERP: unified report toolbars ── */
.book-tb-export-bar,
.book-gl-export-bar,
.book-bs-export-bar,
.book-pl-export-bar,
.book-cf-export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-subtle, #e5e7eb);
  background: var(--surface-card, #fff);
}

.book-tb-export-bar__actions,
.book-gl-export-bar__actions,
.book-bs-export-bar__actions,
.book-pl-export-bar__actions,
.book-cf-export-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.book-tb-filters,
.book-gl-filters,
.book-bs-filters,
.book-pl-filters,
.book-cf-filters {
  border-radius: var(--radius-lg, 12px);
  margin-bottom: var(--space-4);
}

.book-cf-filters {
  border-radius: var(--radius-lg, 12px);
  margin-bottom: var(--space-4);
}

/* ── Accounting ERP: unified report filters & headers ── */
.book-rpt-filters {
  margin-bottom: var(--space-4);
}

.book-rpt-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) 0;
}

.book-rpt-filters__body {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.book-rpt-filters--collapsed .book-rpt-filters__body {
  display: none;
}

.book-rpt-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.book-rpt-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  flex-shrink: 0;
}

.book-rpt-scope {
  margin-bottom: var(--space-4);
}

.book-tb-report__sticky,
.book-bs-report__sticky,
.book-pl-report__sticky,
.book-cf-report__sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-card, #fff);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.book-tb-table thead th,
.book-bs-table thead th,
.book-pl-table thead th,
.book-cf-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-muted, #f9fafb);
}

@media (max-width: 768px) {
  .book-dash-header__actions.book-rpt-header__actions {
    width: 100%;
    justify-content: flex-start;
  }
  .book-rpt-filters__head { flex-direction: column; align-items: flex-start; }
}

.book-trf-form-warning {
  padding: var(--space-3);
  border-radius: var(--radius-md, 8px);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #92400e;
  font-size: 0.875rem;
  margin-bottom: var(--space-3);
}

.book-trf-summary-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.book-trf-summary-row:last-child { border-bottom: none; }

.book-brec-kpi--matched .book-dash-kpi__value { color: var(--color-success, #059669); }

@media (max-width: 768px) {
  .book-erp-drawer { width: 100vw; }
}

/* ── Chart of Accounts ── */
.book-coa-page,
.book-coa-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-coa-table-card {
  padding: var(--space-4);
}

.book-coa-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.book-coa-empty {
  padding: var(--space-2) 0;
}

.book-coa-table-wrap {
  overflow-x: auto;
}

.book-coa-header__counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-coa-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-coa-group__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: none;
  background: var(--page-bg-subtle);
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.book-coa-group__chevron {
  color: var(--text-muted);
  width: 16px;
}

.book-coa-group__count {
  margin-left: auto;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.book-coa-group__body {
  border-top: 1px solid var(--border-color);
}

.book-coa-row--child td:nth-child(2) {
  padding-left: var(--space-6);
}

.book-coa-lock {
  opacity: 0.85;
}

.book-coa-type-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.book-coa-type--asset { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.book-coa-type--liability { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.book-coa-type--equity { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.book-coa-type--revenue { background: rgba(16, 185, 129, 0.12); color: #059669; }
.book-coa-type--expense { background: rgba(249, 115, 22, 0.12); color: #ea580c; }

.book-coa-group__head.book-coa-type--asset { border-left: 4px solid #2563eb; }
.book-coa-group__head.book-coa-type--liability { border-left: 4px solid #dc2626; }
.book-coa-group__head.book-coa-type--equity { border-left: 4px solid #7c3aed; }
.book-coa-group__head.book-coa-type--revenue { border-left: 4px solid #059669; }
.book-coa-group__head.book-coa-type--expense { border-left: 4px solid #ea580c; }

.book-coa-system-banner {
  padding: var(--space-3) var(--space-4);
  background: var(--color-warning-light);
  color: var(--color-warning-text);
  border: 1px solid var(--color-warning);
  font-size: var(--font-size-sm);
}

.book-coa-mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-coa-mapping-item {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-coa-mapping-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

@media (max-width: 1200px) {
  .book-coa-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-coa-mapping-grid { grid-template-columns: 1fr; }
  .book-coa-table-wrap { overflow-x: auto; }
}

/* ── Opening Balance ── */
.book-ob-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
}

.book-ob-header-sticky {
  position: sticky;
  top: 0;
  z-index: 30;
}

.book-ob-header {
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.book-ob-header__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.book-ob-header__locked-icon {
  font-size: var(--font-size-lg);
  opacity: 0.85;
}

.book-ob-status-badge {
  font-size: var(--font-size-sm);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.book-ob-badge--draft {
  background: var(--color-info-light);
  color: var(--color-info-text);
}

.book-ob-badge--locked {
  background: #f1f5f9;
  color: var(--text-secondary);
}

.book-ob-summary {
  grid-template-columns: repeat(4, 1fr);
}

.book-ob-summary-card {
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.book-ob-summary-card__value {
  font-size: var(--font-size-xl);
}

.book-ob-fy-select {
  max-width: 100px;
  min-height: 32px;
  font-size: var(--font-size-sm);
  margin-top: var(--space-1);
}

.book-ob-diff-strip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: 12px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.book-ob-diff-strip--neutral {
  background: var(--page-bg-subtle);
  color: var(--text-muted);
}

.book-ob-diff-strip--ok {
  background: var(--color-success-light);
  color: var(--color-success-text);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.book-ob-diff-strip--warn {
  background: var(--color-danger-light);
  color: var(--color-danger-text);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.book-ob-diff-strip__icon {
  font-size: var(--font-size-md);
}

.book-ob-diff-strip__label {
  font-weight: var(--font-weight-bold);
}

.book-ob-diff-strip__value {
  margin-left: auto;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
}

.book-ob-toolbar {
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}

.book-ob-toolbar__filters {
  flex: 1;
  min-width: 280px;
}

.book-ob-toolbar__toggles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.book-ob-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  user-select: none;
}

.book-ob-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.book-ob-toggle__track {
  width: 36px;
  height: 20px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.book-ob-toggle__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: var(--shadow-xs);
}

.book-ob-toggle input:checked + .book-ob-toggle__track {
  background: var(--color-primary);
}

.book-ob-toggle input:checked + .book-ob-toggle__track .book-ob-toggle__knob {
  transform: translateX(16px);
}

.book-ob-validation-panel {
  border-radius: 12px;
  border: 1px solid var(--color-warning);
  background: var(--color-warning-light);
  padding: var(--space-4);
}

.book-ob-validation-panel__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  color: var(--color-warning-text);
}

.book-ob-validation-panel__icon {
  font-size: var(--font-size-lg);
}

.book-ob-validation-panel__summary {
  margin: var(--space-3) 0 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.book-ob-validation-panel__summary--ok {
  color: var(--color-success-text);
}

.book-ob-validation-panel__summary--fail {
  color: var(--color-danger-text);
}

.book-ob-table-card {
  padding: 0;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.book-ob-table-wrap {
  overflow-x: auto;
}

.book-ob-groups {
  display: flex;
  flex-direction: column;
}

.book-ob-groups--large {
  max-height: 65vh;
  overflow-y: auto;
}

.book-ob-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 44px;
}

.book-ob-empty {
  padding: var(--space-6);
}

.book-ob-group__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: none;
  background: var(--page-bg-subtle);
  cursor: pointer;
  text-align: left;
}

.book-ob-group__head.book-coa-type--asset { border-left: 4px solid #2563eb; }
.book-ob-group__head.book-coa-type--liability { border-left: 4px solid #dc2626; }
.book-ob-group__head.book-coa-type--equity { border-left: 4px solid #7c3aed; }
.book-ob-group__head.book-coa-type--revenue { border-left: 4px solid #059669; }
.book-ob-group__head.book-coa-type--expense { border-left: 4px solid #ea580c; }

.book-ob-group__chevron {
  color: var(--text-muted);
  width: 16px;
  flex-shrink: 0;
}

.book-ob-group__count {
  margin-left: auto;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.book-ob-group__body {
  border-top: 1px solid var(--border-color-subtle);
}

.book-ob-table {
  font-size: var(--font-size-sm);
}

.book-ob-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-color-subtle);
}

.book-ob-table tbody td {
  padding: var(--space-2) var(--space-3);
  vertical-align: middle;
}

.book-ob-col-account { width: 38%; min-width: 200px; }
.book-ob-col-type { width: 12%; }
.book-ob-col-normal { width: 14%; }
.book-ob-col-amount { width: 22%; }
.book-ob-col-status { width: 14%; }

.book-ob-row--child .book-ob-account-code,
.book-ob-row--child .book-ob-account-name {
  padding-left: var(--space-4);
}

.book-ob-row--parent {
  background: var(--page-bg-subtle);
}

.book-ob-account-code {
  font-family: var(--font-mono);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
}

.book-ob-account-name {
  color: var(--text-primary);
}

.book-ob-lock {
  opacity: 0.85;
  margin-right: var(--space-1);
}

.book-ob-normal-bal {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.book-ob-normal-bal--debit { color: #2563eb; }
.book-ob-normal-bal--credit { color: #7c3aed; }

.book-ob-table .ob-amount {
  max-width: 160px;
  margin-left: auto;
  min-height: 36px;
  font-variant-numeric: tabular-nums;
  border-radius: 8px;
}

.book-ob-amount-display {
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-medium);
}

.book-ob-amount-display--muted {
  color: var(--text-muted);
}

.book-ob-amount-empty {
  color: var(--text-muted);
}

.book-ob-status {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.book-ob-status--editable { color: var(--color-info-text); }
.book-ob-status--entered { color: var(--color-success-text); }
.book-ob-status--readonly { color: var(--text-muted); }
.book-ob-status--locked { color: var(--text-secondary); }
.book-ob-status--empty { color: var(--text-muted); }

.book-ob-totals-bar {
  position: sticky;
  bottom: 64px;
  z-index: 25;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  padding: var(--space-3) var(--space-5);
  background: #fff;
  border: 1px solid var(--border-color-subtle);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.book-ob-totals-bar__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-ob-totals-bar__label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.book-ob-totals-bar__value {
  font-size: var(--font-size-md);
  font-variant-numeric: tabular-nums;
}

.book-ob-totals-bar__item--ok .book-ob-totals-bar__value {
  color: var(--color-success);
}

.book-ob-totals-bar__item--warn .book-ob-totals-bar__value {
  color: var(--color-danger);
}

.book-ob-totals-bar__validation {
  margin-left: auto;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
}

.book-ob-totals-bar__validation--ok {
  background: var(--color-success-light);
  color: var(--color-success-text);
}

.book-ob-totals-bar__validation--warn {
  background: var(--color-warning-light);
  color: var(--color-warning-text);
}

.book-ob-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  border-radius: 12px 12px 0 0;
  justify-content: flex-end;
  margin: 0 calc(-1 * var(--space-2));
  padding: var(--space-3) var(--space-5);
}

.book-ob-action-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-left: auto;
}

.book-ob-page:not(:has(.book-ob-action-bar)) .book-ob-totals-bar {
  bottom: 0;
}

.book-ob-history-card {
  padding: 0;
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.book-ob-history-card__head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-color-subtle);
}

.book-ob-history-card__title {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
}

.book-ob-history-card .book-ob-table-wrap {
  padding: var(--space-3) var(--space-5) var(--space-4);
}

.book-ob-history-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  padding: var(--space-4) !important;
}

.book-ob-locked-note {
  text-align: center;
  padding: var(--space-2);
}

.book-ob-validation {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.book-ob-check {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: 8px;
  border: 1px solid var(--border-color-subtle);
  background: #fff;
}

.book-ob-check__icon {
  flex-shrink: 0;
  font-size: var(--font-size-md);
}

.book-ob-check--ok { border-color: var(--color-success); }
.book-ob-check--warn { border-color: var(--color-warning); }
.book-ob-check--fail { border-color: var(--color-danger); }

@media (max-width: 1200px) {
  .book-ob-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-ob-summary { grid-template-columns: 1fr; }
  .book-ob-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .book-ob-toolbar__toggles {
    flex-direction: column;
    align-items: flex-start;
  }
  .book-ob-totals-bar {
    bottom: 72px;
    flex-direction: column;
    align-items: stretch;
  }
  .book-ob-totals-bar__validation {
    margin-left: 0;
  }
  .book-ob-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .book-ob-action-bar__actions {
    justify-content: flex-end;
  }
  .book-ob-col-type,
  .book-ob-col-normal {
    display: none;
  }
}

/* ── Journal Entries ── */
.book-je-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-je-header__counts {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.book-je-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-je-period-kpi .book-je-period-bal {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 600;
}

.book-je-period-debit { color: var(--color-info, #3b82f6); }
.book-je-period-credit { color: var(--color-success); }

.book-je-table-card .book-je-cards { display: none; }

.book-je-source {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-je-th-debit,
.book-je-debit { color: var(--color-info, #3b82f6); }

.book-je-th-credit,
.book-je-credit { color: var(--color-success); }

.book-je-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.book-je-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.book-je-card__amount {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: var(--space-2) 0;
}

.book-je-card__source {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.book-je-card__meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-je-locked-banner {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-warning-light);
  border: 1px solid var(--color-warning);
  font-size: var(--text-sm);
}

.book-je-detail-field {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

.book-je-detail-field span {
  color: var(--text-muted);
  min-width: 100px;
}

.book-je-lines-title {
  margin: var(--space-4) 0 var(--space-3);
  font-size: var(--text-base);
}

.book-je-totals-row td {
  border-top: 2px solid var(--border-color);
  padding-top: var(--space-3);
}

.book-je-balance {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
}

.book-je-balance--ok {
  background: var(--color-success-light);
  color: var(--color-success);
}

.book-je-balance--bad {
  background: var(--color-danger-light, #fef2f2);
  color: var(--color-danger);
}

.book-je-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-color);
}

.book-je-reversal-info {
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
  color: var(--text-muted);
}

.book-je-form-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-subtle, var(--surface-2));
  border-radius: var(--radius-md);
}

.book-je-form-diff--ok { color: var(--color-success); }
.book-je-form-diff--bad { color: var(--color-danger); }

.book-je-form-source {
  margin-bottom: var(--space-3);
}

.book-je-back-inline {
  margin-bottom: var(--space-2);
}

@media (max-width: 1200px) {
  .book-je-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-je-kpi { grid-template-columns: 1fr; }
  .book-je-table-wrap { display: none; }
  .book-je-table-card .book-je-cards { display: block; padding: var(--space-3); }
  .book-je-form-totals { grid-template-columns: 1fr; }
}

/* ── General Ledger ── */
.book-gl-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-gl-filters__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.book-gl-filters__head .card-title {
  margin: 0;
  font-size: var(--text-base);
}

.book-gl-filters--collapsed .book-gl-filters__body {
  display: none;
}

.book-gl-filters__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.book-gl-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 38px;
  font-size: var(--text-sm);
}

.book-gl-export-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.book-gl-export-bar__actions {
  display: flex;
  gap: var(--space-2);
}

.book-gl-report__sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-1, var(--card-bg));
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-4);
}

.book-gl-report__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.book-gl-report__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.book-gl-report__account {
  font-size: var(--text-lg);
  font-weight: 700;
}

.book-gl-report__opening strong {
  display: block;
  font-size: var(--text-lg);
}

.book-gl-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.book-gl-summary__item {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle, var(--surface-2));
  font-size: var(--text-sm);
}

.book-gl-summary__item span {
  display: block;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.book-gl-th-debit,
.book-gl-debit { color: var(--color-info, #3b82f6); }

.book-gl-th-credit,
.book-gl-credit { color: var(--color-success); }

.book-gl-desc {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-gl-source {
  max-width: 160px;
}

.book-gl-closing-row td {
  border-top: 2px solid var(--border-color);
  background: var(--bg-subtle, var(--surface-2));
}

.book-gl-je-link,
.book-gl-source-link {
  padding: 0;
  font-size: inherit;
}

.book-gl-type-group {
  margin-bottom: var(--space-4);
}

.book-gl-type-group__head {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-weight: 700;
  font-size: var(--text-sm);
}

.book-gl-type-group__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-gl-all-acct__head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-1, var(--card-bg));
  cursor: pointer;
  text-align: left;
}

.book-gl-all-acct__head:hover {
  border-color: var(--color-primary);
}

.book-gl-all-acct__meta {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  font-size: var(--text-sm);
}

@media (max-width: 1200px) {
  .book-gl-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-gl-summary { grid-template-columns: 1fr; }
  .book-gl-export-bar { flex-direction: column; align-items: stretch; }
}

/* ── Trial Balance ── */
.book-tb-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-tb-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-tb-filters__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.book-tb-filters__head .card-title { margin: 0; }

.book-tb-filters--collapsed .book-tb-filters__body { display: none; }

.book-tb-filters__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.book-tb-radio-group {
  display: flex;
  gap: var(--space-4);
  min-height: 38px;
  align-items: center;
  font-size: var(--text-sm);
}

.book-tb-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.book-tb-export-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.book-tb-export-bar__actions { display: flex; gap: var(--space-2); }

.book-tb-report__sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-1, var(--card-bg));
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
}

.book-tb-asat__label {
  color: var(--text-muted);
  margin-right: var(--space-2);
  font-size: var(--text-sm);
}

.book-tb-group { margin-bottom: var(--space-3); }

.book-tb-group__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-subtle, var(--surface-2));
  cursor: pointer;
  text-align: left;
}

.book-tb-group__count,
.book-tb-group__sub {
  margin-left: auto;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.book-tb-group__body {
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-tb-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-1, var(--card-bg));
}

.book-tb-sort { cursor: pointer; user-select: none; }
.book-tb-sort:hover { color: var(--color-primary); }

.book-tb-th-debit, .book-tb-debit { color: var(--color-info, #3b82f6); }
.book-tb-th-credit, .book-tb-credit { color: var(--color-success); }

.book-tb-subtotal td {
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle, var(--surface-2));
}

.book-tb-grand-total {
  padding: var(--space-4);
  border-top: 2px solid var(--border-color);
}

.book-tb-grand-row td {
  font-size: var(--text-base);
  padding-top: var(--space-3);
}

.book-tb-status {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  text-align: center;
}

.book-tb-status--ok {
  background: var(--color-success-light);
  border: 1px solid var(--color-success);
  color: var(--color-success);
}

.book-tb-status--bad {
  background: var(--color-danger-light, #fef2f2);
  border: 2px solid var(--color-danger);
  color: var(--color-danger);
}

.book-tb-status__value {
  font-size: var(--text-lg);
  font-weight: 700;
}

.book-tb-status__diff { font-size: var(--text-sm); margin-top: var(--space-1); }

.book-tb-footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--border-color);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.book-tb-footer span { margin-right: var(--space-2); }

.book-tb-acct-link { padding: 0; font-size: inherit; }

@media (max-width: 1200px) {
  .book-tb-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-tb-kpi { grid-template-columns: 1fr; }
  .book-tb-export-bar { flex-direction: column; align-items: stretch; }
  .book-tb-footer { grid-template-columns: 1fr; }
}

.book-tb-journal-warn {
  padding: var(--space-3) var(--space-4);
  background: var(--color-danger-light, #fef2f2);
  border: 2px solid var(--color-danger);
  color: var(--color-danger);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

.book-tb-diagnostics { margin-bottom: var(--space-3); }

.book-tb-diag-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.book-tb-diag-grid > div {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle, var(--surface-2));
  font-size: var(--text-sm);
}

.book-tb-diag-grid span {
  display: block;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

@media print {
  .book-tb-filters, .book-tb-export-bar, .book-dash-scope, .book-tb-header .book-cust-header__desc, .book-tb-diagnostics { display: none !important; }
  .book-tb-report__sticky { position: static; }
  .book-tb-group__body[hidden] { display: block !important; }
}

/* ── Balance Sheet ── */
.book-bs-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-bs-kpi { grid-template-columns: repeat(4, 1fr); }

.book-bs-filters__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.book-bs-filters__head .card-title { margin: 0; }
.book-bs-filters--collapsed .book-bs-filters__body { display: none; }

.book-bs-filters__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.book-bs-radio-group,
.book-bs-check {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  font-size: var(--text-sm);
  min-height: 38px;
}

.book-bs-export-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.book-bs-export-bar__actions { display: flex; gap: var(--space-2); }

.book-bs-report__sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-1, var(--card-bg));
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-4);
}

.book-bs-report__heading {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
  text-align: center;
  letter-spacing: 0.06em;
}

.book-bs-asat { text-align: center; font-size: var(--text-sm); color: var(--text-muted); }

.book-bs-body { padding: var(--space-4); }

.book-bs-major { margin-bottom: var(--space-5); }

.book-bs-major__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--border-color);
}

.book-bs-subsection { margin-bottom: var(--space-3); }

.book-bs-subsection__head {
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle, var(--surface-2));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
}

.book-bs-subsection__body { margin-top: var(--space-2); }

.book-bs-table .book-bs-amt { font-variant-numeric: tabular-nums; }
.book-bs-amt--prev { color: var(--text-muted); }
.book-bs-amt--loss { color: var(--color-danger); }

.book-bs-subtotal td { background: var(--bg-subtle, var(--surface-2)); }

.book-bs-total-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
  border-radius: var(--radius-md);
  font-weight: 700;
}

.book-bs-total-line--compare { grid-template-columns: 1fr auto auto; }

.book-bs-total-line--assets { background: rgba(59, 130, 246, 0.08); border: 1px solid var(--color-info, #3b82f6); }
.book-bs-total-line--liab { background: rgba(239, 68, 68, 0.06); border: 1px solid var(--color-danger); }
.book-bs-total-line--equity { background: rgba(16, 185, 129, 0.08); border: 1px solid var(--color-success); }

.book-bs-total-val { font-variant-numeric: tabular-nums; text-align: right; }

.book-bs-profit-row td { font-style: italic; }

.book-bs-equation {
  margin: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  text-align: center;
}

.book-bs-equation--ok {
  background: var(--color-success-light);
  border: 1px solid var(--color-success);
  color: var(--color-success);
}

.book-bs-equation--bad {
  background: var(--color-danger-light, #fef2f2);
  border: 2px solid var(--color-danger);
  color: var(--color-danger);
}

.book-bs-equation__formula { font-weight: 600; margin-bottom: var(--space-2); }
.book-bs-equation__status { font-size: var(--text-lg); font-weight: 700; }

.book-bs-footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--border-color);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.book-bs-acct-link { padding: 0; font-size: inherit; }

@media (max-width: 1200px) {
  .book-bs-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-bs-kpi { grid-template-columns: 1fr; }
  .book-bs-export-bar { flex-direction: column; align-items: stretch; }
  .book-bs-footer { grid-template-columns: 1fr; }
  .book-bs-total-line--compare { grid-template-columns: 1fr; }
}

@media print {
  .book-bs-filters, .book-bs-export-bar, .book-dash-scope, .book-bs-header .book-cust-header__desc { display: none !important; }
  .book-bs-report__sticky { position: static; }
  .book-bs-subsection__body[hidden] { display: block !important; }
}

/* ── Profit & Loss ── */
.book-pl-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-pl-kpi { grid-template-columns: repeat(4, 1fr); }

.book-pl-filters__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.book-pl-filters__head .card-title { margin: 0; }
.book-pl-filters--collapsed .book-pl-filters__body { display: none; }

.book-pl-filters__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.book-pl-radio-group,
.book-pl-check {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  font-size: var(--text-sm);
  min-height: 38px;
}

.book-pl-export-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.book-pl-export-bar__actions { display: flex; gap: var(--space-2); }

.book-pl-report__sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-1, var(--card-bg));
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-4);
}

.book-pl-report__heading {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
  text-align: center;
  letter-spacing: 0.06em;
}

.book-pl-period { text-align: center; font-size: var(--text-sm); color: var(--text-muted); }

.book-pl-body { padding: var(--space-4); }

.book-pl-section { margin-bottom: var(--space-4); }

.book-pl-section__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-align: left;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle, var(--surface-2));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
}

.book-pl-section__total {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.book-pl-section--revenue .book-pl-section__head { border-left: 3px solid var(--color-success, #10b981); }
.book-pl-section--expense .book-pl-section__head { border-left: 3px solid var(--color-danger, #ef4444); }

.book-pl-section__body { margin-top: var(--space-2); }

.book-pl-table .book-pl-amt { font-variant-numeric: tabular-nums; }
.book-pl-amt--prev { color: var(--text-muted); }

.book-pl-subtotal td { background: var(--bg-subtle, var(--surface-2)); font-weight: 600; }

.book-pl-net {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  margin: 0 var(--space-4) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--text-lg);
}

.book-pl-net--compare { grid-template-columns: 1fr auto auto; }

.book-pl-net--profit {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid var(--color-success, #10b981);
  color: var(--color-success, #10b981);
}

.book-pl-net--loss {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid var(--color-danger, #ef4444);
  color: var(--color-danger, #ef4444);
}

.book-pl-net-val { font-variant-numeric: tabular-nums; text-align: right; }

.book-pl-warn {
  margin-bottom: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-warning, #f59e0b);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-primary);
}

.book-pl-warn ul { margin: var(--space-2) 0 0; padding-left: var(--space-4); }

.book-pl-footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--border-color);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.book-pl-acct-link { padding: 0; font-size: inherit; }

.book-pl-chevron { width: 1rem; flex-shrink: 0; }

@media (max-width: 1200px) {
  .book-pl-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-pl-kpi { grid-template-columns: 1fr; }
  .book-pl-export-bar { flex-direction: column; align-items: stretch; }
  .book-pl-footer { grid-template-columns: 1fr; }
  .book-pl-net--compare { grid-template-columns: 1fr; }
}

@media print {
  .book-pl-filters, .book-pl-export-bar, .book-dash-scope, .book-pl-header .book-cust-header__desc { display: none !important; }
  .book-pl-report__sticky { position: static; }
  .book-pl-section__body[hidden] { display: block !important; }
}

/* ── Cash Flow Statement ── */
.book-cf-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-cf-kpi { grid-template-columns: repeat(4, 1fr); }

.book-cf-filters__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.book-cf-filters__head .card-title { margin: 0; }
.book-cf-filters--collapsed .book-cf-filters__body { display: none; }

.book-cf-filters__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.book-cf-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  font-size: var(--text-sm);
  min-height: 38px;
}

.book-cf-export-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.book-cf-export-bar__actions { display: flex; gap: var(--space-2); }

.book-cf-report__sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-1, var(--card-bg));
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-4);
}

.book-cf-report__heading {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
  text-align: center;
  letter-spacing: 0.06em;
}

.book-cf-period,
.book-cf-method { text-align: center; font-size: var(--text-sm); color: var(--text-muted); }

.book-cf-body { padding: var(--space-4); }

.book-cf-section { margin-bottom: var(--space-4); }

.book-cf-section__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-align: left;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle, var(--surface-2));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
}

.book-cf-section__total {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.book-cf-section--operating .book-cf-section__head { border-left: 3px solid var(--color-info, #3b82f6); }
.book-cf-section--investing .book-cf-section__head { border-left: 3px solid var(--color-warning, #f59e0b); }
.book-cf-section--financing .book-cf-section__head { border-left: 3px solid var(--color-primary, #6366f1); }

.book-cf-section__body { margin-top: var(--space-2); }

.book-cf-table .book-cf-amt { font-variant-numeric: tabular-nums; }
.book-cf-amt--in { color: var(--color-success, #10b981); }
.book-cf-amt--out { color: var(--color-danger, #ef4444); }
.book-cf-amt--prev { color: var(--text-muted); }

.book-cf-subtotal td { background: var(--bg-subtle, var(--surface-2)); font-weight: 600; }

.book-cf-internal {
  margin-top: var(--space-4);
  padding: var(--space-3);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle, var(--surface-2));
}

.book-cf-internal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.book-cf-summary {
  margin: 0 var(--space-4) var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle, var(--surface-2));
}

.book-cf-summary--compare .book-cf-summary__row {
  grid-template-columns: 1fr auto auto;
}

.book-cf-summary__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.book-cf-summary__row--bold {
  font-weight: 700;
  font-size: var(--text-base);
  border-top: 2px solid var(--border-color);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
}

.book-cf-summary__operator {
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--space-1) 0;
}

.book-cf-summary__val { font-variant-numeric: tabular-nums; text-align: right; }

.book-cf-reconcile {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
}

.book-cf-reconcile--ok {
  background: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.book-cf-reconcile--warn {
  background: var(--color-danger-light, #fef2f2);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.book-cf-warn {
  margin-bottom: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-warning, #f59e0b);
  background: rgba(245, 158, 11, 0.08);
}

.book-cf-warn ul { margin: var(--space-2) 0 0; padding-left: var(--space-4); }

.book-cf-footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--border-color);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.book-cf-line-link,
.book-cf-chevron { padding: 0; font-size: inherit; }
.book-cf-chevron { width: 1rem; flex-shrink: 0; }

@media (max-width: 1200px) {
  .book-cf-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .book-cf-kpi { grid-template-columns: 1fr; }
  .book-cf-export-bar { flex-direction: column; align-items: stretch; }
  .book-cf-footer { grid-template-columns: 1fr; }
  .book-cf-summary--compare .book-cf-summary__row { grid-template-columns: 1fr; }
}

@media print {
  .book-cf-filters, .book-cf-export-bar, .book-dash-scope, .book-cf-header .book-cust-header__desc { display: none !important; }
  .book-cf-report__sticky { position: static; }
  .book-cf-section__body[hidden] { display: block !important; }
}

/* ── Inter-Book Transfer Center ── */
.ibt-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.ibt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.ibt-header__bridge {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-subtle, var(--surface-2));
  border: 1px solid var(--border-color);
}

.ibt-bridge-book {
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.ibt-bridge-book--aud { background: rgba(59, 130, 246, 0.12); color: var(--color-info, #3b82f6); }
.ibt-bridge-book--lkr { background: rgba(16, 185, 129, 0.12); color: var(--color-success, #10b981); }
.ibt-bridge-arrow { font-size: var(--text-lg); color: var(--text-muted); }

.ibt-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ibt-kpi__split {
  display: flex;
  flex-direction: column;
  gap: clamp(0.15rem, 0.5cqi + 0.1rem, var(--space-1));
  font-size: clamp(0.75rem, 2.5cqi + 0.35rem, var(--text-base));
  min-width: 0;
}

.ibt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.ibt-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  flex: 1;
  min-width: 240px;
}

.ibt-toolbar__filters .form-control { min-width: 160px; }
.ibt-toolbar__actions { display: flex; gap: var(--space-2); }

.ibt-dir {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}

.ibt-dir--aud-lkr { background: rgba(59, 130, 246, 0.1); color: var(--color-info, #3b82f6); }
.ibt-dir--lkr-aud { background: rgba(16, 185, 129, 0.1); color: var(--color-success, #10b981); }

.ibt-detail-nav { margin-bottom: calc(var(--space-2) * -1); }

.ibt-detail { padding: var(--space-4); }

.ibt-detail__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.ibt-detail__ref { margin: 0 0 var(--space-2); font-size: var(--text-xl); }
.ibt-detail__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.ibt-detail-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-subtle, var(--surface-2));
  border: 1px solid var(--border-color);
}

.ibt-detail-flow__book {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.ibt-detail-flow__book--src { text-align: left; }
.ibt-detail-flow__book--dst { text-align: right; }

.ibt-detail-flow__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.ibt-detail-flow__mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.ibt-detail-flow__rate { font-size: var(--text-sm); color: var(--text-muted); }
.ibt-detail-flow__arrow { font-size: var(--text-2xl); color: var(--color-primary); }

.ibt-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.ibt-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.ibt-detail-notes { margin-bottom: var(--space-3); font-size: var(--text-sm); }
.ibt-detail-warn {
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-danger-light, #fef2f2);
  color: var(--color-danger);
  font-size: var(--text-sm);
}

.ibt-detail-journals h4 { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.ibt-journal-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.ibt-form-card { padding: var(--space-4); }
.ibt-radio-group {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
}

.ibt-form-books {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-4);
}

.ibt-form-book__val {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle, var(--surface-2));
  border: 1px solid var(--border-color);
  font-weight: 600;
}

.ibt-form-arrow {
  text-align: center;
  font-size: var(--text-xl);
  color: var(--color-primary);
  padding-bottom: var(--space-2);
}

.ibt-converted {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid var(--color-primary, #6366f1);
  border-radius: var(--radius-md);
}

.ibt-converted strong { font-size: var(--text-lg); color: var(--color-primary); }
.ibt-form-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); }

.ibt-available-rate {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid var(--color-success, #10b981);
  border-radius: var(--radius-md);
}

.ibt-available-rate__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.ibt-available-rate__value {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-success, #10b981);
}

@media (max-width: 1200px) {
  .ibt-kpi { grid-template-columns: repeat(2, 1fr); }
  .ibt-detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .ibt-kpi { grid-template-columns: 1fr; }
  .ibt-toolbar { flex-direction: column; align-items: stretch; }
  .ibt-detail-flow,
  .ibt-form-books { grid-template-columns: 1fr; }
  .ibt-detail-flow__book--dst { text-align: left; }
  .ibt-detail-grid { grid-template-columns: 1fr; }
}

/* ── Exchange Rates (Transfer Center) ── */
.xrt-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.xrt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.xrt-header__pairs {
  display: flex;
  gap: var(--space-2);
}

.xrt-pair-tab {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle, var(--surface-2));
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.xrt-pair-tab--active {
  background: var(--color-primary, #6366f1);
  color: #fff;
  border-color: var(--color-primary, #6366f1);
}

.xrt-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.xrt-kpi--highlight { border: 1px solid var(--color-success, #10b981); }
.xrt-kpi__rate { font-size: clamp(0.8125rem, 3cqi + 0.4rem, var(--text-lg)); }
.xrt-kpi__split {
  display: flex;
  flex-direction: column;
  gap: clamp(0.15rem, 0.5cqi + 0.1rem, var(--space-1));
  font-size: clamp(0.6875rem, 2cqi + 0.3rem, var(--text-sm));
  min-width: 0;
}
.xrt-kpi--up .book-dash-kpi__value { color: var(--color-success); }
.xrt-kpi--down .book-dash-kpi__value { color: var(--color-danger); }

.xrt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.xrt-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  flex: 1;
}

.xrt-toolbar__filters .form-control { min-width: 140px; }
.xrt-toolbar__actions { display: flex; gap: var(--space-2); }

.xrt-panels {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
}

.xrt-chart-wrap {
  position: relative;
  height: 220px;
  padding: var(--space-3);
}

.xrt-history-card .card-header,
.xrt-chart-card .card-header { padding: var(--space-3) var(--space-4); }

.xrt-history-table { font-size: var(--text-sm); }

.xrt-row--active { background: rgba(16, 185, 129, 0.06); }
.xrt-row--current { background: rgba(99, 102, 241, 0.08); font-weight: 600; }

.xrt-currency {
  font-weight: 600;
  font-size: var(--text-sm);
}

.xrt-detail-nav { margin-bottom: calc(var(--space-2) * -1); }

.xrt-detail { padding: var(--space-4); }

.xrt-detail__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.xrt-detail__pair { margin: 0 0 var(--space-2); font-size: var(--text-xl); }
.xrt-detail__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.xrt-detail-rate {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.xrt-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.xrt-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.xrt-detail-notes,
.xrt-detail-history { margin-top: var(--space-3); font-size: var(--text-sm); }

.xrt-detail-warn {
  padding: var(--space-2) var(--space-3);
  margin: var(--space-3) 0;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--color-warning, #f59e0b);
  font-size: var(--text-sm);
}

.xrt-form-card { padding: var(--space-4); }
.xrt-form-preview {
  padding: var(--space-3);
  margin: var(--space-3) 0;
  font-weight: 600;
  background: var(--bg-subtle, var(--surface-2));
  border-radius: var(--radius-md);
}
.xrt-form-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); }

@media (max-width: 1200px) {
  .xrt-kpi { grid-template-columns: repeat(2, 1fr); }
  .xrt-panels { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .xrt-kpi { grid-template-columns: 1fr; }
  .xrt-toolbar { flex-direction: column; align-items: stretch; }
  .xrt-detail-grid { grid-template-columns: 1fr; }
}

/* ── Transfer History (th-*) ── */
.th-page { display: flex; flex-direction: column; gap: var(--space-4); }

.th-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.th-header__badge {
  display: inline-block;
  margin-top: var(--space-2);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
}

.th-header__bridge { display: flex; align-items: center; gap: var(--space-2); }

.th-kpi { grid-template-columns: repeat(4, 1fr); }

.th-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  flex-wrap: wrap;
}

.th-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  flex: 1;
}

.th-toolbar__filters .form-control { min-width: 140px; }
.th-toolbar__actions { display: flex; gap: var(--space-2); }

.th-dir {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

.th-dir--aud-lkr { background: rgba(59, 130, 246, 0.1); color: var(--color-info, #3b82f6); }
.th-dir--lkr-aud { background: rgba(16, 185, 129, 0.1); color: var(--color-success, #10b981); }

.th-table-card { overflow: hidden; }
.th-table-wrap { max-height: none; }
.th-rate-cell { font-variant-numeric: tabular-nums; }
.th-rev-hint { margin-top: var(--space-1); }

.th-detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(var(--space-2) * -1);
}

.th-detail { padding: var(--space-4); }

.th-detail__head { margin-bottom: var(--space-4); }

.th-detail__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

.th-detail__ref-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.th-detail-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle, var(--surface-2));
  border: 1px solid var(--border-color);
}

.th-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.th-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.th-detail-notes {
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.th-rate-snapshot {
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.th-rate-snapshot h4 { margin: 0 0 var(--space-3); font-size: var(--text-sm); }

.th-rate-snapshot__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.th-rate-snapshot__grid > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.th-rate-snapshot__note { margin: var(--space-3) 0 0; }

.th-journals-section { margin-bottom: var(--space-4); }
.th-journals-section h3 { margin: 0 0 var(--space-3); font-size: var(--text-base); }

.th-journals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.th-journal-card {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--surface-1, var(--card-bg));
}

.th-journal-card--empty { opacity: 0.7; }

.th-journal-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.th-journal-card__head h4 { margin: 0; font-size: var(--text-sm); }
.th-journal-card__num { font-size: var(--text-sm); }

.th-journal-card__lines { margin-bottom: var(--space-3); }

.th-journal-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-color);
}

.th-journal-line:last-child { border-bottom: none; }
.th-journal-line__side { color: var(--text-muted); font-weight: 600; }
.th-journal-line__amt { font-variant-numeric: tabular-nums; font-weight: 600; }

.th-journal-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.th-reversal {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.04);
}

.th-reversal h4 { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--color-danger); }
.th-reversal__links { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.th-audit { padding: var(--space-3) var(--space-4); }
.th-audit h4 { margin: 0 0 var(--space-3); font-size: var(--text-sm); }

.th-audit__list { display: flex; flex-direction: column; gap: var(--space-2); }

.th-audit-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle, var(--surface-2));
  font-size: var(--text-sm);
}

.th-audit-row__action { font-weight: 600; color: var(--color-primary); }
.th-audit-row__time { color: var(--text-muted); white-space: nowrap; }

@media print {
  .sidebar, .topbar, .th-filters, .th-toolbar, .th-detail-nav, .pagination { display: none !important; }
  .th-page { gap: 0; }
}

@media (max-width: 1200px) {
  .th-kpi { grid-template-columns: repeat(2, 1fr); }
  .th-journals-grid { grid-template-columns: 1fr; }
  .th-detail-grid, .th-rate-snapshot__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .th-kpi { grid-template-columns: 1fr; }
  .th-toolbar { flex-direction: column; align-items: stretch; }
  .th-detail-flow { grid-template-columns: 1fr; text-align: center; }
  .th-detail-grid, .th-rate-snapshot__grid { grid-template-columns: 1fr; }
  .th-audit-row { grid-template-columns: 1fr; }
}

/* ── Transfer Center shared (book-tc-*) ── */
.book-tc-book {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.book-tc-book__name { font-weight: 600; }
.book-tc-book__code {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle, var(--surface-2));
  border: 1px solid var(--border-color);
}

.ibt-section-head { margin-bottom: calc(var(--space-2) * -1); }

.book-cust-section-head {
  padding: 0 var(--space-1);
}

.book-cust-section-head__title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
  font-weight: 700;
}

.book-cust-section-head__desc {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.ibt-validation-banner {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid var(--color-primary, #6366f1);
  border-radius: var(--radius-md);
}

.ibt-validation-banner__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--text-sm);
}

.ibt-acct-warn {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid var(--color-danger, #ef4444);
  border-radius: var(--radius-md);
  color: var(--color-danger, #ef4444);
  font-size: var(--text-sm);
}

.ibt-form-books--single { grid-template-columns: 1fr !important; }
.ibt-converted-inline {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  min-height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle, var(--surface-2));
  border: 1px solid var(--border-color);
}

.xrt-header__pairs--inline {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.xrt-filters .book-qt-section__title,
.th-filters .book-qt-section__title {
  padding: var(--space-3) var(--space-4) 0;
}

.xrt-pair-label { font-weight: 600; }
.xrt-form-preview__value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .ibt-table tbody tr,
  .xrt-table tbody tr,
  .th-table tbody tr {
    display: block;
    padding: var(--space-3);
    border-bottom: 1px solid var(--border-color);
  }

  .ibt-table tbody td,
  .xrt-table tbody td,
  .th-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-1) 0;
    border: none;
    text-align: right !important;
  }

  .ibt-table tbody td::before,
  .xrt-table tbody td::before,
  .th-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-align: left;
    flex: 1;
  }

  .ibt-table thead,
  .xrt-table thead,
  .th-table thead { display: none; }

  .xrt-panels { grid-template-columns: 1fr; }
  .book-qt-form-layout { grid-template-columns: 1fr; }
}

/* ── Asset Management (ast-*) ── */
.ast-page { display: flex; flex-direction: column; gap: var(--space-4); }

.ast-header { margin-bottom: 0; }
.ast-header--compact { padding: var(--space-4) var(--space-5); }

.ast-kpi { grid-template-columns: repeat(4, 1fr); }
.ast-status-kpi { grid-template-columns: repeat(5, 1fr); }

.ast-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.ast-panel { overflow: hidden; }

.ast-chart { display: flex; flex-direction: column; gap: var(--space-3); }

.ast-chart-row__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
}

.ast-chart-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle, var(--surface-2));
  overflow: hidden;
}

.ast-chart-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary), var(--color-info, #3b82f6));
}

.ast-lifecycle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
}

.ast-lifecycle__arrow { color: var(--color-primary); }

.ast-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.ast-toolbar__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

.ast-table .cell-amount { font-variant-numeric: tabular-nums; }

.ast-dep-preview {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
}

.ast-report-tabs { border-bottom: 1px solid var(--border-color); }
.ast-report-body { padding: var(--space-4); }

@media print {
  .sidebar, .topbar, .ast-toolbar, .ast-report-tabs { display: none !important; }
}

@media (max-width: 1200px) {
  .ast-kpi { grid-template-columns: repeat(2, 1fr); }
  .ast-status-kpi { grid-template-columns: repeat(3, 1fr); }
  .ast-panels { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .ast-kpi, .ast-status-kpi { grid-template-columns: 1fr; }
  .ast-toolbar { flex-direction: column; align-items: stretch; }
}

/* HR Organization Setup */
.book-hr-org-page .book-hr-org-tabs {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.book-hr-org-cards {
  display: none;
  padding: var(--space-3);
  gap: var(--space-3);
}

.book-hr-org-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.book-hr-org-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.book-hr-org-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.book-hr-org-card__actions .book-ast-row-menu {
  width: 100%;
}

.book-hr-org-page .book-hr-org-kpi-6 {
  grid-template-columns: repeat(6, 1fr);
}

.book-hr-org-tab-intro {
  padding: var(--space-4);
}

.book-hr-org-holiday-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
}

.book-hr-org-weekend-card .card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.book-hr-org-weekend-branch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.book-hr-org-weekend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-hr-org-weekend-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: var(--space-2);
}

.book-hr-org-weekend-day {
  font-size: 0.875rem;
  font-weight: 600;
}

.book-hr-org-branch-checks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  max-height: 160px;
  overflow-y: auto;
}

.book-hr-org-branch-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
}

@media (max-width: 1200px) {
  .book-hr-org-page .book-hr-org-kpi-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .book-hr-org-page .book-hr-org-kpi-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-hr-org-weekend-grid,
  .book-hr-org-branch-checks {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 768px) {
  .book-hr-org-page .book-hr-table-wrap {
    display: none;
  }

  .book-hr-org-cards {
    display: flex;
    flex-direction: column;
  }

  .book-hr-org-page .book-ast-action-bar {
    flex-wrap: wrap;
  }
}

.book-hr-shift-page .book-hr-org-tabs,
.book-hr-shift-page .tab-list.book-ast-rpt-tabs,
.book-hr-ot-page .book-hr-org-tabs,
.book-hr-ot-page .tab-list.book-ast-rpt-tabs {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.book-hr-ot-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.book-hr-ot-flow__step {
  font-weight: 600;
  color: var(--text-primary);
}

.book-hr-ot-flow__arrow {
  color: var(--text-muted);
  font-weight: 600;
}

.book-hr-ot-integration .card-body {
  padding-top: var(--space-3);
}

/* HR report pages — collapsible Search & Filters */
.book-hr-report-page .book-hr-report-filters {
  overflow: hidden;
}

.book-hr-report-filters__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text-primary);
}

.book-hr-report-filters__toggle:hover {
  background: var(--surface-hover, rgba(0, 0, 0, 0.03));
}

.book-hr-report-filters__label {
  font-weight: 600;
  font-size: var(--text-sm);
}

.book-hr-report-filters__chevron {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.book-hr-report-filters__body {
  padding: 0 var(--space-4) var(--space-4);
}

.book-hr-report-filters__body--collapsed {
  display: none;
}

.book-hr-report-filters__bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.book-hr-report-filters__bar .filter-select,
.book-hr-report-filters__bar .form-control {
  min-width: 10rem;
}

.book-hr-report-page .book-hr-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

/* Employee Add/Edit — tabbed ERP form */
.book-hr-emp-form-modal,
.book-hr-emp-form-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
}

.book-hr-form-page .book-hr-emp-form-page-body {
  padding: 0 var(--space-4) var(--space-4);
}

.book-hr-form-page .book-hr-emp-form-panels {
  max-height: none;
  overflow: visible;
}

.book-hr-dash-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--space-2);
  min-height: 96px;
  padding: var(--space-5) var(--space-4);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.book-hr-dash-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.book-hr-dash-link__title {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.book-hr-dash-payroll-status .badge {
  font-size: 0.875rem;
}

.book-hr-att-cards {
  display: none;
}

@media (max-width: 768px) {
  .book-hr-att-page .book-hr-table-wrap {
    display: none;
  }

  .book-hr-att-cards {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3);
  }

  .book-hr-att-card {
    padding: var(--space-3);
  }

  .book-hr-att-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
  }
}

.book-hr-emp-form-tabs {
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: var(--space-1);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2);
}

.book-hr-emp-form-tabs .tab-btn {
  font-size: 0.8125rem;
  padding: 6px 12px;
  white-space: nowrap;
}

.book-hr-emp-form-panels {
  max-height: min(62vh, 520px);
  overflow-y: auto;
  padding-right: var(--space-1);
}

.book-hr-emp-form-panel {
  display: none;
}

.book-hr-emp-form-panel.active {
  display: block;
}

.book-hr-emp-form-card {
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.book-hr-emp-photo-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--space-4);
  align-items: start;
}

.book-hr-emp-photo-preview,
.book-hr-emp-photo-placeholder {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.book-hr-emp-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.book-hr-payroll-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.book-hr-radio-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg-subtle);
}

.book-hr-radio-card:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.book-hr-payroll-excluded {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
}

.book-hr-shift-preview {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.book-hr-shift-preview__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.book-hr-shift-preview__time {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--space-2);
}

.book-hr-emp-shift-stats,
.book-hr-emp-shift-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-hr-emp-shift-stats div,
.book-hr-emp-shift-rules div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8125rem;
}

.book-hr-comp-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 200px;
  overflow-y: auto;
}

.book-hr-comp-check {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-2);
  align-items: center;
  font-size: 0.875rem;
}

.book-hr-pending-docs {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.book-hr-pending-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .book-hr-payroll-toggle,
  .book-hr-emp-shift-stats,
  .book-hr-emp-shift-rules,
  .book-hr-ro-grid {
    grid-template-columns: 1fr;
  }

  .book-hr-emp-photo-row {
    grid-template-columns: 1fr;
  }
}

.book-hr-ro-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3) var(--space-4);
}

.book-hr-ro-grid--statutory {
  grid-template-columns: repeat(2, 1fr);
}

.book-hr-ro-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-color);
}

.book-hr-ro-field__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.book-hr-ro-field__value {
  font-weight: 600;
  font-size: 0.9375rem;
}

.book-hr-payroll-empty {
  padding: var(--space-4);
  text-align: center;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.book-hr-payroll-warn {
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
  font-size: 0.875rem;
}

.book-hr-payroll-nav {
  padding: var(--space-3);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-2);
}

.book-hr-stat-ro-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
}

.book-hr-stat-ro-value {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.book-hr-payroll-disabled {
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--text-muted) 6%, var(--card-bg));
}

.book-hr-payroll-disabled .form-section-title {
  color: var(--text-muted);
}

.book-hr-stat-source {
  margin-top: var(--space-1);
  margin-bottom: var(--space-2);
}

/* Payroll Rules (LKR) settings page */
.book-payroll-rules-page {
  max-width: 100%;
}

.book-payroll-rules-header {
  margin-bottom: var(--space-4);
}

.book-payroll-rules-banner.settings-banner--info {
  background: color-mix(in srgb, var(--info, #3b82f6) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--info, #3b82f6) 25%, transparent);
}

.book-payroll-rules-tabs {
  flex-wrap: wrap;
  gap: var(--space-1);
}

.book-payroll-rules-card {
  margin-bottom: var(--space-4);
}

.book-payroll-gl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.book-payroll-gl-readonly {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.book-payroll-gl-readonly-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.book-payroll-gl-readonly-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.book-payroll-gl-readonly-value {
  font-size: 0.875rem;
  font-weight: 600;
}

.book-payroll-gl-readonly-value--ok {
  color: var(--color-success, #047857);
}

.book-payroll-gl-readonly-value--missing {
  color: var(--color-danger, #dc2626);
}

.settings-inline-link {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.book-payroll-tax-arch {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .book-payroll-gl-grid {
    grid-template-columns: 1fr;
  }
}

/* Tax Configuration (LKR) settings page */
.book-tax-settings-page {
  max-width: 100%;
}

.book-tax-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-tax-toolbar .filter-bar {
  margin: 0;
}

.book-tax-table-card .card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.book-tax-settings-header {
  margin-bottom: var(--space-4);
}

.book-tax-settings-banner.settings-banner--info {
  background: color-mix(in srgb, var(--info, #3b82f6) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--info, #3b82f6) 25%, transparent);
}

.book-tax-settings-link {
  color: var(--color-primary);
  text-decoration: underline;
}

.book-tax-settings-tabs {
  flex-wrap: wrap;
  gap: var(--space-1);
}

.book-tax-settings-card {
  margin-bottom: var(--space-4);
}

.book-tax-modal-section {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-3);
}

.book-tax-modal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.book-tax-apply-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.book-tax-gl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.book-tax-map-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  overflow: hidden;
}

.book-tax-map-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.book-tax-map-card__title {
  font-weight: 700;
  font-size: 1rem;
}

.book-tax-map-card__book,
.book-tax-map-card__fields {
  padding: var(--space-4);
}

.book-tax-map-row {
  padding: var(--space-3) 0;
}

.book-tax-map-row__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.book-tax-map-row__title {
  font-weight: 600;
}

.book-tax-map-row__purpose {
  margin: var(--space-1) 0 0;
}

.book-tax-map-row__badges {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-tax-map-row__hint {
  margin-bottom: var(--space-2);
}

.book-tax-map-divider {
  border: none;
  border-top: 1px dashed var(--border-color);
  margin: var(--space-2) 0;
}

.book-tax-map-saved {
  margin: 0 var(--space-4) var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.book-tax-map-saved__title {
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-tax-map-saved__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-tax-map-saved__grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-tax-mapping-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-tax-mapping-summary__book {
  margin-bottom: 2px;
}

.book-tax-posting-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.book-tax-journal-block {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  font-size: 0.875rem;
}

.book-tax-journal-title {
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.book-tax-journal-line {
  padding: var(--space-1) 0;
}

.book-tax-journal-line span {
  display: inline-block;
  width: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.book-tax-example {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-3);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.book-tax-arch {
  padding: var(--space-4);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.book-tax-arch__title {
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--border-color);
}

.book-tax-arch__cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.book-tax-arch__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.book-tax-arch__list {
  margin: var(--space-1) 0;
  padding-left: var(--space-4);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .book-tax-gl-grid,
  .book-tax-map-saved__grid,
  .book-tax-posting-grid,
  .book-tax-arch__cols,
  .book-tax-apply-grid {
    grid-template-columns: 1fr;
  }
}

/* Hikvision Biometric Integration */
.book-hr-bio-page .book-hr-bio-banner.settings-banner--info {
  background: color-mix(in srgb, var(--info, #3b82f6) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--info, #3b82f6) 25%, transparent);
}

.book-hr-bio-flow__steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  padding: var(--space-2) 0;
}

.book-hr-bio-flow__steps span:nth-child(odd) {
  padding: var(--space-1) var(--space-2);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.book-hr-bio-modal-section {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-3);
}

.book-hr-bio-modal-section:last-child {
  border-bottom: none;
}

.book-hr-bio-csv-help code {
  display: block;
  padding: var(--space-2);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.book-hr-bio-enroll-status {
  font-size: 0.875rem;
}

/* ---- Leave Management ---- */
.book-hr-leave-page .book-hr-leave-kpi {
  grid-template-columns: repeat(6, 1fr);
}

.book-hr-leave-page .book-hr-org-tabs,
.book-hr-leave-page .tab-list.book-ast-rpt-tabs {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.book-hr-leave-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.book-hr-leave-actions .book-cust-export {
  display: flex;
  gap: var(--space-1);
  margin-left: auto;
}

.book-hr-leave-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  line-height: 1.45;
}

.book-hr-leave-expand-btn {
  min-width: 28px;
  padding: 2px 6px;
  font-size: 0.75rem;
}

.book-hr-leave-expand-panel {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  margin: var(--space-2) 0;
}

.book-hr-leave-expand-row td {
  background: var(--bg-subtle);
  border-top: none;
}

.book-hr-leave-profile-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-hr-leave-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.book-hr-leave-list li {
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border-color);
}

.book-hr-leave-list li:last-child {
  border-bottom: none;
}

.book-hr-leave-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-hr-leave-settings-grid div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}

.book-hr-leave-reports {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-hr-leave-report-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.book-hr-leave-holiday-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-hr-leave-weekend-summary {
  padding: var(--space-4);
}

.book-hr-leave-inline-cal .card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.book-hr-leave-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.book-hr-leave-cal-header {
  text-align: center;
  font-size: 1rem;
}

.book-hr-leave-weekend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-hr-leave-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.book-hr-leave-cal-dow {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--space-1);
}

.book-hr-leave-cal-cell {
  min-height: 72px;
  padding: var(--space-1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
}

.book-hr-leave-cal-cell--empty {
  background: transparent;
  border-color: transparent;
}

.book-hr-leave-cal-cell--weekend {
  background: color-mix(in srgb, var(--text-muted) 8%, var(--card-bg));
}

.book-hr-leave-cal-cell--holiday {
  background: color-mix(in srgb, var(--info, #3b82f6) 12%, var(--card-bg));
  border-color: color-mix(in srgb, var(--info, #3b82f6) 30%, transparent);
}

.book-hr-leave-cal-cell--approved {
  background: color-mix(in srgb, var(--color-success, #22c55e) 14%, var(--card-bg));
  border-color: color-mix(in srgb, var(--color-success, #22c55e) 35%, transparent);
}

.book-hr-leave-cal-cell--pending {
  background: color-mix(in srgb, var(--color-warning, #f59e0b) 14%, var(--card-bg));
  border-color: color-mix(in srgb, var(--color-warning, #f59e0b) 35%, transparent);
}

.book-hr-att-cal-cell--absent,
.book-hr-leave-cal-legend-item.book-hr-att-cal-cell--absent {
  background: color-mix(in srgb, var(--color-danger, #ef4444) 12%, var(--card-bg));
  border-color: color-mix(in srgb, var(--color-danger, #ef4444) 30%, transparent);
}

.book-hr-att-cal-cell--leave,
.book-hr-leave-cal-legend-item.book-hr-att-cal-cell--leave {
  background: color-mix(in srgb, var(--info, #3b82f6) 10%, var(--card-bg));
  border-color: color-mix(in srgb, var(--info, #3b82f6) 28%, transparent);
}

.book-hr-att-cal-cell--missing,
.book-hr-leave-cal-legend-item.book-hr-att-cal-cell--missing {
  background: color-mix(in srgb, var(--color-warning, #f59e0b) 16%, var(--card-bg));
  border-color: color-mix(in srgb, var(--color-warning, #f59e0b) 40%, transparent);
}

.book-hr-leave-cal-day {
  font-weight: 600;
}

.book-hr-leave-cal-tag {
  font-size: 0.625rem;
  line-height: 1.2;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-hr-leave-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-hr-leave-cal-legend-item {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
}

@media (max-width: 1400px) {
  .book-hr-leave-page .book-hr-leave-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .book-hr-leave-page .book-hr-leave-kpi {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-hr-leave-reports {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-hr-leave-actions .book-cust-export {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .book-hr-leave-page .book-hr-leave-kpi {
    grid-template-columns: 1fr;
  }

  .book-hr-leave-reports {
    grid-template-columns: 1fr;
  }

  .book-hr-leave-settings-grid {
    grid-template-columns: 1fr;
  }

  .book-hr-leave-cal-cell {
    min-height: 48px;
  }

  .book-hr-leave-page .book-cust-table-wrap {
    display: none;
  }
}

/* ---- Payroll — Salary Components ---- */
.book-payroll-comp-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.book-payroll-comp-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-payroll-comp-page .book-payroll-comp-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-payroll-comp-page .book-cust-toolbar__right .filter-bar {
  width: 100%;
  justify-content: flex-end;
}

.action-btn--duplicate:hover {
  background: var(--color-warning-light);
  color: var(--color-warning-text, var(--color-warning));
}

.action-btn--assign:hover {
  background: var(--color-info-light);
  color: var(--color-info);
}

@media (max-width: 1200px) {
  .book-payroll-comp-page .book-payroll-comp-kpi {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-payroll-grp-page .book-payroll-grp-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-payroll-comp-page .book-payroll-comp-kpi {
    grid-template-columns: 1fr;
  }

  .book-payroll-comp-header__actions {
    width: 100%;
  }

  .book-payroll-comp-header__actions .btn {
    width: 100%;
  }

  .book-payroll-grp-page .book-payroll-grp-kpi {
    grid-template-columns: 1fr;
  }

  .book-payroll-grp-header__actions {
    width: 100%;
  }

  .book-payroll-grp-header__actions .btn {
    width: 100%;
  }

  .book-payroll-grp-detail .book-ast-detail__hero-actions {
    flex-wrap: wrap;
  }
}

/* ---- Payroll — Salary Groups ---- */
.book-payroll-grp-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.book-payroll-grp-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-payroll-grp-page .book-payroll-grp-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-payroll-grp-page .book-cust-toolbar__right .filter-bar {
  width: 100%;
  justify-content: flex-end;
}

/* ---- Payroll — Employee Salary Setup ---- */
.book-payroll-ess-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.book-payroll-ess-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-payroll-ess-page .book-payroll-ess-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-payroll-ess-page .book-cust-toolbar__right .filter-bar {
  width: 100%;
  justify-content: flex-end;
}

.book-payroll-ess-form {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-4);
  align-items: start;
  margin-bottom: var(--space-4);
}

.book-payroll-ess-form__summary {
  position: sticky;
  top: var(--space-2);
}

.book-payroll-ess-summary {
  padding: var(--space-4);
  background: var(--page-bg, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
}

.book-payroll-ess-summary__rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.book-payroll-ess-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
}

.book-payroll-ess-summary__row span {
  color: var(--text-muted);
}

.book-payroll-ess-summary__row strong {
  font-size: var(--font-size-base);
  white-space: nowrap;
}

.book-payroll-ess-summary__row--net strong {
  color: var(--color-primary);
  font-size: var(--font-size-lg);
}

.book-payroll-ess-summary__row--total strong {
  color: var(--color-success);
  font-size: var(--font-size-lg);
}

.book-payroll-ess-summary__divider {
  height: 1px;
  background: var(--border-color, #e2e8f0);
  margin: var(--space-2) 0;
}

.book-payroll-ess-form__footer {
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding-top: var(--space-4);
}

.book-payroll-ess-comp-table .data-table th,
.book-payroll-ess-comp-table .data-table td {
  font-size: var(--font-size-sm);
}

@media (max-width: 1200px) {
  .book-payroll-ess-page .book-payroll-ess-kpi {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-payroll-ess-form {
    grid-template-columns: 1fr;
  }

  .book-payroll-ess-form__summary {
    position: static;
  }
}

@media (max-width: 768px) {
  .book-payroll-ess-page .book-payroll-ess-kpi {
    grid-template-columns: 1fr;
  }

  .book-payroll-ess-header__actions {
    width: 100%;
  }

  .book-payroll-ess-header__actions .btn {
    width: 100%;
  }

  .book-payroll-ess-detail .book-ast-detail__hero-actions {
    flex-wrap: wrap;
  }
}

/* ---- Payroll — Salary Advances ---- */
.book-payroll-adv-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.book-payroll-adv-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-payroll-adv-page .book-payroll-adv-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-payroll-adv-page .book-cust-toolbar__right .filter-bar {
  width: 100%;
  justify-content: flex-end;
}

.action-btn--approve:hover {
  background: var(--color-success-light);
  color: var(--color-success);
}

@media (max-width: 1200px) {
  .book-payroll-adv-page .book-payroll-adv-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-payroll-adv-page .book-payroll-adv-kpi {
    grid-template-columns: 1fr;
  }

  .book-payroll-adv-header__actions {
    width: 100%;
  }

  .book-payroll-adv-header__actions .btn {
    width: 100%;
  }

  .book-payroll-adv-page .book-payroll-adv-table-card .table-wrapper {
    display: none;
  }

  .book-payroll-adv-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .book-payroll-adv-card {
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
  }

  .book-payroll-adv-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
  }

  .book-payroll-adv-card__actions {
    margin-top: var(--space-3);
    display: flex;
    justify-content: flex-end;
  }

  .book-payroll-adv-detail .book-ast-detail__hero-actions {
    flex-wrap: wrap;
  }
}

.book-qt-currency-lock {
  position: relative;
  display: flex;
  align-items: stretch;
}

.book-qt-currency-lock .form-control {
  padding-right: 2.25rem;
  background: var(--color-surface-muted, var(--bg-muted));
}

.book-qt-currency-lock__badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.65;
  pointer-events: none;
}

.book-payroll-adv-form-summary {
  margin-bottom: 0;
}

@media (min-width: 769px) {
  .book-payroll-adv-mobile-cards {
    display: none;
  }
}

/* ---- Payroll — Monthly Payroll ---- */
.book-payroll-run-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.book-payroll-run-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-payroll-run-page .book-payroll-run-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-payroll-run-page .book-cust-toolbar__right .filter-bar {
  width: 100%;
  justify-content: flex-end;
}

.book-payroll-run-badge--paid {
  background: #065f46;
  color: #ecfdf5;
}

.book-payroll-run-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-payroll-run-summary__card {
  padding: var(--space-4);
  background: var(--page-bg, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
}

.book-payroll-run-summary__card span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-1);
}

.book-payroll-run-summary__card strong {
  font-size: var(--font-size-lg);
}

.book-payroll-run-summary__card--net strong {
  color: var(--color-primary);
}

.book-payroll-run-summary__card--total strong {
  color: var(--color-success);
}

.book-payroll-run-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.book-payroll-run-flow__step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md, 8px);
  background: var(--page-bg, #f1f5f9);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.book-payroll-run-flow__step--done {
  background: var(--color-success-light, #dcfce7);
  color: var(--color-success);
}

.book-payroll-run-flow__step--current {
  background: var(--color-primary-light, #dbeafe);
  color: var(--color-primary);
  font-weight: 600;
}

.book-payroll-run-flow__arrow {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}

.book-payroll-run-wizard__steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-payroll-run-wizard__step {
  font-size: var(--font-size-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm, 6px);
  background: var(--page-bg, #f1f5f9);
  color: var(--text-muted);
}

.book-payroll-run-wizard__step--active {
  background: var(--color-primary-light, #dbeafe);
  color: var(--color-primary);
  font-weight: 600;
}

.book-payroll-run-wizard__step--done {
  background: var(--color-success-light, #dcfce7);
  color: var(--color-success);
}

.book-payroll-run-emp-list {
  max-height: 220px;
  overflow-y: auto;
}

@media (max-width: 1200px) {
  .book-payroll-run-page .book-payroll-run-kpi {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-payroll-run-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-payroll-run-page .book-payroll-run-kpi {
    grid-template-columns: 1fr;
  }

  .book-payroll-run-header__actions {
    width: 100%;
  }

  .book-payroll-run-header__actions .btn {
    width: 100%;
  }

  .book-payroll-run-detail .book-ast-detail__hero-actions {
    flex-wrap: wrap;
  }

  .book-payroll-run-summary {
    grid-template-columns: 1fr;
  }
}

/* ---- Payroll — Payslips ---- */
.book-payroll-ps-header .book-dash-header__meta {
  margin-top: var(--space-1);
}

.book-payroll-ps-page .book-payroll-ps-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-payroll-ps-page .book-cust-toolbar__right .filter-bar {
  width: 100%;
  justify-content: flex-end;
}

.book-payroll-ps-kpi__money {
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.book-payroll-ps-badge--paid {
  background: #065f46;
  color: #ecfdf5;
}

.book-payroll-ps-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.book-payroll-ps-bulk__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-payroll-ps-check {
  width: 36px;
}

.book-payroll-ps-preview__frame {
  padding: 0;
  overflow: hidden;
}

.book-payroll-ps-preview__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.book-payroll-ps-preview__toolbar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.book-payroll-ps-preview__toolbar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.book-payroll-ps-preview__toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-payroll-ps-preview__stage {
  display: flex;
  justify-content: center;
  padding: var(--space-5) var(--space-4) var(--space-6);
  background: var(--bg-subtle, #f1f5f9);
  border-radius: var(--radius-md);
  min-height: 0;
}

.book-payroll-ps-preview__paper {
  width: 210mm;
  max-width: 100%;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 8px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.book-payroll-ps-preview__iframe {
  display: block;
  width: 100%;
  height: 297mm;
  max-height: 85vh;
  min-height: 720px;
  border: 0;
  background: #fff;
}

@media (max-width: 1200px) {
  .book-payroll-ps-page .book-payroll-ps-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-payroll-ps-page .book-payroll-ps-kpi {
    grid-template-columns: 1fr;
  }

  .book-payroll-ps-bulk {
    flex-direction: column;
    align-items: stretch;
  }

  .book-payroll-ps-bulk__actions .btn {
    width: 100%;
  }

  .book-payroll-ps-preview__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .book-payroll-ps-preview__toolbar-actions {
    width: 100%;
  }

  .book-payroll-ps-preview__toolbar-actions .btn {
    flex: 1;
  }

  .book-payroll-ps-preview__stage {
    padding: var(--space-3);
  }

  .book-payroll-ps-preview__iframe {
    min-height: 560px;
    max-height: none;
    height: 75vh;
  }
}

@media print {
  .book-payroll-ps-preview__toolbar,
  .book-payroll-ps-page > .book-dash-header,
  .book-payroll-ps-page > .book-cust-toolbar,
  .book-payroll-ps-page > .book-payroll-ps-kpi,
  .book-payroll-ps-page > .book-payroll-ps-bulk,
  .book-payroll-ps-page > .card:not(.book-payroll-ps-preview__toolbar),
  .book-payroll-ps-page > button {
    display: none !important;
  }

  .book-payroll-ps-preview__stage {
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .book-payroll-ps-preview__paper {
    transform: none !important;
    zoom: 1 !important;
    box-shadow: none !important;
    width: 210mm !important;
    max-width: none !important;
    border-radius: 0 !important;
  }

  .book-payroll-ps-preview__iframe {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}

/* ── Payroll Reports (Accounting-style) ── */
.book-payroll-rpt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-payroll-rpt-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-payroll-rpt-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-4);
}

.book-payroll-rpt-categories .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-payroll-rpt-dashboard {
  margin-bottom: var(--space-4);
}

.book-payroll-rpt-nav__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.book-payroll-rpt-nav__card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.book-payroll-rpt-nav__card--active {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, var(--surface-card));
  box-shadow: var(--shadow-sm);
}

.book-payroll-rpt-nav__label {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.book-payroll-rpt-nav__desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.book-payroll-rpt-page .book-cust-toolbar__right .filter-bar {
  width: 100%;
  justify-content: flex-end;
}

.book-payroll-rpt-page .book-payroll-rpt-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-payroll-rpt-kpi__money {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.book-payroll-rpt-export__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0 var(--space-4);
}

.book-payroll-rpt-export__opts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: 0 var(--space-4) var(--space-4);
}

@media (max-width: 1100px) {
  .book-payroll-rpt-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-payroll-rpt-page .book-payroll-rpt-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .book-payroll-rpt-nav {
    grid-template-columns: 1fr;
  }

  .book-payroll-rpt-page .book-payroll-rpt-kpi {
    grid-template-columns: 1fr;
  }

  .book-payroll-rpt-header__actions {
    width: 100%;
  }
}

/* ── Leave Reports (Payroll Reports framework) ── */
.book-leave-rpt-page .book-payroll-rpt-nav {
  padding: 0 var(--space-4) var(--space-4);
}

.book-leave-rpt-page .book-cust-toolbar__right .filter-bar {
  width: 100%;
  justify-content: flex-end;
}

.book-leave-rpt-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-leave-rpt-header .book-dash-header__title {
  font-size: var(--text-xl);
}

@media (max-width: 1100px) {
  .book-leave-rpt-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .book-leave-rpt-kpi {
    grid-template-columns: 1fr;
  }
}

/* ── Inventory — Items (Accounting-style) ── */
.book-inv-items-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-items-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-inv-items-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-inv-items-kpi {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.book-inv-items-kpi .book-dash-kpi,
.book-inv-items-kpi .erp-kpi-card,
.book-inv-items-kpi-card {
  min-height: 118px;
  min-width: 0;
  overflow: hidden;
}

.book-inv-items-kpi .book-dash-kpi__label,
.book-inv-items-kpi .erp-kpi-card__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-inv-items-kpi .book-dash-kpi__value,
.book-inv-items-kpi .erp-kpi-card__value {
  font-size: clamp(1rem, 1.2vw, 1.35rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-inv-items-kpi .book-dash-kpi__footer,
.book-inv-items-kpi .erp-kpi-card__footer {
  overflow: hidden;
}

.book-inv-items-kpi .book-dash-kpi__footer span,
.book-inv-items-kpi .erp-kpi-card__meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-kpi-grid--items {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: clamp(0.875rem, 2vw, 1.25rem);
}

@media (max-width: 1023px) {
  .erp-kpi-grid--items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .erp-kpi-grid--items {
    grid-template-columns: 1fr;
  }
}

.book-inv-items-kpi-wrap .erp-kpi-card {
  min-height: 118px;
  overflow: hidden;
}

.book-inv-items-kpi-wrap .erp-kpi-card__label,
.book-inv-items-kpi-wrap .erp-kpi-card__value,
.book-inv-items-kpi-wrap .erp-kpi-card__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-inv-items-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-inv-items-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-inv-items-kpi__money {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.book-inv-items-toolbar .filter-bar,
.book-inv-items-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-inv-items-toolbar .search-bar,
.book-inv-items-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-inv-items-filter-bar .filter-select {
  min-width: 140px;
}

.book-inv-items-filter-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-primary) 25%, var(--border-color));
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-inv-items-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--border-color));
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-inv-items-cat-badge--muted {
  color: var(--text-muted);
  background: var(--page-bg-subtle);
  border-color: var(--border-color);
}

.book-inv-items-code {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.book-inv-items-name {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-inv-items-header {
  overflow: hidden;
}

.book-inv-items-header .book-dash-header__main {
  min-width: 0;
  flex: 1 1 280px;
}

.book-inv-items-header__actions .book-cust-export {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-width: 100%;
}

.book-inv-items-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-inv-items-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-inv-items-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-inv-items-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-inv-items-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-inv-items-table tbody tr:last-child td {
  border-bottom: none;
}

.book-inv-items-table-card .pagination {
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-inv-items-header__actions .btn--primary {
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.book-inv-items-header__actions .btn--ghost:hover {
  background: var(--page-bg-subtle);
  border-color: var(--border-color);
}

.book-inv-items-table .book-ast-actions-col .cell-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}

@media (max-width: 1400px) {
  .book-inv-items-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {
  .book-inv-items-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-inv-items-header__actions {
    width: 100%;
  }

  .book-inv-items-header__actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .book-inv-items-header__actions .btn--primary {
    flex: 1 1 100%;
  }

  .book-inv-items-filter-bar .filter-select,
  .book-inv-items-filter-bar .btn {
    flex: 1 1 calc(50% - var(--space-2));
  }
}

@media (max-width: 640px) {
  .book-inv-items-kpi {
    grid-template-columns: 1fr;
  }
}

/* ── Inventory — Categories (Accounting-style) ── */
.book-inv-cat-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-cat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-inv-cat-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-inv-cat-kpi {
  grid-template-columns: repeat(2, 1fr);
}

.book-inv-cat-table-wrap--hidden {
  display: none;
}

.book-inv-cat-card {
  padding: var(--space-4);
}

.book-inv-cat-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.book-gl-action-bar {
  margin-bottom: var(--space-4);
}

.book-inv-cat-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-inv-cat-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-inv-cat-section__title {
  margin-bottom: var(--space-3);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-inv-cat-section-toolbar .filter-bar,
.book-inv-cat-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-inv-cat-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-inv-cat-filter-bar .filter-select {
  min-width: 140px;
}

.book-inv-cat-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-info);
  background: color-mix(in srgb, var(--color-info) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-info) 18%, var(--border-color));
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-inv-cat-type-badge--muted {
  color: var(--text-muted);
  background: var(--page-bg-subtle);
  border-color: var(--border-color);
}

.book-inv-cat-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-inv-cat-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-inv-cat-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-inv-cat-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-inv-cat-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-inv-cat-table tbody tr:last-child td {
  border-bottom: none;
}

.book-inv-cat-table .book-ast-actions-col .cell-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}

.book-inv-cat-header__actions .btn--primary {
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

@media (max-width: 1100px) {
  .book-inv-cat-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-inv-cat-header__actions {
    width: 100%;
  }

  .book-inv-cat-header__actions .btn {
    flex: 1 1 auto;
  }

  .book-inv-cat-filter-bar .filter-select,
  .book-inv-cat-filter-bar .btn {
    flex: 1 1 calc(50% - var(--space-2));
  }
}

@media (max-width: 640px) {
  .book-inv-cat-kpi {
    grid-template-columns: 1fr;
  }
}

/* ── Inventory — Stock In (Accounting-style) ── */
.book-inv-si-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-si-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-inv-si-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-inv-si-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-inv-si-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-inv-si-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-inv-si-kpi__money {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.book-inv-si-toolbar .filter-bar,
.book-inv-si-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-inv-si-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-inv-si-filter-bar .filter-select {
  min-width: 130px;
}

.book-inv-si-ref-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text-secondary);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-inv-si-ref-badge--muted {
  color: var(--text-muted);
}

.book-inv-si-item-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.book-inv-si-item-name {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-inv-si-item-cat .book-inv-items-cat-badge {
  font-size: 10px;
  padding: 2px 8px;
}

.book-inv-si-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-inv-si-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-inv-si-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-inv-si-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-inv-si-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-inv-si-table tbody tr:last-child td {
  border-bottom: none;
}

.book-inv-si-table-card .pagination {
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-inv-si-table .book-ast-actions-col .cell-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}

.book-inv-si-detail-card {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.book-inv-si-header__actions .btn--primary {
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

@media (max-width: 1400px) {
  .book-inv-si-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {
  .book-inv-si-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-inv-si-header__actions {
    width: 100%;
  }

  .book-inv-si-header__actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .book-inv-si-header__actions .btn--primary {
    flex: 1 1 100%;
  }

  .book-inv-si-filter-bar .filter-select,
  .book-inv-si-filter-bar .btn {
    flex: 1 1 calc(50% - var(--space-2));
  }
}

@media (max-width: 640px) {
  .book-inv-si-kpi {
    grid-template-columns: 1fr;
  }
}

/* ── Inventory — Stock Out (Accounting-style) ── */
.book-inv-so-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-so-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-inv-so-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-inv-so-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-inv-so-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-inv-so-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-inv-so-kpi__money {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.book-inv-so-toolbar .filter-bar,
.book-inv-so-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-inv-so-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-inv-so-filter-bar .filter-select {
  min-width: 130px;
}

.book-inv-so-ref-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text-secondary);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-inv-so-ref-badge--muted {
  color: var(--text-muted);
}

.book-inv-so-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-inv-so-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-inv-so-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-inv-so-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-inv-so-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-inv-so-table tbody tr:last-child td {
  border-bottom: none;
}

.book-inv-so-table-card .pagination {
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-inv-so-table .book-ast-actions-col .cell-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}

.book-inv-so-detail-card {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.book-inv-so-header__actions .btn--primary {
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

@media (max-width: 1400px) {
  .book-inv-so-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {
  .book-inv-so-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-inv-so-header__actions {
    width: 100%;
  }

  .book-inv-so-header__actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .book-inv-so-header__actions .btn--primary {
    flex: 1 1 100%;
  }

  .book-inv-so-filter-bar .filter-select,
  .book-inv-so-filter-bar .btn {
    flex: 1 1 calc(50% - var(--space-2));
  }
}

@media (max-width: 640px) {
  .book-inv-so-kpi {
    grid-template-columns: 1fr;
  }
}

/* ── Inventory — Item Assignments (Accounting-style) ── */
.book-inv-asn-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-asn-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-inv-asn-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-inv-asn-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

.book-inv-asn-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-inv-asn-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-inv-asn-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-inv-asn-toolbar .filter-bar,
.book-inv-asn-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-inv-asn-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-inv-asn-filter-bar .filter-select {
  min-width: 130px;
}

.book-inv-asn-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-inv-asn-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-inv-asn-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-inv-asn-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-inv-asn-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-inv-asn-table tbody tr:last-child td {
  border-bottom: none;
}

.book-inv-asn-table-card .pagination {
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-inv-asn-table .book-ast-actions-col .cell-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.book-inv-asn-item-cell .book-inv-items-name {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-inv-asn-detail-card {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.book-inv-asn-header__actions .btn--primary {
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

@media (max-width: 1400px) {
  .book-inv-asn-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {
  .book-inv-asn-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-inv-asn-header__actions {
    width: 100%;
  }

  .book-inv-asn-header__actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .book-inv-asn-header__actions .btn--primary {
    flex: 1 1 100%;
  }

  .book-inv-asn-filter-bar .filter-select,
  .book-inv-asn-filter-bar .btn {
    flex: 1 1 calc(50% - var(--space-2));
  }
}

@media (max-width: 640px) {
  .book-inv-asn-kpi {
    grid-template-columns: 1fr;
  }
}

/* ── Inventory — Locations (Accounting-style) ── */
.book-inv-loc-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-loc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-inv-loc-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-inv-loc-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-inv-loc-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-inv-loc-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-inv-loc-kpi__money {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.book-inv-loc-toolbar .filter-bar,
.book-inv-loc-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-inv-loc-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-inv-loc-filter-bar .filter-select {
  min-width: 140px;
}

.book-inv-loc-name {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-inv-loc-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-inv-loc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-inv-loc-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-inv-loc-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-inv-loc-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-inv-loc-table tbody tr:last-child td {
  border-bottom: none;
}

.book-inv-loc-table-card .pagination {
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-inv-loc-table .book-ast-actions-col .cell-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}

.book-inv-loc-detail-card {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.book-inv-loc-header__actions .btn--primary {
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

@media (max-width: 1400px) {
  .book-inv-loc-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {
  .book-inv-loc-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-inv-loc-header__actions {
    width: 100%;
  }

  .book-inv-loc-header__actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .book-inv-loc-header__actions .btn--primary {
    flex: 1 1 100%;
  }

  .book-inv-loc-filter-bar .filter-select,
  .book-inv-loc-filter-bar .btn {
    flex: 1 1 calc(50% - var(--space-2));
  }
}

@media (max-width: 640px) {
  .book-inv-loc-kpi {
    grid-template-columns: 1fr;
  }
}

/* ── Inventory — Reports (Accounting-style) ── */
.book-inv-rpt-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-inv-rpt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-inv-rpt-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-inv-rpt-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-inv-rpt-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-inv-rpt-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-inv-rpt-kpi__money {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.book-inv-rpt-categories .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-inv-rpt-page .book-inv-rpt-nav {
  padding: 0 var(--space-4) var(--space-4);
}

.book-inv-rpt-toolbar .filter-bar,
.book-inv-rpt-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-inv-rpt-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-inv-rpt-filter-bar .filter-select {
  min-width: 130px;
}

.book-inv-rpt-loc-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-info);
  background: color-mix(in srgb, var(--color-info) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-info) 18%, var(--border-color));
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-inv-rpt-loc-badge--muted {
  color: var(--text-muted);
  background: var(--page-bg-subtle);
  border-color: var(--border-color);
}

.book-inv-rpt-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-inv-rpt-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-inv-rpt-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-inv-rpt-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-inv-rpt-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-inv-rpt-table tbody tr:last-child td {
  border-bottom: none;
}

.book-inv-rpt-table-card .pagination {
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-inv-rpt-total-footer {
  padding: var(--space-4);
  text-align: right;
  font-size: var(--font-size-md);
  border-top: 1px solid var(--border-color);
  background: var(--page-bg-subtle);
}

.book-inv-rpt-detail-card {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

@media (max-width: 1400px) {
  .book-inv-rpt-kpi {
    grid-template-columns: repeat(3, 1fr);
  }

  .book-inv-rpt-page .book-payroll-rpt-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .book-inv-rpt-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-inv-rpt-header__actions {
    width: 100%;
  }

  .book-inv-rpt-filter-bar .filter-select,
  .book-inv-rpt-filter-bar .btn {
    flex: 1 1 calc(50% - var(--space-2));
  }
}

@media (max-width: 640px) {
  .book-inv-rpt-kpi {
    grid-template-columns: 1fr;
  }

  .book-inv-rpt-page .book-payroll-rpt-nav {
    grid-template-columns: 1fr;
  }
}

/* ── Intelligence — Financial Reports (Accounting-style) ── */
.book-fin-rpt-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-fin-rpt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-fin-rpt-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-fin-rpt-header__actions .btn {
  border-radius: var(--radius-md);
  min-height: 34px;
}

.book-fin-rpt-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-fin-rpt-kpi--6 {
  grid-template-columns: repeat(6, 1fr);
}

.book-fin-rpt-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
}

.book-fin-rpt-view-header__title {
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.book-fin-rpt-view-header__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.book-fin-rpt-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0;
}

.book-fin-rpt-meta dt {
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  margin: 0;
}

.book-fin-rpt-meta dd {
  margin: 0 0 var(--space-2);
}

.book-fin-rpt-tabs {
  margin-top: var(--space-3);
}

.book-mgmt-rpt-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-mgmt-rpt-group__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.book-mgmt-rpt-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}

.book-mgmt-rpt-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  min-height: 140px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.book-mgmt-rpt-card:hover {
  box-shadow: var(--shadow-md);
}

.book-mgmt-rpt-card--active {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--border-color));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.book-mgmt-rpt-card__title {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-mgmt-rpt-card__desc {
  margin: var(--space-1) 0 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

.book-fin-rpt-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-fin-rpt-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-fin-rpt-kpi__money {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.book-fin-rpt-kpi__value--pos,
.book-fin-rpt-amount--pos {
  color: var(--color-success);
}

.book-fin-rpt-kpi__value--neg,
.book-fin-rpt-amount--neg {
  color: var(--color-danger);
}

.book-fin-rpt-kpi--inline {
  grid-template-columns: repeat(3, 1fr);
}

.book-fin-rpt-categories .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-fin-rpt-page .book-fin-rpt-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 var(--space-4) var(--space-4);
}

.book-fin-rpt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4);
}

.book-fin-rpt-period {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--page-bg-subtle);
  box-shadow: var(--shadow-xs);
}

.book-fin-rpt-period-btn {
  border: none;
  border-right: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  transition: background 0.15s, color 0.15s;
}

.book-fin-rpt-period-btn:last-child {
  border-right: none;
}

.book-fin-rpt-period-btn:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, var(--card-bg));
  color: var(--color-primary);
}

.book-fin-rpt-period-btn.active {
  background: color-mix(in srgb, var(--color-primary) 12%, var(--card-bg));
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

.book-fin-rpt-date-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-fin-rpt-date-input {
  min-width: 150px;
  border-radius: var(--radius-md);
}

.book-fin-rpt-date-sep {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.book-fin-rpt-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-fin-rpt-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-4);
  align-items: start;
}

.book-fin-rpt-summary-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-fin-rpt-summary-card .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-fin-rpt-summary-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.book-fin-rpt-summary-table {
  width: 100%;
  border-collapse: collapse;
}

.book-fin-rpt-summary-table td {
  padding: var(--space-2) 0;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--border-color);
}

.book-fin-rpt-summary-table tr:last-child td {
  border-bottom: none;
}

.book-fin-rpt-summary-label {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-fin-rpt-summary-sub {
  padding-left: var(--space-4) !important;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}

.book-fin-rpt-summary-divider td {
  border-top: 2px solid var(--border-color);
  padding-top: var(--space-3);
}

.book-fin-rpt-summary-total td {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  border-top: 2px solid var(--border-color);
  padding-top: var(--space-3);
}

.book-fin-rpt-metrics {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.book-fin-rpt-metric-card {
  padding: clamp(0.75rem, 2.5cqi + 0.4rem, var(--space-4));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  min-width: 0;
  overflow: hidden;
}

.book-fin-rpt-metric-label {
  font-size: clamp(0.625rem, 2cqi + 0.35rem, var(--font-size-xs));
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: clamp(0.25rem, 1cqi + 0.15rem, var(--space-2));
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-fin-rpt-metric-value {
  font-size: clamp(0.875rem, 4cqi + 0.45rem, 1.5rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.book-fin-rpt-chart-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-fin-rpt-chart-card .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-fin-rpt-chart-body {
  position: relative;
  min-height: 280px;
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.book-fin-rpt-chart-body canvas {
  width: 100% !important;
  max-height: 320px;
}

.book-fin-rpt-chart-body--donut {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-fin-rpt-chart-body--donut canvas {
  max-height: 280px;
  max-width: 280px;
}

.book-fin-rpt-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-fin-rpt-table-card .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-fin-rpt-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-fin-rpt-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-fin-rpt-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-fin-rpt-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-fin-rpt-table tbody tr:last-child td {
  border-bottom: none;
}

.book-fin-rpt-table-total td {
  font-weight: var(--font-weight-bold);
  background: var(--page-bg-subtle);
  border-top: 2px solid var(--border-color);
}

.book-fin-rpt-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--border-color));
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-fin-rpt-progress {
  height: 6px;
  background: var(--page-bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-1);
  min-width: 80px;
}

.book-fin-rpt-progress__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  min-width: 2px;
}

.book-fin-rpt-progress__fill--ok {
  background: var(--color-success);
}

.book-fin-rpt-progress__fill--warn {
  background: var(--color-warning);
}

.book-fin-rpt-progress__fill--danger {
  background: var(--color-danger);
}

.book-fin-rpt-empty {
  padding: var(--space-6);
  text-align: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-fin-rpt-banner {
  border-radius: var(--radius-md);
}

@media (max-width: 1400px) {
  .book-fin-rpt-kpi,
  .book-fin-rpt-kpi--6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .book-fin-rpt-page .book-fin-rpt-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .book-fin-rpt-kpi,
  .book-fin-rpt-kpi--6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-fin-rpt-grid-2 {
    grid-template-columns: 1fr;
  }

  .book-fin-rpt-kpi--inline {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-fin-rpt-header__actions {
    width: 100%;
  }

  .book-fin-rpt-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .book-fin-rpt-period {
    width: 100%;
  }

  .book-fin-rpt-period-btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .book-fin-rpt-date-filter {
    width: 100%;
  }

  .book-fin-rpt-date-input {
    flex: 1 1 calc(50% - var(--space-2));
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .book-fin-rpt-kpi,
  .book-fin-rpt-kpi--inline,
  .book-fin-rpt-kpi--6 {
    grid-template-columns: 1fr;
  }

  .book-mgmt-rpt-cards {
    grid-template-columns: 1fr;
  }

  .book-fin-rpt-view-header {
    flex-direction: column;
  }

  .book-fin-rpt-page .book-fin-rpt-nav {
    grid-template-columns: 1fr;
  }

  .book-fin-rpt-chart-body {
    min-height: 220px;
  }
}

/* ── Intelligence — Tax Center (Accounting-style) ── */
.book-tax-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-tax-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-tax-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-tax-header__actions .btn {
  border-radius: var(--radius-md);
  min-height: 34px;
}

.book-tax-banner.settings-banner--info {
  background: color-mix(in srgb, var(--info, #3b82f6) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--info, #3b82f6) 25%, transparent);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.book-tax-banner svg {
  flex-shrink: 0;
  color: var(--color-info);
  margin-top: 2px;
}

.book-tax-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-tax-kpi--5 {
  grid-template-columns: repeat(5, 1fr);
}

.book-tax-type-summary__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-tax-type-card {
  padding: var(--space-4);
}

.book-tax-type-card__title {
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-3);
  font-size: var(--font-size-md);
}

.book-tax-type-card__rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.book-tax-type-card__rows > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
}

.book-tax-type-card__rows span {
  color: var(--text-muted);
}

.book-tax-report-cards .book-mgmt-rpt-cards {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.book-tax-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-tax-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-tax-kpi__money {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.book-tax-kpi__meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.book-tax-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4);
}

.book-tax-toolbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.book-tax-toolbar__label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  white-space: nowrap;
}

.book-tax-year-select {
  min-width: 110px;
  border-radius: var(--radius-md);
}

.book-tax-period {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--page-bg-subtle);
  box-shadow: var(--shadow-xs);
}

.book-tax-period-btn {
  border: none;
  border-right: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  transition: background 0.15s, color 0.15s;
}

.book-tax-period-btn:last-child {
  border-right: none;
}

.book-tax-period-btn:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, var(--card-bg));
  color: var(--color-primary);
}

.book-tax-period-btn.active {
  background: color-mix(in srgb, var(--color-primary) 12%, var(--card-bg));
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
}

.book-tax-date-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-tax-date-input {
  min-width: 150px;
  border-radius: var(--radius-md);
}

.book-tax-date-sep {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.book-tax-analytics__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-4);
}

.book-tax-analytics .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-tax-analytics__card {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-tax-analytics__label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-tax-analytics__value {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-tax-categories .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-tax-page .book-tax-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 var(--space-4) var(--space-4);
}

.book-tax-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-tax-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-tax-table-card .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-tax-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-tax-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-tax-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-tax-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-tax-table tbody tr:last-child td {
  border-bottom: none;
}

.book-tax-amount--pos {
  color: var(--color-success);
}

.book-tax-amount--neg {
  color: var(--color-danger);
}

.book-tax-amount--warn {
  color: var(--color-warning);
}

.book-tax-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--border-color));
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-tax-progress {
  height: 6px;
  background: var(--page-bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-1);
  min-width: 80px;
}

.book-tax-progress__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  min-width: 2px;
}

.book-tax-deductible-card {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-tax-deductible-card .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-tax-deductible-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  padding: var(--space-4);
}

.book-tax-deductible-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-tax-deductible-value {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-tax-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.book-tax-detail-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-tax-detail-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-tax-detail-value {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

@media (max-width: 1200px) {
  .book-tax-kpi,
  .book-tax-kpi--5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-tax-type-summary__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-tax-analytics__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-tax-page .book-tax-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-tax-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-tax-header__actions {
    width: 100%;
  }

  .book-tax-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .book-tax-period {
    width: 100%;
  }

  .book-tax-period-btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .book-tax-date-filter {
    width: 100%;
  }

  .book-tax-date-input {
    flex: 1 1 calc(50% - var(--space-2));
    min-width: 0;
  }

  .book-tax-deductible-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .book-tax-kpi,
  .book-tax-kpi--5,
  .book-tax-analytics__grid,
  .book-tax-detail-grid,
  .book-tax-type-summary__grid {
    grid-template-columns: 1fr;
  }

  .book-tax-page .book-tax-nav {
    grid-template-columns: 1fr;
  }
}

/* ── Administration — Users (Accounting-style) ── */
.book-user-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-user-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-user-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-user-header__actions .btn {
  border-radius: var(--radius-md);
  min-height: 34px;
}

.book-user-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-user-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-user-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-user-toolbar .filter-bar,
.book-user-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-user-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-user-filter-bar .filter-select {
  min-width: 130px;
}

.book-user-filter-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--border-color));
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-user-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-user-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-user-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-user-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-user-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-user-table tbody tr:last-child td {
  border-bottom: none;
}

.book-user-table-card .pagination {
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-user-table .book-ast-actions-col .cell-actions {
  justify-content: flex-end;
}

.book-user-email {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.book-user-login {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  white-space: nowrap;
}

.book-user-emp-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-user-position {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.book-user-position-sub {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.book-user-menu-btn {
  min-width: 34px;
  font-size: 1.1rem;
  line-height: 1;
  letter-spacing: 1px;
}

.book-user-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-user-role-badge--admin {
  color: var(--color-info-text);
  background: var(--color-info-light);
}

.book-user-role-badge--accountant {
  color: var(--color-success-text);
  background: var(--color-success-light);
}

.book-user-role-badge--hr {
  color: #6d28d9;
  background: color-mix(in srgb, #8b5cf6 14%, var(--card-bg));
  border: 1px solid color-mix(in srgb, #8b5cf6 22%, var(--border-color));
}

.book-user-role-badge--employee,
.book-user-role-badge--default {
  color: var(--text-secondary);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
}

.book-user-role-badge--finance,
.book-user-role-badge--sales {
  color: var(--color-info-text);
  background: var(--color-info-light);
}

.book-user-role-badge--payroll,
.book-user-role-badge--inventory,
.book-user-role-badge--assets,
.book-user-role-badge--dept {
  color: #0f766e;
  background: color-mix(in srgb, #14b8a6 14%, var(--card-bg));
  border: 1px solid color-mix(in srgb, #14b8a6 22%, var(--border-color));
}

.book-user-role-badge--audit {
  color: #92400e;
  background: color-mix(in srgb, #f59e0b 16%, var(--card-bg));
  border: 1px solid color-mix(in srgb, #f59e0b 24%, var(--border-color));
}

.book-user-info-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.book-user-info-banner svg {
  flex-shrink: 0;
  color: var(--color-info);
  margin-top: 2px;
}

.book-user-info-banner__title {
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-1);
}

.book-user-info-banner__text {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.book-user-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-user-detail-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-user-detail-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-user-detail-value {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.book-user-form-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.book-user-form-card .form-section-title {
  margin-bottom: var(--space-3);
}

.book-user-form-note {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

@media (max-width: 1400px) {
  .book-user-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {
  .book-user-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-user-header__actions {
    width: 100%;
  }

  .book-user-filter-bar .filter-select,
  .book-user-filter-bar .btn {
    flex: 1 1 calc(50% - var(--space-2));
  }

  .book-user-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .book-user-kpi {
    grid-template-columns: 1fr;
  }
}

/* ── Administration — Roles (Accounting-style) ── */
.book-role-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-role-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-role-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-role-header__actions .btn {
  border-radius: var(--radius-md);
  min-height: 34px;
}

.book-role-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-role-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-role-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-role-toolbar .filter-bar,
.book-role-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-role-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-role-filter-bar .filter-select {
  min-width: 130px;
}

.book-role-filter-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--border-color));
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-role-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-role-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-role-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-role-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-role-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-role-table tbody tr:last-child td {
  border-bottom: none;
}

.book-role-table-card .pagination {
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-role-name-cell {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.book-role-name {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-role-type-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--color-info-text);
  background: var(--color-info-light);
  border-radius: var(--radius-full);
}

.book-role-type-badge--custom {
  color: var(--text-secondary);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
}

.book-role-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  max-width: 360px;
}

.book-role-access-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-role-access-badge--full {
  color: var(--color-danger-text);
  background: var(--color-danger-light);
}

.book-role-access-badge--mgmt {
  color: var(--color-info-text);
  background: var(--color-info-light);
}

.book-role-access-badge--dept {
  color: #6d28d9;
  background: color-mix(in srgb, #8b5cf6 14%, var(--card-bg));
  border: 1px solid color-mix(in srgb, #8b5cf6 22%, var(--border-color));
}

.book-role-access-badge--employee,
.book-role-access-badge--custom {
  color: var(--text-secondary);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
}

.book-role-access-badge--audit {
  color: #92400e;
  background: color-mix(in srgb, #f59e0b 16%, var(--card-bg));
  border: 1px solid color-mix(in srgb, #f59e0b 24%, var(--border-color));
}

.book-role-menu-btn {
  min-width: 34px;
  font-size: 1.1rem;
  line-height: 1;
  letter-spacing: 1px;
}

.book-role-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-role-detail-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-role-detail-card--wide {
  grid-column: 1 / -1;
}

.book-role-detail-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-role-detail-value {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.book-role-detail-value--text {
  font-weight: var(--font-weight-normal);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.book-role-perm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  max-height: 320px;
  overflow-y: auto;
  padding-right: var(--space-1);
}

.book-role-perm-card {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.book-role-perm-card__title {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  text-transform: capitalize;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.book-role-perm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.book-role-perm-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.book-role-perm-item svg {
  flex-shrink: 0;
  color: var(--color-success);
}

.book-role-form-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.book-role-form-card .form-section-title {
  margin-bottom: var(--space-3);
}

@media (max-width: 1400px) {
  .book-role-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {
  .book-role-kpi {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-role-perm-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .book-role-header__actions {
    width: 100%;
  }

  .book-role-filter-bar .filter-select,
  .book-role-filter-bar .btn {
    flex: 1 1 calc(50% - var(--space-2));
  }

  .book-role-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .book-role-kpi {
    grid-template-columns: 1fr;
  }
}

/* ── Administration — Permissions (Accounting-style) ── */
.book-perm-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: 88px;
}

.book-perm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-perm-header__actions .btn {
  border-radius: var(--radius-md);
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.book-perm-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-perm-kpi__value {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.book-perm-role-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-perm-role-card__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: var(--space-4);
  align-items: end;
}

.book-perm-role-card__label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.book-perm-role-card__name {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.book-perm-role-card__desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.book-perm-role-select {
  border-radius: var(--radius-md);
  min-width: 220px;
}

.book-perm-toolbar .filter-bar,
.book-perm-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-perm-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-perm-filter-bar .filter-select {
  min-width: 140px;
}

.book-perm-groups-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-perm-group-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-perm-group-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.book-perm-group-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-perm-group-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--border-color));
  border-radius: var(--radius-full);
}

.book-perm-group-card__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.book-perm-toggle-card {
  position: relative;
  display: block;
  cursor: pointer;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.book-perm-toggle-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--border-color));
  box-shadow: var(--shadow-sm);
}

.book-perm-toggle-card--on {
  border-color: color-mix(in srgb, var(--color-success) 35%, var(--border-color));
  background: color-mix(in srgb, var(--color-success) 4%, var(--card-bg));
}

.book-perm-toggle-card--off {
  opacity: 0.92;
}

.book-perm-toggle-card:has(.perm-cb:disabled) {
  cursor: not-allowed;
  opacity: 0.78;
}

.book-perm-toggle-card:has(.perm-cb:disabled):hover {
  border-color: var(--border-color);
  box-shadow: none;
}

.book-perm-toggle-card__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.book-perm-toggle-card__body {
  padding: var(--space-3) var(--space-4);
  padding-right: 56px;
  min-height: 96px;
}

.book-perm-toggle-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.book-perm-toggle-card__module {
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--text-muted);
}

.book-perm-toggle-card__status {
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.35px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.book-perm-toggle-card__status--on {
  color: var(--color-success-text);
  background: var(--color-success-light);
}

.book-perm-toggle-card__status--off {
  color: var(--text-secondary);
  background: var(--page-bg-subtle);
}

.book-perm-toggle-card__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.book-perm-toggle-card__desc {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.book-perm-toggle-card__switch {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  transition: background 0.2s;
}

.book-perm-toggle-card--on .book-perm-toggle-card__switch {
  background: var(--color-success);
}

.book-perm-toggle-card__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s;
}

.book-perm-toggle-card--on .book-perm-toggle-card__knob {
  transform: translateX(18px);
}

.book-perm-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--card-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.book-perm-save-bar__hint {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.book-perm-save-bar__hint--dirty {
  color: var(--color-warning);
  font-weight: var(--font-weight-semibold);
}

.book-perm-empty {
  padding: var(--space-6);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

@media (max-width: 1200px) {
  .book-perm-group-card__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .book-perm-kpi {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-perm-role-card__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .book-perm-kpi,
  .book-perm-group-card__grid {
    grid-template-columns: 1fr;
  }

  .book-perm-save-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .book-perm-header__actions {
    width: 100%;
  }
}

/* ── Administration — Audit Logs (Accounting-style) ── */
.book-audit-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-audit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-audit-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-audit-header__actions .btn {
  border-radius: var(--radius-md);
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.book-audit-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-audit-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-audit-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-audit-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-4);
}

.book-audit-toolbar .filter-bar,
.book-audit-filter-bar {
  width: 100%;
  margin: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-audit-filter-bar .search-wrapper {
  flex: 1 1 220px;
  min-width: 220px;
}

.book-audit-filter-bar .filter-select,
.book-audit-date-input {
  min-width: 130px;
  border-radius: var(--radius-md);
}

.book-audit-date-sep {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.book-audit-filter-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--border-color));
  border-radius: var(--radius-full);
}

.book-audit-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.book-audit-view-toggle .btn {
  border-radius: 0;
  border: none;
}

.book-audit-view-toggle .btn.active {
  background: color-mix(in srgb, var(--color-primary) 12%, var(--card-bg));
  color: var(--color-primary);
}

.book-audit-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-audit-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-audit-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  white-space: nowrap;
}

.book-audit-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-audit-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-audit-table tbody tr:last-child td {
  border-bottom: none;
}

.book-audit-table-card .pagination {
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.book-audit-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.book-audit-date__primary {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.book-audit-date__secondary {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.book-audit-desc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 320px;
}

.book-audit-desc__primary {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.book-audit-desc__secondary {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.book-audit-ref {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.book-audit-mod-badge,
.book-audit-act-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-audit-mod-badge--auth {
  color: var(--color-info-text);
  background: var(--color-info-light);
}

.book-audit-mod-badge--banking {
  color: var(--color-success-text);
  background: var(--color-success-light);
}

.book-audit-mod-badge--settings {
  color: #6d28d9;
  background: color-mix(in srgb, #8b5cf6 14%, var(--card-bg));
  border: 1px solid color-mix(in srgb, #8b5cf6 22%, var(--border-color));
}

.book-audit-mod-badge--users,
.book-audit-mod-badge--default {
  color: var(--text-secondary);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
}

.book-audit-mod-badge--journal {
  color: var(--color-warning-text);
  background: var(--color-warning-light);
}

.book-audit-act-badge--login {
  color: var(--color-success-text);
  background: var(--color-success-light);
}

.book-audit-act-badge--logout,
.book-audit-act-badge--default {
  color: var(--text-secondary);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
}

.book-audit-act-badge--create {
  color: var(--color-info-text);
  background: var(--color-info-light);
}

.book-audit-act-badge--edit {
  color: var(--color-warning-text);
  background: var(--color-warning-light);
}

.book-audit-act-badge--delete {
  color: var(--color-danger-text);
  background: var(--color-danger-light);
}

.book-audit-act-badge--approve {
  color: #6d28d9;
  background: color-mix(in srgb, #8b5cf6 14%, var(--card-bg));
  border: 1px solid color-mix(in srgb, #8b5cf6 22%, var(--border-color));
}

.book-audit-menu-btn {
  min-width: 34px;
  font-size: 1.1rem;
  line-height: 1;
  letter-spacing: 1px;
}

.book-audit-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-audit-detail-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-audit-detail-card--wide {
  grid-column: 1 / -1;
}

.book-audit-detail-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-audit-detail-value {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.book-audit-detail-value--text {
  font-weight: var(--font-weight-normal);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.book-audit-timeline-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: none;
  border: none;
  background: transparent;
}

.book-audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: var(--space-2);
}

.book-audit-timeline-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  position: relative;
}

.book-audit-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.book-audit-timeline-item__dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--border-color);
  border: 2px solid var(--card-bg);
  box-shadow: 0 0 0 1px var(--border-color);
}

.book-audit-timeline-item--active .book-audit-timeline-item__dot {
  background: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.book-audit-timeline-item__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.book-audit-timeline-item__desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.book-audit-timeline-item__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.book-audit-timeline-item__time .book-audit-date {
  flex-direction: row;
  gap: var(--space-2);
  align-items: center;
}

.book-audit-empty {
  padding: var(--space-6);
  border-radius: var(--radius-md);
}

@media (max-width: 1400px) {
  .book-audit-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {
  .book-audit-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-audit-header__actions {
    width: 100%;
  }

  .book-audit-toolbar {
    flex-direction: column;
  }

  .book-audit-filter-bar .filter-select,
  .book-audit-filter-bar .btn,
  .book-audit-date-input {
    flex: 1 1 calc(50% - var(--space-2));
    min-width: 0;
  }

  .book-audit-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .book-audit-kpi {
    grid-template-columns: 1fr;
  }
}

/* ── Administration — Demo Data (Accounting-style) ── */
.book-demo-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-demo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-demo-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.book-demo-header__actions .btn {
  border-radius: var(--radius-md);
  min-height: 34px;
}

.book-demo-status-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-demo-status-card__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.book-demo-status-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-primary) 12%, var(--card-bg));
  color: var(--color-primary);
  flex-shrink: 0;
}

.book-demo-status-card__main {
  flex: 1;
  min-width: 200px;
}

.book-demo-status-card__sub {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: var(--space-1) 0 0;
}

.book-demo-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.book-demo-status-item--wide {
  grid-column: 1 / -1;
}

.book-demo-status-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.book-demo-status-value {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.book-demo-status-value--highlight {
  color: var(--color-primary);
}

.book-demo-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-demo-kpi .book-dash-kpi {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-demo-kpi .book-dash-kpi:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.book-demo-actions__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.book-demo-action-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: 3px solid var(--border-color);
}

.book-demo-action-card--primary {
  border-top-color: var(--color-success);
}

.book-demo-action-card--warning {
  border-top-color: var(--color-warning);
}

.book-demo-action-card--danger {
  border-top-color: var(--color-danger);
}

.book-demo-action-card__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.book-demo-action-card__desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
}

.book-demo-action-card__note {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin: 0;
}

.book-demo-analytics-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: var(--space-4);
  align-items: start;
}

.book-demo-table-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-demo-table-card .form-section-title {
  padding: var(--space-4) var(--space-4) 0;
}

.book-demo-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-demo-table thead th {
  background: var(--page-bg-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
}

.book-demo-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-demo-table tbody tr.book-ast-row:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
}

.book-demo-store {
  font-size: var(--font-size-sm);
}

.book-demo-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.book-demo-cat-badge--hr {
  color: var(--color-info-text);
  background: var(--color-info-light);
}

.book-demo-cat-badge--inv {
  color: var(--color-success-text);
  background: var(--color-success-light);
}

.book-demo-cat-badge--acct {
  color: #6d28d9;
  background: color-mix(in srgb, #8b5cf6 14%, var(--card-bg));
  border: 1px solid color-mix(in srgb, #8b5cf6 22%, var(--border-color));
}

.book-demo-cat-badge--assets {
  color: var(--color-warning-text);
  background: var(--color-warning-light);
}

.book-demo-cat-badge--system {
  color: var(--text-secondary);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
}

.book-demo-sources-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-demo-sources-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.book-demo-source-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 1fr minmax(40px, auto);
  gap: var(--space-2);
  align-items: center;
  font-size: var(--font-size-sm);
}

.book-demo-source-row__label {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-demo-source-row__bar-wrap {
  height: 8px;
  background: var(--page-bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.book-demo-source-row__bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  min-width: 2px;
}

.book-demo-source-row__value {
  font-weight: var(--font-weight-bold);
  text-align: right;
}

.book-demo-included__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.book-demo-included-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-demo-included-card__title {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.book-demo-included-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.book-demo-included-card__list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.book-demo-included-card__list svg {
  flex-shrink: 0;
  color: var(--color-success);
}

.book-demo-login-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.book-demo-login-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.book-demo-login-item {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--page-bg-subtle);
}

.book-demo-login-role {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.book-demo-login-user {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.book-demo-login-warning {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.book-demo-empty {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

@media (max-width: 1200px) {
  .book-demo-kpi {
    grid-template-columns: repeat(3, 1fr);
  }

  .book-demo-analytics-grid {
    grid-template-columns: 1fr;
  }

  .book-demo-included__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .book-demo-actions__grid,
  .book-demo-status-grid {
    grid-template-columns: 1fr;
  }

  .book-demo-kpi {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-demo-login-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .book-demo-header__actions {
    width: 100%;
  }

  .book-demo-header__actions .btn {
    flex: 1 1 100%;
  }

  .book-demo-kpi,
  .book-demo-included__grid,
  .book-demo-login-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Employee Import / Export ── */
.book-ast-action-bar.card {
  overflow: visible;
}

.book-emp-export-wrap {
  position: relative;
  display: inline-flex;
}

.book-emp-export-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1000;
  min-width: 200px;
  padding: var(--space-1);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.book-emp-export-panel--fixed {
  position: fixed;
}

.book-emp-export-panel[hidden] {
  display: none !important;
}

.book-emp-export-item {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  text-align: left;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.book-emp-export-item:hover {
  background: var(--bg-subtle);
}

.book-emp-import-desc {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.book-emp-import-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-color);
}

.book-emp-import-step {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.book-emp-import-step--active {
  color: var(--text-primary);
}

.book-emp-import-step--current .book-emp-import-step__num {
  background: var(--color-primary);
  color: #fff;
}

.book-emp-import-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-subtle);
  font-size: 0.65rem;
  font-weight: 700;
}

.book-emp-import-section {
  margin-bottom: var(--space-4);
}

.book-emp-import-section__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.book-emp-import-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  background: var(--bg-subtle);
  transition: border-color 0.15s, background 0.15s;
}

.book-emp-import-dropzone--active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.book-emp-import-dropzone__icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.book-emp-import-dropzone__title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.book-emp-import-dropzone__or {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin: var(--space-2) 0;
}

.book-emp-import-dropzone__hint {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  margin-top: var(--space-2);
}

.book-emp-import-fileinfo {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  display: grid;
  gap: var(--space-1);
}

.book-emp-import-summary {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.book-emp-import-summary__item {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.book-emp-import-summary__item--valid { color: #059669; background: #ecfdf5; }
.book-emp-import-summary__item--warn { color: #d97706; background: #fffbeb; }
.book-emp-import-summary__item--error { color: #dc2626; background: #fef2f2; }

.book-emp-import-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.book-emp-import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-xs);
}

.book-emp-import-table th,
.book-emp-import-table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

.book-emp-import-table th {
  background: var(--bg-subtle);
  font-weight: var(--font-weight-bold);
  position: sticky;
  top: 0;
}

.book-emp-import-badge {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.book-emp-import-msg {
  font-size: 0.65rem;
  margin-top: 2px;
  line-height: 1.3;
}

.book-emp-import-msg--error { color: #dc2626; }
.book-emp-import-msg--warn { color: #d97706; }

.book-emp-import-note {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.book-emp-import-progress {
  padding: var(--space-6) var(--space-4);
  text-align: center;
}

.book-emp-import-progress__label {
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-3);
}

.book-emp-import-progress__bar {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.book-emp-import-progress__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.book-emp-import-results__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

.book-emp-import-results__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-emp-import-results__stat {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-color);
}

.book-emp-import-results__stat span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.book-emp-import-results__stat strong {
  font-size: var(--font-size-xl);
}

.book-emp-import-results__stat--success strong { color: #059669; }
.book-emp-import-results__stat--skip strong { color: #d97706; }
.book-emp-import-results__stat--fail strong { color: #dc2626; }

.book-emp-import-dup-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

@media (max-width: 640px) {
  .book-emp-import-results__stats {
    grid-template-columns: 1fr;
  }
  .book-emp-import-step__label {
    display: none;
  }
}

/* ---- Employee self-service dashboard ---- */
.book-emp-portal .book-emp-dash-profile {
  overflow: hidden;
}

.book-emp-dash-profile__grid {
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 280px);
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
}

.book-emp-dash-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.book-emp-dash-profile__greeting {
  margin: 0 0 4px;
}

.book-emp-dash-profile__name {
  margin: 0 0 4px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.book-emp-dash-profile__id {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.book-emp-dash-profile__role {
  color: var(--text-muted);
}

.book-emp-dash-profile__sep {
  margin: 0 6px;
}

.book-emp-dash-profile__meta {
  display: grid;
  gap: 8px;
}

.book-emp-dash-profile__meta-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}

.book-emp-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-3);
}

.book-emp-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.book-emp-quick-action:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.book-emp-quick-action__icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.book-emp-quick-action__icon svg {
  width: 100%;
  height: 100%;
}

.book-emp-quick-action__label {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.book-emp-dash-summary__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  font-size: 0.85rem;
}

.book-emp-dash-summary__grid strong {
  display: block;
  font-size: 1.1rem;
}

.book-emp-leave-balance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.book-emp-leave-balance-card {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-muted, #f8fafc);
}

.book-emp-leave-balance-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.book-emp-leave-balance-card__value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.book-emp-holiday-list,
.book-emp-announcement-list {
  display: grid;
  gap: var(--space-3);
}

.book-emp-holiday-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-color);
}

.book-emp-holiday-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.book-emp-holiday-row__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-emp-holiday-row__days {
  color: var(--primary);
  white-space: nowrap;
}

.book-emp-announcement {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.book-emp-announcement--high {
  border-left: 3px solid var(--warning, #f59e0b);
}

.book-emp-announcement__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.book-emp-announcement__title {
  display: block;
  margin-bottom: 4px;
}

.employee-announcement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.employee-announcement-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%;
}

.employee-announcement-card--important {
  border-left: 3px solid var(--warning, #f59e0b);
}

.employee-announcement-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}

.employee-announcement-card__brand {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.employee-announcement-card__icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.employee-announcement-card__type {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.employee-announcement-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  word-break: break-word;
}

.employee-announcement-card__summary {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary, var(--text-muted));
}

.employee-announcement-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-color);
}

.employee-announcement-card__meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.employee-announcement-card__meta-item span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.employee-announcement-card__meta-item strong {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.employee-announcement-card__actions {
  margin-top: auto;
  padding-top: var(--space-2);
}

@media (max-width: 900px) {
  .employee-announcement-grid {
    grid-template-columns: 1fr;
  }
}

.employee-document-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.employee-document-category-card__list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-secondary, var(--text-muted));
  font-size: 0.875rem;
  line-height: 1.6;
}

.employee-document-category-card__list li + li {
  margin-top: 4px;
}

.employee-table.data-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.employee-table.data-table td strong {
  font-weight: 600;
  color: var(--text-primary);
}

@media (max-width: 1024px) {
  .employee-document-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .employee-document-category-grid {
    grid-template-columns: 1fr;
  }
}

.book-emp-request-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.book-emp-request-card,
.request-card {
  background: var(--card-bg, var(--card-background, #fff));
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
}

.book-emp-request-card:hover,
.request-card:hover {
  box-shadow: var(--shadow-md, 0 4px 12px rgba(15, 23, 42, 0.08));
  border-color: color-mix(in srgb, var(--primary-color, #2563eb) 20%, var(--border-color));
}

.request-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.request-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary-color, #2563eb) 10%, transparent);
  color: var(--primary-color, #2563eb);
  flex-shrink: 0;
}

.request-card__icon svg {
  width: 18px;
  height: 18px;
}

.request-card__title,
.book-emp-request-card__title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin: 0;
}

.request-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.request-card__stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.request-card__stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary, var(--text-muted));
  font-weight: 600;
}

.request-card__stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.request-card__empty {
  margin-bottom: 16px;
}

.request-card__empty p {
  font-size: 0.8125rem;
  color: var(--text-secondary, var(--text-muted));
  margin: 0 0 10px;
}

.request-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.book-emp-requests-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.book-emp-requests-header .book-dash-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.book-emp-req-table-card .data-table thead th {
  padding: 12px;
  background: var(--bg-subtle, #f8fafc);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, var(--text-muted));
}

.book-emp-req-table-card .data-table tbody td {
  padding: 12px;
  vertical-align: middle;
}

.book-emp-req-row:hover {
  background: var(--bg-subtle);
}

.book-emp-req-timeline-card {
  padding: 20px;
}

.book-emp-req-timeline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.book-emp-req-timeline__step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-secondary, var(--text-muted));
}

.book-emp-req-timeline__step--done {
  color: var(--text-primary);
  font-weight: 600;
}

.book-emp-req-timeline__step--active {
  color: var(--primary-color, #2563eb);
  font-weight: 700;
}

.book-emp-req-timeline__step--rejected {
  color: var(--danger, #dc2626);
  font-weight: 700;
}

.book-emp-req-timeline__step--pending {
  opacity: 0.55;
}

.book-emp-req-timeline__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.book-emp-req-timeline__line {
  width: 24px;
  height: 2px;
  background: var(--border-color);
}

.book-emp-req-alert__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  margin-top: 8px;
}

/* My Requests — ERP command centre */
.book-emp-req-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
}

.book-emp-req-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.book-emp-req-kpi {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
  transition: box-shadow 0.15s ease;
}

.book-emp-req-kpi:hover {
  box-shadow: var(--shadow-md, 0 4px 12px rgba(15, 23, 42, 0.08));
}

.book-emp-req-kpi__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md, 8px);
  flex-shrink: 0;
}

.book-emp-req-kpi__icon svg {
  width: 22px;
  height: 22px;
}

.book-emp-req-kpi--receivable .book-emp-req-kpi__icon {
  background: color-mix(in srgb, #f59e0b 14%, transparent);
  color: #d97706;
}

.book-emp-req-kpi--revenue .book-emp-req-kpi__icon {
  background: color-mix(in srgb, #10b981 14%, transparent);
  color: #059669;
}

.book-emp-req-kpi--expense .book-emp-req-kpi__icon {
  background: color-mix(in srgb, #ef4444 14%, transparent);
  color: #dc2626;
}

.book-emp-req-kpi__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, var(--text-muted));
  margin-bottom: 4px;
}

.book-emp-req-kpi__value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.book-emp-req-kpi__footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.book-emp-req-alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.book-emp-req-alert-card {
  background: var(--card-bg, #fff);
  border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--border-color));
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
}

.book-emp-req-alert-card--urgent {
  border-color: color-mix(in srgb, #ef4444 40%, var(--border-color));
  background: linear-gradient(135deg, #fff 0%, #fff7ed 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
}

.book-emp-req-alert-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.book-emp-req-alert-card__warn {
  font-size: 1rem;
  line-height: 1;
}

.book-emp-req-alert-card__date-badge {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary-color, #2563eb) 10%, transparent);
  color: var(--primary-color, #2563eb);
}

.book-emp-req-alert-card__urgent-badge {
  margin-left: auto;
}

.book-emp-req-alert-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 var(--space-3);
  color: var(--text-primary);
}

.book-emp-req-alert-card__missing {
  margin-bottom: var(--space-4);
}

.book-emp-req-alert-card__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.book-emp-req-alert-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-emp-missing-badge {
  font-size: 0.75rem;
}

.book-emp-req-alert-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-color);
}

.book-emp-req-table-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.book-emp-req-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.book-emp-req-table-toolbar__search {
  min-width: 200px;
}

.book-emp-req-table-empty {
  padding: var(--space-4);
  margin: 0;
}

.book-emp-req-history-card {
  padding: var(--space-5);
}

.book-emp-req-history {
  display: grid;
  gap: 0;
  margin-top: var(--space-2);
}

.book-emp-req-history__item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
}

.book-emp-req-history__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
}

.book-emp-req-history__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color, #2563eb);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #2563eb) 18%, transparent);
}

.book-emp-req-history__dot--success { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.book-emp-req-history__dot--warning { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.book-emp-req-history__dot--danger { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
.book-emp-req-history__dot--muted { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18); }

.book-emp-req-history__line {
  flex: 1;
  width: 2px;
  min-height: 24px;
  margin-top: 4px;
  background: var(--border-color);
}

.book-emp-req-history__rail--last .book-emp-req-history__line {
  display: none;
}

.book-emp-req-history__body {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.book-emp-req-history__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.book-emp-req-history__icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 6px);
  background: color-mix(in srgb, var(--primary-color, #2563eb) 10%, transparent);
  color: var(--primary-color, #2563eb);
}

.book-emp-req-history__icon svg {
  width: 14px;
  height: 14px;
}

.book-emp-req-history__date {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, var(--text-muted));
}

.book-emp-req-history__type {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.book-emp-req-history__desc {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.book-emp-req-history__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .book-emp-req-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .book-emp-req-alert-grid {
    grid-template-columns: 1fr;
  }

  .book-emp-req-table-toolbar {
    width: 100%;
  }

  .book-emp-req-table-toolbar__search {
    flex: 1;
    min-width: 0;
  }
}

/* Company Holidays — Employee Portal ERP calendar */
.book-emp-holidays-erp {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-emp-hol-kpi .book-dash-kpi__value {
  font-variant-numeric: tabular-nums;
}

.book-emp-hol-year-nav__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.book-emp-hol-year-nav__center {
  text-align: center;
  min-width: 200px;
}

.book-emp-hol-year-nav__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.book-emp-hol-year-nav__year {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.book-emp-hol-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.book-emp-hol-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--card-bg, #fff);
}

.book-emp-hol-legend__item--holiday::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: color-mix(in srgb, #6366f1 25%, #fff);
  border: 1px solid #6366f1;
}

.book-emp-hol-legend__item--weekend::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.book-emp-hol-legend__item--work::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.book-emp-hol-annual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.book-emp-hol-month-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
}

.book-emp-hol-month-card__head {
  padding: var(--space-3) var(--space-4);
  font-weight: 700;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle, #f8fafc);
}

.book-emp-hol-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  padding: var(--space-3);
}

.book-emp-hol-cal-dow {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 0;
}

.book-emp-hol-cal-cell {
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--card-bg, #fff);
}

.book-emp-hol-cal-cell--empty {
  background: transparent;
  border: none;
  min-height: 0;
}

.book-emp-hol-cal-cell--weekend {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.book-emp-hol-cal-cell--holiday {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border-color: color-mix(in srgb, #6366f1 35%, #e2e8f0);
}

.book-emp-hol-cal-day {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.book-emp-hol-cal-emoji {
  font-size: 0.65rem;
  line-height: 1;
}

.book-emp-hol-cal-name {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-emp-hol-cal-badge {
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 1px 4px;
  border-radius: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-emp-hol-cal-badge--weekend {
  color: #64748b;
  background: #e2e8f0;
}

.book-emp-hol-cal-badge--holiday {
  color: #4338ca;
  background: color-mix(in srgb, #6366f1 15%, #fff);
}

.book-emp-hol-list-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.book-emp-hol-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.book-emp-hol-list-empty {
  padding: var(--space-4);
  margin: 0;
}

.book-emp-hol-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-color);
}

@media (max-width: 1200px) {
  .book-emp-hol-annual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .book-emp-hol-annual-grid {
    grid-template-columns: 1fr;
  }

  .book-emp-hol-list-toolbar {
    width: 100%;
  }

  .book-emp-hol-list-toolbar .form-control,
  .book-emp-hol-list-toolbar .filter-select {
    flex: 1;
    min-width: 0;
  }
}

/* Employee Portal — Leave Calendar (leave, holidays, weekends only) */
.book-emp-leave-cal-kpi .book-dash-kpi__value {
  font-variant-numeric: tabular-nums;
}

.book-emp-leave-cal-month-nav {
  padding: var(--space-4) var(--space-5);
}

.book-emp-leave-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.book-emp-leave-cal-legend--compact {
  gap: var(--space-2);
}

.book-emp-leave-cal-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--card-bg, #fff);
}

.book-emp-leave-cal-month-wrap .book-emp-leave-cal-month-card {
  max-width: 100%;
}

.book-emp-leave-cal-grid .book-emp-hol-cal-cell {
  min-height: 64px;
}

.book-emp-leave-cal-grid--widget .book-emp-hol-cal-cell {
  min-height: 44px;
}

.book-emp-leave-cal-cell--approved {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border-color: color-mix(in srgb, #10b981 35%, #e2e8f0);
}

.book-emp-leave-cal-cell--pending {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: color-mix(in srgb, #f59e0b 35%, #e2e8f0);
}

.book-emp-leave-cal-type {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-emp-leave-cal-badge {
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 1px 4px;
  border-radius: 4px;
}

.book-emp-leave-cal-badge--approved {
  color: #047857;
  background: color-mix(in srgb, #10b981 15%, #fff);
}

.book-emp-leave-cal-badge--pending {
  color: #b45309;
  background: color-mix(in srgb, #f59e0b 15%, #fff);
}

.book-emp-leave-cal-weekend-dot {
  font-size: 0.55rem;
  line-height: 1;
  margin-top: auto;
  align-self: flex-end;
}

.book-emp-leave-cal-events-card .card-header {
  padding: var(--space-4) var(--space-5);
}

@media (max-width: 992px) {
  .book-emp-leave-cal-page .book-dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .book-emp-leave-cal-page .book-dash-kpi-grid {
    grid-template-columns: 1fr;
  }

  .book-emp-leave-cal-grid .book-emp-hol-cal-cell {
    min-height: 52px;
  }

  .book-emp-leave-cal-type,
  .book-emp-hol-cal-name {
    display: none;
  }
}

.book-emp-request-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.book-emp-payroll-summary {
  display: grid;
  gap: 8px;
}

.book-emp-payroll-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.book-emp-payroll-summary__row--net {
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 1rem;
}

/* Employee Payroll Dashboard */
.book-emp-payroll-dash .book-emp-payroll-summary-card {
  padding: var(--space-5);
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid var(--border-color);
}

.book-emp-payroll-summary-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.book-emp-payroll-summary-card__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.book-emp-payroll-summary-card__period {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.book-emp-payroll-summary-card__status {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.book-emp-payroll-summary-card__status.is-paid {
  color: #059669;
  font-weight: 600;
}

.book-emp-payroll-summary-card__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.book-emp-payroll-summary-card__grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.book-emp-payroll-summary-card__grid span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.book-emp-payroll-summary-card__grid strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.book-emp-payroll-summary-card__net strong {
  font-size: 1.35rem;
  color: #059669;
}

.book-emp-payroll-kpi-card {
  position: relative;
  padding-top: var(--space-5);
}

.book-emp-payroll-kpi-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.book-emp-payroll-kpi-card__icon svg {
  width: 18px;
  height: 18px;
}

.book-emp-payroll-latest__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-4);
}

.book-emp-payroll-breakdown-grid {
  display: grid;
  gap: var(--space-3);
}

.book-emp-payroll-accordion {
  overflow: hidden;
}

.book-emp-payroll-accordion__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-4);
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.book-emp-payroll-accordion__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.book-emp-payroll-accordion__icon svg {
  width: 16px;
  height: 16px;
}

.book-emp-payroll-accordion__title {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}

.book-emp-payroll-accordion__chev {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.book-emp-payroll-accordion.is-open .book-emp-payroll-accordion__chev {
  transform: rotate(180deg);
}

.book-emp-payroll-accordion__body {
  display: none;
  padding: 0 var(--space-4) var(--space-4);
}

.book-emp-payroll-accordion.is-open .book-emp-payroll-accordion__body {
  display: block;
}

.book-emp-payroll-breakdown__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.book-emp-payroll-breakdown__row--total {
  border-bottom: 0;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border-color);
  font-weight: 600;
}

.book-emp-payroll-history-table tbody tr td[data-label]::before {
  display: none;
}

@media (max-width: 768px) {
  .book-emp-payroll-summary-card__grid {
    grid-template-columns: 1fr;
  }

  .book-emp-payroll-history-table thead {
    display: none;
  }

  .book-emp-payroll-history-table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
  }

  .book-emp-payroll-history-table tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: 0;
  }

  .book-emp-payroll-history-table tbody tr td[data-label]::before {
    display: inline;
    content: attr(data-label);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
  }
}

.book-emp-tax-section__title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, var(--text-muted));
  margin: 0 0 var(--space-3);
}

/* Employee Portal — Tax & Contributions (ERP report style) */
.book-emp-tax-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.book-emp-tax-header.book-tax-header {
  align-items: flex-start;
}

.book-emp-tax-toolbar.tax-toolbar,
.book-emp-tax-page .tax-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
}

.book-emp-tax-toolbar .tax-toolbar__right,
.book-emp-tax-toolbar .book-cust-toolbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.book-emp-tax-page .finance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.book-emp-tax-page .finance-kpi-card {
  background: var(--card-bg, var(--card-background, #fff));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
}

.book-emp-tax-page .finance-kpi-card .kpi-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, var(--text-muted));
  margin-bottom: var(--space-2);
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
}

.book-emp-tax-page .finance-kpi-card .kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
}

.book-emp-tax-section {
  margin-bottom: 20px;
}

.book-emp-tax-table-card.book-tax-table-card .card-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.book-emp-tax-table-card .book-tax-table thead th {
  padding: 12px;
  background: var(--bg-subtle, #f8fafc);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, var(--text-muted));
  border-bottom: 1px solid var(--border-color);
}

.book-emp-tax-table-card .book-tax-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.book-emp-tax-info {
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 0;
}

.book-emp-tax-info__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.book-emp-tax-info__text {
  font-size: 0.8125rem;
  color: var(--text-secondary, var(--text-muted));
  line-height: 1.5;
}

.book-emp-tax-line,
.book-emp-tax-breakdown-total {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.book-emp-tax-breakdown-total {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 2px solid var(--border-color);
  font-weight: 700;
}

.book-emp-tax-month-row {
  cursor: default;
}

.book-emp-tax-report {
  display: flex;
  flex-direction: column;
}

.book-emp-tax-report__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
}

.book-emp-tax-report__subtitle {
  font-style: italic;
  margin-top: calc(var(--space-2) * -1);
}

.book-emp-tax-report__lines .book-emp-tax-line:last-child {
  border-bottom: none;
}

.book-emp-tax-report__label {
  color: var(--text-primary);
}

.book-emp-tax-report__amount {
  font-variant-numeric: tabular-nums;
}

.book-emp-tax-payslip-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.book-emp-tax-payslip-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
}

.book-emp-tax-payslip-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.book-emp-tax-payslip-item__period {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.book-emp-tax-month-row:hover {
  background: transparent;
}

@media (max-width: 1024px) {
  .book-emp-tax-page .finance-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .book-emp-tax-page .finance-kpi-grid {
    grid-template-columns: 1fr;
  }

  .book-emp-tax-toolbar.tax-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .book-emp-tax-toolbar .tax-toolbar__right,
  .book-emp-tax-toolbar .book-cust-toolbar__right {
    justify-content: flex-start;
  }
}

/* ---- Employee Profile (ESS) — Leave Dashboard standard ---- */
.book-emp-profile-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.employee-summary-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
}

.employee-summary-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.employee-summary-card__avatar-wrap {
  flex-shrink: 0;
}

.employee-summary-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.employee-summary-card__name {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--text-primary);
}

.employee-kpi-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.employee-kpi-card {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--page-bg-subtle);
}

.employee-kpi-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.employee-kpi-card__value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

.employee-action-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.employee-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-4) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: center;
}

.employee-action-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.employee-action-card__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.employee-action-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.employee-action-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.employee-section-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
}

.employee-section-card__title {
  margin: 0 0 var(--space-4);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.employee-section-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.employee-section-card__field strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-word;
}

.employee-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.employee-empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-muted) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-3);
}

.employee-empty-state__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.employee-empty-state__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 var(--space-4);
}

.book-emp-profile-req-row:hover {
  background: var(--bg-subtle);
}

@media (max-width: 1024px) {
  .employee-kpi-card-grid,
  .employee-action-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .employee-kpi-card-grid,
  .employee-action-card-grid,
  .employee-section-card__grid {
    grid-template-columns: 1fr;
  }

  .employee-summary-card__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Legacy profile class aliases (retained for profile-updates page table) */
.book-emp-profile-header .book-dash-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.book-emp-profile-table-card .data-table thead th {
  padding: 12px;
  background: var(--bg-subtle, #f8fafc);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, var(--text-muted));
}

.book-emp-profile-table-card .data-table tbody td {
  padding: 12px;
  vertical-align: middle;
}

/* Employee Expenses Dashboard (ESS) */
.book-emp-expenses-dash .book-dash-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.book-emp-expense-receipt__card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--bg-subtle);
}

.book-emp-expense-receipt__img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-sm);
  display: block;
  margin-bottom: var(--space-2);
}

.book-emp-expense-receipt__meta,
.book-emp-expense-receipt__file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
}

@media (max-width: 992px) {
  .book-emp-expenses-dash .book-dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .book-emp-expenses-table thead { display: none; }
  .book-emp-expenses-table tr {
    display: block;
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-3) 0;
  }
  .book-emp-expenses-table td {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border: none;
  }
  .book-emp-expenses-table td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
  }
}

.book-emp-alert {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--warning, #f59e0b);
  background: #fffbeb;
}

.book-emp-alert--warning {
  border-left-color: var(--warning, #f59e0b);
}

.book-emp-alert__icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.book-emp-alert__body {
  flex: 1;
  min-width: 0;
}

.book-emp-leave-balance-card--detail .book-emp-leave-balance-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.book-emp-leave-balance-card--detail .book-emp-leave-balance-card__stats strong {
  display: block;
  font-size: 1.1rem;
}

.book-emp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.book-emp-cal-head {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.book-emp-cal-cell {
  aspect-ratio: 1;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  padding: 4px 2px;
  text-align: center;
}

.book-emp-cal-cell--clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.book-emp-cal-cell--clickable:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.book-emp-cal-cell__status {
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.1;
}

.book-emp-cal-cell__time {
  font-size: 0.58rem;
  color: var(--text-muted);
  line-height: 1.1;
}

.book-emp-cal-cell--muted {
  opacity: 0.45;
  background: var(--surface-muted, var(--surface-card));
}

.book-emp-cal-cell--weekend {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text-muted);
}

.book-emp-att-txn-card .book-cust-contact-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.book-emp-leave-bal-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.book-emp-leave-preview {
  background: var(--surface-muted, rgba(0, 0, 0, 0.02));
  border: 1px dashed var(--border-color);
}

.book-emp-leave-policy-card {
  border-left: 3px solid var(--primary);
}

.book-emp-leave-timeline .book-emp-timeline__dot--done {
  background: #10b981;
}

.book-emp-leave-timeline .book-emp-timeline__dot--reject {
  background: #ef4444;
}

.book-emp-leave-form .book-qt-section__title {
  margin-top: 12px;
}

.book-emp-leave-analytics .book-dash-row {
  display: grid;
  gap: var(--space-4);
}

.book-emp-leave-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.book-emp-leave-summary-card__title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.book-emp-leave-summary-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.book-emp-leave-summary-card__stats strong {
  display: block;
  font-size: 1.1rem;
}

.book-emp-leave-upcoming-list,
.book-emp-leave-recent-list {
  display: grid;
  gap: var(--space-3);
}

.book-emp-leave-upcoming-item,
.book-emp-leave-recent-item {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.book-emp-leave-upcoming-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.book-emp-leave-policy-lines {
  display: grid;
  gap: 8px;
}

.book-emp-leave-policy-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
}

.book-emp-cal-grid--widget .book-emp-cal-cell {
  min-height: 28px;
  font-size: 0.65rem;
  aspect-ratio: auto;
}

.book-emp-cal-grid--widget .book-emp-cal-cell__status {
  display: none;
}

.book-emp-cal-legend--compact {
  font-size: 0.7rem;
}

@media (max-width: 900px) {
  .book-emp-leave-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .book-emp-leave-summary-grid {
    grid-template-columns: 1fr;
  }
}

.book-emp-cal-cell--empty {
  border-color: transparent;
  background: transparent;
}

.book-emp-cal-day {
  font-weight: 600;
}

.book-emp-cal-cell--present {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

.book-emp-cal-cell--late {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #b45309;
}

.book-emp-cal-cell--absent {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #b91c1c;
}

.book-emp-cal-cell--leave {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #4338ca;
}

.book-emp-cal-cell--holiday {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.3);
  color: #0369a1;
}

.book-emp-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-emp-cal-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.book-emp-timeline {
  display: grid;
  gap: var(--space-3);
  padding-left: var(--space-2);
}

.book-emp-timeline__item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: var(--space-3);
  position: relative;
}

.book-emp-timeline__item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: -12px;
  width: 2px;
  background: var(--border-color);
}

.book-emp-timeline__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.book-emp-timeline__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.book-emp-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.book-emp-detail-grid__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-emp-detail-grid__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@media (max-width: 640px) {
  .book-emp-cal-grid {
    gap: 2px;
  }
  .book-emp-cal-cell {
    min-height: 32px;
    font-size: 0.7rem;
  }
  .book-emp-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .book-emp-dash-profile__grid {
    grid-template-columns: auto 1fr;
  }
  .book-emp-dash-profile__meta {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .book-emp-request-grid,
  .book-emp-request-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .book-emp-dash-profile__grid {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .book-emp-dash-profile__avatar-wrap {
    justify-self: start;
  }
  .book-emp-dash-profile__meta {
    grid-template-columns: 1fr;
  }
  .book-emp-leave-balance-grid,
  .book-emp-request-grid,
  .book-emp-request-summary,
  .book-emp-dash-summary__grid {
    grid-template-columns: 1fr;
  }
  .request-card__stats {
    grid-template-columns: 1fr;
  }
}

/* ---- Quotation entry form (LKR Accounting) ---- */
.book-qt-form-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-qt-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.book-qt-form-header__main {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.book-qt-form-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.book-qt-form-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-4);
  align-items: start;
}

.book-qt-form-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.book-qt-section {
  padding: var(--space-5);
}

.book-qt-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.book-qt-section__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.book-qt-section__head .book-qt-section__title {
  margin-bottom: 0;
}

.book-qt-customer-preview {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
}

.book-qt-customer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.book-qt-customer-grid span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.book-qt-items-table .col-qty { width: 120px; min-width: 120px; }
.book-qt-items-table .col-qty .form-control { min-width: 120px; width: 100%; }
.book-qt-items-table .col-rate { width: 120px; min-width: 110px; }
.book-qt-items-table .col-tax { width: 180px; min-width: 160px; }
.book-qt-items-table .col-amt { width: 120px; }
.book-qt-items-table .col-rm { width: 40px; }

.book-inv-items-table .col-qty { width: 120px; min-width: 120px; }
.book-inv-items-table .col-qty .form-control { min-width: 120px; width: 100%; }
.book-inv-items-table .col-rate { width: 120px; min-width: 110px; }
.book-inv-items-table .col-tax { width: 180px; min-width: 160px; }

.book-tax-book-switch {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.book-tax-book-switch__btn {
  padding: var(--space-3) var(--space-5);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  cursor: pointer;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  transition: border-color 0.15s, background 0.15s;
}

.book-tax-book-switch__btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light, rgba(99, 102, 241, 0.1));
  color: var(--color-primary);
}

.book-tax-book-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.book-tax-book-summary__card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--page-bg-subtle);
}

.book-inv-tax-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--border-color);
}

.book-inv-totals {
  max-width: 360px;
  margin-left: auto;
}

.book-inv-totals__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0;
}

.book-inv-totals__row--total {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  border-top: 2px solid var(--border-color);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
}

.book-rcp-pay-methods {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.book-rcp-pay-method {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.book-rcp-alloc-table .alloc-amt {
  min-width: 120px;
}

.book-rcp-form-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 1100px;
}

.book-rcp-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.book-rcp-summary-card {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-primary) 4%, var(--card-bg));
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.book-rcp-summary-card small {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.book-rcp-summary-card strong {
  font-size: var(--font-size-lg);
  font-variant-numeric: tabular-nums;
}

.book-rcp-summary-card--remaining strong {
  color: var(--color-primary);
}

.book-rcp-alloc-warning {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-warning) 12%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--color-warning) 35%, var(--border-color));
  color: var(--color-warning);
  font-size: var(--font-size-sm);
}

.book-rcp-acct-preview-card {
  padding: 0;
  overflow: hidden;
}

.book-rcp-acct-preview-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: none;
  background: transparent;
  font: inherit;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  text-align: left;
}

.book-rcp-acct-preview-chevron {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.book-rcp-acct-preview {
  padding: 0 var(--space-5) var(--space-5);
  border-top: 1px solid var(--border-color);
}

.book-rcp-acct-preview__body {
  margin-top: var(--space-3);
}

.book-rcp-journal-lines {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.book-rcp-journal-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: var(--font-size-sm);
}

.book-rcp-journal-side {
  font-weight: var(--font-weight-bold);
  color: var(--color-success);
}

.book-rcp-journal-line--credit .book-rcp-journal-side {
  color: var(--color-primary);
}

.book-rcp-alloc-status-wrap {
  margin-top: var(--space-3);
}

.book-rcp-alloc-status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.book-rcp-alloc-status--ok {
  background: color-mix(in srgb, var(--color-success) 14%, var(--card-bg));
  color: var(--color-success);
}

.book-rcp-alloc-status--partial {
  background: color-mix(in srgb, var(--color-warning) 14%, var(--card-bg));
  color: var(--color-warning);
}

.book-rcp-summary-aside .book-rcp-alloc-warning {
  margin-top: var(--space-3);
}

.book-rcp-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  position: sticky;
  bottom: var(--space-3);
  z-index: 2;
}

.book-rcp-form-footer__book {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.book-rcp-form-footer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

@media (max-width: 768px) {
  .book-rcp-summary-cards {
    grid-template-columns: 1fr;
  }
  .book-rcp-form-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .book-rcp-journal-line {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
}

.book-qt-summary {
  position: sticky;
  top: var(--space-4);
  padding: var(--space-5);
}

.book-qt-summary__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-color);
}

.book-qt-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--font-size-sm);
}

.book-qt-summary-row strong {
  font-variant-numeric: tabular-nums;
}

.book-qt-summary-row--tax {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.book-qt-summary-row--total {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 2px solid var(--color-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
}

.book-qt-discount-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--font-size-sm);
}

.book-qt-discount-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.book-qt-tax-breakdown {
  border-top: 1px dashed var(--border-color);
  margin-top: var(--space-1);
  padding-top: var(--space-1);
}

.book-qt-summary__book {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-color);
}

.book-qt-summary__posting {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--border-color);
}

.tax-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  background: var(--color-primary-light, rgba(99, 102, 241, 0.12));
  color: var(--color-primary);
}

.book-qt-detail-totals {
  max-width: 360px;
  margin-left: auto;
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--page-bg-subtle);
}

.book-qt-tax-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

@media (max-width: 1100px) {
  .book-qt-form-layout {
    grid-template-columns: 1fr;
  }
  .book-qt-summary {
    position: static;
  }
}

.book-qt-tax-notice {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  background: var(--page-bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.book-qt-tax-notice--ok {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: var(--text-primary);
}

.book-qt-tax-notice--warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

@media (max-width: 768px) {
  .book-qt-customer-grid { grid-template-columns: 1fr; }
  .book-qt-form-header { flex-direction: column; }
  .book-qt-table-wrap { overflow-x: auto; }
}

/* ── Administration — Permission matrix & forms ── */
.book-perm-view-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.book-perm-matrix-card {
  padding: 0;
  overflow: hidden;
}

.book-perm-matrix-table th,
.book-perm-matrix-table td {
  vertical-align: middle;
}

.book-perm-matrix-table th:not(:first-child):not(:nth-child(2)),
.book-perm-matrix-table td:not(:first-child):not(:nth-child(2)) {
  width: 72px;
}

.book-perm-matrix-cb {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.book-perm-matrix-cb:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.book-admin-form-page .book-admin-form-section {
  margin-bottom: var(--space-4);
}

.book-notify-email-preview {
  max-height: 240px;
  overflow: auto;
  padding: var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--page-bg-subtle);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.book-audit-kpi {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .book-audit-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .book-audit-kpi,
  .book-notify-tpl-kpi,
  .book-notify-rule-kpi {
    grid-template-columns: 1fr;
  }

  .book-perm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .book-perm-view-toggle {
    justify-content: flex-end;
  }
}

/* ── Enterprise RBAC ── */
.book-rbac-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.book-rbac-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--page-bg-subtle);
  font-size: var(--font-size-sm);
}

.book-rbac-mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-2);
}

.book-rbac-mod-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.book-rbac-mod-card--on {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.06);
}

.book-rbac-yes {
  color: var(--color-success);
  font-weight: var(--font-weight-semibold);
}

.book-rbac-scope {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.pe-role-matrix .pe-matrix-group {
  padding: var(--space-3);
}
.pe-matrix-group__head {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-color);
}
.pe-matrix-group__title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
}
.pe-matrix-mod {
  font-weight: var(--font-weight-medium);
}
.pe-book-section {
  margin-top: var(--space-4);
}
.pe-section-title {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}
.pe-book-block {
  padding: var(--space-3);
}
.pe-book-block__head {
  margin-bottom: var(--space-3);
}
.pe-book-enable {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}
.pe-book-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
}
.pe-book-feature {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  cursor: pointer;
}
.pe-book-feature--on {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.06);
}

/* ---- Employee ERP dashboard (self-service) ---- */
.book-emp-dashboard-erp .book-emp-dash-profile {
  margin-bottom: var(--space-4);
}

.book-emp-leave-progress-grid {
  display: grid;
  gap: var(--space-3);
}

.book-emp-leave-progress-card {
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-muted, rgba(248, 250, 252, 0.6));
}

.book-emp-leave-progress-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}

.book-emp-leave-progress-card__meta {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
}

.book-emp-leave-progress__track {
  height: 8px;
  border-radius: 999px;
  background: var(--border-color);
  overflow: hidden;
}

.book-emp-leave-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.85), rgba(16, 185, 129, 0.85));
  transition: width 0.3s ease;
}

.book-emp-dash-timeline {
  max-height: 420px;
  overflow-y: auto;
  padding-right: var(--space-1);
}

.book-emp-dashboard-erp .book-dash-chart-card {
  height: 100%;
  min-height: 280px;
}

.book-emp-dashboard-erp .book-dash-row--2 > .chart-card,
.book-emp-dashboard-erp .book-dash-row--2 > .book-cust-table-card,
.book-emp-dashboard-erp .book-dash-row--2 > .book-qt-section,
.book-emp-dashboard-erp .book-dash-row--2 > .card {
  min-height: 0;
}

.book-emp-dash-quick-panel .book-emp-quick-actions {
  margin-top: var(--space-2);
}

@media (max-width: 1024px) {
  .book-emp-dashboard-erp .book-dash-row--2 {
    grid-template-columns: 1fr;
  }
  .book-emp-dashboard-erp .book-dash-chart-card {
    min-height: 240px;
  }
}

/* HR Manager Command Center */
.book-hr-command-center .book-hr-command-kpi {
  margin-bottom: var(--space-4);
}

.book-hr-command-center .book-hr-chart-card {
  min-height: 280px;
}

.book-hr-command-center .book-hr-chart-card__body {
  position: relative;
  min-height: 220px;
}

.book-hr-command-center .book-hr-chart-card canvas {
  max-height: 240px;
}

/* HR dashboard charts — light ERP panels (shared across HR Dashboard, Analytics, module dashboards) */
.book-hr-dash-chart-card {
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: none;
}

.book-hr-dash-chart-panel {
  position: relative;
  min-height: 200px;
  padding: var(--space-3) var(--space-4) var(--space-4);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-top: 1px solid #eef2f7;
  border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
}

.book-hr-dash-chart-panel canvas {
  background: transparent !important;
}

.book-hr-page .book-dash-chart-card.book-hr-dash-chart-card .book-hr-dash-chart-panel,
.book-hr-command-center .book-hr-chart-card .book-hr-dash-chart-panel {
  min-height: 220px;
}

.book-hr-command-center .book-hr-panel-card .card-body {
  padding-top: 0;
}

.book-hr-command-center .book-hr-dash-quick-panel {
  margin-top: var(--space-4);
}

@media (max-width: 1024px) {
  .book-hr-command-center .book-dash-row--2 {
    grid-template-columns: 1fr;
  }
}

/* HR Manager Portal — placeholder module pages */
.book-hr-portal-page .book-hr-portal-kpi .book-dash-kpi__value {
  font-variant-numeric: tabular-nums;
}

.book-hr-portal-search {
  min-width: 200px;
  max-width: 280px;
}

.book-hr-portal-chart__body {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-hr-portal-chart__placeholder {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  border: 1px dashed #cbd5e1;
  position: relative;
  overflow: hidden;
}

.book-hr-portal-chart__placeholder::after {
  content: 'Chart preview';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.book-hr-portal-dev-banner {
  border: 1px dashed color-mix(in srgb, var(--primary, #6366f1) 35%, #e2e8f0);
  background: color-mix(in srgb, var(--primary, #6366f1) 4%, #fff);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.book-hr-portal-dev-banner__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4338ca;
  background: color-mix(in srgb, #6366f1 12%, #fff);
  border: 1px solid color-mix(in srgb, #6366f1 25%, #e2e8f0);
}

@media (max-width: 768px) {
  .book-hr-portal-page .book-dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-hr-portal-search {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .book-hr-portal-page .book-dash-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.book-dash-row--hr-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: var(--space-4);
  align-items: start;
}

.book-dash-row--hr-full {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: start;
}

.book-dash-row--hr-full .book-hr-portal-main {
  max-width: none;
  grid-column: 1 / -1;
  width: 100%;
}

.book-hr-portal-main {
  min-width: 0;
}

.book-hr-portal-side {
  position: sticky;
  top: var(--space-4);
}

.book-hr-portal-quick__head {
  margin-bottom: var(--space-3);
}

.book-hr-portal-quick__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.book-hr-portal-quick__actions .book-hr-portal-quick__btn {
  justify-content: flex-start;
  width: 100%;
}

.breadcrumb-section {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.breadcrumb-section::before {
  content: '›';
  margin: 0 6px;
  color: var(--text-muted);
}

@media (max-width: 992px) {
  .book-dash-row--hr-main {
    grid-template-columns: 1fr;
  }

  .book-hr-portal-side {
    position: static;
  }

  .book-hr-portal-quick__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .book-hr-portal-quick__actions .book-hr-portal-quick__btn {
    width: auto;
  }
}

/* HR Leave pages — full-width operational layout */
.book-hr-leave-page .book-hr-leave-table-card,
.book-hr-leave-page .book-hr-leave-policy-page {
  max-width: none;
  grid-column: 1 / -1;
  width: 100%;
}

.book-hr-leave-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-hr-leave-page .book-hr-leave-table,
.book-hr-leave-page .book-hr-leave-mgmt-table {
  width: 100%;
  table-layout: auto;
}

.book-hr-leave-page .book-hr-leave-reason {
  white-space: normal;
  word-break: break-word;
  max-width: none;
}

.book-hr-leave-page .book-hr-leave-actions-cell {
  white-space: nowrap;
}

.book-hr-leave-page .book-hr-action-card-section {
  margin-top: var(--space-4);
}

/* Leave Management — column widths */
.book-hr-leave-mgmt-table .col-employee { width: 180px; min-width: 180px; }
.book-hr-leave-mgmt-table .col-department { width: 160px; min-width: 160px; }
.book-hr-leave-mgmt-table .col-leave-type { width: 140px; min-width: 140px; }
.book-hr-leave-mgmt-table .col-from { width: 120px; min-width: 120px; }
.book-hr-leave-mgmt-table .col-to { width: 120px; min-width: 120px; }
.book-hr-leave-mgmt-table .col-days { width: 80px; min-width: 80px; }
.book-hr-leave-mgmt-table .col-reason { min-width: 200px; }
.book-hr-leave-mgmt-table .col-status { width: 120px; min-width: 120px; }
.book-hr-leave-mgmt-table .col-actions { width: 180px; min-width: 180px; }

/* Leave Balances — wide grid */
.book-hr-leave-balances-table th,
.book-hr-leave-balances-table td {
  white-space: nowrap;
}

.book-hr-leave-balances-table td:first-child {
  min-width: 160px;
}

.book-hr-leave-expand-panel .book-hr-leave-reason {
  white-space: normal;
  word-break: break-word;
  max-width: 320px;
}

/* HR Overtime pages — full-width operational layout */
.book-hr-ot-page .book-hr-ot-table-card {
  max-width: none;
  grid-column: 1 / -1;
  width: 100%;
}

.book-hr-ot-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-hr-ot-page .book-hr-ot-table {
  width: 100%;
  table-layout: auto;
}

.book-hr-ot-page .book-hr-ot-reason {
  white-space: normal;
  word-break: break-word;
  max-width: none;
}

.book-hr-ot-page .book-hr-ot-actions-cell {
  white-space: nowrap;
}

.book-hr-ot-page .book-hr-action-card-section {
  margin-top: var(--space-4);
}

.book-hr-ot-dashboard-page .book-hr-portal-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-hr-ot-approval-page .book-hr-portal-kpi {
  grid-template-columns: repeat(5, 1fr);
}

.book-hr-ot-approval-filters {
  flex-wrap: wrap;
}

.book-hr-ot-flow--vertical {
  flex-direction: column;
  align-items: flex-start;
}

.book-hr-ot-rules {
  margin: 0;
  padding-left: var(--space-5);
  line-height: 1.55;
}

.book-hr-ot-approval-table th,
.book-hr-ot-approval-table td {
  white-space: nowrap;
}

.book-hr-ot-approval-table .book-hr-ot-reason {
  white-space: normal;
  word-break: break-word;
  min-width: 140px;
  max-width: 220px;
}

@media (max-width: 1200px) {
  .book-hr-ot-approval-page .book-hr-portal-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .book-hr-ot-approval-page .book-hr-portal-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-hr-ot-approval-page .book-hr-portal-kpi {
    grid-template-columns: 1fr;
  }
}

.book-hr-ot-reports-page .book-hr-portal-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-hr-ot-reports-filters {
  flex-wrap: wrap;
}

@media (max-width: 992px) {
  .book-hr-ot-reports-page .book-hr-portal-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-hr-ot-reports-page .book-hr-portal-kpi {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .book-hr-ot-dashboard-page .book-hr-portal-kpi {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .book-hr-ot-dashboard-page .book-hr-portal-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-hr-ot-dashboard-page .book-hr-portal-kpi {
    grid-template-columns: 1fr;
  }
}

/* HR Payroll pages — full-width dashboard layout */
.book-hr-payroll-page .book-hr-payroll-table-card {
  max-width: none;
  grid-column: 1 / -1;
  width: 100%;
}

.book-hr-payroll-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.book-hr-payroll-page .book-hr-payroll-table {
  width: 100%;
  table-layout: auto;
}

.book-hr-payroll-page .book-hr-payroll-actions-cell {
  white-space: nowrap;
}

.book-hr-payroll-page .book-hr-action-card-section {
  margin-top: var(--space-4);
}

.book-hr-payroll-dashboard-page .book-hr-portal-kpi {
  grid-template-columns: repeat(4, 1fr);
}

.book-hr-payroll-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.book-hr-payroll-summary-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.book-hr-payroll-flow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.book-hr-payroll-flow__step {
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.book-hr-payroll-flow__step--active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.12);
}

.book-hr-payroll-flow__step--done {
  color: var(--text-primary);
}

.book-hr-payroll-flow__arrow {
  color: var(--text-muted);
  font-weight: 600;
  padding-left: var(--space-2);
}

.book-hr-payroll-integration .card-body {
  padding-top: var(--space-3);
}

@media (max-width: 1200px) {
  .book-hr-payroll-dashboard-page .book-hr-portal-kpi {
    grid-template-columns: repeat(4, 1fr);
  }

  .book-hr-payroll-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .book-hr-payroll-dashboard-page .book-hr-portal-kpi {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-hr-payroll-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .book-hr-payroll-dashboard-page .book-hr-portal-kpi {
    grid-template-columns: 1fr;
  }

  .book-hr-payroll-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Leave Policies — dedicated form sections */
.book-hr-leave-policies-page .book-hr-leave-policy-page {
  width: 100%;
}

.book-hr-leave-policy-section .card-body {
  padding-top: var(--space-4);
}

.book-hr-leave-policy-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius, 8px);
  background: var(--page-bg-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
}

.book-hr-leave-policy-flow__step {
  font-weight: var(--font-weight-semibold, 600);
  color: var(--text-primary, #0f172a);
}

.book-hr-leave-policy-flow__arrow {
  color: var(--text-muted, #64748b);
  font-weight: 700;
}

.book-hr-action-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .book-hr-action-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .book-hr-action-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.book-hr-action-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius, 8px);
  background: var(--surface, #fff);
  color: var(--text-primary, #0f172a);
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: var(--font-weight-semibold, 600);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.book-hr-action-card:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary, #6366f1) 45%, #e2e8f0);
  background: color-mix(in srgb, var(--primary, #6366f1) 4%, #fff);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.book-hr-action-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.book-hr-action-card__label {
  line-height: 1.3;
}

/* HR standard layout — full-width tables + taller scroll area */
.book-hr-standard-layout-page .book-hr-standard-table-card,
.book-hr-leave-page .book-hr-leave-table-card {
  max-width: none;
  grid-column: 1 / -1;
  width: 100%;
}

.book-hr-standard-layout-page .book-hr-standard-table-wrap,
.book-hr-leave-page .book-hr-leave-table-wrap {
  min-height: 550px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.book-hr-standard-layout-page .book-hr-action-card-section,
.book-hr-leave-page .book-hr-action-card-section {
  margin-top: var(--space-4);
  width: 100%;
}

