/* Growth OS — shell, navegação e componentes comuns.
   Usa os tokens do styles.css (Viva Design System); nada de paleta nova. */

body { min-height: 100vh; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.os-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.os-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px 16px;
  background: var(--panel); border-right: 1px solid var(--border);
}
.os-brand { display: block; padding: 2px 10px 0; text-decoration: none; color: var(--text); }
.os-brand b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 24px; line-height: 1.1; }
.os-brand span { display: block; margin-top: 3px; font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--terracota); font-weight: 600; }
.os-nav { display: flex; flex-direction: column; gap: 2px; }
.os-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
}
.os-nav a svg { width: 18px; height: 18px; flex: none; }
.os-nav a:hover { background: var(--hover-bg); color: var(--text); }
.os-nav a.active { background: var(--active-tint-bg); color: var(--text); box-shadow: inset 2px 0 0 var(--terracota); }
.os-nav-label { margin: 10px 10px 4px; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.os-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.os-user { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.os-side-foot .segmented { width: 100%; }
.os-side-foot .seg-btn { padding: 6px 8px; font-size: 12px; }
.os-main { min-width: 0; padding: 22px 32px 72px; max-width: 1360px; width: 100%; margin: 0 auto; }

@media (max-width: 860px) {
  .os-shell { grid-template-columns: minmax(0, 1fr); }
  .os-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .os-nav { flex-direction: row; flex-wrap: wrap; }
  .os-nav-label { display: none; }
  .os-side-foot { margin-top: 0; margin-left: auto; flex-direction: row; align-items: center; }
  .os-side-foot .segmented { width: auto; }
  .os-main { padding: 18px 16px 56px; }
}

/* ---------- Cabeçalhos ---------- */
.os-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.os-crumbs a { color: var(--muted); text-decoration: none; }
.os-crumbs a:hover { color: var(--text); text-decoration: underline; }
.os-crumbs .sep { opacity: .5; }
.os-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 0 0 18px; }
.os-head h1 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 32px; line-height: 1.15; text-wrap: balance; }
.os-sub { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.os-h2 { margin: 0 0 10px; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--terracota); font-weight: 600; }

/* ---------- Botões e campos ---------- */
.os-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel-strong); color: var(--panel-strong-text);
  font: 500 13px var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.os-btn:hover { filter: brightness(1.12); }
.os-btn.primary { background: var(--terracota); border-color: var(--terracota); color: #fff; }
.os-btn.ghost { background: transparent; color: var(--text); }
.os-btn.ghost:hover { background: var(--hover-bg); filter: none; }
.os-btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.os-btn.sm { padding: 5px 10px; font-size: 12px; }
.os-btn:disabled { opacity: .55; cursor: default; }
.os-btn:focus-visible, .os-nav a:focus-visible, .os-tab:focus-visible, .os-input:focus-visible, .os-link:focus-visible { outline: 2px solid var(--terracota); outline-offset: 2px; }
.os-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.os-link:hover { text-decoration-color: var(--terracota); }
.os-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.os-field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.os-input {
  width: 100%; padding: 8px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
  font: 14px var(--font-body);
}
.os-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 14px; }
.os-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }

/* ---------- Superfícies ---------- */
.os-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.os-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.os-tile {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
}
.os-tile:hover { border-color: var(--terracota); background: var(--hover-bg); }
.os-tile svg { width: 22px; height: 22px; color: var(--terracota); }
.os-tile b { font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.os-tile span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.os-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }
.os-notice { padding: 11px 14px; border-radius: var(--radius); border: 1px solid var(--ocre); background: var(--active-tint-bg); font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
.os-notice.err { border-color: var(--red); }
.os-notice code { font-size: 12px; }
.os-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); font-size: 11px; color: var(--muted); white-space: nowrap; }
.os-pill.cat { border-color: var(--terracota); color: var(--terracota); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: 10.5px; }

/* ---------- Tabelas ---------- */
.os-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
table.os-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.os-table th { text-align: left; padding: 10px 14px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.os-table td { padding: 11px 14px; border-bottom: 1px solid var(--border-hairline); vertical-align: middle; }
.os-table tr:last-child td { border-bottom: 0; }
.os-table tbody tr.click { cursor: pointer; }
.os-table tbody tr.click:hover td { background: var(--hover-bg); }
.os-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.os-table td a { color: var(--text); font-weight: 600; text-decoration: none; }
.os-table td a:hover { text-decoration: underline; }
.os-muted { color: var(--muted); }

/* ---------- Abas do deal ---------- */
.os-tabs { display: flex; gap: 4px; margin: 0 0 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.os-tab { padding: 9px 15px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.os-tab:hover { color: var(--text); }
.os-tab.active { color: var(--text); border-bottom-color: var(--terracota); }

/* ---------- Resumo do deal ---------- */
.os-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .os-two { grid-template-columns: minmax(0, 1fr); } }
dl.os-dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 13.5px; }
dl.os-dl dt { color: var(--muted); }
dl.os-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.os-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } dl.os-dl dd { margin-bottom: 8px; } }

/* ---------- Arquivos do deal ---------- */
.os-files { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 760px) { .os-files { grid-template-columns: minmax(0, 1fr); } }
.os-folders { display: flex; flex-direction: column; gap: 2px; }
.os-folder {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 8px 10px; border-radius: var(--radius); border: 0; background: transparent;
  color: var(--muted); font: 500 13.5px var(--font-body); text-align: left; cursor: pointer;
}
.os-folder:hover { background: var(--hover-bg); color: var(--text); }
.os-folder.active { background: var(--active-tint-bg); color: var(--text); box-shadow: inset 2px 0 0 var(--terracota); }
.os-folder .n { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.os-newfolder { margin-top: 10px; }
.os-drop { border: 1px dashed var(--border); border-radius: var(--radius); padding: 0; transition: border-color .12s, background .12s; }
.os-drop.over { border-color: var(--terracota); background: var(--active-tint-bg); }
.os-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--border-hairline); }
.os-file:last-child { border-bottom: 0; }
.os-file-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.os-file-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.os-file-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Login ---------- */
.os-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.os-login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 26px; }
.os-login-card h1 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 30px; }
.os-login-card .os-brand-sub { display: block; margin: 4px 0 20px; font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--terracota); font-weight: 600; }
.os-login-card form { display: flex; flex-direction: column; gap: 12px; }
.os-login-msg { margin: 12px 0 0; font-size: 13px; line-height: 1.5; min-height: 1.5em; }
.os-login-msg.err { color: var(--red); }

/* ---------- Toast ---------- */
.os-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; background: var(--panel-strong); color: var(--panel-strong-text); padding: 10px 16px; border-radius: var(--radius); font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.28); max-width: calc(100vw - 32px); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
