/* OfficePilot — design system (PLAN.md: matte frosted glass, no black anywhere) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f2f3f8;
  --sky: #38bdf8;
  --sky-deep: #0ea5e9;
  --lavender: #a78bfa;
  --violet: #8b5cf6;
  --ink: #1e293b;
  --muted: #64748b;
  --line: rgba(30, 41, 59, .08);
  --glass: rgba(255, 255, 255, .72);
  --glass-border: rgba(255, 255, 255, .65);
  --radius: 18px;
  --shadow: 0 8px 30px rgba(30, 41, 59, .08);
  --shadow-lg: 0 16px 44px rgba(30, 41, 59, .14);
  --grad: linear-gradient(135deg, var(--sky), var(--violet));
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(167, 139, 250, .22), transparent 60%),
    radial-gradient(800px 480px at -10% 20%, rgba(56, 189, 248, .20), transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
h1, h2, h3, h4, .brand-name { font-family: 'Outfit', system-ui, sans-serif; }
a { color: var(--sky-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
img { max-width: 100%; }

/* ---------- shared components (other builders use these too) ---------- */
.page { padding: 20px 24px 96px; max-width: 1180px; margin: 0 auto; animation: fadeUp .35s ease both; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; margin: 0; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.card, .glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card h3, .glass h3 { margin: 0 0 10px; font-size: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--line); background: rgba(255,255,255,.8); color: var(--ink);
  border-radius: 12px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--grad); color: #fff; border: none; box-shadow: 0 6px 18px rgba(139, 92, 246, .35); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(139, 92, 246, .45); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--sky-deep); }
.btn-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; padding: 4px 10px; border-radius: 999px;
  background: rgba(56, 189, 248, .14); color: var(--sky-deep); border: 1px solid rgba(56, 189, 248, .3);
}
.pill.violet { background: rgba(139, 92, 246, .12); color: var(--violet); border-color: rgba(139, 92, 246, .3); }
.pill.green { background: rgba(52, 211, 153, .14); color: #047857; border-color: rgba(52, 211, 153, .35); }
.pill.amber { background: rgba(251, 191, 36, .16); color: #92400e; border-color: rgba(251, 191, 36, .4); }
.pill.red { background: rgba(248, 113, 113, .14); color: #b91c1c; border-color: rgba(248, 113, 113, .35); }
.pill.grey { background: rgba(100, 116, 139, .12); color: var(--muted); border-color: rgba(100, 116, 139, .3); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi .kpi-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kpi .kpi-value { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 800; margin: 6px 0 2px; }
.kpi .kpi-note { font-size: 12px; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: rgba(56, 189, 248, .06); cursor: pointer; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(30, 41, 59, .14); background: rgba(255, 255, 255, .85); outline: none;
}
.input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(56, 189, 248, .25); }
.label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin: 12px 0 6px; text-transform: uppercase; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs .tab {
  border: 1px solid var(--line); background: rgba(255,255,255,.7); color: var(--muted);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600;
}
.tabs .tab.active { background: var(--grad); color: #fff; border: none; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.empty .empty-icon { font-size: 30px; margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

/* ---------- shell: sidebar / topbar / dock ---------- */
#shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
  background: rgba(255, 255, 255, .55); backdrop-filter: blur(18px) saturate(1.4);
  border-right: 1px solid var(--glass-border);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand-lockup img { width: 40px; height: 40px; object-fit: contain; }
.brand-name { font-size: 20px; font-weight: 800; line-height: 1.05; }
.brand-name .pilot { background: linear-gradient(90deg, var(--sky), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-tag { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background .12s ease;
}
.nav-link:hover { background: rgba(56, 189, 248, .12); text-decoration: none; }
.nav-link.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(139, 92, 246, .3); }
.nav-link .nav-ico { font-size: 16px; width: 20px; text-align: center; }
.nav-link .badge { margin-left: auto; }
.nav-section { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.sidebar-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.main { flex: 1; min-width: 0; }
.topbar {
  display: none; align-items: center; gap: 10px; padding: 12px 16px;
  background: rgba(255, 255, 255, .6); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-border); position: sticky; top: 0; z-index: 20;
}
.topbar img { width: 32px; height: 32px; object-fit: contain; }
.topbar .spacer { flex: 1; }
.dock {
  display: none; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--glass-border); border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 6px; overflow-x: auto; gap: 2px;
}
.dock .nav-link { flex-direction: column; gap: 2px; font-size: 10px; padding: 7px 10px; white-space: nowrap; }
.dock .nav-link .nav-ico { font-size: 17px; }

/* ---------- sign-in / sign-up ---------- */
.auth-stage { min-height: 100vh; padding: 24px; display: flex; align-items: stretch; gap: 24px; }
.auth-brand {
  flex: 1.1; border-radius: 24px; padding: 40px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #312e81 0%, #4c1d95 45%, #7c3aed 80%, #0ea5e9 130%);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.auth-brand::before, .auth-brand::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
  animation: drift 14s ease-in-out infinite alternate;
}
.auth-brand::before { width: 420px; height: 420px; background: #38bdf8; top: -120px; right: -80px; }
.auth-brand::after { width: 360px; height: 360px; background: #f472b6; bottom: -140px; left: -60px; animation-delay: -6s; }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand img { width: 84px; height: 84px; object-fit: contain; }
.auth-brand h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; margin: 22px 0 10px; max-width: 480px; }
.auth-brand p.lede { color: rgba(255, 255, 255, .85); font-size: 16px; max-width: 440px; margin: 0 0 28px; }
.auth-features { display: grid; gap: 10px; max-width: 480px; }
.auth-feature {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(10px); font-weight: 600; font-size: 14px;
}
.auth-feature .chev { margin-left: auto; opacity: .8; }
.auth-foot { margin-top: auto; padding-top: 28px; font-weight: 800; letter-spacing: .14em; font-size: 13px; color: rgba(255, 255, 255, .9); }
.auth-card-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 440px; padding: 30px; }
.auth-card h2 { font-size: 24px; margin: 8px 0 4px; }
.auth-card .lede { color: var(--muted); margin: 0 0 8px; font-size: 14px; }
.auth-card .btn-primary { width: 100%; padding: 12px; margin-top: 16px; font-size: 15px; }
.trust-row { display: flex; gap: 14px; justify-content: center; margin-top: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.auth-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 12px; }
.new-card { margin-top: 18px; padding: 14px; border-radius: 14px; background: rgba(56, 189, 248, .08); border: 1px solid rgba(56, 189, 248, .25); text-align: center; font-size: 14px; }
.faq { margin-top: 16px; border-top: 1px solid var(--line); }
.faq details { padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 6px 0 0; }
.signup-wrap { max-width: 860px; margin: 0 auto; padding: 24px 24px 96px; }
.signup-steps { display: flex; gap: 8px; margin: 18px 0; }
.signup-step { flex: 1; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 6px; border-radius: 12px; background: rgba(255,255,255,.6); border: 1px solid var(--line); }
.signup-step.active { background: var(--grad); color: #fff; border: none; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.plan-card { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.plan-card:hover { transform: translateY(-2px); }
.plan-card.selected { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .3), var(--shadow); }
.plan-card .price { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 800; }

/* ---------- dashboard ---------- */
.title-band { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-band .counts { display: flex; gap: 8px; flex-wrap: wrap; margin-left: 8px; }
.count-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.75); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.chart-wrap { position: relative; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff;
  font-size: 12px; padding: 6px 9px; border-radius: 8px; opacity: 0; transition: opacity .12s ease;
  white-space: nowrap; z-index: 5; transform: translate(-50%, -110%);
}
.bar-row { display: grid; grid-template-columns: 130px 1fr 70px; align-items: center; gap: 10px; font-size: 13px; margin: 8px 0; }
.bar-track { height: 10px; border-radius: 999px; background: rgba(30, 41, 59, .08); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--grad); animation: growX .6s ease both; transform-origin: left; }
.goal-row { display: grid; grid-template-columns: 110px 1fr 52px; align-items: center; gap: 10px; font-size: 13px; margin: 9px 0; }

/* ---------- calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.cal-day { min-height: 170px; padding: 10px; }
.cal-day.today { border-color: var(--sky); box-shadow: 0 0 0 2px rgba(56, 189, 248, .35), var(--shadow); }
.cal-day h4 { margin: 0 0 8px; font-size: 13px; }
.job-block {
  display: block; width: 100%; text-align: left; padding: 8px 10px; margin-bottom: 6px;
  border-radius: 10px; border: 1px solid rgba(56, 189, 248, .3); background: rgba(56, 189, 248, .12);
  font-size: 12px; font-weight: 600; color: var(--ink); cursor: grab;
}
.job-block.dragging { opacity: .45; }
.job-block .jb-time { display: block; color: var(--sky-deep); font-size: 11px; }
.cal-day.drop-target { background: rgba(139, 92, 246, .1); border-color: var(--violet); }

/* ---------- jobs / dispatch ---------- */
.job-item { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; margin-bottom: 10px; cursor: pointer; transition: transform .12s ease; }
.job-item:hover { transform: translateY(-1px); }
.job-item .ji-body { flex: 1; min-width: 0; }
.job-item .ji-title { font-weight: 700; font-size: 15px; }
.job-item .ji-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.check-row { display: flex; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.check-row:last-child { border-bottom: none; }
.check-row.done span { text-decoration: line-through; color: var(--muted); }
.map-wrap { position: relative; }
.map-wrap svg { width: 100%; height: auto; display: block; border-radius: 14px; }
.map-dot { cursor: pointer; }
.map-dot circle { transition: r .15s ease; }
.map-dot:hover circle { r: 11; }
.crew-row { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.crew-row:last-child { border-bottom: none; }
.avatar-dot { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; flex-shrink: 0; }

/* ---------- modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(30, 41, 59, .35); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .18s ease both; }
.modal { width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; animation: fadeUp .22s ease both; }
.modal h3 { margin-top: 0; }
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(420px, 92vw); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); animation: fadeUp .25s ease both; text-align: center; }
.toast.error { background: #b91c1c; }
.hidden { display: none !important; }
.center { text-align: center; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(30px, 20px) scale(1.12); } }
.chart-anim { animation: fadeUp .5s ease both; }

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .cal-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; }
  .auth-stage { flex-direction: column; padding: 12px; gap: 12px; }
  .auth-brand { padding: 28px 22px; }
  .auth-brand h1 { font-size: 28px; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .topbar { display: flex; }
  .dock { display: flex; }
  .page { padding: 16px 14px 120px; }
  .kpi .kpi-value { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
