/* ═══════════════════════════════════════════════════════════════
   Fortax FCA Design System v1
   Cream canvas, ink pill navbar, lime + lavender accents.
   Ubuntu everywhere. SVG icons only. Light + dark via CSS vars.
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&family=Ubuntu+Mono&display=swap');

:root {
  --bg: #F2EFE8;
  --surface: #FFFFFF;
  --surface-2: #F8F6F0;
  --ink: #17161A;
  --ink-soft: #45434A;
  --muted: #8B8894;
  --line: #E5E1D6;
  --lime: #C9F24B;
  --lime-ink: #2A3A05;
  --lavender: #CBB9F6;
  --lavender-ink: #2C1E4F;
  --green: #16A34A;
  --amber: #D97706;
  --red: #DC2626;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(23,22,26,.07);
  --nav-bg: #17161A;
  --nav-ink: #F2EFE8;
}
html[data-theme="dark"] {
  --bg: #121116;
  --surface: #1C1B21;
  --surface-2: #232229;
  --ink: #F2EFE8;
  --ink-soft: #C9C6CF;
  --muted: #85828D;
  --line: #2C2B33;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --nav-bg: #1C1B21;
  --nav-ink: #F2EFE8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Ubuntu', system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.icon { vertical-align: -3px; }
.mono { font-family: 'Ubuntu Mono', monospace; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ── Navbar: dark rounded pill ─────────────────────────────── */
.fnav {
  margin: 18px auto 0; max-width: 1240px; padding: 0 20px;
}
.fnav-inner {
  background: var(--nav-bg); color: var(--nav-ink);
  border-radius: 999px; padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
}
.fnav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.fnav-brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); display: inline-block; }
.fnav-brand span.sub { color: #9A97A2; font-weight: 400; font-size: 14px; }
.fnav-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.08); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; color: #CFCCD6;
}
.fnav-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.fnav-spacer { flex: 1; }
.fnav-views {
  background: #F5C044; color: #3A2A00; border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
}
.fnav .btn-login {
  background: var(--lime); color: var(--lime-ink); border-radius: 999px;
  padding: 9px 22px; font-weight: 700; font-size: 14px; border: 0; cursor: pointer;
}
.fnav .theme-toggle {
  background: rgba(255,255,255,.1); border: 0; color: var(--nav-ink);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Hero cards row ────────────────────────────────────────── */
.hero-row {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 16px; margin: 22px 0 16px;
}
.hero-card {
  background: var(--surface); border-radius: var(--radius); padding: 30px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero-card h1 { margin: 0 0 10px; font-size: 34px; line-height: 1.12; letter-spacing: -0.5px; }
.hero-card h1 .accent { color: #3B6CF6; font-style: italic; }
.hero-card p { margin: 0; color: var(--ink-soft); font-size: 15px; max-width: 420px; }
.hero-card .blob {
  position: absolute; right: -30px; bottom: -40px; width: 170px; height: 170px;
  background: radial-gradient(circle at 40% 40%, var(--lavender), transparent 70%);
  filter: blur(6px); opacity: .8;
}
.stat-card {
  border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 170px; position: relative;
}
.stat-card.lime { background: var(--lime); color: var(--lime-ink); }
.stat-card.lavender { background: var(--lavender); color: var(--lavender-ink); }
.stat-card .top { display: flex; justify-content: space-between; align-items: flex-start; font-size: 14px; font-weight: 500; }
.stat-card .badge-ic {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.75); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.stat-card .big { font-size: 46px; font-weight: 700; line-height: 1; }
.stat-card .big small { font-size: 20px; font-weight: 500; opacity: .7; }
.stat-card .foot { font-size: 13px; opacity: .8; }

/* ── Search bar ────────────────────────────────────────────── */
.search-bar {
  background: var(--surface); border-radius: var(--radius); padding: 12px;
  display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); flex-wrap: wrap;
}
.search-input {
  flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; color: var(--muted);
}
.search-input input {
  border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink);
  width: 100%; padding: 12px 0; font-size: 15px;
}
.select-pill {
  position: relative;
}
.select-pill select {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 999px; padding: 11px 38px 11px 18px;
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.select-pill::after {
  content: ''; position: absolute; right: 16px; top: 50%; transform: translateY(-35%) rotate(45deg);
  width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  pointer-events: none;
}
.btn {
  border: 0; cursor: pointer; font: inherit; font-weight: 700; border-radius: 999px;
  padding: 12px 24px; font-size: 14px; display: inline-flex; align-items: center; gap: 8px;
}
.btn-ink { background: var(--nav-bg); color: #fff; }
.btn-lime { background: var(--lime); color: var(--lime-ink); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── CA grid ───────────────────────────────────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 14px; }
.section-head h2 { margin: 0; font-size: 21px; }
.section-head .meta { color: var(--muted); font-size: 13px; }
.ca-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ca-card {
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
  transition: transform .15s ease;
}
.ca-card:hover { transform: translateY(-3px); }
.ca-card .head { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 52px; height: 52px; border-radius: 16px; background: var(--lavender);
  color: var(--lavender-ink); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 19px; flex: none; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.ca-card .name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.vbadge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; flex: none;
}
.ca-card .firm { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ca-card .row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; color: var(--ink-soft);
}
.chip.lime { background: var(--lime); border-color: transparent; color: var(--lime-ink); font-weight: 500; }
.ca-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.rating { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 14px; }
.rating .icon { color: #F5C044; }
.fee { font-size: 13px; color: var(--muted); }
.fee b { color: var(--ink); font-size: 15px; }

/* Skeletons */
.sk { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.sk .b { background: var(--surface-2); border-radius: 8px; height: 14px; margin: 10px 0; animation: sk 1.2s infinite; }
.sk .b.w40 { width: 40%; } .sk .b.w70 { width: 70%; } .sk .b.h40 { height: 40px; }
@keyframes sk { 50% { opacity: .5; } }

/* ── Profile page ──────────────────────────────────────────── */
.profile-hero {
  background: var(--surface); border-radius: var(--radius); padding: 30px;
  box-shadow: var(--shadow); display: flex; gap: 22px; align-items: flex-start; margin-top: 22px; flex-wrap: wrap;
}
.profile-hero .avatar { width: 84px; height: 84px; border-radius: 24px; font-size: 30px; }
.profile-hero h1 { margin: 0; font-size: 26px; display: flex; align-items: center; gap: 10px; }
.profile-hero .sub { color: var(--muted); margin: 6px 0 10px; font-size: 14px; }
.pstats { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.pstat {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 18px; text-align: center; min-width: 92px;
}
.pstat .v { font-weight: 700; font-size: 19px; }
.pstat .l { color: var(--muted); font-size: 12px; }
.two-col { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin: 16px 0 40px; align-items: start; }
.card {
  background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 14px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.svc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.svc-row:last-child { border-bottom: 0; }
.svc-row .t { font-weight: 500; font-size: 14px; }
.svc-row .d { color: var(--muted); font-size: 12px; margin-top: 2px; }
.svc-row .f { font-weight: 700; white-space: nowrap; }
.review { padding: 13px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review .who { font-weight: 500; font-size: 14px; display: flex; justify-content: space-between; }
.review .txt { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }

/* ── Auth ──────────────────────────────────────────────────── */
.auth-wrap { max-width: 440px; margin: 50px auto; padding: 0 20px; }
.auth-card { background: var(--surface); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0 0 6px; font-size: 24px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  border-radius: var(--radius-sm); padding: 12px 14px; font: inherit; font-size: 14px; outline: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.role-tabs { display: flex; background: var(--surface-2); border-radius: 999px; padding: 5px; margin-bottom: 18px; }
.role-tabs button {
  flex: 1; border: 0; background: transparent; font: inherit; font-weight: 500; font-size: 14px;
  padding: 9px; border-radius: 999px; cursor: pointer; color: var(--muted);
}
.role-tabs button.active { background: var(--nav-bg); color: #fff; }

.flash { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; margin: 14px 0; }
.flash.error { background: #FDE8E8; color: #9B1C1C; }
.flash.success { background: #E7F8EE; color: #14532D; }
.flash.notice { background: #FEF6E0; color: #7A4E00; }
html[data-theme="dark"] .flash.error { background: #3A1414; color: #FCA5A5; }
html[data-theme="dark"] .flash.success { background: #0F2A1B; color: #86EFAC; }
html[data-theme="dark"] .flash.notice { background: #33280C; color: #FCD34D; }

/* ── App shell (dashboards) ───────────────────────────────── */
.shell { display: grid; grid-template-columns: 240px 1fr; gap: 18px; margin: 22px 0 40px; align-items: start; }
.side {
  background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  position: sticky; top: 18px;
}
.side a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-bottom: 2px;
}
.side a.active, .side a:hover { background: var(--surface-2); color: var(--ink); }
.side .build { color: var(--muted); font-size: 11px; text-align: center; margin-top: 14px; }
.main { min-width: 0; }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.mini-stat { background: var(--surface); border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow); }
.mini-stat .v { font-size: 22px; font-weight: 700; }
.mini-stat .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
table.tbl tr:last-child td { border-bottom: 0; }
.status { display: inline-block; border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 500; }
.status.PENDING, .status.REQUESTED, .status.PROPOSED { background: #FEF6E0; color: #7A4E00; }
.status.CONFIRMED, .status.ACCEPTED, .status.PAID, .status.IN_PROGRESS, .status.PROCESSING { background: #E3ECFE; color: #1E43A8; }
.status.COMPLETED, .status.VERIFIED, .status.APPROVED, .status.DELIVERED { background: #E7F8EE; color: #14532D; }
.status.CANCELLED, .status.REJECTED, .status.FAILED, .status.NO_SHOW, .status.BLOCKED { background: #FDE8E8; color: #9B1C1C; }
html[data-theme="dark"] .status.PENDING, html[data-theme="dark"] .status.REQUESTED, html[data-theme="dark"] .status.PROPOSED { background: #33280C; color: #FCD34D; }
html[data-theme="dark"] .status.CONFIRMED, html[data-theme="dark"] .status.ACCEPTED, html[data-theme="dark"] .status.PAID, html[data-theme="dark"] .status.IN_PROGRESS, html[data-theme="dark"] .status.PROCESSING { background: #14243F; color: #93B4F8; }
html[data-theme="dark"] .status.COMPLETED, html[data-theme="dark"] .status.VERIFIED, html[data-theme="dark"] .status.APPROVED, html[data-theme="dark"] .status.DELIVERED { background: #0F2A1B; color: #86EFAC; }
html[data-theme="dark"] .status.CANCELLED, html[data-theme="dark"] .status.REJECTED, html[data-theme="dark"] .status.FAILED { background: #3A1414; color: #FCA5A5; }

.empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 14px; }
.pager { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }

footer.ffoot { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0 40px; }

@media (max-width: 980px) {
  .hero-row { grid-template-columns: 1fr 1fr; }
  .hero-card { grid-column: 1 / -1; }
  .ca-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .side a { margin: 0; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hero-row, .ca-grid { grid-template-columns: 1fr; }
  .fnav-chip.loc { display: none; }
  .hero-card h1 { font-size: 27px; }
}

/* footer strip */
.foot-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 26px 4px 40px; color: var(--muted); font-size: 13px; }
.foot-strip .links { display: flex; gap: 18px; }
.foot-strip a { color: var(--muted); text-decoration: none; font-weight: 500; }
.foot-strip a:hover { color: var(--text); }
