/* The Seed Platform — estilos
   Direção: verde profundo e dourado sobre papel natural; títulos em serifa clássica,
   texto em fonte do sistema (sem dependências externas, funciona offline). */
:root {
  --green-950: #0F2418;
  --green-900: #14301F;
  --green-800: #1C3F2A;
  --green-700: #275238;
  --green-100: #E3EBDF;
  --green-50: #F0F4EC;
  --gold-600: #9A7628;
  --gold-500: #B8913A;
  --gold-300: #DCC48A;
  --gold-100: #F4ECD6;
  --paper: #FBF8F0;
  --surface: #FFFFFF;
  --ink: #18221C;
  --muted: #56615A;
  --line: #E1DACA;
  --danger: #A33A2A;
  --danger-bg: #FBEDEA;
  --warn-bg: #FBF3DF;
  --ok: #2D6A43;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 48, 31, .06), 0 4px 16px rgba(20, 48, 31, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; color: var(--green-900); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.15; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 18px; line-height: 1.25; }
p { margin: 0; }
a { color: var(--green-700); }
a:hover { color: var(--green-900); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Fundo: pé de mostarda ---------- */
.bg-tree { position: fixed; right: -6vw; bottom: -4vh; width: min(70vw, 760px); aspect-ratio: 1; background: url("/assets/mustard-tree.svg") no-repeat center / contain; opacity: .07; pointer-events: none; z-index: 0; }

/* ---------- Estrutura ---------- */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar { width: 272px; flex: none; background: var(--green-900); color: #E9EFE6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 22px 20px 16px; border-bottom: 1px solid rgba(220, 196, 138, .18); }
.brand-name { font-family: var(--display); font-size: 19px; font-weight: 700; color: #FFFDF5; margin-top: 10px; letter-spacing: .01em; }
.logo-slot { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 84px; border: 1.5px dashed rgba(220, 196, 138, .55); border-radius: 12px; color: var(--gold-300); font-size: 12px; line-height: 1.35; padding: 10px; }
.logo-slot.light { border-color: var(--gold-500); color: var(--gold-600); background: var(--gold-100); }
.logo-img { display: block; width: 100%; max-height: 150px; object-fit: contain; margin: 0 auto; background: #FFFFFF; border-radius: 12px; padding: 10px; }
.auth-card .logo-img { max-height: 190px; padding: 0; }
.nav { padding: 12px 10px 24px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-300); padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: #DCE5D8; text-decoration: none; font-size: 15px; min-height: 40px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #FFF; }
.nav a[aria-current="page"] { background: rgba(220, 196, 138, .16); color: #FFF8E6; box-shadow: inset 3px 0 0 var(--gold-500); }
.nav .soon { margin-left: auto; flex: none; white-space: nowrap; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-300); border: 1px solid rgba(220, 196, 138, .4); border-radius: 999px; padding: 1px 6px; }
.nav a > span:not(.soon) { min-width: 0; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: rgba(251, 248, 240, .92); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; }
.topbar .title { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--green-900); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--green-900); text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; }
.badge-dot { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--gold-500); color: var(--green-950); font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.menu-btn { display: none; }
.back-btn[disabled] { opacity: .35; cursor: default; }
.content { padding: 28px max(20px, env(safe-area-inset-right)) 64px max(20px, env(safe-area-inset-left)); max-width: 1180px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 70ch; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--gold-600); margin-bottom: 6px; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 15px; white-space: nowrap; }
.btn-primary { background: var(--green-800); color: #FFFDF5; }
.btn-primary:hover { background: var(--green-900); color: #FFF; }
.btn-gold { background: var(--gold-500); color: var(--green-950); }
.btn-gold:hover { background: var(--gold-600); color: #FFF; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--green-900); }
.btn-ghost:hover { border-color: var(--green-700); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--green-700); text-decoration: underline; cursor: pointer; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; border: 1px solid transparent; }
.pill-publicado, .pill-ativo, .pill-concluida, .pill-ok { background: var(--green-100); color: var(--green-800); }
.pill-rascunho, .pill-pendente, .pill-aberta { background: var(--warn-bg); color: #7A5A12; border-color: #EBD9A8; }
.pill-arquivado, .pill-inativo, .pill-cancelada, .pill-recusada, .pill-excluido { background: #EEEDE8; color: #555; }
.pill-demo { background: var(--gold-100); color: var(--gold-600); border-color: var(--gold-300); }
.pill-off { background: var(--danger-bg); color: var(--danger); }
.tag { font-size: 12.5px; padding: 2px 10px; border-radius: 999px; background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-100); white-space: nowrap; }
.progress { height: 8px; border-radius: 99px; background: var(--green-100); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-700), var(--gold-500)); }
.notice { border-radius: 12px; padding: 12px 14px; background: var(--gold-100); border: 1px solid var(--gold-300); color: #5E4A17; font-size: 14.5px; }
.notice.info { background: var(--green-50); border-color: var(--green-100); color: var(--green-900); }
.notice.danger { background: var(--danger-bg); border-color: #EBC3BB; color: var(--danger); }
.empty { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 28px 20px; text-align: center; color: var(--muted); background: rgba(255, 255, 255, .6); }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.list-item .grow { flex: 1 1 240px; min-width: 0; }
.list-item a.title-link { font-weight: 700; color: var(--green-900); text-decoration: none; overflow-wrap: anywhere; }
.list-item a.title-link:hover { text-decoration: underline; }
.when { font-family: var(--display); font-weight: 700; color: var(--green-900); font-variant-numeric: tabular-nums; min-width: 92px; }
.day-head { font-family: var(--display); font-size: 17px; color: var(--green-800); margin: 18px 0 8px; }
.day-head::first-letter { text-transform: uppercase; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; border-bottom: 3px solid transparent; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 44px; }
.tabs button[aria-selected="true"] { color: var(--green-900); border-bottom-color: var(--gold-500); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: flex-end; }
.filters .field { flex: 1 1 170px; margin: 0; }
.hero-card { background: var(--green-900); color: #EEF3EA; border-radius: 18px; padding: 24px; position: relative; overflow: hidden; }
.hero-card h2 { color: #FFFDF5; }
.hero-card .muted { color: #B9C8B8; }
.hero-card::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; background: url("/assets/mustard-tree.svg") no-repeat center / contain; opacity: .14; filter: invert(1) sepia(1) saturate(2) hue-rotate(5deg); pointer-events: none; }
.kpi { font-family: var(--display); font-size: 30px; font-weight: 700; color: var(--green-900); line-height: 1.1; font-variant-numeric: tabular-nums; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--surface); }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--green-50); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--green-950); border-radius: 14px; overflow: hidden; max-width: 100%; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; color: #DDE6DA; text-align: center; padding: 20px; }

.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; font-weight: 700; letter-spacing: .02em; object-fit: cover; font-family: var(--body); }
.cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--green-100); max-width: 100%; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.chip-count { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--green-900); }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 600; color: var(--green-900); }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #FFFEFA; }
.input:focus { border-color: var(--green-700); outline: none; box-shadow: 0 0 0 3px rgba(39, 82, 56, .15); }
textarea.input { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; margin-bottom: 12px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green-800); flex: none; }
.form-error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

/* ---------- Autenticação ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 26px; margin: 14px 0 6px; }
.brand-badge { display: inline-block; padding: 9px 22px; border-radius: 999px; background: linear-gradient(135deg, #0A1A33 0%, #13305C 55%, #1D4A8A 100%); color: #F1D9A0; font-size: 12.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; border: 1px solid rgba(220, 196, 138, .55); box-shadow: 0 6px 18px rgba(10, 26, 51, .28), inset 0 1px 0 rgba(255, 255, 255, .12); }

/* ---------- Modal e avisos ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 36, 24, .45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 640px; background: var(--paper); border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.toast-area { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--green-900); color: #FFFDF5; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14.5px; }
.toast.error { background: var(--danger); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix input { width: 18px; height: 18px; accent-color: var(--green-800); }

/* ---------- Celular ---------- */
@media (max-width: 920px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s ease; z-index: 40; padding-left: env(safe-area-inset-left); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .menu-btn { display: inline-flex; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 36, 24, .4); z-index: 30; }
  .content { padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* The Seed Business e abas por link */
.business-hero { position: relative; overflow: hidden; border-radius: 18px; padding: clamp(20px, 4vw, 34px); margin-bottom: 18px; background: linear-gradient(135deg, #0A1A33 0%, #13305C 55%, #1D4A8A 100%); border: 1px solid rgba(220, 196, 138, .35); }
.business-hero .brand-badge { background: rgba(255, 255, 255, .06); }
.tabs a.tab-link { display: inline-flex; align-items: center; padding: 10px 14px; border-bottom: 3px solid transparent; font-weight: 600; color: var(--muted); text-decoration: none; min-height: 44px; }
.tabs a.tab-link[aria-selected="true"] { color: var(--green-900); border-bottom-color: var(--gold-500); }
