/* PreQualPro Design System - Apple-inspired, clean, professional */

:root {
  /* Neutrals */
  --white: #FFFFFF;
  --frost: #F4F6F8;
  --mist: #E2E6EB;
  --fog: #C9D0D8;
  --steel: #8D99A6;
  --slate: #5C6A78;
  --iron: #3A4550;
  --ink: #1C2329;

  /* Primary */
  --primary-50: #F3F8FE;
  --primary-100: #E8F2FD;
  --primary-500: #0F6FDE;
  --primary-600: #0B5BBC;
  --primary-700: #084799;

  /* Accent */
  --accent-100: #FDF0EB;
  --accent-500: #E85D2D;
  --accent-600: #CC4D20;

  /* Semantic */
  --success-100: #E6F5EF;
  --success-500: #0D9460;
  --warning-100: #FDF6E6;
  --warning-500: #D4920D;
  --error-100: #FCEBEB;
  --error-500: #D93636;

  /* Confidence */
  --confidence-high: #0D9460;
  --confidence-medium: #D4920D;
  --confidence-low: #D93636;

  /* Trends */
  --trend-up: #0D9460;
  --trend-stable: #0F6FDE;
  --trend-declining: #D4920D;
  --trend-ineligible: #D93636;

  /* Document Types */
  --doc-w2: #0F6FDE;
  --doc-paystub: #0D8B94;
  --doc-tax: #7B4B94;
  --doc-schedule-c: #5A8F6E;
  --doc-schedule-e: #A66B42;
  --doc-k1: #5B5BD6;
  --doc-bank: #4A7C9B;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(28, 35, 41, 0.04);
  --shadow-md: 0 2px 8px rgba(28, 35, 41, 0.08);
  --shadow-lg: 0 8px 24px rgba(28, 35, 41, 0.12);
  --shadow-xl: 0 16px 48px rgba(28, 35, 41, 0.16);

  /* Transitions */
  --transition-fast: 100ms ease;
  --transition-base: 150ms ease;
  --transition-slow: 250ms ease;

  /* Legacy compatibility aliases */
  --primary: var(--primary-500);
  --primary-hover: var(--primary-600);
  --bg-primary: var(--frost);
  --bg-card: var(--white);
  --bg-hover: var(--frost);
  --border: var(--mist);
  --border-focus: var(--primary-500);
  --text-primary: var(--iron);
  --text-secondary: var(--slate);
  --text-muted: var(--steel);
  --success: var(--success-500);
  --warning: var(--warning-500);
  --error: var(--error-500);
  --info: var(--primary-500);
  --spacing-xs: var(--space-1);
  --spacing-sm: var(--space-2);
  --spacing-md: var(--space-4);
  --spacing-lg: var(--space-6);
  --spacing-xl: var(--space-8);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--frost);
  color: var(--iron);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 15px;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--mist);
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo-image {
  height: 32px;
  width: auto;
}

.logo h1 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--primary-500);
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: var(--space-2);
}

.nav-link {
  color: var(--slate);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--primary-500);
  background: var(--primary-50);
}

.nav-link.active {
  color: var(--primary-500);
  background: var(--primary-100);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: var(--space-8);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Welcome Card */
.welcome-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--mist);
  margin-bottom: var(--space-8);
}

.welcome-card h2 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--ink);
  letter-spacing: -0.02em;
}

.welcome-card p {
  color: var(--slate);
  font-size: 17px;
  margin-bottom: var(--space-6);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--success-100);
  border-radius: var(--radius-full);
  color: var(--success-500);
  font-weight: 500;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success-500);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--mist);
  transition: all var(--transition-base);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--fog);
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--ink);
}

.feature-card p {
  color: var(--slate);
  font-size: 15px;
}

/* Footer */
.footer {
  background: var(--white);
  border-top: 1px solid var(--mist);
  padding: var(--space-6);
  text-align: center;
  color: var(--steel);
  font-size: 13px;
}

/* Utility Classes */
.text-mono {
  font-family: var(--font-mono);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  height: 40px;
}

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

.btn-primary:hover {
  background: var(--primary-600);
  box-shadow: var(--shadow-sm);
}

.btn-primary:active {
  background: var(--primary-700);
}

.btn-accent {
  background: var(--accent-500);
  color: white;
}

.btn-accent:hover {
  background: var(--accent-600);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--white);
  color: var(--iron);
  border: 1px solid var(--fog);
}

.btn-secondary:hover {
  background: var(--frost);
  border-color: var(--steel);
}

.btn-ghost {
  background: transparent;
  color: var(--slate);
}

.btn-ghost:hover {
  background: var(--frost);
  color: var(--iron);
}

.btn-danger {
  background: var(--error-500);
  color: white;
}

.btn-danger:hover {
  background: #c42f2f;
}

/* Button Sizes */
.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  height: 28px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  height: 32px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 17px;
  height: 48px;
}

.btn-full {
  width: 100%;
}

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

/* Auth Pages */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: var(--space-10);
  background: var(--frost);
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--mist);
  width: 100%;
  max-width: 420px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: var(--space-1);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}

.auth-subtitle {
  text-align: center;
  color: var(--slate);
  margin-bottom: var(--space-6);
  font-size: 15px;
}

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

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--mist);
  color: var(--slate);
}

.auth-footer a {
  color: var(--primary-500);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.demo-credentials {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 13px;
}

.demo-credentials p {
  margin: var(--space-1) 0;
  color: var(--iron);
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-group label {
  font-weight: 500;
  color: var(--iron);
  font-size: 13px;
}

.form-group .optional {
  color: var(--steel);
  font-weight: 400;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--fog);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  height: 44px;
  transition: all var(--transition-fast);
  background: var(--white);
}

.form-group textarea {
  height: auto;
  min-height: 100px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(15, 111, 222, 0.1);
}

.form-group input::placeholder {
  color: var(--steel);
}

.form-group .helper-text {
  font-size: 13px;
  color: var(--steel);
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: var(--error-500);
}

.form-group.error .helper-text {
  color: var(--error-500);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* Error Message */
.error-message {
  background: var(--error-100);
  color: var(--error-500);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: 13px;
  text-align: center;
  border: 1px solid rgba(217, 54, 54, 0.2);
}

/* Dashboard Styles */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
}

.dashboard-header h2 {
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.user-greeting {
  color: var(--slate);
  font-weight: 500;
  display: flex;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--mist);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-500);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.stat-label {
  color: var(--slate);
  font-size: 13px;
  margin-top: var(--space-1);
  font-weight: 500;
}

.section-header {
  margin-bottom: var(--space-4);
}

.section-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

/* Loan Files List */
.loan-files-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.loan-file-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--mist);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.loan-file-card:hover {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-md);
}

.loan-file-info h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--ink);
}

.loan-file-meta {
  color: var(--slate);
  font-size: 13px;
}

/* Status Badges */
.status-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
}

.status-draft {
  background: var(--frost);
  color: var(--slate);
}

.status-documents-pending {
  background: var(--primary-100);
  color: var(--primary-500);
}

.status-processing {
  background: var(--warning-100);
  color: var(--warning-500);
}

.status-review-needed {
  background: var(--error-100);
  color: var(--error-500);
}

.status-complete, .status-exported {
  background: var(--success-100);
  color: var(--success-500);
}

.empty-state {
  text-align: center;
  padding: var(--space-10);
  color: var(--slate);
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--fog);
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(28, 35, 41, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: var(--space-4);
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--steel);
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.modal-close:hover {
  color: var(--iron);
  background: var(--frost);
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  justify-content: flex-end;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header {
    padding: var(--space-4);
  }

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

  .welcome-card {
    padding: var(--space-6);
  }

  .welcome-card h2 {
    font-size: 24px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    gap: var(--space-4);
    align-items: flex-start;
  }

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

  .loan-file-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .nav {
    gap: var(--space-1);
  }

  .nav-link {
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
  }
}

/* Borrower Detail Page */
.page-header {
  margin-bottom: var(--space-8);
}

.back-link {
  color: var(--slate);
  text-decoration: none;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.back-link:hover {
  color: var(--primary-500);
}

.page-header h2 {
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.borrower-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-8);
}

.borrower-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.info-card, .section-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--mist);
}

.info-card h3, .section-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--ink);
}

.info-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.info-label {
  font-size: 11px;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.info-value {
  color: var(--iron);
  font-size: 15px;
}

/* Income Summary */
.income-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.income-total {
  text-align: center;
  padding: var(--space-5);
  background: var(--success-100);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(13, 148, 96, 0.2);
}

.income-label {
  display: block;
  font-size: 11px;
  color: var(--success-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.income-value {
  display: block;
  font-size: 36px;
  font-weight: 700;
  color: var(--success-500);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.income-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--mist);
}

.income-item:last-child {
  border-bottom: none;
}

.income-type {
  color: var(--slate);
  font-size: 13px;
}

.income-amount {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--iron);
}

.no-income {
  color: var(--steel);
  font-size: 13px;
  text-align: center;
  padding: var(--space-4);
}

.income-annual {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--mist);
}

.income-value-small {
  font-size: 15px;
  font-weight: 600;
  color: var(--slate);
  font-family: var(--font-mono);
}

/* Income Details */
.income-detail-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
  border: 1px solid var(--mist);
  transition: all var(--transition-base);
}

.income-detail-item:hover {
  border-color: var(--fog);
  box-shadow: var(--shadow-sm);
}

.income-detail-item.excluded {
  opacity: 0.6;
}

.income-detail-header {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.income-detail-header:hover {
  background: var(--frost);
}

.income-detail-header.expanded {
  background: var(--frost);
  border-bottom: 1px solid var(--mist);
}

.income-detail-header.expanded .expand-icon {
  transform: rotate(180deg);
}

.income-detail-main {
  flex: 1;
}

.income-detail-type {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.income-type-badge {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.income-detail-source {
  font-size: 13px;
  color: var(--slate);
}

.income-detail-amounts {
  text-align: right;
  margin-right: var(--space-4);
}

.income-detail-monthly {
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--success-500);
}

.income-detail-monthly .per-month {
  font-size: 11px;
  font-weight: 400;
  color: var(--steel);
}

.income-detail-annual {
  font-size: 13px;
  color: var(--slate);
  font-family: var(--font-mono);
}

.income-detail-expand {
  color: var(--steel);
}

.expand-icon {
  transition: transform var(--transition-fast);
}

/* Audit Trail */
.income-audit-trail {
  padding: var(--space-4);
  background: var(--frost);
}

.audit-section {
  display: flex;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--mist);
}

.audit-section:last-of-type {
  border-bottom: none;
}

.audit-label {
  width: 120px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audit-value {
  flex: 1;
  font-size: 13px;
  color: var(--iron);
}

.audit-value .formula {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--iron);
}

.audit-value .guideline {
  font-size: 11px;
  color: var(--steel);
  margin-top: var(--space-1);
}

.audit-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--mist);
}

.view-fields-btn {
}

/* Section Header Row */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.section-header-row h3 {
  margin-bottom: 0;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--fog);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-6);
  background: var(--white);
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary-500);
  background: var(--primary-50);
}

.upload-zone-content p {
  margin: var(--space-2) 0;
  color: var(--slate);
}

.upload-hint {
  font-size: 13px;
  color: var(--steel);
}

/* Documents List */
.documents-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.document-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--mist);
  transition: all var(--transition-base);
}

.document-card:hover {
  border-color: var(--fog);
  box-shadow: var(--shadow-sm);
}

/* Document type indicator border */
.document-card[data-type="w2"] {
  border-left: 4px solid var(--doc-w2);
}

.document-card[data-type="paystub"] {
  border-left: 4px solid var(--doc-paystub);
}

.document-card[data-type="1040"] {
  border-left: 4px solid var(--doc-tax);
}

.document-card[data-type="schedule_c"] {
  border-left: 4px solid var(--doc-schedule-c);
}

.document-card[data-type="schedule_e"] {
  border-left: 4px solid var(--doc-schedule-e);
}

.document-card[data-type="k1"] {
  border-left: 4px solid var(--doc-k1);
}

.document-card[data-type="bank_statement"] {
  border-left: 4px solid var(--doc-bank);
}

.document-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.document-icon {
  font-size: 24px;
  color: var(--slate);
}

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

.document-info h4 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: var(--space-1);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-meta {
  font-size: 13px;
  color: var(--slate);
}

.document-delete-btn {
  background: transparent;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  color: var(--steel);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.document-delete-btn:hover {
  background: var(--error-100);
  color: var(--error-500);
}

.document-delete-btn:active {
  transform: scale(0.95);
}

/* Confidence Badges */
.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
}

.confidence-high {
  background: var(--success-100);
  color: var(--success-500);
  border: 1px solid rgba(13, 148, 96, 0.2);
}

.confidence-medium {
  background: var(--warning-100);
  color: var(--warning-500);
  border: 1px solid rgba(212, 146, 13, 0.2);
}

.confidence-low {
  background: var(--error-100);
  color: var(--error-500);
  border: 1px solid rgba(217, 54, 54, 0.2);
}

/* Trend Indicators */
.trend-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 13px;
  font-weight: 500;
}

.trend-up {
  color: var(--trend-up);
}

.trend-stable {
  color: var(--trend-stable);
}

.trend-declining {
  color: var(--trend-declining);
}

.trend-ineligible {
  color: var(--trend-ineligible);
}

/* Upload Progress */
.upload-progress {
  text-align: center;
  padding: var(--space-6);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-lg);
}

.upload-progress p {
  color: var(--primary-500);
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--mist);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary-500);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 1; width: 30%; }
  50% { opacity: 0.7; width: 70%; }
}

/* Processing Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}

/* Mobile Responsive - Borrower Page */
@media (max-width: 900px) {
  .borrower-layout {
    grid-template-columns: 1fr;
  }
}

/* Focus States for Accessibility */
:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--frost);
  font-weight: 600;
  font-size: 13px;
  color: var(--slate);
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--mist);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--mist);
  font-size: 15px;
}

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

.data-table tr:hover {
  background: var(--primary-50);
}

.data-table .total-row {
  background: var(--primary-100);
  font-weight: 600;
}

.data-table .number {
  font-family: var(--font-mono);
  text-align: right;
}
