/* StartupOS — design system
   Baseado no protótipo de referência aprovado. Cor, raio, sombra e tipografia
   dos dois temas vivem aqui. Trocar a marca = trocar estas variáveis. */

.sos, .sos * { box-sizing: border-box; }

/* Os tokens vivem em :root TAMBÉM porque modais e avisos são criados
   fora do container .sos. Sem isso, texto e fonte quebram dentro deles. */
:root, .sos {
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --font-num: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px;
  --violet: #7C6BF0; --violet-dim: rgba(124,107,240,.14);
  --good: #3DD68C; --info: #4CC2E0; --warn: #F5B14C; --bad: #F2555A;
}
.sos {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  font-size: 15px;
  line-height: 1.5;
}
:root[data-theme="dark"], .sos[data-theme="dark"] {
  --bg: #0A0A0D; --bg-2: #0E0E13;
  --surface: rgba(255,255,255,.032);
  --surface-2: rgba(255,255,255,.055);
  --glass: rgba(18,18,24,.72);
  --line: rgba(255,255,255,.085);
  --line-2: rgba(255,255,255,.14);
  --text: #ECECF1; --text-2: #9C9CAD; --text-3: #64647A;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 12px 32px -12px rgba(0,0,0,.7);
  --grid: rgba(255,255,255,.06);
}
:root[data-theme="light"], .sos[data-theme="light"] {
  --bg: #FAFAFB; --bg-2: #FFFFFF;
  --surface: rgba(9,9,15,.024);
  --surface-2: rgba(9,9,15,.05);
  --glass: rgba(255,255,255,.78);
  --line: rgba(9,9,15,.09);
  --line-2: rgba(9,9,15,.16);
  --text: #14141A; --text-2: #61616E; --text-3: #92929F;
  --shadow: 0 1px 2px rgba(9,9,15,.05), 0 12px 28px -14px rgba(9,9,15,.18);
  --grid: rgba(9,9,15,.06);
}

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px; line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 10px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 3px solid var(--bg); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

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

/* ---- layout ---- */
.shell { display: flex; min-height: 100dvh; }
.side {
  width: 236px; flex: 0 0 236px; border-right: 1px solid var(--line);
  padding: 14px 12px; position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 4px; background: var(--bg);
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center;
  gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.page { padding: 22px 20px 96px; max-width: 1320px; width: 100%; margin: 0 auto; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* grades de duas colunas que viram uma só no celular */
.hero { grid-template-columns: auto minmax(0,1fr); gap: 20px; align-items: center; }
.split { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.split.wide { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); }
.split.narrow-first { grid-template-columns: minmax(0,1fr) minmax(0,1.5fr); }
.split.os-split { grid-template-columns: 210px minmax(0,1fr); }

/* ---- superfícies ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px; position: relative;
  transition: border-color .18s ease, transform .18s ease;
}
.card.hover:hover { border-color: var(--line-2); transform: translateY(-1px); }
.card.flat { background: transparent; }
.pad0 { padding: 0; overflow: hidden; }

/* ---- tipografia ---- */
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.h1 { font-size: 25px; font-weight: 640; letter-spacing: -.028em; margin: 0; }
.h2 { font-size: 15px; font-weight: 620; letter-spacing: -.017em; margin: 0; }
.h3 { font-size: 13px; font-weight: 580; margin: 0; }
.sub { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.tiny { font-size: 11.5px; color: var(--text-3); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.big { font-size: 30px; font-weight: 600; }

/* ---- controles ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: 9px; font-size: 12.5px;
  font-weight: 540; font-family: inherit; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn.primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn.primary:hover { opacity: .9; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.icon { width: 34px; padding: 0; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.nav {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; border: none; background: transparent; width: 100%;
  text-align: left; font-family: inherit; transition: background .14s ease, color .14s ease;
}
.nav:hover { background: var(--surface); color: var(--text); }
.nav[aria-current="true"] { background: var(--surface-2); color: var(--text); font-weight: 560; }
.nav .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--violet); opacity: 0; }
.nav[aria-current="true"] .dot { opacity: 1; }

.input, .select, .ta {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 11px; font-size: 13px; color: var(--text);
  font-family: inherit; outline: none; transition: border-color .15s ease;
}
.input:focus, .select:focus, .ta:focus { border-color: var(--violet); }
.ta { resize: vertical; min-height: 74px; line-height: 1.55; }
.label { font-size: 11.5px; font-weight: 560; color: var(--text-2); display: block; margin-bottom: 5px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px;
  border-radius: 6px; font-size: 11px; font-weight: 560; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.badge .pip { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.good { color: var(--good); background: rgba(61,214,140,.12); }
.badge.info { color: var(--info); background: rgba(76,194,224,.12); }
.badge.warn { color: var(--warn); background: rgba(245,177,76,.12); }
.badge.bad  { color: var(--bad);  background: rgba(242,85,90,.12); }

.avatar {
  display: grid; place-items: center; border-radius: 50%; flex: 0 0 auto;
  font-weight: 600; color: #fff; letter-spacing: -.02em;
}

.bar { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.16,1,.3,1); }

.empty { text-align: center; padding: 40px 18px; color: var(--text-3); }
.empty .h3 { color: var(--text); margin-bottom: 6px; }
.empty .sub { max-width: 340px; margin: 0 auto 14px; }

/* ---- tabela ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; padding: 9px 14px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { cursor: pointer; transition: background .12s ease; }
.tbl tbody tr:hover { background: var(--surface); }

/* ---- lista de linhas (mobile) ---- */
.rowline { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.rowline:last-child { border-bottom: none; }
.rowline:hover { background: var(--surface); }
.rowline .grow { flex: 1; min-width: 0; }
.rowline .title { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.check { width: 19px; height: 19px; border-radius: 6px; flex: none; border: 1.5px solid var(--line);
  background: transparent; cursor: pointer; display: grid; place-items: center; color: transparent; transition: all .16s ease; }
.check.done { background: var(--good); border-color: var(--good); color: #0A0A0D; }
.check svg { width: 12px; height: 12px; }

/* ---- modal ---- */
.overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(4,4,8,.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .16s ease;
}
@media (min-width: 640px) { .overlay { align-items: center; padding: 24px; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow);
  animation: rise .22s cubic-bezier(.16,1,.3,1);
}
@media (min-width: 640px) { .sheet { border-radius: var(--r-xl); } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 15px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.sheet-body { padding: 16px; }
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 13px 16px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--bg-2); }

.toast-wrap { position: fixed; left: 50%; bottom: 78px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--bg-2); border: 1px solid var(--line); padding: 9px 15px; border-radius: 999px; font-size: 13px; font-weight: 550; box-shadow: var(--shadow); animation: rise .2s ease; }
.toast.err { border-color: var(--bad); color: var(--bad); }

/* ---- nav mobile ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--glass);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 0; border: none; background: transparent; cursor: pointer;
  font-size: 9.5px; font-weight: 560; color: var(--text-3); font-family: inherit;
  border-radius: 9px;
}
.tab[aria-current="true"] { color: var(--text); background: var(--surface); }
.tab svg { width: 18px; height: 18px; }

@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) } }
@keyframes sweep { from { stroke-dashoffset: var(--len) } }
.enter { animation: rise .3s cubic-bezier(.16,1,.3,1) both; }

/* ---- ring + pulse ---- */
.ring { position: relative; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); }
.ring .mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }

.pulse { display: grid; grid-template-rows: repeat(7,1fr); grid-auto-flow: column; gap: 3px; }
.pulse i { width: 100%; aspect-ratio: 1; min-width: 7px; border-radius: 2.5px; background: var(--surface-2); display: block; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; }

/* ---- login ---- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }

/* ---- responsivo ---- */
@media (max-width: 1080px) { .g4 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 900px) {
  .side { display: none; }
  .tabbar { display: flex; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .hero, .split, .split.wide, .split.narrow-first, .split.os-split { grid-template-columns: minmax(0,1fr); }
  .hero { justify-items: center; text-align: center; }
  .hero > .grid { text-align: left; width: 100%; }
  .page { padding: 16px 14px 96px; }
  .topbar { padding: 10px 14px; }
  .h1 { font-size: 21px; }
  .hide-sm { display: none !important; }
  .tbl th, .tbl td { padding: 9px 10px; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (min-width: 901px) { .only-mobile { display: none !important; } }
