:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --navy: #0f172a;
  --navy-light: #1e293b;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --emerald: #059669;
  --emerald-hover: #047857;
  --amber: #d97706;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.top-nav {
  background: var(--navy);
  color: #fff;
  padding: 1rem 0;
  border-bottom: 3px solid var(--emerald);
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.brand-logo {
  background: var(--emerald);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
}

.infra-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.badge-outline {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.badge-approved {
  background: #dbeafe;
  color: #1e40af;
}

.badge-paid {
  background: #d1fae5;
  color: #065f46;
}

.badge-uninvoiced {
  background: #fee2e2;
  color: #991b1b;
}

/* Main & KPI Grid */
.main-content {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}

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

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0.25rem 0;
}

.stat-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.text-emerald { color: var(--emerald); }
.text-amber { color: var(--amber); }
.text-blue { color: var(--primary); }

/* Tabs */
.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
  border-color: #cbd5e1;
}

.tab-btn.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

.pill-count {
  background: rgba(100, 116, 139, 0.2);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.tab-btn.active .pill-count {
  background: var(--emerald);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Layout & Cards */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.card-header {
  margin-bottom: 1.15rem;
}

.card-header h2, .card-header-row h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.card-header p, .card-header-row p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

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

/* Dropzone */
.dropzone {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}

.upload-icon {
  font-size: 2.3rem;
  margin-bottom: 0.4rem;
}

.drop-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.drop-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.preview-container {
  margin-top: 0.75rem;
}

.preview-container img {
  max-width: 100%;
  max-height: 340px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.pdf-badge {
  padding: 1rem;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
  border-radius: 8px;
}

.demo-bar {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.demo-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.demo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.scan-status-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  font-size: 0.84rem;
}

.scan-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group.full-width, .form-actions.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

input, select {
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.4rem;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.05rem;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s;
}

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

.btn-sm {
  padding: 0.38rem 0.7rem;
  font-size: 0.78rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-emerald {
  background: var(--emerald);
  color: #fff;
}
.btn-emerald:hover:not(:disabled) {
  background: var(--emerald-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: #1e293b;
}
.btn-secondary:hover:not(:disabled) {
  background: #cbd5e1;
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
}

/* Toolbar & Data Table */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.invoice-generator-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
}

.selection-summary {
  font-size: 0.84rem;
  font-weight: 600;
  color: #065f46;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th, .data-table td {
  padding: 0.7rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #475569;
  font-size: 0.77rem;
  text-transform: uppercase;
}

.empty-row {
  text-align: center;
  padding: 2rem !important;
  color: var(--text-muted);
}

/* Claims Cards */
.claims-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.claim-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.15rem;
  background: #f8fafc;
}

.claim-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.claim-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
}

.claim-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.claim-amount-box {
  text-align: right;
}

.claim-total {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--emerald);
}

.claim-body {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  font-size: 0.84rem;
}

@media (max-width: 720px) {
  .claim-body {
    grid-template-columns: 1fr;
  }
}

.claim-receipts-mini {
  margin-top: 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem;
}

.claim-actions {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

/* Employees List */
.employees-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.emp-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.emp-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.emp-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--navy);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 1000;
  border-left: 4px solid var(--emerald);
}

.hidden {
  display: none !important;
}
