/* =========================================================================
   Local Self-Hosted Font Faces with font-display: swap
   ========================================================================= */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/Geist-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/Geist-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/Geist-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/Geist-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/static/fonts/Geist-800.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/Inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/Inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/Inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/Inter-700.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/JetBrainsMono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/JetBrainsMono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/JetBrainsMono-600.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/JetBrainsMono-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url('/static/fonts/MaterialSymbolsOutlined.woff2') format('woff2');
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* =========================================================================
   FinOps Precision & Independent Agency Design System Stylesheet
   Design System Asset ID: assets/14377250085497032579
   ========================================================================= */

:root {

  /* Surfaces & Canvases */
  --canvas-light: #F8FAFC;
  --surface-pure: #FFFFFF;
  
  /* Ink & Typography */
  --ink-charcoal: #111C2D;     /* Primary text (No #000000) */
  --slate-muted: #64748B;      /* Secondary text, metadata */
  --border-whisper: rgba(226, 232, 240, 0.85); /* 1px structural dividing lines */
  
  /* Single Accent Rule: Interactive Primary Actions */
  --primary: #0F766E;          /* Precision Teal */
  --primary-hover: #005C55;    /* Deep Forest Tint */
  --primary-light: #F0FDFA;    /* Teal whisper tint */
  --primary-focus: rgba(15, 118, 110, 0.25);
  
  /* Status Colors (Strictly for state badges and tabular indicators) */
  --success: #047857;          /* Solvent Green (Paid) - calibrated WCAG AA */
  --success-light: #ECFDF5;
  --warning: #B45309;          /* Amber Ochre (Pending) - calibrated WCAG AA */
  --warning-light: #FFFBEB;
  --danger: #B91C1C;           /* Muted Crimson (Overdue) */
  --danger-light: #FEF2F2;
  --draft: #4338CA;            /* Draft Violet-Slate - calibrated WCAG AA */
  --draft-light: #EEF2FF;
  
  /* Slates & Neutrals */
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #111C2D;

  /* Typography Families */
  --font-display: "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--ink-charcoal);
  background-color: var(--canvas-light);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .font-display, .font-headline {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink-charcoal);
  font-weight: 600;
}

.font-mono, .tabular-nums {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

/* Material Symbols Outlined Alignment */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* Layout Containers */
.app-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--canvas-light);
}

.sidebar {
  width: 260px;
  background-color: var(--surface-pure);
  border-right: 1px solid var(--border-whisper);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-bar {
  height: 64px;
  background-color: var(--surface-pure);
  border-bottom: 1px solid var(--border-whisper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.content-area {
  padding: 1.5rem;
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* Card Surfaces */
.card {
  background-color: var(--surface-pure);
  border-radius: 0.75rem;
  border: 1px solid var(--border-whisper);
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

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

/* Metric KPI Cards */
.kpi-card {
  background-color: var(--surface-pure);
  border-radius: 0.75rem;
  border: 1px solid var(--border-whisper);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-muted);
}

.kpi-amount {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink-charcoal);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0.5rem 0 0.25rem 0;
}

/* Typography & Metadata */
.text-muted { color: var(--slate-muted); }

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: capitalize;
  line-height: 1;
}

.badge-draft {
  background-color: var(--draft-light);
  color: var(--draft);
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.badge-sent {
  background-color: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.badge-partially_paid {
  background-color: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.badge-paid {
  background-color: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-overdue {
  background-color: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(185, 28, 28, 0.2);
}
.badge-cancelled {
  background-color: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.375rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid var(--slate-300);
  background-color: var(--surface-pure);
  color: var(--ink-charcoal);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-focus);
}

/* Buttons & Tactile Feedback */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem; /* 8px rounded-lg */
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 40px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.btn:hover {
  text-decoration: none;
}
.btn:active {
  transform: scale(0.98);
}

/* Primary Action Button: Precision Teal */
.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF !important;
  border-color: var(--primary);
  box-shadow: 0 1px 2px 0 rgba(15, 118, 110, 0.15);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: scale(0.98) translateY(0);
}

/* Secondary Action Button */
.btn-secondary {
  background-color: var(--surface-pure);
  border-color: var(--border-whisper);
  color: var(--slate-800);
}
.btn-secondary:hover {
  background-color: var(--slate-50);
  border-color: var(--slate-300);
  color: var(--ink-charcoal);
}

.btn-danger {
  background-color: var(--danger);
  color: #FFFFFF !important;
  border-color: var(--danger);
}
.btn-danger:hover {
  background-color: #991B1B;
  border-color: #991B1B;
}

.btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  min-height: 32px;
  border-radius: 0.375rem;
}

/* Tables & Tabular Data */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-whisper);
  border-radius: 0.75rem;
  background-color: var(--surface-pure);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.table th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-muted);
  background-color: var(--canvas-light);
  border-bottom: 1px solid var(--border-whisper);
}
.table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-whisper);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tr:hover td {
  background-color: #F8FAFC;
}

/* Ledger Recalculation Opacity Pulse */
@keyframes ledger-pulse {
  0% { opacity: 0.7; }
  100% { opacity: 1.0; }
}

.ledger-recalculating, .animate-pulse-brief {
  animation: ledger-pulse 150ms ease-out;
}

/* Custom Crisp Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--canvas-light);
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Modals & Popovers */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 28, 45, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.modal-content {
  background: var(--surface-pure);
  border-radius: 0.75rem;
  max-width: 32rem;
  width: 100%;
  border: 1px solid var(--border-whisper);
  box-shadow: 0 20px 25px -5px rgba(17, 28, 45, 0.1);
  padding: 1.5rem;
}

/* Responsive & Mobile Constraints */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-whisper);
  }
  .content-area {
    padding: 1rem;
  }
  .btn, button, input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    min-height: 44px; /* Minimum 44px touch targets */
  }
  .grid-cols-2, .grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
}

/* Grid Column Span Utilities */
.col-span-full {
  grid-column: 1 / -1 !important;
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

