/* FinanceSync shared styles */

.pg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.pg-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
}

.pg-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.pg-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.pg-sep { opacity: 0.6; }

.pg-head-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  background: var(--bg-card);
  color: var(--text-1);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

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

.btn-secondary {
  background: var(--mist);
  border-color: var(--border);
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--sh-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--verdi-light), var(--verdi-accent));
}

.stat-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(2,115,94,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 16px;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
}

.stat-card .label {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.stat-card .trend {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card .trend.up { color: var(--success); }
.stat-card .trend.down { color: var(--danger); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .pg-head { flex-direction: column; align-items: flex-start; }
}

/* ── Base card — no padding, edge-to-edge content ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: border-color 0.15s;
}
.card:hover { border-color: rgba(2,115,94,0.14); }

/* card-head: uniform header for all card types */
.card-head, .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

.card-head h3, .card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-head h3 svg,
.card-title svg { color: var(--primary); flex-shrink: 0; }
.card-title i { color: var(--primary); font-size: 14px; }

/* card-body: unpadded by default, opt-in padding */
.card-body { padding: 0; }
.card-body--pad { padding: 16px 18px; }

/* cards that need padded free-form content (reports, settings) */
.card--padded { padding: 18px 20px; overflow: visible; }
.card--padded:hover { border-color: rgba(2,115,94,0.14); }
.card--padded .card-header {
  padding: 0 0 12px;
  border-bottom: none;
  margin-bottom: 0;
}

.card-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.card-link:hover { text-decoration: underline; }

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--mist);
  border: 1px solid var(--border);
}

.list-item:hover { background: var(--hover); }

.list-item .meta {
  font-size: 11px;
  color: var(--text-3);
}

.list-item .name {
  font-weight: 600;
  color: var(--text-1);
  font-size: 13px;
}

.list-item .value {
  margin-left: auto;
  font-weight: 700;
  color: var(--text-1);
  font-size: 13px;
}

.pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pill.success { background: rgba(16,185,129,0.12); color: #059669; }
.pill.warning { background: rgba(245,158,11,0.12); color: #d97706; }
.pill.danger { background: rgba(239,68,68,0.12); color: #dc2626; }
.pill.info { background: rgba(59,130,246,0.12); color: #2563eb; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 8px;
  background: var(--mist);
  border: 2px dashed var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.quick-action:hover {
  border-color: var(--primary);
  border-style: solid;
  background: rgba(2,115,94,0.06);
}

.quick-action i { font-size: 20px; color: var(--primary); }
.quick-action svg { color: var(--primary); }
.quick-action span { font-size: 12px; font-weight: 600; color: var(--text-1); }

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  background: var(--bg-card);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--mist);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}

.table .empty-row {
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  padding: 18px 12px;
}

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

.amount {
  font-weight: 700;
  color: var(--text-1);
}

.note {
  font-size: 12px;
  color: var(--text-3);
}

.section-stack { display: grid; gap: 16px; }

.empty-state {
  text-align: center;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--mist);
  color: var(--text-2);
  font-size: 12px;
}

/* ── Insight strip ── */
.insight-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.insight-tile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(2,35,38,0.02), rgba(16,185,129,0.12));
  box-shadow: var(--sh-sm);
}

.insight-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(16,185,129,0.16);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.insight-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.insight-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin-top: 4px;
}

.insight-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── FinanceSync hero ── */
.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(2,35,38,0.96), rgba(3,89,81,0.96));
  color: #f8fafc;
  box-shadow: 0 18px 40px rgba(2, 35, 38, 0.25);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(16,185,129,0.25), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

.hero-left, .hero-right { position: relative; z-index: 1; }
.hero-left { max-width: 55%; display: flex; flex-direction: column; gap: 6px; }

.hero-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
}

.hero-title-text { letter-spacing: 0.02em; text-transform: uppercase; font-size: 13px; opacity: 0.75; }

.hero-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.4);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-sub { font-size: 20px; font-weight: 700; }

.hero-meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: rgba(248, 250, 252, 0.75);
}

.hero-meta i { margin-right: 4px; }

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  min-width: 240px;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.hero-actions .btn {
  background: rgba(248, 250, 252, 0.16);
  color: #f8fafc;
  border-color: rgba(248, 250, 252, 0.2);
}

.hero-actions .btn-primary {
  background: #10b981;
  border-color: transparent;
}

.hero-actions .btn-primary:hover { background: #059669; }

/* ── Insight layout ── */
.insight-grid {
  margin-bottom: 18px;
}

.card-meta {
  font-size: 11px;
  color: var(--text-3);
}

.chart-card .card-header { margin-bottom: 10px; }

.chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-area {
  min-height: 180px;
  background: var(--mist);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
}

.aging-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aging-bar {
  display: flex;
  height: 12px;
  background: var(--mist);
  border-radius: 999px;
  overflow: hidden;
}

.aging-seg { height: 100%; }
.aging-seg.seg-0 { background: #10b981; }
.aging-seg.seg-1 { background: #f59e0b; }
.aging-seg.seg-2 { background: #f97316; }
.aging-seg.seg-3 { background: #ef4444; }

.aging-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.aging-item {
  background: var(--mist);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aging-item strong { font-size: 13px; color: var(--text-1); }

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.pipeline-card {
  background: var(--mist);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pipeline-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.pipeline-value { font-size: 18px; font-weight: 700; color: var(--text-1); }
.pipeline-sub { font-size: 11px; color: var(--text-3); }

.focus-grid { margin-bottom: 18px; }

.list-compact .list-item {
  padding: 10px 12px;
}

.list-item--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.progress-line {
  height: 6px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.progress-line span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--verdi-light), var(--verdi-accent));
}

.table.table-compact th,
.table.table-compact td { padding: 8px 10px; font-size: 11px; }

.table.table-compact .pill { font-size: 9px; }

.list-item .value {
  margin-left: auto;
  font-weight: 700;
  color: var(--text-1);
  font-size: 13px;
}

@media (max-width: 900px) {
  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-left { max-width: 100%; }
  .hero-right { align-items: flex-start; width: 100%; }
  .hero-actions { justify-content: flex-start; }
  .aging-grid { grid-template-columns: repeat(2, 1fr); }
  .insight-strip { grid-template-columns: 1fr; }
}

/* ── FinanceSync dashboard: MotorSync-aligned layout ── */
.fs-dashboard .pg-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.fs-dashboard .pg-head h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
}

.fs-dashboard .pg-head .sub {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
}

.fs-dashboard .sub-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.fs-dashboard .pg-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fs-dashboard .pg-date {
  font-size: 12px;
  color: var(--text-2);
  background: var(--hover);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
}

/* ─── POD CARDS (ring charts — identical to MotorSync) ─── */
@keyframes fs-fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fs-dashboard .pods-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 20px;
}
.fs-dashboard .pod-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--sh-sm); transition: all 0.2s ease;
  animation: fs-fadeInUp 0.4s ease both;
  text-decoration: none; color: inherit;
}
.fs-dashboard .pod-card:nth-child(2) { animation-delay: .05s; }
.fs-dashboard .pod-card:nth-child(3) { animation-delay: .1s; }
.fs-dashboard .pod-card:nth-child(4) { animation-delay: .15s; }
.fs-dashboard .pod-card:hover {
  border-color: rgba(2,115,94,0.18); box-shadow: var(--sh-md); transform: translateY(-2px);
}
.fs-dashboard .pod-ring { width: 52px; height: 52px; position: relative; flex-shrink: 0; }
.fs-dashboard .pod-ring svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.fs-dashboard .pod-ring-bg { fill: none; stroke: var(--border); stroke-width: 3.5; }
.fs-dashboard .pod-ring-fill {
  fill: none; stroke-width: 3.5; stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.fs-dashboard .pod-ring-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.fs-dashboard .pod-info { flex: 1; min-width: 0; }
.fs-dashboard .pod-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-3); font-weight: 600; margin-bottom: 2px;
}
.fs-dashboard .pod-value { font-size: 22px; font-weight: 700; color: var(--text-1); line-height: 1.1; }
.fs-dashboard .pod-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ─── KPI STRIP (icon tiles — identical to MotorSync) ─── */
.fs-dashboard .kpi-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-bottom: 20px;
}
.fs-dashboard .kpi-tile {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--sh-sm); transition: all 0.15s ease;
  position: relative; overflow: hidden;
}
.fs-dashboard .kpi-tile::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0;
  width: 3px; border-radius: 12px 0 0 12px;
}
.fs-dashboard .kpi-tile--green::before { background: linear-gradient(180deg, #02735E, #10b981); }
.fs-dashboard .kpi-tile--blue::before  { background: linear-gradient(180deg, #3b82f6, #60a5fa); }
.fs-dashboard .kpi-tile--orange::before{ background: linear-gradient(180deg, #f59e0b, #fbbf24); }
.fs-dashboard .kpi-tile:hover { border-color: rgba(2,115,94,0.18); box-shadow: var(--sh-md); transform: translateY(-1px); }
.fs-dashboard .kpi-tile-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fs-dashboard .kpi-tile-value  { font-size: 22px; font-weight: 700; color: var(--text-1); line-height: 1.1; }
.fs-dashboard .kpi-tile-label  { font-size: 10.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 1px; }
.fs-dashboard .kpi-tile-detail { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.fs-dashboard .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.fs-dashboard .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--sh-sm);
  overflow: hidden;
}

.fs-dashboard .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

.fs-dashboard .card-head h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.fs-dashboard .card-head i { color: var(--primary); font-size: 14px; }
.fs-dashboard .card-head svg { color: var(--primary); flex-shrink: 0; }

.fs-dashboard .card-meta { font-size: 12px; color: var(--text-3); }

/* ── Project revenue pipeline stats ── */
.fs-dashboard .fs-pipe-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.fs-dashboard .fs-pipe-stat {
  padding: 18px 20px; text-align: center;
  border-right: 1px solid var(--border);
}
.fs-dashboard .fs-pipe-stat:last-child { border-right: none; }
.fs-dashboard .fs-pipe-stat .v { font-size: 22px; font-weight: 700; color: var(--text-1); line-height: 1.1; }
.fs-dashboard .fs-pipe-stat .l {
  font-size: 10.5px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px;
}
@media (max-width: 700px) {
  .fs-dashboard .fs-pipe-stats { grid-template-columns: 1fr 1fr; }
  .fs-dashboard .fs-pipe-stat:nth-child(2) { border-right: none; }
  .fs-dashboard .fs-pipe-stat:nth-child(1), .fs-dashboard .fs-pipe-stat:nth-child(2) { border-bottom: 1px solid var(--border); }
}

.fs-dashboard .card-body { padding: 0; }
.fs-dashboard .card-body--pad { padding: 16px 18px; }

.fs-dashboard .card-link {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  transition: color 0.1s;
}

.fs-dashboard .card-link:hover { color: var(--primary-hover); text-decoration: underline; }

.fs-dashboard .list { display: flex; flex-direction: column; gap: 0; }
.fs-dashboard .list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.fs-dashboard .list-item:last-child { border-bottom: none; }
.fs-dashboard .list-item:hover { background: var(--hover); }
.fs-dashboard .list-item .name { font-weight: 600; font-size: 12.5px; color: var(--text-1); }
.fs-dashboard .list-item .meta { font-size: 11px; color: var(--text-2); margin-top: 1px; }

.fs-dashboard .quick-actions {
  display: flex;
  flex-direction: column;
}

.fs-dashboard .quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  background: transparent;
}

.fs-dashboard .quick-action:last-child { border-bottom: none; }
.fs-dashboard .quick-action:hover { background: var(--hover); border-color: var(--border); }
.fs-dashboard .quick-action i,
.fs-dashboard .quick-action .qa-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: rgba(2,115,94,0.08);
  color: var(--primary);
  flex-shrink: 0;
}
.fs-dashboard .quick-action svg { color: var(--primary); }
.fs-dashboard .quick-action span { font-size: 12.5px; font-weight: 600; color: var(--text-1); }

.fs-dashboard .pipeline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--sh-sm);
}

.fs-dashboard .pipeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.fs-dashboard .pipeline-head h3 { font-size: 14px; font-weight: 700; color: var(--text-1); }
.fs-dashboard .pipeline-stages { display: grid; grid-template-columns: repeat(4, 1fr); }
.fs-dashboard .pipeline-stage {
  padding: 20px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
  position: relative;
}
.fs-dashboard .pipeline-stage:last-child { border-right: none; }
.fs-dashboard .pipeline-stage::after {
  content: '\203A';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-3);
  z-index: 1;
  line-height: 1;
}
.fs-dashboard .pipeline-stage:last-child::after { display: none; }
.fs-dashboard .ps-count { font-size: 30px; font-weight: 700; color: var(--text-1); line-height: 1; }
.fs-dashboard .ps-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 4px 0 6px;
}
.fs-dashboard .ps-amount { font-size: 13px; font-weight: 600; color: var(--primary); }
.fs-dashboard .ps-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--border); }
.fs-dashboard .ps-bar span { display: block; height: 100%; border-radius: 0 2px 2px 0; }
.fs-dashboard .bar-green { background: var(--primary); }
.fs-dashboard .bar-teal { background: var(--verdi-accent); }
.fs-dashboard .bar-blue { background: var(--info); }
.fs-dashboard .bar-amber { background: var(--warning); }
.fs-dashboard .bar-emerald { background: var(--success); }

@media (max-width: 1200px) {
  .fs-dashboard .pods-grid  { grid-template-columns: repeat(2, 1fr); }
  .fs-dashboard .kpi-strip  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) {
  .fs-dashboard .pipeline-stages { grid-template-columns: repeat(2, 1fr); }
  .fs-dashboard .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .fs-dashboard .pods-grid  { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fs-dashboard .kpi-strip  { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .fs-dashboard .pipeline-stages { grid-template-columns: 1fr; }
  .fs-dashboard .pg-head { flex-direction: column; gap: 8px; }
  .fs-dashboard .pg-head-right { align-self: flex-start; }
}
@media (max-width: 480px) {
  .fs-dashboard .pods-grid { grid-template-columns: 1fr; }
}

/* ── Settings page ── */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.setting-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }

.toggle {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--border); position: relative;
  flex-shrink: 0; cursor: pointer;
  transition: background 0.2s;
}
.toggle::after {
  content: ''; position: absolute;
  left: 3px; top: 3px;
  width: 16px; height: 16px;
  border-radius: 50%; background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(18px); }

/* ── Table wrap inside card (no inner border) ── */
.card .table-wrap {
  border: none;
  border-radius: 0;
  background: transparent;
}

/* ── table in list pages ── */
.table tbody tr:hover { background: var(--hover); cursor: pointer; }
.table thead th { background: var(--mist); }

/* ── sidebar SVG icon alignment ── */
.sb-link svg { opacity: 0.7; }
.sb-link.active svg { opacity: 1; }
.sb-icon-box svg { color: #fff; }

/* ── Modal (shared — invoice/expense/payment creation) ── */
.fs-modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.55); backdrop-filter: blur(4px);
  z-index: 7000; align-items: center; justify-content: center; padding: 24px;
}
.fs-modal-backdrop.active { display: flex; }
.fs-modal {
  width: min(520px, 95vw); max-height: 90vh; overflow-y: auto;
  background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border);
  box-shadow: 0 35px 70px rgba(15,23,42,0.25);
  display: flex; flex-direction: column; position: relative;
  animation: fs-modal-rise 0.25s ease;
}
@keyframes fs-modal-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fs-modal-head {
  padding: 20px 24px 12px; display: flex; gap: 14px; align-items: center;
}
.fs-modal-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(2,115,94,0.1); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fs-modal-title { font-size: 16px; font-weight: 700; color: var(--text-1); margin: 0; }
.fs-modal-sub { font-size: 12.5px; color: var(--text-2); margin: 2px 0 0; }
.fs-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 6px; border: none;
  background: rgba(15,23,42,0.06); color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.fs-modal-close:hover { background: rgba(2,115,94,0.12); color: var(--primary); }
.fs-modal-body { padding: 8px 24px; display: flex; flex-direction: column; gap: 14px; }
.fs-form-group { display: flex; flex-direction: column; gap: 6px; }
.fs-form-group label { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
.fs-form-group input,
.fs-form-group select,
.fs-form-group textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); font-size: 13px; font-family: inherit;
  background: var(--bg-card); color: var(--text-1);
}
.fs-form-group textarea { resize: vertical; min-height: 60px; }
.fs-form-group input:focus,
.fs-form-group select:focus,
.fs-form-group textarea:focus {
  outline: 2px solid rgba(2,115,94,0.25); border-color: rgba(2,115,94,0.35);
}
.fs-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fs-origin-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: rgba(2,115,94,0.08); padding: 5px 10px; border-radius: 6px;
}
.fs-modal-foot {
  padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--border); margin-top: 8px;
}
.fs-btn {
  padding: 10px 18px; border-radius: 8px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s;
}
.fs-btn-primary { background: var(--primary); color: #fff; }
.fs-btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(2,115,94,0.3); }
.fs-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.fs-btn-secondary { background: var(--bg-card); color: var(--text-2); border: 1px solid var(--border); }
.fs-btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 540px) { .fs-form-row { grid-template-columns: 1fr; } }

/* ── Document builder (invoices / quotes) ── */
.fs-builder-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; flex-wrap:wrap; gap:12px; }
.fs-builder-header h1 { font-size:20px; font-weight:700; color:var(--text-1); display:flex; align-items:center; gap:8px; }
.fs-builder-header p { font-size:13px; color:var(--text-2); margin-top:2px; }
.fs-builder-actions { display:flex; gap:8px; flex-wrap:wrap; }
.fs-btab-bar { display:flex; gap:2px; background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:4px; margin-bottom:16px; max-width:520px; }
.fs-btab { flex:1; padding:9px 8px; font-size:12px; font-weight:600; color:var(--text-3); border:none; background:none; cursor:pointer; border-radius:8px; font-family:inherit; transition:.15s; display:flex; align-items:center; justify-content:center; gap:6px; }
.fs-btab:hover { color:var(--text-2); background:var(--mist); }
.fs-btab.active { color:var(--primary); background:rgba(2,115,94,.08); font-weight:700; }
/* Stacked sections (all visible) — preview sits 1:1 on the opposite side */
.fs-bpanel { display:block; }
@keyframes fs-fade { from{opacity:0} to{opacity:1} }
.fs-bsection-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--text-3); margin:4px 2px 8px; display:flex; align-items:center; gap:7px; }
.fs-bsection-label::before { content:''; width:14px; height:14px; border-radius:4px; background:rgba(2,115,94,.12); flex-shrink:0; }
.fs-bform-col { display:flex; flex-direction:column; }
.fs-bcard { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; margin-bottom:16px; overflow:hidden; }
.fs-bcard-head { padding:13px 18px; background:var(--mist); border-bottom:1px solid var(--border); }
.fs-bcard-head h3 { font-size:13.5px; font-weight:700; color:var(--text-1); display:flex; align-items:center; gap:8px; margin:0; }
.fs-bcard-head h3 svg { color:var(--primary); }
.fs-bcard-body { padding:18px; }
.fs-items-tbl { width:100%; border-collapse:collapse; }
.fs-items-tbl th { text-align:left; font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:var(--text-3); font-weight:700; padding:0 8px 8px; }
.fs-items-tbl th.r, .fs-items-tbl td.r { text-align:right; }
.fs-items-tbl td { padding:4px 8px; vertical-align:middle; }
.fs-items-tbl input, .fs-items-tbl select { width:100%; padding:8px 10px; border-radius:8px; border:1px solid var(--border); font-size:13px; font-family:inherit; background:var(--bg-card); color:var(--text-1); }
.fs-items-tbl input:focus, .fs-items-tbl select:focus { outline:2px solid rgba(2,115,94,.2); border-color:rgba(2,115,94,.35); }
.fs-item-total { font-weight:700; font-size:13px; color:var(--text-1); white-space:nowrap; }
.fs-item-remove { width:30px; height:30px; border-radius:7px; border:1px solid var(--border); background:var(--bg-card); color:var(--text-3); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:.15s; }
.fs-item-remove:hover { color:var(--danger); border-color:var(--danger); }
.fs-add-item { margin-top:12px; display:inline-flex; align-items:center; gap:6px; padding:9px 14px; border-radius:8px; border:1px dashed var(--border); background:var(--mist); color:var(--primary); font-size:12.5px; font-weight:600; cursor:pointer; font-family:inherit; transition:.15s; }
.fs-add-item:hover { border-color:var(--primary); border-style:solid; }
.fs-items-empty { text-align:center; color:var(--text-3); font-size:13px; padding:24px; }
.fs-totals-row { display:flex; align-items:center; justify-content:space-between; padding:9px 0; border-bottom:1px solid var(--border); font-size:13px; }
.fs-totals-row:last-child { border-bottom:none; }
.fs-totals-row label { color:var(--text-2); font-weight:500; display:inline-flex; align-items:center; gap:8px; }
.fs-totals-row .val { font-weight:700; color:var(--text-1); }
.fs-totals-row.grand { font-size:17px; padding-top:14px; }
.fs-totals-row.grand .val { color:var(--primary); }
.fs-totals-input { width:80px; padding:6px 8px; border-radius:6px; border:1px solid var(--border); font-size:12px; font-family:inherit; text-align:right; }
.fs-subtotal-live { font-size:13px; font-weight:700; color:var(--primary); margin-top:10px; text-align:right; }

/* ── Builder grid: form + live preview (like EstimateSync/ContractSync) ── */
.fs-bgrid { display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
.fs-bform-col { min-width:0; }
.fs-bpreview-col { min-width:0; position:sticky; top:calc(var(--topbar-h) + 16px); }
.fs-bpreview-wrap { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; overflow:hidden; display:flex; flex-direction:column; box-shadow:var(--sh-sm); }
.fs-bpreview-title { font-size:11px; font-weight:700; color:var(--text-3); text-transform:uppercase; letter-spacing:.04em; padding:11px 16px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:8px; background:var(--mist); }
.fs-bpreview-title span { display:inline-flex; align-items:center; gap:7px; }
.fs-bpreview-title svg { color:var(--primary); }
.fs-bpreview-actions { display:flex; gap:6px; }
.fs-bpreview-btn { width:28px; height:28px; border-radius:6px; border:1px solid var(--border); background:var(--bg-card); color:var(--text-3); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:.15s; }
.fs-bpreview-btn:hover { color:var(--primary); border-color:var(--primary); }
.fs-bpreview-frame { width:100%; border:none; background:#fff; height:calc(100vh - 200px); min-height:520px; }
@media (max-width:640px) { .fs-bgrid { grid-template-columns:1fr; } .fs-bpreview-col { position:static; } .fs-bpreview-frame { height:600px; } }

/* ── Collections (Cobros) KPIs ── */
.fs-col-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
.fs-col-kpi { display:flex; gap:12px; align-items:center; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:16px; }
.fs-col-kpi-icon { width:38px; height:38px; border-radius:9px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.fs-col-kpi-body { min-width:0; }
.fs-col-kpi-label { font-size:11px; font-weight:600; color:var(--text-3); text-transform:uppercase; letter-spacing:.03em; }
.fs-col-kpi-value { font-size:22px; font-weight:700; color:var(--text-1); line-height:1.2; margin-top:2px; }
.fs-col-kpi-meta { font-size:11px; color:var(--text-3); margin-top:2px; }
.fs-col-actions { display:flex; gap:6px; }
.fs-col-btn { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; padding:5px 10px; border-radius:7px; border:1px solid var(--border); background:var(--bg-card); color:var(--text-2); cursor:pointer; }
.fs-col-btn:hover { border-color:var(--primary); color:var(--primary); }
.fs-col-btn.verify { background:#10b981; border-color:#10b981; color:#fff; }
.fs-col-btn.verify:hover { background:#0ea372; border-color:#0ea372; color:#fff; }
.fs-col-btn.reject:hover { border-color:#ef4444; color:#ef4444; }
@media (max-width:1000px) { .fs-col-kpis { grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px) { .fs-col-kpis { grid-template-columns:1fr; } }

/* ── Reports catalog ── */
.fs-rep-catalog { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.fs-rep-card { display:flex; gap:12px; align-items:flex-start; text-align:left; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:16px; cursor:pointer; transition:.15s; font-family:inherit; }
.fs-rep-card:hover { border-color:var(--primary); box-shadow:var(--sh-sm); }
.fs-rep-card.active { border-color:var(--primary); box-shadow:0 0 0 1px var(--primary); }
.fs-rep-card-icon { width:34px; height:34px; flex-shrink:0; border-radius:8px; background:rgba(2,115,94,.08); color:var(--primary); display:flex; align-items:center; justify-content:center; }
.fs-rep-card-icon svg { width:17px; height:17px; }
.fs-rep-card-text { display:flex; flex-direction:column; gap:3px; min-width:0; }
.fs-rep-card-name { font-size:14px; font-weight:600; color:var(--text-1); }
.fs-rep-card-desc { font-size:11px; color:var(--text-3); line-height:1.35; }
.fs-rep-totals td { border-top:2px solid var(--border); background:var(--mist); }
@media (max-width:1000px) { .fs-rep-catalog { grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px) { .fs-rep-catalog { grid-template-columns:1fr; } }
@media print { .topbar, .sidebar, .pg-head-right, .fs-rep-catalog { display:none !important; } .main { margin:0 !important; width:100% !important; } }

/* export / print dropdown */
.fs-bexport { position:relative; }
.fs-bexport-trigger { display:inline-flex; align-items:center; gap:5px; padding:5px 10px; border-radius:7px; border:1px solid var(--border); background:var(--bg-card); color:var(--text-2); font-size:11.5px; font-weight:600; cursor:pointer; font-family:inherit; transition:.15s; }
.fs-bexport-trigger:hover { border-color:var(--primary); color:var(--primary); }
.fs-bexport-menu { display:none; position:absolute; top:calc(100% + 4px); right:0; min-width:190px; background:var(--bg-card); border:1px solid var(--border); border-radius:9px; box-shadow:0 10px 28px rgba(15,23,42,.16); z-index:30; overflow:hidden; padding:4px; }
.fs-bexport.open .fs-bexport-menu { display:block; }
.fs-bexport-menu button { width:100%; display:flex; align-items:center; gap:9px; padding:9px 11px; border:none; background:none; cursor:pointer; font-size:12.5px; font-weight:500; color:var(--text-1); font-family:inherit; border-radius:6px; text-align:left; transition:background .12s; }
.fs-bexport-menu button:hover { background:var(--hover); }
.fs-bexport-menu button svg { color:var(--primary); flex-shrink:0; }

/* ── Block / module system (drag-drop pre-filled modules) ── */
.fs-block-lib { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:16px; }
.fs-block-chip { display:inline-flex; align-items:center; gap:6px; padding:7px 12px; border-radius:8px; border:1px dashed var(--border); background:var(--mist); color:var(--text-2); font-size:12px; font-weight:600; cursor:pointer; font-family:inherit; transition:.15s; }
.fs-block-chip:hover { border-color:var(--primary); border-style:solid; color:var(--primary); background:rgba(2,115,94,.05); }
.fs-block-chip svg { color:var(--primary); }

.fs-block-card { border:1px solid var(--border); border-radius:12px; margin-bottom:14px; overflow:hidden; background:var(--bg-card); transition:box-shadow .15s, opacity .15s; }
.fs-block-card.dragging { opacity:.45; }
.fs-block-card.drag-over { box-shadow:0 0 0 2px var(--primary); }
.fs-block-head { display:flex; align-items:center; gap:10px; padding:10px 14px; background:var(--mist); border-bottom:1px solid var(--border); }
.fs-block-drag { color:var(--text-3); cursor:grab; flex-shrink:0; display:inline-flex; }
.fs-block-drag:active { cursor:grabbing; }
.fs-block-icon { width:28px; height:28px; border-radius:8px; background:rgba(2,115,94,.1); color:var(--primary); display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.fs-block-name { flex:1; min-width:0; border:1px solid transparent; background:transparent; font-size:13.5px; font-weight:700; color:var(--text-1); font-family:inherit; padding:5px 8px; border-radius:6px; }
.fs-block-name:hover { background:var(--bg-card); }
.fs-block-name:focus { outline:none; background:var(--bg-card); border-color:var(--border); }
.fs-block-meta { font-size:11px; color:var(--text-3); font-weight:500; white-space:nowrap; }
.fs-block-actions { display:flex; gap:4px; flex-shrink:0; }
.fs-block-btn { width:28px; height:28px; border-radius:6px; border:1px solid var(--border); background:var(--bg-card); color:var(--text-3); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:.15s; }
.fs-block-btn:hover { color:var(--primary); border-color:var(--primary); }
.fs-block-btn.danger:hover { color:var(--danger); border-color:var(--danger); }
.fs-block-body { padding:12px 14px; }
.fs-add-block-row { display:flex; gap:8px; margin-top:6px; }
.fs-add-block-row input { flex:1; padding:9px 12px; border-radius:8px; border:1px solid var(--border); font-size:13px; font-family:inherit; background:var(--bg-card); color:var(--text-1); }
.fs-add-block-row input:focus { outline:2px solid rgba(2,115,94,.2); border-color:rgba(2,115,94,.35); }

/* ── Inline validation ── */
.fs-invalid,
.fs-invalid:focus { border-color:var(--danger) !important; outline:2px solid rgba(239,68,68,.2) !important; }
.fs-bcard.fs-invalid { outline:none !important; box-shadow:0 0 0 2px var(--danger); animation:fs-shake .3s ease; }
@keyframes fs-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
