/* ==========================================================================
   Painel Carlos · camada premium (11/11/2026)
   Carregada depois de app.css: define tokens e reestiliza os componentes.
   Nenhuma regra de comportamento vive aqui.
   ========================================================================== */

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-ui: "Instrument Sans", "Inter", system-ui, sans-serif;
  --font: "Instrument Sans", "Inter", system-ui, sans-serif;

  --ground: #000000;
  --surface: #0e0e0e;
  --surface-2: #151515;
  --surface-active: #1a1a1a;
  --raised: #1f1f1f;
  --field: #0a0a0a;
  --border: #191919;
  --rule: #1a1a1a;
  --control: #3a3a3a;

  --text: #ffffff;
  --muted: #b4b4b4;
  --faint: #8f8f8f;
  --accent: #f2b33d;
  --accent-ink: #191204;
  --accent-soft: #2a2214;
  --positive: #4ecb8a;
  --positive-bg: #132a1e;
  --negative: #ef6a80;
  --negative-bg: #2c171d;
  --warning: #f2b33d;
  --warning-bg: #241d10;

  --r-card: 16px;
  --r-field: 10px;
  --r-pill: 999px;
  --gap: 16px;
  --pad: 22px;
  --control-h: 34px;

  --nav-w: 232px;
  --topbar-h: 56px;
  --content-max: 1320px;
}

/* ---------- base ---------- */

html { font-family: var(--font-ui); }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, .card-title, .section-title, .flow-title, .variant-title, .rail-title {
  letter-spacing: -0.015em;
}
.num, .table .num, .kpi-value, .progress-label { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */

.sidebar {
  width: var(--nav-w);
  background: var(--ground);
  border-right: 1px solid #141414;
  padding: 18px 12px 14px;
  gap: 0;
}
.brand { padding: 0 8px 18px; gap: 11px; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; }
.brand-mark svg { width: 26px; height: 26px; }
.brand-text strong { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.brand-text small { font-size: 12px; color: var(--faint); letter-spacing: 0.01em; }

.nav { gap: 2px; }
.nav-group {
  margin: 18px 8px 8px;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #7c7c7c;
}
.nav-item {
  min-height: 34px;
  padding: 0 10px;
  gap: 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 400;
  color: #a3a3a3;
}
.nav-item svg { color: #6f6f6f; width: 17px; height: 17px; }
.nav-item:hover { background: #0d0d0d; color: #fff; }
.nav-item:hover svg { color: #b4b4b4; }
.nav-item[aria-current="page"] {
  background: var(--surface-active);
  color: #fff;
  font-weight: 500;
}
.nav-item[aria-current="page"] svg { color: #fff; }
.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  font-size: 11px;
  background: #2a2a2a;
  color: #e8e8e8;
}
.nav-item[aria-current="page"] .nav-count { background: #ffffff; color: #000; }

.sidebar-foot { padding-top: 14px; border-top: 1px solid #141414; }
.sidebar-foot .nav-item { min-height: 32px; font-size: 13px; color: #909090; }
.sidebar-foot .nav-item svg { width: 15px; height: 15px; }
.storage-note { margin: 12px 10px 0; font-size: 12px; color: #8a8a8a; }

.topbar {
  height: var(--topbar-h);
  padding: 0 24px;
  background: var(--ground);
  border-bottom: 1px solid #141414;
}
.video-chip {
  height: 36px;
  padding: 0 10px 0 8px;
  gap: 9px;
  border-radius: 10px;
  background: var(--surface);
}
.video-chip:hover { background: var(--surface-2); }
.video-chip-thumb, .video-chip-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.video-chip-name { font-size: 12.5px; font-weight: 500; }
.video-chip-sub { font-size: 11px; color: #7c7c7c; }
.topbar-brand { font-size: 13px; font-weight: 600; }
.save-stamp { font-size: 12px; color: #8a8a8a; }

.content, main { padding: 26px 28px 48px; }
main { max-width: var(--content-max); }

/* ---------- page title ---------- */

.page-head { align-items: flex-end; margin-bottom: 24px; gap: 24px; }
.page-head h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.028em;
}
.page-sub { font-size: 13.5px; line-height: 1.5; color: var(--muted); max-width: 72ch; }
.page-actions .btn { height: 36px; }

.section-head { margin-bottom: 12px; }
.section-title { font-size: 15px; font-weight: 600; }
.section-sub { font-size: 12.5px; color: var(--faint); }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--r-card);
  padding: var(--pad);
}
.card-head { margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12.5px; line-height: 1.5; color: var(--faint); }
.card-foot { margin-top: 16px; }

.rail-card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 20px;
}
.rail-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #8a8a8a;
}
.rail-title { font-size: 17px; font-weight: 600; line-height: 1.25; }
.rail-text { font-size: 13px; line-height: 1.55; color: var(--muted); }

/* ---------- head do estúdio (visão geral) ---------- */

.studio-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-bottom: 26px;
}
.studio-lead h1 {
  margin: 0;
  max-width: 34ch;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.studio-lede {
  margin: 12px 0 0;
  max-width: 54ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.studio-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }

.studio-steps {
  display: grid;
  gap: 14px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.studio-steps li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 13px;
  align-items: start;
}
.studio-steps span {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  margin-top: 1px;
  border-radius: var(--r-pill);
  background: #171717;
  color: #b4b4b4;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.studio-steps strong { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.35; color: #fff; }
.studio-steps small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--faint); }

/* ---------- KPI strip ---------- */

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: var(--gap);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}
.kpi-cell {
  min-width: 0;
  padding: 18px 20px 16px;
  border-left: 1px solid var(--rule);
}
.kpi-cell:first-child { border-left: 0; }
.kpi-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #9a9a9a;
}
.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 8px;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
}
.kpi-cell.is-lead .kpi-value { font-size: 34px; font-weight: 600; }
.kpi-value.is-empty { font-size: 20px; color: #8a8a8a; font-weight: 400; }
.kpi-unit { font-size: 13px; font-weight: 400; color: #8a8a8a; letter-spacing: 0; }
.kpi-note {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #8a8a8a;
}
.kpi-cell.is-alert .kpi-note { color: var(--accent); }

/* ---------- flow ---------- */

.flow-node {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto 14px;
  grid-template-areas:
    "icon title state open"
    "icon sub   state open";
  align-items: center;
  column-gap: 14px;
  text-align: left;
  padding: 15px 18px;
  border-radius: 14px;
  background: var(--surface);
}
a.flow-node:hover { background: var(--surface-2); }
.flow-node.is-active { background: var(--surface-2); }
.flow-icon {
  grid-area: icon;
  margin: 0;
  color: #8f8f8f;
  display: grid;
  place-items: center;
}
.flow-icon svg { width: 20px; height: 20px; }
.flow-node.is-active .flow-icon { color: #fff; }
.flow-node.is-done .flow-icon { color: #cfcfcf; }
.flow-title { grid-area: title; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.flow-sub { grid-area: sub; margin: 3px 0 0; font-size: 12.5px; color: var(--faint); }
.flow-state {
  grid-area: state;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: #9a9a9a;
  white-space: nowrap;
}
.flow-state .dot { width: 6px; height: 6px; background: #5a5a5a; }
.flow-state.is-done { color: #b9b9b9; }
.flow-state.is-done .dot { background: var(--positive); }
.flow-state.is-active { color: #e8e8e8; }
.flow-state.is-active .dot { background: var(--accent); }
.flow-open {
  grid-area: open;
  position: static;
  display: grid;
  place-items: center;
  color: #4a4a4a;
}
.flow-open svg { width: 14px; height: 14px; }
a.flow-node:hover .flow-open { color: #fff; transform: translateX(2px); }
.flow-link { height: 20px; }
.flow-link .line { height: 12px; background: #262626; }
.flow-link svg { width: 10px; height: 10px; opacity: .55; }

.flow-variants { gap: 8px; }
.flow-variant {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon sub"
    "icon state";
  column-gap: 10px;
  align-content: start;
  text-align: left;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--surface);
}
a.flow-variant:hover { background: var(--surface-2); }
.flow-variant-icon {
  grid-area: icon;
  margin: 2px 0 0;
  color: #8f8f8f;
  display: block;
}
.flow-variant-icon svg { width: 16px; height: 16px; }
.flow-variant-title { grid-area: title; font-size: 13.5px; font-weight: 600; }
.flow-variant-sub {
  grid-area: sub;
  width: auto;
  font-size: 12px;
  color: var(--faint);
}
.flow-variant-state { grid-area: state; margin-top: 7px; font-size: 12px; color: #8a8a8a; }
.flow-variant.is-approved .flow-variant-state { color: var(--positive); }

/* ---------- progress ---------- */

.progress { gap: 3px; margin-bottom: 8px; }
.progress-seg { height: 3px; background: #242424; }
.progress-seg.is-done { background: var(--accent); }
.progress-label { margin-bottom: 14px; font-size: 12px; color: #8a8a8a; }

/* ---------- buttons and controls ---------- */

.btn { height: var(--control-h); padding: 0 15px; font-size: 13px; border-radius: var(--r-pill); }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: #e9e9e9; }
.btn-primary:disabled { background: #1f1f1f; color: #7a7a7a; }
.btn-secondary { background: #1c1c1c; color: #fff; }
.btn-secondary:hover { background: #262626; }
.btn-secondary:disabled { background: #141414; color: #707070; }
.btn-ghost { color: #a8a8a8; }
.btn-ghost:hover { background: #141414; color: #fff; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; }
.icon-btn { width: 34px; height: 34px; }

.chip { height: 30px; padding: 0 12px; font-size: 12px; background: #191919; color: #b4b4b4; }
.chip:hover { background: #232323; }
.chip[aria-pressed="true"] { background: #fff; color: #000; }

.field > label { font-size: 12px; font-weight: 500; color: #a8a8a8; margin-bottom: 7px; }
.input, .select, .textarea {
  border-color: #262626;
  border-radius: var(--r-field);
  font-size: 13.5px;
  background: var(--field);
}
.input, .select { height: 38px; }
.input:hover, .select:hover, .textarea:hover { border-color: #383838; }
.input:focus, .select:focus, .textarea:focus { border-color: #6f6f6f; }
.hint { font-size: 12px; color: #8a8a8a; }

/* ---------- pills, notices, tables ---------- */

.pill {
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  background: #1c1c1c;
  color: #b4b4b4;
}
.pill-ok { background: var(--positive-bg); color: var(--positive); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-bad { background: var(--negative-bg); color: var(--negative); }
.pill-neutral { background: #1c1c1c; color: #a8a8a8; }
.pill-warn { background: var(--warning-bg); color: var(--accent); }

.notice {
  padding: 13px 15px;
  border-radius: 12px;
  background: #141414;
  font-size: 12.5px;
  line-height: 1.5;
  color: #b4b4b4;
}
.notice strong { font-weight: 500; }
.notice.is-stale { background: #1d1810; color: #e3c78f; }

.table { font-size: 13px; }
.table th {
  padding: 0 10px 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #8a8a8a;
  border-bottom: 1px solid #1c1c1c;
}
.table td { padding: 11px 10px; border-bottom: 1px solid #161616; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-clickable:hover td { background: #131313; }

/* ---------- esteira / automação ---------- */

.auto-steps {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 0;
  border-radius: 12px;
  background: #0b0b0b;
  overflow: hidden;
}
.auto-steps li {
  padding: 13px 14px 12px;
  border: 0;
  border-left: 1px solid #1b1b1b;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.35;
  color: #b4b4b4;
  gap: 6px;
}
.auto-steps li:first-child { border-left: 0; }
.auto-steps li span {
  width: auto;
  height: auto;
  display: block;
  padding: 0;
  border-radius: 0;
  background: none;
  color: #7e7e7e;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.auto-path-label {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: #8a8a8a;
}
.auto-path { border-color: #1d1d1d; border-radius: 10px; }
.auto-job { border-color: #1d1d1d; border-radius: 12px; background: #121212; }
.auto-output { background: #171717; border-radius: 10px; }
.auto-hook { color: var(--accent); }
.check input { accent-color: #e6e6e6; }

/* ---------- acervo ---------- */

.script-row { padding: 13px 0; }
.script-name { font-size: 14.5px; font-weight: 500; }
.script-hook { font-size: 12.5px; }
.tag { height: 22px; font-size: 12px; background: #1c1c1c; color: #adadad; }

/* ---------- empty, dialogs, toasts ---------- */

.empty {
  padding: 32px 24px;
  min-height: clamp(320px, 54vh, 520px);
  border: 1px dashed #303030;
  border-radius: var(--r-card);
  background: #080808;
}
.empty-title { font-size: 15px; }
.empty-text { font-size: 13px; color: var(--muted); }

.dlg { border-radius: 18px; background: #0f0f0f; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.dlg-form { padding: 24px; gap: 16px; }
.dlg-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.dlg-sub { font-size: 12.5px; }
.dlg::backdrop { background: rgba(0, 0, 0, .78); }

.toast { border-radius: 12px; font-size: 12.5px; }

/* ---------- dropzone and variants ---------- */

.drop { border-radius: var(--r-card); background: var(--surface); min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.drop:hover, .drop.is-over { background: #12110c; }
.drop-title { font-size: 15.5px; }
.drop-text { font-size: 13px; }

.variant-card { border-radius: var(--r-card); padding: 18px; }
.variant-title { font-size: 14.5px; }
.variant-letter { font-size: 12px; }
.variant-foot { border-top-color: #1c1c1c; }

/* ---------- week / schedule ---------- */

.week-day { background: #121212; border-radius: 10px; }
.week-day.is-today { border-top-color: var(--accent); }
.week-post { border-radius: 8px; }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-cell:nth-child(3) { border-left: 0; }
  .kpi-cell:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

@media (max-width: 860px) {
  .content, main { padding: 20px 16px 40px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 24px; }
  .sidebar { width: min(84vw, 304px); }
  .nav-item { min-height: 44px; font-size: 14px; }
  .sidebar-foot .nav-item { min-height: 42px; }
}

@media (max-width: 980px) {
  .studio-head { grid-template-columns: 1fr; gap: 22px; }
  .studio-lead h1 { max-width: 24ch; font-size: 27px; }
  .studio-steps { gap: 12px; }
}

@media (max-width: 640px) {
  .studio-head { margin-bottom: 20px; gap: 18px; }
  .studio-lead h1 { font-size: 24px; max-width: 22ch; }
  .studio-lede { font-size: 13.5px; }
  .studio-actions { margin-top: 14px; }
  .studio-actions .btn { flex: 1 1 auto; }
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .page-actions { justify-content: flex-start; }
  .kpi-cell { padding: 14px 16px; }
  .kpi-value { font-size: 22px; }
  .kpi-cell.is-lead .kpi-value { font-size: 30px; }
  .flow-node {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    grid-template-areas:
      "icon title state"
      "icon sub   state";
    column-gap: 12px;
    padding: 13px 14px;
  }
  .flow-open { display: none; }
  .flow-state { font-size: 11px; }
  .flow-variants { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .rail-card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
