:root {
  /* Minimalist Premium Theme */
  --primary: #111827;
  --primary-hover: #374151;
  --primary-light: #f3f4f6;
  --secondary: #6b7280;
  
  --bg-app: #f9fafb;
  --bg-card: #ffffff;
  --bg-sidebar: #f9fafb;
  --sidebar-hover: #f3f4f6;
  --sidebar-active: #e5e7eb;
  
  --text-main: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-light: #ffffff;
  
  --border: #e5e7eb;
  --border-subtle: #f3f4f6;
  --border-dark: #d1d5db;

  --accent: #0f172a;
  --accent-hover: #1e293b;

  --sev-critical: #b91c1c;
  --sev-critical-bg: #fef2f2;
  --sev-high: #c2410c;
  --sev-high-bg: #fff7ed;
  --sev-medium: #b45309;
  --sev-medium-bg: #fffbeb;
  --sev-low: #047857;
  --sev-low-bg: #ecfdf5;

  --role-admin: #4f46e5;
  --role-admin-bg: #e0e7ff;
  --role-auditor: #2563eb;
  --role-auditor-bg: #dbeafe;
  --role-staff: #059669;
  --role-staff-bg: #d1fae5;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-xl: 0 10px 15px rgba(0, 0, 0, 0.05), 0 4px 6px rgba(0, 0, 0, 0.025);
  
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Menlo", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

#app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Sidebar */
#sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  user-select: none;
  transition: width 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

#sidebar.collapsed {
  width: 68px;
}

#sidebar.collapsed .brand-title,
#sidebar.collapsed .brand-subtitle,
#sidebar.collapsed .brand-badge,
#sidebar.collapsed .nav-section-title,
#sidebar.collapsed .nav-item-text,
#sidebar.collapsed .sidebar-footer-text {
  display: none !important;
}

#sidebar.collapsed .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin: 2px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.1s ease;
}

#sidebar.collapsed .brand-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  color: #ffffff;
  border-color: #64748b;
  background: #1e293b;
}

.brand-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 15px;
  color: white;
  flex-shrink: 0;
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.brand-badge {
  font-size: 10px;
  background-color: #1e293b;
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  padding: 14px 18px 4px 18px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}


.nav-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

#sidebar .nav-item,
#sidebar button.nav-item,
.nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 8px 12px !important;
  margin: 2px 12px !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-secondary) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  outline: none !important;
  box-shadow: none !important;
  width: calc(100% - 24px) !important;
  box-sizing: border-box !important;
  text-align: left !important;
  cursor: pointer !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  transition: all 0.12s ease !important;
}

#sidebar .nav-item:hover,
#sidebar button.nav-item:hover,
.nav-item:hover {
  background-color: var(--sidebar-hover, rgba(255, 255, 255, 0.05)) !important;
  color: var(--text-main, #ffffff) !important;
  border-color: transparent !important;
}

#sidebar .nav-item.active,
#sidebar button.nav-item.active,
.nav-item.active {
  background-color: var(--sidebar-active, rgba(2, 132, 199, 0.15)) !important;
  color: var(--primary, #38bdf8) !important;
  font-weight: 600 !important;
  border-color: transparent !important;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid #1e293b;
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.offline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
}

/* Main Content Area */


/* Top App Bar */








.engagement-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-profile-menu-wrap {
  position: relative;
}









.user-avatar.auditor {
  background-color: var(--role-auditor);
}

.user-avatar.staff {
  background-color: var(--role-staff);
}

/* User Profile Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: 42px;
  right: 0;
  width: 240px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  z-index: 150;
  display: none;
}

.user-dropdown-menu.show {
  display: block;
}

.user-dropdown-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: #334155;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
}

.user-dropdown-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #64748b;
  stroke-width: 2;
  transition: color 0.1s;
}

.user-dropdown-item:hover {
  background-color: #f1f5f9;
  color: var(--primary);
}

.user-dropdown-item:hover svg {
  color: var(--primary);
}

.user-dropdown-item.danger:hover {
  background-color: #fef2f2;
  color: var(--sev-critical);
}

.user-dropdown-item.danger:hover svg {
  color: var(--sev-critical);
}

/* View Content Container */
#content-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Cards & Containers */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Financial Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: #ffffff;
}







.data-table tr:hover {
  background-color: #f8fafc;
}

.data-table tr.selected {
  background-color: var(--primary-light);
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.font-mono {
  font-family: var(--font-sans);
}

.font-bold {
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-critical {
  background-color: var(--sev-critical-bg);
  color: var(--sev-critical);
  border: 1px solid #fecaca;
}

.badge-high {
  background-color: var(--sev-high-bg);
  color: var(--sev-high);
  border: 1px solid #fed7aa;
}

.badge-medium {
  background-color: var(--sev-medium-bg);
  color: var(--sev-medium);
  border: 1px solid #fef08a;
}

.badge-low {
  background-color: var(--sev-low-bg);
  color: var(--sev-low);
  border: 1px solid #bbf7d0;
}

.badge-open {
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-resolved {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

/* Role Badges */
.badge-role-admin {
  background-color: var(--role-admin-bg);
  color: var(--role-admin);
  border: 1px solid #ddd6fe;
}

.badge-role-auditor {
  background-color: var(--role-auditor-bg);
  color: var(--role-auditor);
  border: 1px solid #bfdbfe;
}

.badge-role-staff {
  background-color: var(--role-staff-bg);
  color: var(--role-staff);
  border: 1px solid #a7f3d0;
}

.badge-disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #cbd5e1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: white;
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.btn-secondary:hover { background-color: var(--bg-app); border-color: var(--border-dark); }

.btn-secondary:hover {
  background-color: #f1f5f9;
}

.btn-danger {
  background-color: var(--sev-critical);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-success {
  background-color: #059669;
  color: #ffffff;
}

.btn-success:hover {
  background-color: #047857;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11.5px;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 2;
  display: inline-block;
  vertical-align: middle;
}

.btn-sm svg {
  width: 12px;
  height: 12px;
}

.svg-icon {
  display: inline-block;
  vertical-align: middle;
  width: 14px;
  height: 14px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

.status-indicator-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #94a3b8;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

.status-indicator-dot.online {
  background-color: #10b981;
}

.status-indicator-dot.offline {
  background-color: #f59e0b;
}

.status-indicator-dot.disabled {
  background-color: #94a3b8;
}

.status-divider {
  color: #cbd5e1;
  font-size: 11px;
  margin: 0 1px;
  user-select: none;
}

.status-label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Stats Metric Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.metric-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
}

.metric-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

/* Forms & Inputs */








/* Modals */


.modal-card {
  background: #ffffff;
  width: 480px;
  max-width: 90vw;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}



.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}





/* Slide-out Evidence Drawer */
#drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4);
  z-index: 99;
  display: none;
}

#evidence-drawer {
  position: fixed;
  top: 0;
  right: -550px;
  width: 540px;
  height: 100vh;
  background-color: #ffffff;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
}

#evidence-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background-color: #f8fafc;
}

/* Chat Assistant */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 520px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: #ffffff;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.chat-bubble.bot {
  align-self: flex-start;
  background-color: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.chat-bubble.user {
  align-self: flex-end;
  background-color: var(--primary);
  color: #ffffff;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background-color: #f8fafc;
}

/* Benford's Bar Chart */
.chart-bar-container {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 200px;
  padding: 20px 10px 10px 10px;
  border-bottom: 1px solid var(--border-dark);
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.chart-bars-wrap {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
  height: 160px;
}

.bar-actual {
  flex: 1;
  background-color: var(--primary);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.bar-expected {
  flex: 1;
  background-color: #94a3b8;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.chart-digit-label {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  color: var(--text-muted);
}

/* =========================================================
   PROFESSIONAL AUTHENTICATION & LOGIN SCREEN
   ========================================================= */

#login-screen-overlay {
  position: fixed;
  inset: 0;
  background: #0f172a;
  background: radial-gradient(circle at 50% 25%, #1e293b 0%, #090d16 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}
/* Client & Engagement Management Badges & Styles */
.badge-entity {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  font-size: 11px;
}

.badge-audit-type {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 600;
  font-size: 11px;
}

.badge-status-draft {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.badge-status-progress {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #93c5fd;
}

.badge-status-review {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.badge-status-completed {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-status-archived {
  background: #f3f4f6;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
}

.timeline-container {
  position: relative;
  padding-left: 24px;
  margin-top: 16px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--primary);
}

.timeline-content {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.assistant-prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.assistant-prompt-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* --- Audit Risk & Findings Module Styles --- */
.risk-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: help;
}

.risk-score-critical {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.risk-score-high {
  background: #fff7ed;
  color: #c2410c;
  border-color: #ffedd5;
}

.risk-score-medium {
  background: #fffbeb;
  color: #b45309;
  border-color: #fef3c7;
}

.risk-score-low {
  background: #ecfdf5;
  color: #047857;
  border-color: #d1fae5;
}

.badge-module-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.risk-factor-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
}

.risk-factor-box .factor-title {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 3px;
}

.risk-factor-box .factor-value {
  font-weight: 700;
  color: #0f172a;
}

.risk-factor-box .factor-impact {
  font-size: 11px;
  color: #4f46e5;
  font-weight: 600;
}

.badge-under-review {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Audit Checklist Module Status Badges */
.badge-chk-not-started {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-weight: 600;
}

.badge-chk-in-progress {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 600;
}

.badge-chk-completed {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-weight: 600;
}

.badge-chk-not-applicable {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}

.badge-chk-requires-review {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  font-weight: 700;
  animation: pulseRequiresReview 2.5s infinite;
}

@keyframes pulseRequiresReview {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
  50% { box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15); }
}

.category-tab-chip {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s ease-in-out;
}

.category-tab-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.category-tab-chip.active {
  background: #3b82f6;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.category-tab-chip .badge-count {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.category-tab-chip.active .badge-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ==========================================================================
   Working Papers Module Styles (SA 230 Compliant Audit Documentation)
   ========================================================================== */

.badge-wp-prepared {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-weight: 600;
}

.badge-wp-under-review {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  font-weight: 600;
}

.badge-wp-reviewed {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #86efac;
  font-weight: 700;
}

.badge-wp-needs-correction {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  font-weight: 700;
  animation: pulseRequiresReview 2.5s infinite;
}

.wp-area-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.wp-detail-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 250;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wp-detail-drawer {
  width: 780px;
  max-width: 95vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: slideDrawer 0.25s ease-out;
}

@keyframes slideDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.wp-drawer-header {
  padding: 18px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.wp-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.wp-drawer-footer {
  padding: 14px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.wp-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
  padding-bottom: 2px;
}

.wp-nav-tab {
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wp-nav-tab:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.wp-nav-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: #eff6ff;
}

.wp-field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.wp-field-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}

.wp-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 4px;
}

.wp-field-value {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.wp-upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wp-upload-dropzone:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.wp-attachment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}

.wp-attachment-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.wp-comment-bubble {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.wp-comment-bubble.reviewer {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.wp-link-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
}

.wp-link-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.wp-timeline-item {
  position: relative;
  padding-left: 20px;
  padding-bottom: 14px;
  border-left: 2px solid #e2e8f0;
  font-size: 12px;
}

.wp-timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.wp-timeline-dot {
  position: absolute;
  left: -5px;
  top: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
}

/* ==========================================================================
   FinAuditPro Comprehensive Dashboard Styles
   ========================================================================== */
.dash-top-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 1400px) {
  .dash-top-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .dash-top-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dash-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.dash-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.dash-stat-card.card-blue::before { background: #2563eb; }
.dash-stat-card.card-indigo::before { background: #6366f1; }
.dash-stat-card.card-orange::before { background: #ea580c; }
.dash-stat-card.card-red::before { background: #dc2626; }
.dash-stat-card.card-purple::before { background: #8b5cf6; }
.dash-stat-card.card-amber::before { background: #d97706; }

.dash-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dash-stat-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.dash-stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.dash-stat-val {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a;
  font-family: var(--font-sans);
}

.dash-stat-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Dashboard Sections Grid */
.dash-section-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dash-section-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

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

/* Interactive SVG & CSS Charts */
.dash-chart-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dash-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dash-chart-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-chart-subtitle {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

/* Bar Chart Components */
.chart-bar-interactive {
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-bar-interactive:hover {
  filter: brightness(0.9);
  transform: translateY(-2px);
}

.chart-horizontal-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.chart-horizontal-bar-row:hover {
  background: #f8fafc;
}

.chart-h-label {
  width: 140px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-h-track {
  flex: 1;
  height: 12px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.chart-h-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.chart-h-val {
  min-width: 45px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-sans);
  color: #0f172a;
}

/* Risk Posture Gauge */
.risk-posture-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.risk-posture-CRITICAL { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.risk-posture-HIGH { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.risk-posture-MODERATE { background: #fffbeb; color: #d97706; border: 1px solid #fef08a; }
.risk-posture-LOW { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }

/* Drill-Down Modal Styles */
.dash-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.15s ease-out;
}

.dash-modal-box {
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 960px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.dash-modal-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.dash-modal-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Top Bar Offline & Local AI Status Pill */


.top-offline-pill:hover {
  background: #1e293b;
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

/* AI Model Manager Styles */
.ai-manager-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

.ai-engine-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .ai-engine-selector-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ai-engine-option {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.ai-engine-option:hover {
  border-color: #93c5fd;
  background: #ffffff;
}

.ai-engine-option.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #2563eb;
}

.ai-privacy-shield-box {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.ai-status-indicator-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  margin-bottom: 20px;
}

/* ==========================================================================
   FinAuditPro Modern UI/UX Component Suite
   ========================================================================== */

/* 1. Unified Toast Notification Architecture */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.toast-item {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.08);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 5px solid #2563eb;
  transition: all 0.25s ease;
}

.toast-item.removing {
  animation: toastSlideOut 0.25s ease forwards;
}

.toast-item.success { border-left-color: #10b981; }
.toast-item.error { border-left-color: #ef4444; }
.toast-item.warning { border-left-color: #f59e0b; }
.toast-item.info { border-left-color: #3b82f6; }

.toast-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.toast-item.success .toast-icon { background: #d1fae5; color: #065f46; }
.toast-item.error .toast-icon { background: #fee2e2; color: #991b1b; }
.toast-item.warning .toast-icon { background: #fef3c7; color: #92400e; }
.toast-item.info .toast-icon { background: #dbeafe; color: #1e40af; }

.toast-title {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  flex: 1;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

.toast-close-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.toast-body {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
  padding-left: 32px;
  word-break: break-word;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(15, 23, 42, 0.12);
  width: 100%;
  transform-origin: left;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-12px) scale(0.92); }
}

/* 2. Unified Confirmation Modal Architecture */
.fin-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.fin-confirm-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  max-width: 520px;
  width: 100%;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fin-confirm-header {
  padding: 22px 24px 16px 24px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.fin-confirm-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.fin-confirm-icon-wrap.danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.fin-confirm-icon-wrap.warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.fin-confirm-icon-wrap.primary { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

.fin-confirm-title-area {
  flex: 1;
}

.fin-confirm-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.fin-confirm-msg {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.fin-confirm-consequences {
  margin: 0 24px 18px 24px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
}

.fin-confirm-consequences-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 8px;
}

.fin-confirm-consequences-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: #334155;
}

.fin-confirm-consequences-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.fin-confirm-consequences-list li::before {
  content: "•";
  color: #ef4444;
  font-weight: bold;
}

.fin-confirm-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* 3. Global Search Modal (⌘K / Ctrl+K) */
.global-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 20px 40px 20px;
  animation: fadeIn 0.15s ease;
}

.global-search-dialog {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  max-width: 680px;
  width: 100%;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
}

.global-search-input-wrap {
  display: flex;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  gap: 14px;
}

.global-search-input {
  flex: 1;
  border: none;
  font-size: 16px;
  color: #0f172a;
  outline: none;
  background: transparent;
}

.global-search-input::placeholder {
  color: #94a3b8;
}

.global-search-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px 14px;
}

.search-section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
  padding: 10px 12px 6px 12px;
}

.search-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.search-result-row:hover,
.search-result-row.selected {
  background: #eff6ff;
}

.search-result-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-result-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.global-search-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
}

.search-shortcut-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.search-shortcut-hint kbd {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--font-sans);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* 4. Human-Friendly Error Banner & Technical Diagnostic Box */
.error-banner-card {
  background: #ffffff;
  border: 1px solid #fecaca;
  border-left: 5px solid #ef4444;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.error-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-banner-guidance {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 14px;
}

.error-diagnostic-details {
  margin-top: 10px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  font-size: 12px;
}

.error-diagnostic-details summary {
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  outline: none;
}

.error-diagnostic-details pre {
  margin-top: 10px;
  padding: 10px;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* 5. Standardized Empty States */
.empty-state-card {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 580px;
  margin: 32px auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
}

.empty-state-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 13px;
  color: #64748b;
  max-width: 440px;
  line-height: 1.55;
  margin-bottom: 22px;
}

.empty-state-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* 6. Onboarding Hero for Fresh Practice */
.onboarding-hero-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  border-radius: 14px;
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
}

.onboarding-hero-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.onboarding-hero-subtitle {
  font-size: 14px;
  color: #94a3b8;
  max-width: 600px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.onboarding-step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.onboarding-step-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 18px 20px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.onboarding-step-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.onboarding-step-num {
  font-size: 11px;
  font-weight: 800;
  color: #60a5fa;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.onboarding-step-heading {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.onboarding-step-text {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
}

/* 7. Skeleton Shimmer Loaders */
.skeleton-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

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

.skeleton-box {
  width: 100%;
  height: 20px;
  margin-bottom: 8px;
}

.skeleton-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  margin-bottom: 16px;
}

/* 8. Table Usability Enhancements */
.table-container {
  overflow-x: auto;
  max-height: 70vh;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
}

.table-container table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-container thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 10;
  border-bottom: 2px solid var(--border);
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 10px 14px;
}

.table-wrap-text {
  white-space: normal !important;
  word-break: break-word;
  max-width: 300px;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

/* 9. Responsive Application Shell */
#mobile-sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: #334155;
}

#mobile-sidebar-toggle:hover {
  background: #f1f5f9;
}







@media (max-width: 900px) {
  #sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  user-select: none;
  transition: width 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

  #sidebar.mobile-open {
    transform: translateX(0);
  }

  #mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  

  

  

  .onboarding-step-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  #evidence-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .top-offline-pill span:not(.offline-dot) {
    display: none;
  }
}

/* =========================================================================
   First-Run Setup Wizard & Welcome Splash Styles
   ========================================================================= */
/* =========================================================================
   Unified Professional Authentication Suite (Sign In / Register / Activate)
   ========================================================================= */
.auth-suite-card {
  width: 540px;
  max-width: 95vw;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 1px 1px rgba(255, 255, 255, 0.2);
  overflow: hidden;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.auth-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 26px 32px 20px;
  color: #ffffff;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.auth-logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.auth-brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc !important;
  margin: 0;
  letter-spacing: -0.02em;
}

.auth-brand-text p {
  font-size: 12px;
  color: #94a3b8 !important;
  margin: 2px 0 0 0;
}

.auth-tabs-nav {
  display: flex;
  background: #090d16;
  padding: 6px;
  gap: 6px;
  border-bottom: 1px solid #1e293b;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.auth-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.auth-tab-btn.active {
  color: #ffffff;
  background: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.auth-tab-btn .tab-badge {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 10px;
}

.auth-body-container {
  padding: 26px 32px 30px;
  background: #ffffff;
}

.auth-demo-chips {
  margin-bottom: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
}

.auth-demo-chips-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-chip-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #0284c7;
  transform: translateY(-1px);
}

.auth-chip-btn .chip-role {
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
}

.auth-info-banner {
  display: flex;
  gap: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  color: #166534;
  font-size: 13px;
  line-height: 1.45;
}

.auth-info-banner.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.auth-info-banner .banner-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.wizard-card {
  width: 680px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: modalFadeIn 0.25s ease-out;
}

.login-header {
  background: #0f172a;
  padding: 20px 24px;
  color: #ffffff;
}

.login-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.login-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
  line-height: 1.4;
}

.login-logo {
  width: 36px;
  height: 36px;
  background: #0284c7;
  color: #ffffff;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.login-alert-box {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}

.login-alert-box.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.login-alert-box.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrap .form-control {
  padding-right: 42px;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 15px;
  line-height: 1;
  color: #64748b;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.password-toggle-btn:hover {
  opacity: 0.8;
}

.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}

.wizard-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.wizard-step-item.active {
  color: #38bdf8;
}

.wizard-step-item.completed {
  color: #10b981;
}

.wizard-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1e293b;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.wizard-step-item.active .wizard-step-num {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.5);
}

.wizard-step-item.completed .wizard-step-num {
  background: #059669;
  color: #ffffff;
}

.welcome-splash-card {
  width: 720px;
  max-width: 95vw;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.welcome-splash-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 36px 32px 28px;
  text-align: center;
  color: #ffffff;
}

.welcome-splash-hero h1 {
  color: #ffffff !important;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 12px 0 6px 0;
}

.welcome-splash-hero p {
  color: #94a3b8 !important;
  font-size: 13px;
  max-width: 480px;
  margin: 0 auto 20px auto;
  line-height: 1.5;
}

.welcome-splash-hero .login-logo {
  width: 44px;
  height: 44px;
  font-size: 20px;
  border-radius: 10px;
  margin: 0 auto 12px auto;
  background: #0284c7;
  color: #ffffff;
}

.welcome-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 24px;
}

.welcome-feature-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.welcome-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.splash-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}
.splash-actions button {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
}

.feature-content h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}
.feature-content p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.splash-footer {
  background: var(--bg-app);
  border-top: 1px solid var(--border);
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}


#main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-app);
}

#top-bar {
  display: flex;
  align-items: center;
  padding: 0 24px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  height: 56px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.engagement-selector-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-app);
  height: 38px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border);
  max-width: 620px;
  min-width: 220px;
  flex: 0 1 auto;
  box-sizing: border-box;
  transition: all 0.15s ease;
  cursor: pointer;
}

.engagement-selector-box:hover {
  background: var(--bg-card);
  border-color: var(--border-dark, #cbd5e1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.engagement-selector-box:focus-within {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  background: var(--bg-card);
}

.engagement-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.engagement-select {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 500px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding-right: 2px;
}

.engagement-chevron {
  color: var(--text-muted, #64748b);
  flex-shrink: 0;
  pointer-events: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.engagement-selector-box:hover .engagement-chevron {
  color: var(--text-main);
}

.global-search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  box-sizing: border-box;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 0 12px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.15s ease;
  max-width: 220px;
  flex-shrink: 1;
  white-space: nowrap;
  overflow: hidden;
}

.global-search-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-trigger:hover {
  background: var(--bg-card);
  border-color: var(--border-dark, #cbd5e1);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.global-search-trigger kbd {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.top-offline-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}
.user-profile-badge:hover {
  background: var(--bg-app);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
}
.user-avatar.admin {
  background: var(--primary);
}

/* =========================================================================
   General Ledger 13-Point Anomaly Filter Suite
   ========================================================================= */

.gl-anomaly-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 8px);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.gl-anomaly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.gl-anomaly-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gl-anomaly-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gl-anomaly-tag {
  font-size: 10.5px;
  font-weight: 600;
  background: var(--primary-light, #f1f5f9);
  color: var(--primary, #2563eb);
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.gl-anomaly-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.gl-scope-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.gl-scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-app);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.gl-scope-pill:hover {
  background: var(--bg-card);
  border-color: var(--border-dark, #cbd5e1);
  color: var(--text-main);
  transform: translateY(-1px);
}

.gl-scope-pill.active-all {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.gl-scope-pill.active-flagged {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.gl-scope-pill.active-clean {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.gl-scope-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

.gl-divider-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 10px 0;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.gl-divider-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.gl-rules-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gl-rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.gl-rule-chip:hover {
  background: var(--bg-app);
  border-color: var(--border-dark, #cbd5e1);
  color: var(--text-main);
  transform: translateY(-1px);
}

.gl-rule-chip.has-anomalies {
  border-color: #fecaca;
  color: #991b1b;
  background: #fffafa;
}

.gl-rule-chip.has-anomalies:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.gl-rule-chip.is-zero {
  opacity: 0.7;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
}

.gl-rule-chip.is-zero:hover {
  opacity: 1;
  border-color: var(--border-dark, #cbd5e1);
  color: var(--text-secondary);
}

.gl-rule-chip.active {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
  font-weight: 600;
  opacity: 1 !important;
}

.gl-count-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.4;
}

.gl-count-badge.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.gl-count-badge.badge-zero {
  background: var(--bg-app, #f1f5f9);
  color: var(--text-muted);
}

.gl-rule-chip.active .gl-count-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

/* Premium Minimalist Tables */
.data-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-app);
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 11px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 12px 16px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background-color: var(--bg-app);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}


/* Premium Minimalist Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-card);
  width: 500px;
  max-width: 90vw;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-app);
}


/* Premium Minimalist Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ==========================================================================
   KPI & Stat Card Component System (Trial Balance, GL, Findings, Reconciliations)
   ========================================================================== */
.stat-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 22px !important;
  width: 100% !important;
}

@media (min-width: 1200px) {
  .stat-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }
}

.stat-card {
  background: var(--bg-surface, #ffffff) !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  border-radius: 8px !important;
  padding: 14px 16px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 85px !important;
  box-sizing: border-box !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.stat-card:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.stat-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: var(--text-muted, #64748b) !important;
  margin-bottom: 6px !important;
  line-height: 1.2 !important;
}

.stat-value {
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  margin-bottom: 4px !important;
  letter-spacing: -0.02em !important;
}

/* KPI Cards across Trial Balance, General Ledger, Reconciliations */
.kpi-card {
  background: var(--bg-surface, #ffffff) !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  border-radius: 8px !important;
  padding: 14px 16px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 90px !important;
  box-sizing: border-box !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.kpi-card:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.kpi-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: var(--text-muted, #64748b) !important;
  margin-bottom: 6px !important;
  line-height: 1.3 !important;
}

.kpi-value {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: var(--text-main, #0f172a) !important;
  line-height: 1.3 !important;
  margin-bottom: 4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.kpi-subtext {
  font-size: 11px !important;
  color: var(--text-muted, #94a3b8) !important;
  line-height: 1.3 !important;
  margin-top: auto !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* =========================================================================
   Working Papers Supporting Evidence & Tabular Data Viewer
   ========================================================================= */

.wp-file-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  max-width: 220px;
  text-align: left;
  user-select: none;
}

.wp-file-chip-btn:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
  box-shadow: 0 1px 3px rgba(22, 101, 52, 0.12);
  transform: translateY(-1px);
}

.wp-file-chip-btn .file-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.wp-file-chip-btn .file-chip-size {
  font-size: 10px;
  font-family: var(--font-mono);
  color: #15803d;
  flex-shrink: 0;
}

.wp-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--bg-app, #f1f5f9);
  color: var(--text-secondary, #475569);
  margin-left: 6px;
}

.wp-nav-tab.active .wp-tab-badge {
  background: #2563eb;
  color: #ffffff;
}

.wp-inline-tabular-card {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 8px);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.wp-tabular-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.wp-tabular-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wp-tabular-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wp-tabular-badge {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.wp-tabular-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wp-tabular-search {
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-main);
  width: 220px;
}

.wp-tabular-table-wrap {
  max-height: 420px;
  overflow: auto;
  position: relative;
}

.wp-tabular-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.wp-tabular-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid #f1f5f9;
  z-index: 2;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.wp-tabular-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f8fafc;
  color: var(--text-main);
}

.wp-tabular-table tr:nth-child(even) td {
  background: #fafbfc;
}

.wp-tabular-table tr:hover td {
  background: #f0f7ff;
}

.wp-tabular-table td.cell-num {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
}

.wp-tabular-table td.cell-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.wp-tabular-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-app);
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Modal High-Density Table */
.wp-modal-tabular-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wp-modal-tabular-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg, 12px);
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border: 1px solid var(--border);
}

