/* Debtors & Creditors Financial Dashboard Stylesheet */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  
  --chart-debtor: #06b6d4;
  --chart-creditor: #f43f5e;
  --chart-gap: #10b981;
  --chart-liab: #f59e0b;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: rgba(11, 15, 25, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

[data-theme="light"] .app-header {
  background-color: rgba(248, 250, 252, 0.88);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.brand-titles h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-titles .subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.period-tag {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.72rem;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* Main Container */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Executive KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent-primary));
  opacity: 0.85;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.15);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.05);
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.7rem;
}

.badge-positive {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.badge-negative {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.badge-neutral {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

/* Navigation Tabs - 2 Rows Grid */
.nav-tabs-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  width: 100%;
}

.nav-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .nav-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .nav-tabs {
    grid-template-columns: 1fr;
  }
}

.nav-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.4rem;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

.nav-tab.active {
  color: #fff;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

/* Global Controls Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.select-control, .input-control {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.select-control:focus, .input-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--border-focus);
}

/* Dashboard Views */
.dashboard-view {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.3s ease-in-out;
}

.dashboard-view.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chart Grid */
.charts-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 1.25rem;
}

.charts-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.chart-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-md);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.chart-titles h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-titles p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.chart-actions {
  display: flex;
  gap: 0.35rem;
}

.chart-body {
  position: relative;
  width: 100%;
  min-height: 280px;
  max-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Data Tables */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-header-bar {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-titles h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.table-titles p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.table-search-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
  max-height: 480px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

thead {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
}

th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  white-space: nowrap;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.numeric-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Party Trajectory Card */
.party-trajectory-panel {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .party-trajectory-panel {
    grid-template-columns: 1fr;
  }
}

.party-selector-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.party-list-scroll {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 0.25rem;
}

.party-item {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.party-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color);
}

.party-item.selected {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
}

.party-item-name {
  font-weight: 600;
  font-size: 0.82rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-item-amount {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Utilities */
.text-cyan { color: var(--accent-cyan); }
.text-emerald { color: var(--accent-emerald); }
.text-rose { color: var(--accent-rose); }
.text-amber { color: var(--accent-amber); }
.text-purple { color: var(--accent-purple); }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Authentication Overlay & Lock Screen */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1.5rem;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

[data-theme="light"] .auth-overlay {
  background: rgba(248, 250, 252, 0.88);
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 35px rgba(99, 102, 241, 0.2);
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2rem;
  text-align: center;
  animation: authSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-icon-badge {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-input-group {
  text-align: left;
}

.auth-input-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.auth-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: var(--transition);
  outline: none;
}

.auth-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.auth-input.input-error {
  border-color: var(--accent-rose);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.25);
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.auth-btn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
  color: #ffffff;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  margin-top: 0.5rem;
}

.auth-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.auth-error {
  color: var(--accent-rose);
  font-size: 0.82rem;
  font-weight: 500;
  display: none;
  margin-top: 0.25rem;
}

.auth-error.visible {
  display: block;
}

/* ==========================================================================
   PARETO CONCENTRATION VIEW (80/20 RULE) STYLES
   ========================================================================== */
.pareto-section {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.pareto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.25rem;
}

.pareto-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.pareto-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.pareto-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--card-accent, var(--accent-primary));
}

.pareto-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.pareto-title-group h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pareto-title-group p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.pareto-badge-pill {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.pareto-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

[data-theme="light"] .pareto-stats-grid {
  background: rgba(0, 0, 0, 0.02);
}

.pareto-stat-item .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.pareto-stat-item .stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.15rem;
}

.pareto-stat-item .stat-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.pareto-bar-container {
  margin-top: 0.85rem;
}

.pareto-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.pareto-bar-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
}

[data-theme="light"] .pareto-bar-track {
  background: rgba(0, 0, 0, 0.06);
}

.pareto-bar-segment {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.segment-tier-a {
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
}

.segment-tier-b {
  background: #f59e0b;
}

.segment-tier-c {
  background: #6b7280;
}

.segment-cred-a {
  background: linear-gradient(90deg, #f43f5e, #a855f7);
}

.pareto-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.pareto-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pareto-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pareto-tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tier-badge-a {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.tier-badge-b {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tier-badge-c {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.tier-badge-cred-a {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   STATUTORY LIABILITIES DUE CALENDAR STYLES
   ========================================================================== */
.statutory-section {
  margin-top: 1.75rem;
  margin-bottom: 1.5rem;
}

.statutory-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.statutory-banner-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.statutory-banner-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.statutory-summary-badges {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.stat-summary-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  text-align: right;
}

.stat-summary-pill .stat-pill-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-summary-pill .stat-pill-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-amber);
}

.statutory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.1rem;
}

.statutory-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.statutory-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.statutory-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stat-title-area {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.stat-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.stat-rule {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.countdown-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-imminent {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
  animation: pulse-border 2s infinite;
}

.badge-soon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-upcoming {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(244, 63, 94, 0.35); }
  50% { border-color: rgba(244, 63, 94, 0.85); box-shadow: 0 0 8px rgba(244, 63, 94, 0.3); }
}

.stat-body {
  margin: 0.75rem 0;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.025);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

[data-theme="light"] .stat-body {
  background: rgba(0, 0, 0, 0.02);
}

.stat-due-info .due-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-due-info .due-date {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.1rem;
}

.stat-amount-info {
  text-align: right;
}

.stat-amount-info .amount-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-amount-info .amount-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-amber);
  margin-top: 0.1rem;
}

.stat-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.5rem;
}

[data-theme="light"] .stat-progress-bar {
  background: rgba(0, 0, 0, 0.06);
}

.stat-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ==========================================================================
   TODAY'S ACTIONS TAB STYLES
   ========================================================================== */
.actions-overview-banner {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.1), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.actions-banner-info h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.actions-banner-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.actions-banner-metrics {
  display: flex;
  gap: 1rem;
}

.action-kpi-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 100px;
}

.action-kpi-pill .kpi-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.action-kpi-pill .kpi-num {
  font-size: 1.2rem;
  font-weight: 800;
  margin-top: 0.1rem;
}

.actions-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.action-queue-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.action-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.action-queue-title h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-queue-title p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.action-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 520px;
  padding-right: 0.35rem;
}

.action-row-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

[data-theme="light"] .action-row-item {
  background: rgba(0, 0, 0, 0.02);
}

.action-row-item:hover {
  border-color: var(--border-focus);
  transform: translateX(3px);
  background: rgba(255, 255, 255, 0.04);
}

.action-party-info {
  flex: 1;
  min-width: 0;
}

.action-party-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-party-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-values {
  text-align: right;
  flex-shrink: 0;
}

.action-main-val {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
}

.action-sub-val {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Clean & Professional Action Badges */
.badge-critical {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  letter-spacing: 0.02em;
}

.badge-high-overdue {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  letter-spacing: 0.02em;
}

.badge-followup {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.badge-stalled {
  background: rgba(107, 114, 128, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(107, 114, 128, 0.3);
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.badge-standard {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.badge-fire {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.badge-stuck {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.badge-pay-now {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   REAL AGING BUCKETS MATRIX STYLES
   ========================================================================== */
.aging-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.aging-summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

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

.aging-summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--bucket-color, var(--accent-cyan));
}

.aging-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.aging-card-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.aging-card-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.creditor-terms-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.creditor-term-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.creditor-term-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.creditor-term-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.creditor-term-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-rose);
  text-align: right;
}

/* ==========================================================================
   LIQUIDITY RISK ALERT & CASH-IN-BANK BAR
   ========================================================================== */
.liquidity-bar-container {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.65rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.liquidity-bar-container.alert-danger {
  border-color: rgba(244, 63, 94, 0.4);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(17, 24, 39, 0.85));
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.12);
}

[data-theme="light"] .liquidity-bar-container.alert-danger {
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(244, 63, 94, 0.35);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.08);
}

.liquidity-bar-container.alert-healthy {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(17, 24, 39, 0.85));
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.1);
}

[data-theme="light"] .liquidity-bar-container.alert-healthy {
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.08);
}

.liquidity-banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.15rem;
}

.liquidity-info {
  flex: 1;
  min-width: 290px;
}

.liquidity-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}

.status-tag-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.status-tag-healthy {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.liquidity-info h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.liquidity-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
  line-height: 1.5;
}

.liquidity-controls-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 320px;
}

.cash-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cash-input-wrap label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.cash-input-field .currency-symbol {
  position: absolute;
  left: 0.9rem;
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 1rem;
  pointer-events: none;
}

.cash-input-field input {
  padding: 0.65rem 1rem 0.65rem 2.1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: var(--transition);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .cash-input-field input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
}

.cash-input-field input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.cash-quick-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.btn-quick-cash {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .btn-quick-cash {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-secondary);
}

.btn-quick-cash:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

.liquidity-metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
}

[data-theme="light"] .liquidity-metrics-strip {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.strip-item {
  display: flex;
  flex-direction: column;
}

.strip-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.strip-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   PARTY RISK & PATTERN SCORING STYLES
   ========================================================================== */
.party-risk-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

[data-theme="light"] .party-risk-card {
  background: rgba(0, 0, 0, 0.02);
}

.party-risk-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.risk-level-badge {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.risk-level-high {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.risk-level-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.risk-level-low {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.party-pattern-flags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pattern-flag-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.pattern-flag-pill.flag-escalating {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.pattern-flag-pill.flag-aging {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.pattern-flag-pill.flag-stagnant {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  border-color: rgba(99, 102, 241, 0.3);
}




