/* NEEDS App — hand-written styles (no build step required) */

:root {
  --navy: #0b2a4a;
  --navy-light: #12345f;
  --blue: #3b9edb;
  --blue-dark: #1a76b3;
  --green: #2e9e6d;
  --orange: #f5a623;
  --red: #d9534f;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --border: #e3e8ef;
  --text: #1b2530;
  --text-muted: #64748b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy); margin: 0 0 0.4em; line-height: 1.25; }
p { margin: 0 0 0.75em; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.mt { margin-top: 1.25rem; }
code { background: #eef2f7; padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  padding: 0.6em 1.1em; border-radius: 8px; border: 1px solid transparent;
  font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { background: #eef2f7; }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: #f3d3d1; }
.btn-danger-ghost:hover { background: #fdf1f0; }
.btn-block { width: 100%; }
.btn-lg { padding: 0.85em 1.6em; font-size: 1.05rem; }
.btn-sm { padding: 0.35em 0.7em; font-size: 0.82rem; }
button.btn { font-family: inherit; }

/* ---------- Forms ---------- */
form label { display: block; margin-bottom: 1em; font-weight: 600; font-size: 0.9rem; color: var(--navy); }
input, select, textarea {
  display: block; width: 100%; margin-top: 0.35em; padding: 0.6em 0.75em;
  border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; font-family: inherit;
  background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
input:disabled { background: #f1f4f8; color: var(--text-muted); }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 1em; margin: 0 0 1em; }
legend { font-weight: 700; color: var(--navy); padding: 0 0.4em; }

/* ---------- Flash / banners ---------- */
.flash { padding: 0.8em 1em; border-radius: 8px; margin-bottom: 1.25em; font-weight: 600; font-size: 0.9rem; }
.flash-ok { background: #e7f6ee; color: #1c6e46; border: 1px solid #b9e7cf; }
.flash-error { background: #fdeeed; color: #a4302c; border: 1px solid #f5c6c3; }
.banner { padding: 0.9em 1.1em; border-radius: 8px; margin-bottom: 1.25em; }
.banner-warn { background: #fef6e7; color: #8a5a05; border: 1px solid #f6dfa3; }
.banner-bad { background: #fdeeed; color: #a4302c; border: 1px solid #f5c6c3; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 0.2em 0.65em; border-radius: 999px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; }
.badge-neutral { background: #eef1f5; color: #475467; }
.badge-good { background: #e7f6ee; color: #1c6e46; }
.badge-warn { background: #fef6e7; color: #8a5a05; }
.badge-bad { background: #fdeeed; color: #a4302c; }
.badge-info { background: #e8f2fb; color: #1a5f96; }

/* ================= PUBLIC SITE ================= */
.public-shell { display: flex; flex-direction: column; min-height: 100vh; }
.brand { display: inline-flex; align-items: center; gap: 0.5em; font-weight: 800; font-size: 1.15rem; color: var(--navy); }
.brand svg { width: 34px; height: 34px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.top-nav { display: flex; gap: 1.5rem; }
.top-nav a { color: var(--text); font-weight: 600; font-size: 0.92rem; }
.top-auth { display: flex; gap: 0.6rem; }

.hero { background: linear-gradient(135deg, var(--navy) 0%, #123a63 100%); color: #fff; padding: 4rem 2rem; }
.hero-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 3rem; }
.hero-copy { flex: 1.2; }
.hero-art { flex: 0.8; display: flex; justify-content: center; }
.hero-art svg { width: 220px; height: 220px; filter: drop-shadow(0 10px 30px rgba(0,0,0,0.35)); }
.eyebrow { text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.08em; color: #9fc7ea; font-weight: 700; }
.hero h1 { color: #fff; font-size: 2.6rem; margin: 0.4em 0 0.5em; }
.hero p { color: #d7e6f2; font-size: 1.08rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 0.8rem; margin: 1.5rem 0; flex-wrap: wrap; }
.hero .btn-ghost { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.4); }
.hero .btn-ghost:hover { background: rgba(255,255,255,0.18); }
.hero-stats { display: flex; gap: 2.2rem; margin-top: 2rem; }
.hero-stats strong { display: block; font-size: 1.5rem; color: #fff; }
.hero-stats span { color: #b9d3e8; font-size: 0.82rem; }

.strip { background: #fff; border-bottom: 1px solid var(--border); }
.strip-inner { max-width: 1100px; margin: 0 auto; padding: 0.9rem 2rem; display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center; color: var(--text-muted); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.03em; }

.section { padding: 4rem 2rem; }
.section.alt { background: #eef2f7; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section h2 { font-size: 1.8rem; text-align: center; }
.section-lead { text-align: center; color: var(--text-muted); max-width: 60ch; margin: 0 auto 2.5rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 1rem; }
.cat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.cat-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.cat-card h3 { font-size: 1.05rem; }
.cat-card ul { list-style: none; padding: 0; margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.cat-card li { padding: 0.25em 0; border-top: 1px dashed var(--border); }
.cat-card li:first-child { border-top: none; }
.cat-card li a { color: var(--text); }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.25rem; }
.step { background: #fff; border-radius: var(--radius); padding: 1.4rem 1.1rem; box-shadow: var(--shadow); text-align: center; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; margin: 0 auto 0.7em; }
.step h4 { font-size: 0.98rem; }
.step p { font-size: 0.85rem; color: var(--text-muted); }

.check-list { list-style: none; padding: 0; }
.check-list li { padding: 0.5em 0 0.5em 1.7em; position: relative; border-bottom: 1px dashed var(--border); }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }

.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.mini-stats div { background: #fff; border-radius: var(--radius); padding: 1.2rem; text-align: center; box-shadow: var(--shadow); }
.mini-stats strong { display: block; font-size: 1.4rem; color: var(--navy); }
.mini-stats span { color: var(--text-muted); font-size: 0.82rem; }

.cta { background: var(--navy); color: #fff; padding: 3.5rem 2rem; text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: #d7e6f2; max-width: 50ch; margin: 0 auto 1.5rem; }

.site-footer { background: #071b30; color: #9fb4c8; padding: 2.5rem 2rem; margin-top: auto; }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.site-footer .brand { color: #fff; margin-bottom: 0.8em; }
.footer-meta { font-size: 0.8rem; color: #6f8aa3; }

.auth-page { display: flex; justify-content: center; padding: 3.5rem 1.5rem; }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 2.2rem; width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.5rem; }
.demo-box { margin-top: 1.5rem; padding: 1rem; background: #f4f8fc; border-radius: 8px; font-size: 0.82rem; border: 1px solid var(--border); }
.demo-box ul { margin: 0.5em 0 0; padding-left: 1.2em; }

.error-page { max-width: 700px; margin: 4rem auto; padding: 0 1.5rem; text-align: center; }
.error-page pre { text-align: left; background: #fff; padding: 1rem; border-radius: 8px; overflow: auto; font-size: 0.8rem; border: 1px solid var(--border); }

/* ================= APP SHELL (logged-in dashboards) ================= */
.app-shell { background: var(--bg); }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; background: var(--navy); color: #fff; display: flex; flex-direction: column;
  padding: 1.4rem 1.1rem; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { color: #fff; margin-bottom: 1rem; }
.role-pill { display: inline-block; background: rgba(255,255,255,0.12); color: #cfe4f6; font-size: 0.72rem; font-weight: 700; padding: 0.25em 0.7em; border-radius: 999px; margin-bottom: 1.4rem; letter-spacing: 0.03em; text-transform: uppercase; }
.side-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.nav-link { color: #c3d6e8; padding: 0.6em 0.75em; border-radius: 8px; font-weight: 600; font-size: 0.92rem; }
.nav-link:hover { background: rgba(255,255,255,0.08); text-decoration: none; color: #fff; }
.nav-link.active { background: var(--blue); color: #fff; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1rem; margin-top: 1rem; }
.mini-user { display: flex; align-items: center; gap: 0.6em; margin-bottom: 0.8em; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.mini-user-name { font-size: 0.85rem; font-weight: 700; color: #fff; }
.mini-user-email { font-size: 0.72rem; color: #9db6cc; word-break: break-all; }
.sidebar .btn-ghost { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.2); }
.sidebar .btn-ghost:hover { background: rgba(255,255,255,0.16); }

.main { flex: 1; min-width: 0; }
.main-inner { max-width: 1150px; margin: 0 auto; padding: 2rem 2.2rem 4rem; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.6rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat-tile { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.stat-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; margin-top: 0.15em; }
.stat-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3em; }

.two-col-cards { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.2rem; align-items: start; }

.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem 0; }
.card-head h3 { margin: 0; font-size: 1.05rem; }
.card-body { padding: 1.3rem; }
.card > .card-body:first-child { padding-top: 1.3rem; }
.card-actions { font-size: 0.85rem; }
.card-actions-bottom { padding: 0 1.3rem 1.3rem; }
.card form { margin: 0; }
.card > form > .card-body { padding: 1.3rem; }

.empty-state { color: var(--text-muted); font-size: 0.9rem; padding: 1rem 0; text-align: center; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th { text-align: left; color: var(--text-muted); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.5em 1.3rem; border-bottom: 1px solid var(--border); }
.table td { padding: 0.75em 1.3rem; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }

.tabs { display: flex; gap: 0.4rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--border); }
.tab { padding: 0.6em 0.9em; font-weight: 700; font-size: 0.85rem; color: var(--text-muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--navy); border-color: var(--blue); }
.tab:hover { text-decoration: none; color: var(--navy); }

.progress { background: #eef1f5; border-radius: 999px; height: 8px; overflow: hidden; min-width: 100px; }
.progress-bar { background: linear-gradient(90deg, var(--blue), var(--green)); height: 100%; border-radius: 999px; }
.progress-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3em; }
.bar-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 0.8rem; margin-bottom: 0.7rem; font-size: 0.85rem; }

.stars { color: var(--orange); letter-spacing: 0.05em; }

.wa-thread { display: flex; flex-direction: column; gap: 0.6rem; }
.wa-bubble { background: #e9fbe1; border-radius: 10px 10px 10px 2px; padding: 0.6em 0.9em; max-width: 100%; }
.wa-bubble.wa-missed, .wa-bubble.wa-rejection { background: #f4f4f5; }
.wa-bubble.wa-invoice, .wa-bubble.wa-payment { background: #e8f2fb; }
.wa-meta { font-size: 0.7rem; color: #4a7a3e; font-weight: 700; margin-bottom: 0.2em; }
.wa-check { color: #34b7f1; }
.wa-text { font-size: 0.88rem; }

.vendor-pick-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.vendor-pick { display: flex; align-items: center; gap: 0.7em; border: 1px solid var(--border); border-radius: 8px; padding: 0.6em 0.9em; font-weight: 500; cursor: pointer; }
.vendor-pick input { width: auto; margin: 0; }
.vendor-pick-name { flex: 1; }

.broadcast-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 0.9em 0; border-bottom: 1px dashed var(--border); }
.broadcast-item:last-child { border-bottom: none; }
.broadcast-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.review-item { padding: 0.8em 0; border-bottom: 1px dashed var(--border); }
.review-item:last-child { border-bottom: none; }
.review-form label { margin-bottom: 0.7em; }

.zone-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }

@media (max-width: 900px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-art { order: -1; }
  .two-col, .steps, .two-col-cards { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 1rem; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { display: none; }
  .main-inner { padding: 1.2rem; }
}
