/* ==========================================================================
   Flido Client Dashboard Demo
   Calm Editorial — deep teal #0E5650 + ink #1A1409, yellow #FFE100 sparingly
   ========================================================================== */

:root {
  --brand-teal: #0E5650;
  --brand-yellow: #FFE100;
  --brand-teal-deep: #0A4642;
  --brand-teal-ink: #0E5650;
  --brand-gradient: linear-gradient(135deg, #0E5650 0%, #1A1409 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(14, 86, 80, 0.10) 0%, rgba(14, 86, 80, 0.04) 100%);
  --brand-gradient-faint: linear-gradient(135deg, rgba(14, 86, 80, 0.05) 0%, rgba(14, 86, 80, 0.02) 100%);

  --ink-900: #1A1409;
  --ink-700: #3A2E1A;
  --ink-500: #6B5C42;
  --ink-400: #8A7A5E;
  --ink-300: #B5A98E;
  --ink-200: #D9CFB4;
  --ink-100: #E7DFCB;
  --ink-50: #F0EBDE;
  --paper: #FFFCF3;
  --bg: #F4EFE2;

  --ok: #0F7A3D;
  --warn: #C2740B;
  --bad: #B91C1C;
  --info: #2563EB;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(26, 20, 9, 0.06), 0 1px 1px rgba(26, 20, 9, 0.04);
  --shadow-md: 0 8px 24px rgba(26, 20, 9, 0.08);
  --shadow-lg: 0 20px 56px rgba(26, 20, 9, 0.12);
  --shadow-brand: 0 18px 40px rgba(14, 86, 80, 0.20);

  --font-sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, sans-serif;

  --sidebar-w: 248px;
  --topbar-h: 64px;
  --mobnav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-900);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; display: block; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--brand-yellow); color: var(--ink-900); }

h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.15; letter-spacing: -0.015em; font-weight: 800; color: var(--ink-900); }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.25rem); font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--ink-700); }
.muted { color: var(--ink-500); }
.small { font-size: .85rem; }
.text-shine { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700; font-size: .95rem; letter-spacing: -0.005em;
  cursor: pointer; border: 1.5px solid transparent;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  text-decoration: none; line-height: 1; white-space: nowrap;
  background: transparent; color: var(--ink-900);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--brand-teal-deep); outline-offset: 2px; }
.btn.small { min-height: 36px; padding: 8px 14px; font-size: .85rem; }
.btn.tiny { min-height: 30px; padding: 6px 12px; font-size: .78rem; }
.btn-primary { background: var(--brand-teal); color: var(--paper); box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-teal-deep); box-shadow: 0 22px 44px rgba(14,86,80,.28); }
.btn-secondary { background: var(--paper); color: var(--ink-900); border-color: var(--ink-200); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--brand-teal-deep); color: var(--brand-teal-ink); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-100); }
.btn-danger { background: var(--paper); color: var(--bad); border-color: rgba(220,38,38,.3); }
.btn-danger:hover { background: rgba(220,38,38,.06); }
.btn-block { width: 100%; }

/* Form controls */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .88rem; color: var(--ink-700); }
.field .hint { color: var(--ink-500); font-size: .8rem; }
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink-200);
  background: var(--paper);
  color: var(--ink-900);
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-teal-deep);
  box-shadow: 0 0 0 3px rgba(14,86,80,.18);
}
.textarea { min-height: 96px; resize: vertical; }
.row-fields { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .row-fields.cols-2 { grid-template-columns: 1fr 1fr; } }

/* Badges & tags */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; letter-spacing: .04em; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); text-transform: uppercase; }
.badge.ok { background: rgba(22,163,74,.12); color: #15803D; }
.badge.warn { background: rgba(245,158,11,.14); color: #B45309; }
.badge.bad { background: rgba(220,38,38,.10); color: #B91C1C; }
.badge.info { background: rgba(37,99,235,.10); color: #1D4ED8; }
.badge.neutral { background: var(--ink-100); color: var(--ink-700); }
.badge.brand { background: var(--brand-gradient); color: var(--ink-900); }

/* Cards */
.card {
  background: var(--paper);
  border-radius: var(--radius-md);
  border: 1px solid var(--ink-100);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card.flat { box-shadow: none; }
.card.lift { box-shadow: var(--shadow-md); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-title { font-weight: 700; font-size: 1rem; color: var(--ink-900); margin: 0; }
.card-desc { font-size: .88rem; color: var(--ink-500); margin: 0 0 14px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  color: var(--brand-teal-ink); background: var(--brand-gradient-soft);
  padding: 6px 11px; border-radius: var(--radius-pill);
}

/* ==========================================================================
   LOGIN
   ========================================================================== */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(14,86,80,.20), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(255,225,0,.16), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 28px;
  border: 1px solid var(--ink-100);
}
.login-brand {
  display: flex; align-items: center; gap: 10px; margin-bottom: 22px;
}
.login-brand .logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--brand-gradient);
  display: grid; place-items: center;
  box-shadow: var(--shadow-brand);
  font-weight: 800; color: var(--ink-900);
}
.logo .logo-mark { width: 72%; height: auto; display: block; }
.login-brand .name { font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.login-brand .sub { font-size: .72rem; color: var(--ink-500); letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.login-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.login-card .sub-copy { color: var(--ink-500); font-size: .92rem; margin-bottom: 20px; }
.login-error {
  display: none;
  padding: 10px 12px;
  background: rgba(220,38,38,.08);
  color: #B91C1C;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-bottom: 12px;
}
.login-error.show { display: block; }
.login-actions { display: flex; gap: 10px; margin-top: 18px; }
.login-helper { margin-top: 18px; font-size: .82rem; color: var(--ink-500); text-align: center; }
.login-creds {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--brand-gradient-faint);
  border: 1px dashed var(--ink-200);
  border-radius: var(--radius-sm);
  font-size: .78rem;
  color: var(--ink-500);
  text-align: center;
}
.login-creds code { color: var(--ink-900); font-weight: 700; }

/* ==========================================================================
   DASHBOARD SHELL
   ========================================================================== */
.dashboard {
  display: none;
  min-height: 100vh;
}
.dashboard.show { display: block; }

/* Sidebar (desktop) */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--paper);
  border-right: 1px solid var(--ink-100);
  padding: 18px 14px;
  display: none;
  flex-direction: column;
  z-index: 40;
}
@media (min-width: 980px) { .sidebar { display: flex; } }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--ink-100);
  margin-bottom: 14px;
}
.sidebar-brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-gradient);
  display: grid; place-items: center;
  font-weight: 800; color: var(--ink-900);
}
.sidebar-brand .name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.sidebar-brand .role { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-500); font-weight: 700; }

.nav-tabs { display: flex; flex-direction: column; gap: 4px; }
.nav-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: .92rem;
  color: var(--ink-700);
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
  border: 1px solid transparent;
  background: transparent;
}
.nav-tab:hover { background: var(--ink-50); color: var(--ink-900); }
.nav-tab.active {
  background: var(--brand-gradient-soft);
  color: var(--brand-teal-ink);
  border-color: rgba(14,86,80,.25);
  font-weight: 700;
}
.nav-tab .ic { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-tab.active .ic { opacity: 1; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--ink-100); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.user-chip .av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink-100); color: var(--ink-700);
  display: grid; place-items: center; font-weight: 800; font-size: .78rem;
}
.user-chip .meta .nm { font-weight: 700; font-size: .85rem; line-height: 1.1; }
.user-chip .meta .em { font-size: .72rem; color: var(--ink-500); }
.logout-btn { margin-top: 8px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,252,243,.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ink-100);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  height: var(--topbar-h);
  margin-left: 0;
}
@media (min-width: 980px) { .topbar { margin-left: var(--sidebar-w); padding: 10px 28px; } }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-mobile-brand { display: flex; align-items: center; gap: 10px; }
@media (min-width: 980px) { .topbar-mobile-brand { display: none; } }
.topbar-mobile-brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-gradient); display: grid; place-items: center; font-weight: 800; }
.topbar-title { font-weight: 700; font-size: 1rem; color: var(--ink-900); margin: 0; line-height: 1.2; }
.topbar-sub { font-size: .76rem; color: var(--ink-500); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* Mobile bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: rgba(255,252,243,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--ink-100);
  display: flex;
  height: var(--mobnav-h);
  overflow-x: auto;
  padding: 6px 4px;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }
@media (min-width: 980px) { .bottom-nav { display: none; } }
.bottom-nav .nav-tab {
  flex: 1 0 auto;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  font-size: .68rem;
  text-align: center;
  border-radius: 10px;
  min-width: 72px;
}
.bottom-nav .nav-tab .ic { width: 22px; height: 22px; }
.bottom-nav .nav-tab.active { background: var(--brand-gradient-soft); }

/* Main content */
.main {
  margin-left: 0;
  padding: 22px 16px 100px;
}
@media (min-width: 980px) {
  .main { margin-left: var(--sidebar-w); padding: 28px 32px 60px; }
}
.tab-panel { display: none; animation: fadeUp .35s ease; }
.tab-panel.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-head { margin-bottom: 20px; }
.section-head h1, .section-head h2 { margin-bottom: 6px; }
.section-head .lede { color: var(--ink-500); margin: 0; max-width: 70ch; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

/* Documentation cards */
.doc-card { display: flex; flex-direction: column; gap: 8px; }
.doc-card .card-title { font-size: 1.02rem; }
.doc-card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.point-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.point-list li {
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  color: var(--ink-700);
}

/* Task category grid */
.cat-group { margin-bottom: 22px; }
.cat-group h3 { display: flex; align-items: center; gap: 10px; }
.cat-group h3 .pill {
  background: var(--brand-gradient-soft);
  color: var(--brand-teal-ink);
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--radius-pill); font-weight: 700;
}
.cat-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .cat-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-pill {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--ink-100);
  border-radius: var(--radius-md);
  font-weight: 600; font-size: .92rem;
  cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .2s;
  text-align: left;
  color: var(--ink-900);
}
.cat-pill:hover { border-color: var(--brand-teal-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.cat-pill.selected { border-color: var(--brand-teal-deep); background: var(--brand-gradient-soft); }
.cat-pill .arrow { color: var(--ink-300); font-size: 1rem; }
.different-task {
  margin-top: 18px;
  padding: 18px;
  background: var(--brand-gradient-soft);
  border: 1px dashed var(--brand-teal-deep);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.different-task p { margin: 0; color: var(--ink-700); font-size: .92rem; }

/* Drawer / bottom sheet */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 31, 29, 0.45);
  z-index: 60;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 70;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
  inset: auto 0 0 0;
  max-height: 92vh;
  border-radius: 22px 22px 0 0;
  overflow: hidden;
}
@media (min-width: 980px) {
  .drawer {
    inset: 0 0 0 auto;
    width: min(820px, 92vw);
    max-height: 100vh;
    border-radius: 22px 0 0 22px;
    transform: translateX(100%);
  }
}
.drawer.open { transform: translateY(0); }
@media (min-width: 980px) { .drawer.open { transform: translateX(0); } }
.drawer-head {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ink-100);
  background: var(--paper);
  z-index: 2;
}
.drawer-head .grip {
  display: block; width: 38px; height: 4px; border-radius: 4px;
  background: var(--ink-200); margin: 0 auto 8px;
}
@media (min-width: 980px) { .drawer-head .grip { display: none; } }
.drawer-head h3 { margin: 0; font-size: 1.1rem; }
.drawer-head .sub { font-size: .8rem; color: var(--ink-500); }
.drawer-body { padding: 18px 20px; overflow: auto; flex: 1; }
.drawer-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--ink-100);
  background: var(--paper);
  display: flex; gap: 10px; justify-content: flex-end;
  position: sticky; bottom: 0;
}
.x-btn { background: var(--ink-100); border: 0; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: var(--ink-700); font-size: 1.1rem; }
.x-btn:hover { background: var(--ink-200); }

/* Setup split (form builder + mobile preview) */
.setup-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 980px) {
  .setup-split { grid-template-columns: 1fr 320px; }
}

.field-builder { display: flex; flex-direction: column; gap: 10px; }
.builder-row {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
}
.br-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  align-items: center;
}
@media (min-width: 700px) {
  .br-main { grid-template-columns: 140px 1fr auto; }
}
.builder-row .ftype { font-size: .68rem; font-weight: 800; color: var(--brand-teal-ink); letter-spacing: .1em; text-transform: uppercase; }
.builder-row .fhead { font-weight: 700; color: var(--ink-900); font-size: .92rem; line-height: 1.25; }
.builder-row .fhint { font-size: .78rem; color: var(--ink-500); margin-top: 2px; }
.builder-row .ftools { display: flex; gap: 6px; }
.br-checks {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--ink-200);
}
.br-checks:empty { display: none; }
.check-pill {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px;
  font-size: .72rem; font-weight: 600; line-height: 1;
  background: var(--paper); border: 1px solid var(--ink-200);
  border-radius: var(--radius-pill); color: var(--ink-700);
  white-space: nowrap;
}
.check-pill.paid { border-color: rgba(245,158,11,.5); color: #B45309; background: rgba(245,158,11,.08); }
.check-pill.report { border-color: rgba(37,99,235,.4); color: #1D4ED8; background: rgba(37,99,235,.06); }

/* Icon button (used for add/remove on field rows) */
.icon-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--ink-200);
  background: var(--paper);
  color: var(--ink-700);
  font-size: 1rem; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
  transition: border-color .15s, color .15s, background .15s;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--brand-teal-deep); color: var(--brand-teal-ink); background: var(--brand-gradient-soft); }
.icon-btn.danger:hover { border-color: rgba(220,38,38,.5); color: var(--bad); background: rgba(220,38,38,.06); }

/* Upload fields editor */
.upload-editor { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.upload-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-sm);
}
.upload-row .nm { flex: 1; font-size: .9rem; color: var(--ink-900); font-weight: 600; }
.upload-add { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; }
.upload-add .input { flex: 1; }

/* Mobile app preview */
.phone-frame {
  position: sticky; top: 84px;
  background: var(--ink-900);
  border-radius: 32px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  width: 280px;
  margin: 0 auto;
}
.phone-screen {
  background: var(--bg);
  border-radius: 22px;
  height: 540px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone-bar {
  height: 28px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  font-size: .68rem; color: var(--ink-500); font-weight: 700;
}
.phone-bar .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-300); }
.phone-app-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-100);
  background: var(--paper);
}
.phone-app-head .logo { width: 22px; height: 22px; border-radius: 6px; background: var(--brand-gradient); }
.phone-app-head .nm { font-weight: 800; font-size: .82rem; }
.phone-app-head .sub { font-size: .65rem; color: var(--ink-500); margin-left: auto; }
.phone-form { padding: 12px 14px; overflow: auto; flex: 1; }
.phone-task-title { font-size: .8rem; font-weight: 800; color: var(--ink-900); }
.phone-task-sub { font-size: .68rem; color: var(--ink-500); margin-bottom: 12px; }
.phone-field {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
}
.phone-field .lbl { font-size: .68rem; font-weight: 700; color: var(--ink-700); display: flex; align-items: center; gap: 4px; }
.phone-field .val { font-size: .72rem; color: var(--ink-500); }
.phone-field .hint { font-size: .62rem; color: var(--ink-400); margin-top: 3px; }
.phone-field.upload .val { display: flex; align-items: center; gap: 6px; }
.phone-field.upload .swatch { width: 24px; height: 24px; border-radius: 6px; background: var(--brand-gradient-soft); border: 1px dashed var(--brand-teal-deep); }
.phone-cta {
  margin-top: 12px;
  background: var(--brand-gradient);
  color: var(--ink-900);
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 800; font-size: .78rem;
  text-align: center;
}

/* Commissions */
.commish-toggle { display: inline-flex; padding: 4px; background: var(--ink-100); border-radius: var(--radius-pill); margin-bottom: 18px; }
.commish-toggle button {
  border: 0; background: transparent; padding: 8px 16px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--ink-700);
  transition: background .2s, color .2s;
}
.commish-toggle button.active { background: var(--paper); color: var(--ink-900); box-shadow: var(--shadow-sm); }

.commish-fields .grid-3 { gap: 12px; }
.cost-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.cost-table th, .cost-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--ink-100); font-size: .92rem; }
.cost-table th { color: var(--ink-500); font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.cost-table td.amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cost-table tr.total td { font-weight: 800; color: var(--ink-900); border-top: 2px solid var(--ink-200); border-bottom: 0; }

.share-bar {
  display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 10px 0 6px;
  background: var(--ink-100);
}
.share-bar span { display: block; height: 100%; }
.share-bar .agent { background: var(--brand-teal); }
.share-bar .platform { background: var(--brand-yellow); }
.share-legend { display: flex; gap: 14px; font-size: .8rem; color: var(--ink-500); }
.share-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.share-legend .a { background: var(--brand-teal); }
.share-legend .p { background: var(--brand-yellow); }

.compare-output {
  margin-top: 14px;
  padding: 16px;
  background: var(--brand-gradient-faint);
  border: 1px dashed var(--brand-teal-deep);
  border-radius: var(--radius-md);
  display: none;
}
.compare-output.show { display: block; }
.compare-output .row { display: flex; justify-content: space-between; padding: 5px 0; font-size: .9rem; }
.compare-output .row .v { font-weight: 700; }

.bump-card .row { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0; }
.bump-card .row .col { flex: 1 1 130px; }
.bump-card .col .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); font-weight: 700; }
.bump-card .col .val { font-weight: 700; font-size: 1rem; color: var(--ink-900); margin-top: 2px; }

/* Home tab */
.empty-state {
  display: grid; place-items: center;
  text-align: center;
  padding: 50px 20px;
  background: var(--brand-gradient-faint);
  border: 1px dashed var(--ink-200);
  border-radius: var(--radius-lg);
}
.empty-state img { width: 180px; margin-bottom: 14px; }
.empty-state h3 { margin: 0 0 6px; }
.empty-state p { color: var(--ink-500); max-width: 44ch; margin: 0 auto 18px; }

.task-group { margin-bottom: 22px; }
.task-group h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.task-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.task-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, border-color .2s;
  position: relative;
  text-align: left;
}
.task-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--ink-200); }
@media (min-width: 700px) {
  .task-card {
    grid-template-columns: minmax(0, 1.6fr) 160px 130px 110px 200px;
    align-items: center;
    column-gap: 16px;
  }
}
.task-card > * { min-width: 0; text-align: left; }
.task-card .id { font-weight: 800; font-size: .78rem; color: var(--brand-teal-ink); letter-spacing: .04em; }
.task-card .nm { font-weight: 700; font-size: .98rem; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-card .meta { font-size: .8rem; color: var(--ink-500); }
.task-card .meta b { color: var(--ink-700); font-weight: 600; }
.task-card .commission { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.task-card .stage { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.task-card .stage .badge { white-space: normal; line-height: 1.25; max-width: 100%; }
.task-card .open-arrow { color: var(--ink-300); font-size: 1.2rem; align-self: center; }

/* Task detail drawer body */
.detail-section { margin-bottom: 22px; }
.detail-section h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: .9rem; }
.dl dt { color: var(--ink-500); }
.dl dd { margin: 0; font-weight: 600; color: var(--ink-900); }
.timeline { display: grid; gap: 10px; }
.tl-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: flex-start; }
.tl-item .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-200); margin-top: 6px; }
.tl-item.done .dot { background: var(--brand-teal); box-shadow: 0 0 0 4px rgba(14,86,80,.18); }
.tl-item.cur .dot { background: var(--brand-yellow); box-shadow: 0 0 0 4px rgba(255,225,0,.28); }
.tl-item .when { font-size: .76rem; color: var(--ink-500); }
.tl-item .what { font-weight: 600; color: var(--ink-900); font-size: .92rem; }

.evidence-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.evidence-grid .ev {
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  font-size: .78rem;
  color: var(--ink-700);
}
.evidence-grid .ev .ic { font-size: 1.4rem; margin-bottom: 4px; }

/* Performance */
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 700px) { .metric-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .metric-grid { grid-template-columns: repeat(5, 1fr); } }
.metric-card { padding: 16px; }
.metric-card .label { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); font-weight: 700; }
.metric-card .value { font-size: 1.6rem; font-weight: 800; color: var(--ink-900); margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-card .delta { font-size: .8rem; margin-top: 4px; color: var(--ink-500); }
.metric-card .delta.up { color: var(--ok); }
.metric-card .delta.down { color: var(--bad); }

.split-chart { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--ink-100); }
.split-chart .seg { height: 100%; }
.split-chart .urban { background: var(--brand-teal); }
.split-chart .semi { background: linear-gradient(135deg, #0E5650 0%, #FFE100 100%); }
.split-chart .rural { background: var(--brand-yellow); }
.split-legend { display: flex; gap: 14px; margin-top: 10px; font-size: .82rem; color: var(--ink-700); }
.split-legend .lg { display: flex; align-items: center; gap: 6px; }
.split-legend .sw { width: 10px; height: 10px; border-radius: 3px; }

.gen-output {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--brand-gradient-faint);
  border: 1px dashed var(--brand-teal-deep);
  border-radius: var(--radius-md);
  display: none;
}
.gen-output.show { display: block; }
.gen-output .ttl { font-weight: 700; color: var(--ink-900); margin-bottom: 4px; }
.gen-output .vl { font-size: 1.4rem; font-weight: 800; color: var(--brand-teal-ink); font-variant-numeric: tabular-nums; }
.gen-output .cmp { color: var(--ink-500); font-size: .85rem; margin-top: 4px; }

.report-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .report-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .report-grid { grid-template-columns: repeat(3, 1fr); } }
.report-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: var(--paper);
  border: 1px solid var(--ink-100); border-radius: var(--radius-md);
}
.report-row .nm { font-weight: 600; font-size: .92rem; }

/* Payments */
.pay-toggle { display: inline-flex; padding: 4px; background: var(--ink-100); border-radius: var(--radius-pill); margin-bottom: 20px; }
.pay-toggle button { border: 0; background: transparent; padding: 8px 16px; border-radius: var(--radius-pill); font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--ink-700); }
.pay-toggle button.active { background: var(--paper); color: var(--ink-900); box-shadow: var(--shadow-sm); }

.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 700px) { .wallet-grid { grid-template-columns: repeat(4, 1fr); } }
.wallet-card { padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--ink-100); background: var(--paper); }
.wallet-card.hero { background: var(--brand-gradient); color: var(--ink-900); border-color: transparent; }
.wallet-card .label { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; opacity: .8; }
.wallet-card .value { font-size: 1.6rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }

.invoice-table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--ink-100); background: var(--paper); }
.invoice-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.invoice-table th, .invoice-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--ink-100); font-size: .9rem; }
.invoice-table th { background: var(--ink-50); color: var(--ink-500); font-weight: 700; font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; }
.invoice-table .amt { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }

/* Workflow steps */
.workflow {
  display: grid; gap: 10px; grid-template-columns: 1fr;
  margin-top: 14px;
}
.workflow .step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: var(--ink-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--ink-100);
}
.workflow .step .num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-gradient);
  display: grid; place-items: center;
  font-weight: 800; font-size: .82rem; color: var(--ink-900); flex-shrink: 0;
}
.workflow .step .text { font-size: .92rem; color: var(--ink-700); }
.workflow .step .text b { color: var(--ink-900); }

/* Privacy banner / notes */
.privacy-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(37,99,235,.06);
  border-left: 3px solid var(--info);
  border-radius: 8px;
  font-size: .88rem; color: var(--ink-700);
  margin: 12px 0;
}
.privacy-banner .ic { width: 22px; height: 22px; flex-shrink: 0; }

/* ==========================================================================
   GUIDED DEMO
   ========================================================================== */
.demo-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--mobnav-h) + 14px);
  z-index: 50;
  background: rgba(26,20,9,.96);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 92vw;
}
@media (min-width: 980px) { .demo-bar { bottom: 22px; } }
.demo-bar .progress { width: 120px; height: 6px; background: rgba(255,255,255,.18); border-radius: 6px; overflow: hidden; }
.demo-bar .progress .bar { height: 100%; background: var(--brand-gradient); width: 0%; transition: width .3s; }
.demo-bar .step-lbl { font-size: .78rem; font-weight: 700; }
.demo-bar .ctrl {
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--brand-gradient);
  color: var(--ink-900); cursor: pointer;
  display: grid; place-items: center; font-weight: 800;
}
.demo-bar .ctrl.ghost { background: rgba(255,255,255,.14); color: #fff; }
.demo-bar .ctrl:hover { transform: scale(1.05); }

.caption-card {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--mobnav-h) + 76px);
  z-index: 50;
  width: min(560px, 92vw);
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  border: 1px solid var(--ink-100);
  display: none;
}
@media (min-width: 980px) { .caption-card { bottom: 84px; } }
.caption-card.show { display: block; animation: fadeUp .25s ease; }
.caption-card .ttl { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--brand-teal-ink); }
.caption-card .txt { color: var(--ink-900); font-weight: 600; margin-top: 4px; line-height: 1.45; }

/* Highlight */
.demo-highlight {
  position: relative;
  z-index: 5;
  box-shadow: 0 0 0 3px var(--brand-teal), 0 0 0 8px rgba(14,86,80,.22) !important;
  border-radius: var(--radius-md);
  transition: box-shadow .3s;
}

/* Login preview overlay during demo */
.demo-preview-mode #login {
  position: fixed; inset: 0; z-index: 60;
}
.demo-preview-mode #login form,
.demo-preview-mode #login .login-helper {
  pointer-events: none;
  opacity: .55;
}
.demo-preview-mode #login::before {
  content: 'Live dashboard preview';
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  background: rgba(26,20,9,.92);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Toast */
.toast {
  position: fixed; right: 16px; bottom: calc(var(--mobnav-h) + 76px);
  z-index: 90;
  padding: 12px 16px;
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: .88rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  max-width: 90vw;
}
@media (min-width: 980px) { .toast { bottom: 22px; right: 22px; } }
.toast.show { opacity: 1; transform: translateY(0); }

/* Misc */
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spacer { height: 8px; }
.spacer.lg { height: 22px; }
.divider { height: 1px; background: var(--ink-100); margin: 14px 0; border: 0; }
.kbd { padding: 1px 6px; border-radius: 6px; background: var(--ink-100); border: 1px solid var(--ink-200); font-family: ui-monospace, Menlo, monospace; font-size: .8em; }

/* ==========================================================================
   TICKETS TAB
   ========================================================================== */
.ticket-filter {
  display: inline-flex; padding: 4px; background: var(--ink-100); border-radius: var(--radius-pill);
  margin-bottom: 20px; flex-wrap: wrap; gap: 4px;
}
.ticket-filter button {
  border: 0; background: transparent; padding: 8px 16px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--ink-700);
  transition: background .2s, color .2s; white-space: nowrap;
}
.ticket-filter button.active { background: var(--paper); color: var(--ink-900); box-shadow: var(--shadow-sm); }

.ticket-list { display: flex; flex-direction: column; gap: 12px; }
.ticket-card {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, border-color .2s;
}
.ticket-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--ink-200); }
.ticket-card.resolved { opacity: .65; }
.ticket-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ticket-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ticket-card-title { font-weight: 700; font-size: .98rem; color: var(--ink-900); margin-bottom: 6px; }
.ticket-card-body { font-size: .88rem; color: var(--ink-500); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; flex-wrap: wrap; gap: 8px; }
.ticket-info-chips { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--ink-500); flex-wrap: wrap; }
.ticket-info-chips .sep { color: var(--ink-300); }
.ticket-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ==========================================================================
   TEAM TAB
   ========================================================================== */
.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 700px) { .team-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }

.team-card {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.team-card-head { display: flex; align-items: center; gap: 12px; }
.team-av {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--brand-gradient);
  display: grid; place-items: center;
  font-weight: 800; font-size: .88rem; color: var(--ink-900);
  flex-shrink: 0;
}
.team-av.muted { background: var(--ink-100); color: var(--ink-700); }
.team-name { font-weight: 700; font-size: .98rem; }
.team-email { font-size: .78rem; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.team-role-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.team-last-active { font-size: .72rem; color: var(--ink-400); }
.team-perm-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.perm-chip {
  font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-pill);
  background: var(--brand-gradient-soft); color: var(--brand-teal-ink);
  border: 1px solid rgba(14,86,80,.25); letter-spacing: .04em;
}
.team-card-foot {
  display: flex; gap: 6px;
  padding-top: 10px; border-top: 1px solid var(--ink-100);
}

.access-matrix-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--ink-100); }
.access-matrix { width: 100%; border-collapse: collapse; min-width: 480px; }
.access-matrix th, .access-matrix td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--ink-100); font-size: .88rem; }
.access-matrix th { background: var(--ink-50); color: var(--ink-500); font-weight: 700; font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; }
.access-matrix td.yes { color: var(--ok); font-weight: 800; }
.access-matrix tbody tr:last-child td { border-bottom: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Hide visually but keep accessible */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
