/* ==========================================================================
   APPARK-002 — Education Consultant / Sub-Agent OS
   B2B SaaS Design System & Operational Dashboard Styles
   ========================================================================== */

:root {
  /* Surface Layers */
  --bg-app: #080d1a;
  --bg-surface: #0f172a;
  --bg-card: #131c31;
  --bg-card-hover: #192542;
  --bg-card-subtle: #0d1527;
  
  /* Borders */
  --border-subtle: #1e293b;
  --border-default: #334155;
  --border-highlight: rgba(99, 102, 241, 0.35);
  
  /* Brand & Accents */
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-glow: rgba(99, 102, 241, 0.25);
  
  /* Semantic Colors */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.3);
  
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.3);
  
  --danger: #f43f5e;
  --danger-bg: rgba(244, 63, 94, 0.12);
  --danger-border: rgba(244, 63, 94, 0.3);
  
  --info: #0ea5e9;
  --info-bg: rgba(14, 165, 233, 0.12);
  --info-border: rgba(14, 165, 233, 0.3);
}

/* Base Document */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-app);
  color: #f1f5f9;
  letter-spacing: -0.011em;
}

/* Custom modern scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #090e1d;
}

::-webkit-scrollbar-thumb {
  background: #25334d;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3b4e6d;
}

/* Number display utility */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Surfaces, Cards & Containers
   ========================================================================== */

.saas-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.saas-card-interactive:hover {
  border-color: var(--border-default);
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.saas-card-elevated {
  background: linear-gradient(180deg, rgba(25, 36, 61, 0.6) 0%, rgba(19, 28, 49, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

/* KPI Metric Cards */
.kpi-metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.kpi-metric-card:hover {
  border-color: var(--border-default);
}

.kpi-metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
  opacity: 0.6;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1rem;
  border-radius: 0.5rem;
  padding: 0.5rem 0.875rem;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px 0 rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  box-shadow: 0 4px 12px 0 rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  background-color: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

.btn-secondary:hover {
  background-color: #334155;
  color: #ffffff;
  border-color: #475569;
}

.btn-ghost {
  background-color: transparent;
  color: #94a3b8;
}

.btn-ghost:hover {
  background-color: rgba(51, 65, 85, 0.5);
  color: #f1f5f9;
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.btn-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  background-color: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.btn-xs {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  gap: 0.35rem;
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

/* ==========================================================================
   Form Controls & Inputs
   ========================================================================== */

.saas-input,
.saas-select {
  background-color: #0b1325;
  border: 1px solid #22314d;
  color: #e2e8f0;
  font-size: 0.75rem;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.saas-input:focus,
.saas-select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.saas-input::placeholder {
  color: #64748b;
}

.saas-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   Tables & Data Displays
   ========================================================================== */

.saas-table {
  width: 100%;
  text-align: left;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.75rem;
}

.saas-table th {
  padding: 0.75rem 1rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  background-color: #0a1122;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.saas-table td {
  padding: 0.85rem 1rem;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(30, 41, 59, 0.7);
  vertical-align: middle;
}

.saas-table tbody tr {
  transition: background-color 0.15s ease;
}

.saas-table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.45);
}

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

/* ==========================================================================
   Stage Badges (Preserving exact existing class names for tests)
   ========================================================================== */

.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.68rem;
  border-width: 1px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
}

.stage-registered {
  background-color: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.3);
}

.stage-counseling {
  background-color: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.stage-documents {
  background-color: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.stage-application {
  background-color: rgba(129, 140, 248, 0.12);
  color: #818cf8;
  border-color: rgba(129, 140, 248, 0.3);
}

.stage-offer {
  background-color: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

.stage-enrolled {
  background-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}

.stage-disbursed {
  background-color: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.45);
}

.stage-disputed {
  background-color: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.stage-withdrawn {
  background-color: rgba(71, 85, 105, 0.25);
  color: #94a3b8;
  border-color: rgba(71, 85, 105, 0.45);
}

/* ==========================================================================
   Document Status Pills (Preserving exact existing class names for tests)
   ========================================================================== */

.doc-pill {
  font-size: 0.65rem;
  padding: 0.18rem 0.55rem;
  border-radius: 0.375rem;
  font-weight: 600;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  border-width: 1px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.doc-pill-pending {
  background-color: rgba(51, 65, 85, 0.6);
  color: #94a3b8;
  border-color: #475569;
}

.doc-pill-pending:hover {
  border-color: #64748b;
  color: #cbd5e1;
}

.doc-pill-submitted {
  background-color: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

.doc-pill-submitted:hover {
  background-color: rgba(59, 130, 246, 0.28);
}

.doc-pill-verified {
  background-color: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.doc-pill-rejected {
  background-color: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   Empty States & Feedback States
   ========================================================================== */

.saas-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.saas-empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background-color: #121c32;
  border: 1px solid #233352;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.saas-empty-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.25rem;
}

.saas-empty-desc {
  font-size: 0.75rem;
  color: #64748b;
  max-width: 24rem;
  line-height: 1.4;
}

/* Micro-interaction highlight */
.pulse-subtle {
  animation: pulseSubtle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseSubtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Accessibility focus indicator */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 1px;
}
