:root {
  --b: #e2e8f0;
  --t: #1a202c;
  --m: #718096;
  --bg: #f7fafc;
  --card: #fff;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --red: #dc2626;
  --green: #059669;
  --blue: #2563eb;
  --orange: #d97706;
  --purple: #7c3aed;
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 12px rgba(0,0,0,.07);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-y: auto; }
body {
  font-family: var(--font);
  margin: 0;
  background: var(--bg);
  color: var(--t);
  line-height: 1.5;
  overflow-y: auto;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Layout ===== */
.wrap { max-width: 1600px; margin: 24px auto; padding: 0 24px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 56px;
  background: #1e293b;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.topbar-brand img { height: 26px; }
.topbar-links { display: flex; gap: 4px; }
.topbar-links a {
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: .15s;
}
.topbar-links a:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
  text-decoration: none;
}
.topbar-links a.active {
  color: #fff;
  background: rgba(255,255,255,.15);
  text-decoration: none;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-user { color: rgba(255,255,255,.7); font-size: 13px; }
.topbar-logout {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  background: transparent;
  transition: .15s;
}
.topbar-logout:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.3);
}

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--b);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card h2 {
  font-size: 15px;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--t);
}
.card h2 svg { flex-shrink: 0; color: var(--accent); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

@media (max-width: 820px) {
  .grid, .row, .row3 { grid-template-columns: 1fr; }
  .refuel-row { flex-wrap: wrap; }
  .refuel-info-card, .refuel-summary-card { min-width: 100%; }
  .refuel-chart-area { flex: 1 1 100%; min-width: 100%; }
}

/* ===== Forms ===== */
label { display: block; font-size: 11px; font-weight: 600; color: var(--m); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .03em; }

input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--b);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
  font-family: var(--font);
  color: var(--t);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
textarea { min-height: 84px; resize: vertical; }

.req { color: var(--red); font-weight: 700; margin-left: 3px; }
.hint { font-size: 12px; color: var(--m); margin-top: 6px; }
.divider { height: 1px; background: var(--b); margin: 14px 0; }
.small { font-size: 12px; color: var(--m); }

/* ===== Buttons ===== */
button, .btn {
  border: 1px solid var(--b);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  transition: all .15s;
}
button:hover, .btn:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
button.primary, .btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
button.primary:hover, .btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

a.linkbtn, button.linkbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--b);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--t);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: .15s;
  gap: 6px;
  font-family: var(--font);
}
a.linkbtn:hover, button.linkbtn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.pill {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid rgba(37,99,235,.2);
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 500;
}

.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ===== Login ===== */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}
.login-card {
  background: var(--card);
  border: 1px solid var(--b);
  border-radius: 18px;
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--m); font-size: 13px; margin-bottom: 24px; }
.login-card .form-group { text-align: left; margin-bottom: 16px; }
.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}

/* ===== Page header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }

.search-box {
  padding: 9px 14px;
  width: 320px;
  border: 1px solid var(--b);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ===== Data table ===== */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--b);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--m);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--b);
  background: #f8fafc;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: var(--accent-light); }
.data-table tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(37,99,235,.15);
}

/* ===== Filter tabs ===== */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.filter-tab {
  border: 1px solid var(--b);
  background: #fff;
  border-radius: 999px;
  padding: 7px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--m);
  transition: .15s;
}
.filter-tab:hover { background: var(--accent-light); color: var(--accent); border-color: rgba(37,99,235,.2); }
.filter-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 700;
}

/* ===== Status badges ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.status-badge.active-status {
  background: #ecfdf5;
  color: var(--green);
  border: 1px solid #a7f3d0;
}
.status-badge.finished {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ===== Sortable columns ===== */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color .15s;
}
.data-table th.sortable:hover { color: var(--accent); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--m);
}
.empty-state h2 { font-size: 18px; margin-bottom: 6px; color: var(--t); }

/* ===== Order detail ===== */
.order-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.order-topbar h1 { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.order-topbar h1 svg { color: var(--accent); }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--b);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--t);
  cursor: pointer;
  text-decoration: none;
  transition: .15s;
}
.back-btn:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); text-decoration: none; }

.order-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--t);
}
.order-breadcrumb-main { font-weight: 700; color: var(--accent); }
.order-breadcrumb-sep { color: var(--m); }
.order-breadcrumb-sub { font-weight: 500; }

.order-subtabs {
  margin-bottom: 20px;
  flex-wrap: wrap;
  row-gap: 8px;
  position: sticky;
  top: 56px;
  z-index: 90;
  padding: 8px 0 12px;
  margin-top: -4px;
  background: var(--bg);
  box-shadow: 0 8px 12px -10px rgba(15, 23, 42, 0.25);
}
.order-stripe-shortcut {
  border-color: #c4b5fd !important;
  color: #5b21b6 !important;
}
.order-stripe-shortcut:hover {
  background: #f5f3ff !important;
  border-color: #7c3aed !important;
  color: #4c1d95 !important;
  text-decoration: none !important;
}
.expenses-active .order-topbar { margin-bottom: 6px; }
.expenses-active .order-subtabs { margin-bottom: 6px; }
.expenses-active .order-subpage-content {
  display: block;
  overflow: visible;
}
#content.expenses-view {
  display: block;
}
#content.expenses-view .order-subpage-content {
  display: block;
  overflow: visible;
}
#content.expenses-view .expenses-page {
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.order-subtabs .tabbtn { text-decoration: none; }

.order-subpage { display: none; }
.order-subpage.active { display: block; }

.group {
  border: 1px solid var(--b);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
  background: #fff;
  transition: box-shadow .15s;
}
.group:hover {
  box-shadow: var(--shadow-sm);
}
.subhead { font-size: 13px; font-weight: 700; margin: 8px 0 6px; }
.subsub {
  font-size: 12px;
  font-weight: 700;
  color: var(--t);
  margin: 10px 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.subsub svg { flex-shrink: 0; color: var(--accent); }

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
}
.info-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-blue { background: var(--blue); }
.dot-green { background: var(--green); }
.dot-orange { background: var(--orange); }
.dot-red { background: var(--red); }

.detail-table { width: 100%; border-collapse: collapse; }
.detail-table td {
  padding: 8px 6px;
  font-size: 14px;
  border-bottom: 1px solid var(--b);
}
.detail-table tr:last-child td { border-bottom: none; }
.detail-table td:first-child { color: var(--m); width: 40%; }

.cost-table { width: 100%; border-collapse: collapse; }
.cost-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--m);
  border-bottom: 1px solid var(--b);
  font-weight: 700;
}
.cost-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--b);
  font-size: 14px;
}

.sumsub-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: #fff;
  text-decoration: none;
  transition: .15s;
}
.sumsub-btn:hover { background: var(--accent-light); text-decoration: none; }

/* ===== Read-only inputs ===== */
input[readonly] {
  background: #f8fafc;
  color: var(--t);
  cursor: default;
  border-color: #e2e8f0;
}
input[readonly]:placeholder-shown {
  color: var(--red);
  font-style: italic;
}
.date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}
.no-data { color: var(--red); font-style: italic; font-size: 13px; }

/* ===== Field wrap with copy + link buttons ===== */
.field-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.field-wrap input { flex: 1; min-width: 0; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--b);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--m);
  cursor: pointer;
  flex-shrink: 0;
  transition: .15s;
}
.copy-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { background: #ecfdf5; color: var(--green); border-color: #a7f3d0; }

.field-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 36px;
  border: 1px solid rgba(37,99,235,.3);
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  flex-shrink: 0;
  transition: .15s;
  text-decoration: none;
}
.field-link:hover { background: #dbeafe; border-color: var(--accent); text-decoration: none; }

.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* ===== RTA fines feed (shared with order page) ===== */
.rta-cell { display: flex; align-items: center; gap: 8px; }
.rta-cell .rta-icon { flex-shrink: 0; opacity: 0.7; }
.rta-amount { font-weight: 700; color: #d97706; }
.rta-source-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; background: #fef3c7; color: #92400e; }
.rta-source-badge.police { background: #dbeafe; color: #1e40af; }
.rta-source-badge.rta { background: #dcfce7; color: #166534; }
.rta-source-badge.sharjah { background: #f3e8ff; color: #6b21a8; }
.rta-source-badge.abu-dhabi { background: #e0f2fe; color: #0369a1; }

/* ===== Salik feed (shared with order page) ===== */
.salik-type-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.salik-type-badge.toll { background: #e0f2fe; color: #0369a1; }
.salik-type-badge.parking { background: #dcfce7; color: #166534; }

/* ===== Utility ===== */
.mt { margin-top: 14px; }
.hidden { display: none !important; }
.text-muted { color: var(--m); }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

.loading {
  text-align: center;
  padding: 60px;
  color: var(--m);
  font-size: 14px;
}

/* ===== Document image grid ===== */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.doc-image-card {
  background: #fff;
  border: 1px solid var(--b);
  border-radius: 12px;
  overflow: hidden;
  transition: all .2s;
}
.doc-image-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.doc-image-card.review-green { border-color: #10b981; border-width: 2px; }
.doc-image-card.review-red   { border-color: #ef4444; border-width: 2px; }

.doc-image-card a {
  display: block;
  line-height: 0;
}
.doc-image-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f8fafc;
}

.doc-image-label {
  padding: 8px 12px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--t);
}
.doc-image-meta {
  padding: 2px 12px 6px;
  font-size: 11px;
  color: var(--m);
}
.doc-image-actions {
  display: flex;
  gap: 6px;
  padding: 0 10px 10px;
}
.doc-image-actions .linkbtn {
  flex: 1;
  justify-content: center;
  padding: 5px 8px;
  font-size: 12px;
  gap: 4px;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 12px;
  flex-wrap: wrap;
}
.page-info {
  font-size: 13px;
  color: var(--m);
}
.page-buttons {
  display: flex;
  gap: 4px;
}
.page-btn {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--b);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: var(--t);
  cursor: pointer;
  transition: all .15s;
  padding: 0 8px;
  font-family: var(--font);
}
.page-btn:hover:not(:disabled):not(.active) {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.page-btn:disabled {
  opacity: .3;
  cursor: default;
}

/* ===== Tabs (legacy) ===== */
.tabs { display: flex; gap: 8px; }
.tabbtn {
  border: 1px solid var(--b);
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  color: var(--m);
  transition: .15s;
}
.tabbtn:hover { background: var(--accent-light); color: var(--accent); }
.tabbtn.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ===== Refuel report — new design ===== */
.refuel-page {
  margin-top: 24px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 28px rgba(0,0,0,.08);
}
.refuel-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
}
.refuel-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(37,99,235,.15) 0%, transparent 70%);
  pointer-events: none;
}
.refuel-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.refuel-header-icon {
  width: 40px;
  height: 40px;
  color: rgba(255,255,255,.9);
  flex-shrink: 0;
}
.refuel-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
}
.refuel-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  margin: 2px 0 0;
}
.refuel-loading {
  padding: 32px;
  text-align: center;
  color: var(--m);
  font-size: 14px;
}
.refuel-content {
  padding: 28px 32px;
}
.refuel-row {
  display: flex;
  gap: 20px;
  flex-wrap: nowrap;
  align-items: stretch;
  min-width: 0;
}
.refuel-info-card {
  flex: 0 0 auto;
  padding: 16px 18px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  min-width: 200px;
}
.refuel-summary-card {
  flex: 0 0 auto;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  overflow: hidden;
}
.refuel-summary-fuel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
}
.refuel-summary-fuel .refuel-fuel-item {
  padding: 8px 12px;
}
.refuel-summary-fee {
  padding: 14px 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-top: 1px solid #bfdbfe;
}
.refuel-summary-fee.fuel-fee-box--no-pay {
  background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 55%, #a7f3d0 100%);
  border-top: 1px solid #6ee7b7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.refuel-summary-fee.fuel-fee-box--no-pay .refuel-fee-label {
  color: #047857;
}
.refuel-summary-fee.fuel-fee-box--no-pay .refuel-fee-formula {
  color: #059669;
}
.refuel-summary-fee.fuel-fee-box--no-pay .refuel-fee-amount {
  color: #065f46;
}
.refuel-summary-fee .refuel-fee-label {
  margin-bottom: 4px;
}
.refuel-summary-fee .refuel-fee-formula {
  margin-bottom: 4px;
}
.refuel-paid-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(5,150,105,.35);
}
.refuel-paid-badge::before {
  content: '';
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}
.refuel-paid-transactions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #bfdbfe;
}
.refuel-tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 12px;
}
.refuel-tx-date { color: var(--m); min-width: 140px; }
.refuel-tx-amount { font-weight: 600; color: var(--green); }
.refuel-tx-id { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.refuel-tx-link { color: var(--blue); text-decoration: none; }
.refuel-tx-link:hover { text-decoration: underline; }
.refuel-info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}
.refuel-info-row:last-child { border-bottom: none; padding-bottom: 0; }
.refuel-info-row:first-child { padding-top: 0; }
.refuel-info-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.refuel-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--t);
}
.refuel-fuel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}
.refuel-fuel-item.refuel-fuel-start { background: rgba(5,150,105,.08); border: 1px solid rgba(5,150,105,.2); }
.refuel-fuel-item.refuel-fuel-end { background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.2); }
.refuel-fuel-item.refuel-fuel-diff { background: rgba(217,119,6,.08); border: 1px solid rgba(217,119,6,.2); }
.refuel-fuel-label {
  flex: 1;
  font-size: 12px;
  color: var(--m);
}
.refuel-fuel-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--t);
}
.refuel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.refuel-dot.fuel-start { background: var(--green); }
.refuel-dot.fuel-end { background: var(--red); }
.refuel-dot.fuel-diff { background: var(--orange); }
.refuel-fee-label {
  font-size: 10px;
  font-weight: 700;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.refuel-fee-formula {
  font-size: 12px;
  color: #3b82f6;
  margin-bottom: 6px;
}
.refuel-fee-amount {
  font-size: 22px;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: -0.02em;
}
.refuel-chart-area {
  flex: 1 1 300px;
  min-width: 280px;
}
.refuel-chart-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  min-width: 0;
}
.refuel-chart-header {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.refuel-chart-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  flex-shrink: 0;
}
.chart-container {
  overflow-x: auto;
  border-radius: 8px;
  background: #fff;
  min-height: 128px;
}
#orderRefuelSection .chart-container { overflow: visible; }
.chart-container #refuelChart { min-height: 220px; display: block; width: 100%; }
.chart-container #refuelChart.hidden { display: none; }

/* ===== Stripe transactions (order subpage) ===== */
.stripe-page {
  margin-top: 24px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 28px rgba(0,0,0,.08);
}
.stripe-header {
  background: linear-gradient(125deg, #1e1b4b 0%, #312e81 40%, #4c1d95 100%);
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
}
.stripe-header::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 55%;
  height: 180%;
  background: radial-gradient(ellipse, rgba(99, 91, 255, .22) 0%, transparent 65%);
  pointer-events: none;
}
.stripe-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.stripe-header-icon {
  width: 40px;
  height: 40px;
  color: rgba(255,255,255,.92);
  flex-shrink: 0;
}
.stripe-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
}
.stripe-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,.62);
  margin: 2px 0 0;
}
.stripe-loading {
  padding: 32px;
  text-align: center;
  color: var(--m);
  font-size: 14px;
}
.stripe-content {
  padding: 24px 28px 28px;
}
.stripe-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 720px) {
  .stripe-kpis { grid-template-columns: 1fr; }
}
.stripe-kpi {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
}
.stripe-kpi--volume {
  border-left: 3px solid #6366f1;
}
.stripe-kpi--paid {
  border-left: 3px solid #059669;
}
.stripe-kpi-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--m);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.stripe-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.stripe-kpi--paid .stripe-kpi-value {
  color: #059669;
}
.stripe-hint {
  font-size: 12px;
  color: var(--m);
  margin: 0 0 16px;
  line-height: 1.45;
}
.stripe-table-wrap {
  max-height: 480px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--b);
}
.stripe-dash-link {
  color: var(--blue);
  text-decoration: none;
  word-break: break-all;
}
.stripe-dash-link:hover {
  text-decoration: underline;
}
.stripe-status {
  font-size: 12px;
}
.stripe-td-id {
  font-size: 11px;
  max-width: 200px;
  word-break: break-all;
}

/* ===== Order Expenses page — responsive, scrollable ===== */
.expenses-page {
  margin: 0 -24px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.expenses-header {
  flex-shrink: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 10px 20px;
  position: relative;
  overflow: hidden;
}
.expenses-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -15%;
  width: 50%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(37,99,235,.1) 0%, transparent 70%);
  pointer-events: none;
}
.expenses-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
}
.expenses-header-lead {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.expenses-pdf-btn,
.expenses-wa-btn {
  flex-shrink: 0;
}
.expenses-header-icon {
  width: 26px;
  height: 26px;
  color: rgba(255,255,255,.9);
  flex-shrink: 0;
}
.expenses-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
}
.expenses-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,.65);
  margin: 1px 0 0;
}
.expenses-loading {
  padding: 32px;
  text-align: center;
  color: var(--m);
  font-size: 14px;
}
.expenses-content {
  overflow: visible;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}
/* Cards layout (desktop ≥1100):
   ┌──────────────────┬──────────────────┐
   │ Order details    │ Fuel level log   │
   ├──────────────────┤                  │
   │ Expense types    │                  │
   ├──────────────────┴──────────────────┤
   │ Salik & RTA fines (full width)      │
   └─────────────────────────────────────┘
   The two wrapper divs are HTML legacy — we flatten them with display:contents
   so their children become direct grid items addressable via grid-template-areas. */
.expenses-cards {
  overflow: visible;
}
.expenses-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(300px, 1.15fr);
  grid-template-areas:
    "order   fuel"
    "summary fuel"
    "matrix  matrix";
  gap: 12px;
  padding-bottom: 24px;
  align-items: stretch;
}
.expenses-left,
.expenses-right { display: contents; }
.expenses-order-card   { grid-area: order;   min-height: 0; }
.expenses-summary-card { grid-area: summary; }
.expenses-fuel-card    { grid-area: fuel; min-height: 140px; }
.expenses-matrix-card {
  grid-area: matrix;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  overflow: hidden;
}
.expenses-matrix-card .expenses-card-title {
  margin: 0;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

/* Responsive — tablet: single column, natural document order
   (order details → summary → fuel → matrix). */
@media (max-width: 1100px) {
  .expenses-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "order"
      "summary"
      "fuel"
      "matrix";
    gap: 10px;
    padding-bottom: 20px;
  }
  .expenses-page { margin: 0 -16px; }
  .expenses-content { padding: 10px 14px; }
}
/* Responsive — mobile */
@media (max-width: 640px) {
  .expenses-page { margin: 0 -12px; border-radius: 8px; }
  .expenses-header { padding: 8px 14px; }
  .expenses-title { font-size: 14px; }
  .expenses-subtitle { font-size: 10px; }
  .expenses-content { padding: 8px 12px; }
  .expenses-grid { gap: 8px; padding-bottom: 16px; }
  .expenses-order-viz-main { flex-wrap: wrap; }
  .expenses-car-image--hero { width: 100px; min-height: 76px; }
  .expenses-car-image img { max-height: 76px; }
  .expenses-vehicle-name { font-size: 14px; }
  .expenses-metric { padding: 8px 10px; }
  .expenses-metric-ico { width: 36px; height: 36px; }
  .expenses-metric-ico svg { width: 18px; height: 18px; }
  .expenses-order-card, .expenses-summary-card, .expenses-fuel-card { padding: 8px 10px; }
  .expenses-matrix-card .expenses-card-title { padding: 8px 10px; }
  .expenses-costs-table-wrap { max-height: 260px; overflow-x: auto; }
  .expenses-table.s-table th, .expenses-table.s-table td { padding: 8px 10px; font-size: 11px; }
}
.expenses-order-card,
.expenses-summary-card,
.expenses-fuel-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.expenses-order-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}
.expenses-order-card--viz {
  border-radius: 14px;
}
.expenses-order-viz {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.expenses-order-viz-main {
  display: flex;
  gap: 14px;
  align-items: stretch;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(124, 58, 237, 0.04) 50%, transparent 100%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
.expenses-car-image {
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
  width: 132px;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.expenses-car-image--hero {
  width: 128px;
  min-height: 96px;
  border-radius: 14px;
}
.expenses-car-image img {
  width: 100%;
  max-height: 104px;
  object-fit: contain;
  display: block;
}
.expenses-car-name {
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--t);
  text-align: center;
  background: #f1f5f9;
  border-top: 1px solid #e5e7eb;
  line-height: 1.2;
}
.expenses-car-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  color: #94a3b8;
  width: 100%;
  min-height: 72px;
}
.expenses-car-placeholder svg { opacity: 0.45; }
.expenses-order-viz-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.expenses-order-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(37, 99, 235, 0.2);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  font-size: 12px;
  font-weight: 700;
  color: #1e40af;
  letter-spacing: -0.02em;
}
.expenses-order-chip-ico {
  width: 16px;
  height: 16px;
  color: #2563eb;
  flex-shrink: 0;
}
.expenses-vehicle-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--t);
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.expenses-vehicle-plate {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 2px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: #0f172a;
  background: linear-gradient(180deg, #fefce8 0%, #fef9c3 100%);
  border: 1px solid #fde047;
  box-shadow: 0 1px 0 rgba(250, 204, 21, 0.35);
}
.expenses-vehicle-plate[hidden] {
  display: none !important;
}
.expenses-order-metrics {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0 2px;
}
.expenses-metric {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}
.expenses-metric:last-child {
  border-bottom: none;
  padding-bottom: 12px;
}
.expenses-metric:hover {
  background: rgba(248, 250, 252, 0.9);
}
.expenses-metric-ico {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.expenses-metric-ico svg {
  width: 20px;
  height: 20px;
}
.expenses-metric-ico--driver {
  background: linear-gradient(145deg, #dbeafe 0%, #eff6ff 100%);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.expenses-metric-ico--period {
  background: linear-gradient(145deg, #d1fae5 0%, #ecfdf5 100%);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.28);
}
.expenses-metric-ico--mile {
  background: linear-gradient(145deg, #ffedd5 0%, #fff7ed 100%);
  color: #c2410c;
  border: 1px solid rgba(249, 115, 22, 0.28);
}
.expenses-metric-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.expenses-metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.expenses-metric-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--t);
  line-height: 1.45;
  word-break: break-word;
}
.expenses-summary-card .expenses-card-title,
.expenses-fuel-card .expenses-card-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.expenses-summary-card {
  padding: 10px 12px;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Unified font scale: 11px headers, 12px body */
.expenses-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.expenses-summary-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e5e7eb;
}
.expenses-summary-table th:nth-child(2),
.expenses-summary-table th:nth-child(3),
.expenses-summary-table th:nth-child(4) { text-align: right; }
.expenses-summary-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.expenses-summary-table td:nth-child(2),
.expenses-summary-table td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.expenses-summary-table td:nth-child(4) { text-align: right; font-weight: 500; }
.expenses-summary-table tr:last-child td { border-bottom: none; }
.expenses-summary-total td {
  font-weight: 700;
  font-size: 13px;
  color: var(--t);
  background: linear-gradient(135deg, rgba(37,99,235,.06) 0%, rgba(37,99,235,.03) 100%);
  border-top: 2px solid #93c5fd;
  padding: 8px 10px;
}
.expenses-summary-total td:nth-child(2) { color: #1d4ed8; }
.expenses-summary-total td:nth-child(3) { color: #059669; }
.expenses-fuel-card {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.expenses-fuel-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.expenses-fuel-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
}
.expenses-fuel-item.exp-fuel-start { background: rgba(5,150,105,.08); border: 1px solid rgba(5,150,105,.2); }
.expenses-fuel-item.exp-fuel-end { background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.2); }
.expenses-fuel-item.exp-fuel-diff { background: rgba(217,119,6,.08); border: 1px solid rgba(217,119,6,.2); }
.expenses-fuel-item strong { font-size: 12px; }
.expenses-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.expenses-dot.fuel-start { background: var(--green); }
.expenses-dot.fuel-end { background: var(--red); }
.expenses-dot.fuel-diff { background: var(--orange); }
.expenses-fuel-fee {
  padding: 8px 10px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  margin-bottom: 8px;
}
.expenses-fuel-fee.fuel-fee-box--no-pay {
  background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 55%, #a7f3d0 100%);
  border: 1px solid #6ee7b7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.expenses-fuel-fee.fuel-fee-box--no-pay .expenses-fuel-fee-label {
  color: #047857;
}
.expenses-fuel-fee.fuel-fee-box--no-pay .expenses-fuel-formula {
  color: #059669;
}
.expenses-fuel-fee.fuel-fee-box--no-pay .expenses-fuel-amount {
  color: #065f46;
}
.expenses-fuel-fee-label {
  font-size: 9px;
  font-weight: 700;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.expenses-fuel-formula {
  font-size: 10px;
  color: #3b82f6;
  margin-bottom: 2px;
}
.expenses-fuel-amount {
  font-size: 16px;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: -0.02em;
}
.expenses-paid-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 5px 10px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 6px;
}
.expenses-chart-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}
.expenses-chart-wrap .chart-container {
  flex: 1;
  min-height: 220px;
}
.expenses-chart-label {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.expenses-chart-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  flex-shrink: 0;
}
.expenses-costs-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
/* s-table matrix — unified 12px design */
.expenses-table.s-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
.expenses-table.s-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #e2e8f0;
  z-index: 10;
}
.expenses-table.s-table td {
  padding: 10px 14px;
  font-size: 12px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--t);
}
.expenses-table.s-table tr:last-child td { border-bottom: none; }
.expenses-table .exp-cell-dt,
.expenses-table .exp-cell-id { font-size: 12px; }
.expenses-table .exp-cell-details { font-size: 12px; white-space: pre-wrap; }
.expenses-table .exp-cell-details .rta-source-badge { font-size: 11px; }
.expenses-table .exp-cell-details .exp-paid-bd {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  padding: 2px 8px;
  display: inline-block;
  letter-spacing: .01em;
}

/* Paid cell — amount + tiny source icon. Full per-payment list opens from
   the Payments button in the expense summary row. */
.pay-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
}
.pay-src-ico {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: help;
  line-height: 0;
}
.pay-src-ico svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.pay-src-ico.card   { color: #2563eb; }
.pay-src-ico.manual { color: #7c3aed; }
.pay-src-ico.mix    { color: #475569; }

/* Inline source pill (used inside Payments modal Source column). */
.pay-src-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  line-height: 1.4;
  vertical-align: middle;
}
.pay-src-badge.card   { color: #1e40af; background: #eff6ff; border: 1px solid #bfdbfe; }
.pay-src-badge.manual { color: #5b21b6; background: #f5f3ff; border: 1px solid #ddd6fe; }
.pay-src-badge svg { flex-shrink: 0; opacity: .85; width: 10px; height: 10px; }
.expenses-table .group-header td {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 700;
  font-size: 12px;
  border-top: 1px solid #e2e8f0;
  padding: 12px 14px;
}
.expenses-table .group-header:first-child td { border-top: none; }
.expenses-table .group-row td { background: #fff; }
.expenses-table .group-row td:first-child {
  padding-left: 36px;
  position: relative;
}
.expenses-table .group-row td:first-child::before {
  content: "\2197";
  position: absolute;
  left: 14px;
  top: 10px;
  color: #94a3b8;
  font-size: 12px;
}
.expenses-table .group-row:hover td { background: #f0f9ff !important; }
.expenses-table .feed-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  justify-content: flex-end;
}
.expenses-table .feed-cell .feed-icon { flex-shrink: 0; opacity: 0.8; }
.expenses-table .amount { font-weight: 700; font-size: 12px; color: #0284c7; font-variant-numeric: tabular-nums; }
.expenses-table .amount.text-green { color: var(--green); }
.expenses-table .text-right { text-align: right; }
.expenses-table .expenses-matrix-total td {
  background: linear-gradient(180deg, rgba(37,99,235,.08) 0%, rgba(37,99,235,.04) 100%);
  border-top: 2px solid #93c5fd;
  font-size: 12px;
  font-weight: 700;
  padding: 12px 14px;
}
.expenses-table .empty-panel {
  text-align: center;
  padding: 40px 24px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}
