/* ============================================================
   PortaSys — Design System (protótipo hi-fi)
   Direção: quiet luxury industrial — papel quente, carvão, laranja queimado.
   Fontes: Sora (display) · Instrument Sans (UI) · IBM Plex Mono (códigos)
   ============================================================ */

:root {
  /* Superfícies */
  --paper: #F4F2ED;
  --surface: #FFFFFF;
  --surface-2: #FAF9F5;
  --ink: #1F1D17;
  --ink-2: #5C5850;
  --ink-3: #8E897E;
  --line: #E8E5DC;
  --line-2: #D9D5C9;

  /* Marca */
  --accent: #C2410C;
  --accent-deep: #9A3412;
  --accent-soft: #FBEEE4;
  --accent-line: #EFD9C8;

  /* Sidebar */
  --side-bg: #201E18;
  --side-bg-2: #2A2720;
  --side-ink: #A8A294;
  --side-ink-strong: #F4F2ED;

  /* Status — cor forte (barras, pontos) */
  --s-amedir: #D8D4C8;
  --s-medida: #8F887A;
  --s-conferencia: #C79A2B;
  --s-orcada: #3D6FD6;
  --s-aprovada: #1D9C8A;
  --s-producao: #D97A2B;
  --s-pronta: #7C5CD6;
  --s-expedida: #2FA3BF;
  --s-instalada: #3E9B57;
  --s-cancelada: #C4453B;

  --shadow-1: 0 1px 2px rgba(31, 29, 23, 0.05), 0 6px 20px rgba(31, 29, 23, 0.05);
  --shadow-2: 0 2px 6px rgba(31, 29, 23, 0.08), 0 16px 40px rgba(31, 29, 23, 0.10);

  --r-card: 14px;
  --r-ctl: 9px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv05" on;
}

::selection { background: var(--accent-soft); }

h1, h2, h3, .display { font-family: "Sora", sans-serif; letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
svg { flex: none; }

.mono { font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-2); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ============ LAYOUT (app web) ============ */

.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--side-bg);
  color: var(--side-ink);
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 16px;
}
.side-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.side-logo svg { width: 18px; height: 18px; }
.side-brand-name {
  font-family: "Sora", sans-serif; font-weight: 700; font-size: 15.5px;
  color: var(--side-ink-strong); line-height: 1.1;
}
.side-brand-org { font-size: 10.5px; color: var(--side-ink); letter-spacing: 0.04em; }

.side-section {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #6E695C;
  padding: 14px 10px 6px;
}

.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--side-ink);
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.side-link svg { width: 17px; height: 17px; opacity: 0.85; }
.side-link:hover { background: rgba(255, 255, 255, 0.05); color: #DBD7CB; }
.side-link.active { background: var(--side-bg-2); color: var(--side-ink-strong); }
.side-link.active svg { color: #E8875A; opacity: 1; }
.side-link .side-count {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  background: rgba(255, 255, 255, 0.08); border-radius: 99px; padding: 1px 7px;
}
.side-link.disabled { opacity: 0.4; cursor: default; }
.side-link .side-soon {
  margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; border: 1px solid #4A463C; border-radius: 99px;
  padding: 1px 6px; color: #857F70;
}

.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid #35322A; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.side-user-name { font-size: 12.5px; font-weight: 600; color: var(--side-ink-strong); line-height: 1.2; }
.side-user-role { font-size: 11px; color: var(--side-ink); }

/* ============ TOPBAR ============ */

.main { min-width: 0; }

.topbar {
  height: 62px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 30;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.crumb a:hover { color: var(--ink); }
.crumb .sep { color: var(--line-2); }
.crumb .here { color: var(--ink); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 12px; width: 260px;
  color: var(--ink-3); font-size: 13px;
}
.search svg { width: 15px; height: 15px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .badge-dot {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent); border: 1.5px solid #fff;
}

/* ============ CONTEÚDO ============ */

.content { padding: 26px 28px 56px; max-width: 1440px; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-title { font-size: 22px; font-weight: 600; }
.page-sub { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.page-head .top-actions { margin-left: auto; }

.section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-2);
  margin: 26px 0 12px;
}

.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-5 { grid-template-columns: repeat(5, 1fr); }
.two-col { display: grid; grid-template-columns: 1fr 390px; gap: 16px; align-items: start; }
.split-40-60 { display: grid; grid-template-columns: 2fr 3fr; gap: 16px; align-items: start; }

/* ============ CARDS ============ */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 18px 20px;
  box-shadow: var(--shadow-1);
}
.card.flush { padding: 0; overflow: hidden; }
.card-h {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.card.flush .card-h { padding: 16px 20px 0; margin-bottom: 12px; }
.card-t {
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-2);
}
.card-h .more { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--accent); }
.card-h .more:hover { color: var(--accent-deep); }

.kpi-num {
  font-family: "Sora", sans-serif; font-size: 27px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi-num small { font-size: 15px; font-weight: 600; color: var(--ink-3); }
.kpi-label { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.kpi-foot { font-size: 11.5px; color: var(--ink-3); margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.delta { font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 1.5px 7px; }
.delta.up { color: #2C7A44; background: #E7F4E9; }
.delta.down { color: #B03A31; background: #FBEAEA; }

/* ============ BOTÕES ============ */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  border-radius: var(--r-ctl); padding: 9px 15px;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #38352C; }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent-deep); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* ============ PILLS DE STATUS ============ */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.01em;
  border-radius: 99px; padding: 3px 9px; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.no-dot::before { display: none; }

.st-amedir       { color: #7A756A; background: #EFEDE6; }
.st-amedir::before { background: var(--s-amedir); outline: 1px solid #B9B4A6; }
.st-medida       { color: #635D50; background: #F0EEE9; }
.st-conferencia  { color: #8A6A14; background: #FBF3DC; }
.st-orcada       { color: #2853AC; background: #E9EFFC; }
.st-aprovada     { color: #0E7264; background: #E2F4F1; }
.st-producao     { color: #A05512; background: #FBEFDD; }
.st-pronta       { color: #5B3EB8; background: #F0EBFB; }
.st-expedida     { color: #16768E; background: #E3F3F8; }
.st-instalada    { color: #2C7A44; background: #E7F4E9; }
.st-cancelada    { color: #B03A31; background: #FBEAEA; }

.pill-warn   { color: #8A6A14; background: #FBF3DC; }
.pill-ok     { color: #2C7A44; background: #E7F4E9; }
.pill-danger { color: #B03A31; background: #FBEAEA; }
.pill-info   { color: #2853AC; background: #E9EFFC; }
.pill-muted  { color: #635D50; background: #F0EEE9; }
.pill-accent { color: var(--accent-deep); background: var(--accent-soft); }

/* Cores sólidas p/ barras e pontos */
.bg-amedir { background: var(--s-amedir); }
.bg-medida { background: var(--s-medida); }
.bg-conferencia { background: var(--s-conferencia); }
.bg-orcada { background: var(--s-orcada); }
.bg-aprovada { background: var(--s-aprovada); }
.bg-producao { background: var(--s-producao); }
.bg-pronta { background: var(--s-pronta); }
.bg-expedida { background: var(--s-expedida); }
.bg-instalada { background: var(--s-instalada); }
.bg-cancelada { background: var(--s-cancelada); }

/* ============ TABELAS ============ */

.table { width: 100%; border-collapse: collapse; }
.table th {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.table td {
  font-size: 13px; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table .row-strong { font-weight: 600; }
.table td .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* ============ TABS ============ */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  padding: 9px 14px; border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer;
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============ FUNIL / BARRAS ============ */

.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--paper); }
.stack i { display: block; height: 100%; }

.funnel-row { display: grid; grid-template-columns: 128px 1fr 64px; align-items: center; gap: 12px; padding: 7px 0; }
.funnel-row .f-label { font-size: 12.5px; font-weight: 550; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.funnel-row .f-label i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.funnel-row .f-track { background: var(--paper); border-radius: 6px; height: 20px; overflow: hidden; }
.funnel-row .f-bar { height: 100%; border-radius: 6px; }
.funnel-row .f-val { font-size: 13px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }

.progress { height: 7px; background: #ECE9E0; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* ============ HEATMAP ESPACIAL ============ */

.heat { display: grid; gap: 5px; }
.heat-row { display: grid; grid-template-columns: 64px repeat(4, 1fr); gap: 5px; align-items: center; }
.heat-pav { font-size: 11px; font-weight: 650; color: var(--ink-3); text-align: right; padding-right: 6px; }
.heat-cell {
  height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 650; cursor: pointer;
  border: 1px solid transparent;
}
.heat-cell:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.heat-cell.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.c-amedir { background: transparent; border: 1.5px dashed var(--line-2); color: var(--ink-3); }
.c-medida { background: #F0EEE9; color: #635D50; }
.c-conferencia { background: #FBF3DC; color: #8A6A14; }
.c-orcada { background: #E9EFFC; color: #2853AC; }
.c-aprovada { background: #E2F4F1; color: #0E7264; }
.c-producao { background: #FBEFDD; color: #A05512; }
.c-pronta { background: #F0EBFB; color: #5B3EB8; }
.c-expedida { background: #E3F3F8; color: #16768E; }
.c-instalada { background: #DFF0E2; color: #2C7A44; }

/* ============ ÁRVORE ESPACIAL ============ */

.tree { display: flex; flex-direction: column; gap: 2px; }
.tree-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 7px 10px; border-radius: 8px; cursor: pointer;
  color: var(--ink-2);
}
.tree-item:hover { background: var(--surface-2); }
.tree-item.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.tree-item svg { width: 14px; height: 14px; opacity: 0.7; }
.tree-item .t-count { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tree-item.lvl-2 { margin-left: 18px; }
.tree-item.lvl-3 { margin-left: 36px; }

/* ============ TIMELINE ============ */

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 1.5px; background: var(--line);
}
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -22px; top: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2.5px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2);
}
.tl-title { font-size: 13px; font-weight: 600; }
.tl-desc { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.tl-meta { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* ============ BANNERS / ALERTAS ============ */

.banner {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: 12px; padding: 13px 16px; font-size: 13px;
  border: 1px solid;
}
.banner svg { width: 17px; height: 17px; margin-top: 1px; }
.banner-info { background: #F4F1E8; border-color: #E3DCC8; color: #6B6247; }
.banner-warn { background: #FBF3DC; border-color: #EDDFB3; color: #8A6A14; }
.banner-danger { background: #FBEAEA; border-color: #F0CCC9; color: #B03A31; }
.banner-ai { background: #FDFAF4; border-color: var(--accent-line); color: var(--ink-2); }
.banner-ai svg { color: var(--accent); }
.banner b { color: var(--ink); }

/* ============ PAINEL IA ============ */

.ai-panel { background: #FDFBF6; border: 1px solid var(--accent-line); }
.ai-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--accent-deep); background: var(--accent-soft);
  border-radius: 99px; padding: 3px 10px;
}
.ai-chip svg { width: 12px; height: 12px; }

.anomaly {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 0; border-bottom: 1px solid #F0EAD9;
}
.anomaly:last-child { border-bottom: none; }
.anomaly svg { width: 15px; height: 15px; color: #C79A2B; margin-top: 2px; }
.anomaly .a-body { flex: 1; }
.anomaly .a-title { font-size: 12.5px; font-weight: 600; }
.anomaly .a-desc { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.anomaly .a-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ============ ETIQUETA ============ */

.etiqueta {
  width: 430px; background: #fff;
  border: 1.5px solid var(--ink); border-radius: 10px;
  padding: 14px 16px; box-shadow: var(--shadow-1);
  font-family: "Instrument Sans", sans-serif;
}
.etq-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px dashed var(--line-2); }
.etq-brand { font-family: "Sora", sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 0.05em; }
.etq-os { font-size: 10px; color: var(--ink-3); font-family: "IBM Plex Mono", monospace; }
.etq-body { display: flex; gap: 14px; padding-top: 10px; }
.etq-info { flex: 1; min-width: 0; }
.etq-code { font-family: "IBM Plex Mono", monospace; font-size: 14.5px; font-weight: 600; letter-spacing: -0.02em; }
.etq-loc { font-size: 12.5px; font-weight: 650; margin-top: 6px; }
.etq-specs { font-size: 10.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.6; }
.etq-qr { width: 92px; text-align: center; }
.etq-qr svg { width: 88px; height: 88px; }
.etq-short { font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 700; margin-top: 3px; }
.etq-caption { font-size: 11px; color: var(--ink-3); margin-top: 8px; text-align: center; }

/* ============ KANBAN ============ */

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 250px; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kb-col { background: #EFEDE6; border-radius: 12px; padding: 10px; }
.kb-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.kb-title { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); }
.kb-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--ink-3); background: var(--surface); border-radius: 99px; padding: 1px 8px; }
.kb-cards { display: flex; flex-direction: column; gap: 8px; }
.kb-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(31,29,23,0.04);
}
.kb-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.kb-code { font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 600; }
.kb-meta { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; }
.kb-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10.5px; color: var(--ink-3); }

/* ============ DRAWER / FICHA ============ */

.drawer { position: sticky; top: 88px; }
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.spec { }
.spec dt { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
.spec dd { font-size: 13px; font-weight: 550; margin-top: 2px; }

.photo-thumbs { display: flex; gap: 8px; }
.photo-thumb {
  width: 74px; height: 56px; border-radius: 8px;
  background: linear-gradient(160deg, #E3E0D6, #D2CEC0);
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  color: #9B968A; font-size: 9.5px; font-weight: 600; text-align: center;
}

/* ============ DIVISORES ============ */

.hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.hr-dashed { border-top-style: dashed; }

.stat-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.stat-row:last-child { border-bottom: none; }
.stat-row .v { font-weight: 650; font-variant-numeric: tabular-nums; }

/* ============ AVATARES / TAGS ============ */

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; flex: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.accent { background: var(--accent); color: #fff; }

.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 99px; padding: 2.5px 9px;
  background: var(--surface);
}

/* ============ MOBILE (frames PWA) ============ */

.frames { display: flex; flex-wrap: wrap; gap: 44px 34px; align-items: flex-start; }
.frame-wrap { width: 330px; }
.frame-step {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}
.frame-label { font-size: 14px; font-weight: 650; margin-bottom: 12px; font-family: "Sora", sans-serif; }
.frame-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; margin-top: 14px; }
.frame-note b { color: var(--ink); }

.phone {
  width: 330px; background: #17150F; border-radius: 44px; padding: 9px;
  box-shadow: var(--shadow-2);
}
.phone-screen {
  background: var(--paper); border-radius: 36px; overflow: hidden;
  height: 688px; display: flex; flex-direction: column; position: relative;
}
.p-status {
  height: 34px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; font-size: 11.5px; font-weight: 650; flex: none;
}
.p-status .p-icons { display: flex; align-items: center; gap: 5px; }
.p-sig { display: flex; align-items: flex-end; gap: 1.5px; height: 10px; }
.p-sig i { width: 3px; background: var(--ink); border-radius: 1px; display: block; }
.p-sig i:nth-child(1) { height: 4px; } .p-sig i:nth-child(2) { height: 6px; }
.p-sig i:nth-child(3) { height: 8px; opacity: 0.35; } .p-sig i:nth-child(4) { height: 10px; opacity: 0.35; }
.p-batt { width: 20px; height: 10px; border: 1.2px solid var(--ink); border-radius: 3px; padding: 1.5px; }
.p-batt i { display: block; height: 100%; width: 70%; background: var(--ink); border-radius: 1px; }

.p-offline {
  background: var(--ink); color: var(--paper);
  font-size: 11px; font-weight: 600; text-align: center;
  padding: 6px 12px; display: flex; align-items: center; justify-content: center; gap: 7px;
  flex: none;
}
.p-offline svg { width: 12px; height: 12px; }
.p-online { background: #2C7A44; }

.p-head { padding: 12px 16px 10px; flex: none; }
.p-head-row { display: flex; align-items: center; gap: 10px; }
.p-title { font-family: "Sora", sans-serif; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.p-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }
.p-back {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center; background: var(--surface);
}
.p-back svg { width: 14px; height: 14px; }

.p-body { flex: 1; overflow: hidden; padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }

.p-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 14px;
}
.p-card-title { font-size: 13.5px; font-weight: 650; }
.p-card-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }

.p-nav {
  flex: none; height: 62px; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; align-items: stretch;
}
.p-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 9.5px; font-weight: 650; color: var(--ink-3);
}
.p-nav-item svg { width: 19px; height: 19px; }
.p-nav-item.active { color: var(--accent); }

.p-fab {
  position: absolute; right: 16px; bottom: 76px;
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(194, 65, 12, 0.35);
}
.p-fab svg { width: 22px; height: 22px; }

/* Controles mobile */
.p-field-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.p-input {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 11px;
  padding: 10px 12px; font-size: 14px; font-weight: 550; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.p-input .unit { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.p-input-lg { font-size: 21px; font-family: "Sora", sans-serif; font-weight: 600; padding: 12px 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 99px; padding: 6px 13px;
  background: var(--surface);
}
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.seg { display: flex; background: #ECE9E0; border-radius: 11px; padding: 3px; }
.seg span { flex: 1; text-align: center; font-size: 12.5px; font-weight: 650; padding: 8px 4px; border-radius: 8px; color: var(--ink-3); }
.seg span.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(31,29,23,0.1); }

.sig-canvas {
  background: var(--surface); border: 1.5px dashed var(--line-2); border-radius: 14px;
  height: 170px; display: flex; align-items: flex-end; justify-content: center;
  position: relative; overflow: hidden;
}
.sig-canvas svg { width: 82%; margin-bottom: 26px; }
.sig-line { position: absolute; bottom: 34px; left: 24px; right: 24px; border-top: 1px solid var(--line-2); }

.sync-item { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.sync-item:last-child { border-bottom: none; }
.sync-item .s-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--paper); display: flex; align-items: center; justify-content: center; color: var(--ink-2); flex: none; }
.sync-item .s-ico svg { width: 15px; height: 15px; }
.sync-item .s-body { flex: 1; min-width: 0; }
.sync-item .s-title { font-size: 12.5px; font-weight: 600; }
.sync-item .s-sub { font-size: 11px; color: var(--ink-3); }

/* Scanner QR (montagem) */
.scan-view {
  flex: 1; background: #14120C; border-radius: 18px; margin: 0 2px;
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.scan-frame {
  width: 190px; height: 190px; position: relative;
}
.scan-frame::before, .scan-frame::after,
.scan-frame i::before, .scan-frame i::after {
  content: ""; position: absolute; width: 34px; height: 34px;
  border: 3.5px solid #fff; border-radius: 8px;
}
.scan-frame::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.scan-frame::after { top: 0; right: 0; border-left: none; border-bottom: none; }
.scan-frame i::before { bottom: 0; left: 0; border-right: none; border-top: none; }
.scan-frame i::after { bottom: 0; right: 0; border-left: none; border-top: none; }
.scan-hint {
  position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,0.75); font-size: 11.5px; font-weight: 550;
}
.scan-frame svg { position: absolute; inset: 28px; width: 134px; height: 134px; color: #fff; opacity: 0.92; }

/* ============ FLUXO (index) ============ */

.flow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; position: relative; }
.flow-step { text-align: center; padding: 0 10px; position: relative; }
.flow-step:not(:last-child)::after {
  content: ""; position: absolute; top: 26px; right: -9px;
  width: 18px; height: 1.5px; background: var(--line-2);
}
.flow-ico {
  width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 10px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); box-shadow: var(--shadow-1);
}
.flow-ico svg { width: 22px; height: 22px; }
.flow-num { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--ink-3); }
.flow-name { font-size: 13px; font-weight: 650; margin-top: 2px; }
.flow-desc { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }

.link-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 18px 20px;
  box-shadow: var(--shadow-1); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.link-card .lc-title { font-size: 14.5px; font-weight: 650; font-family: "Sora", sans-serif; display: flex; align-items: center; gap: 8px; }
.link-card .lc-title svg { width: 16px; height: 16px; color: var(--accent); }
.link-card .lc-desc { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.55; }
.link-card .lc-foot { display: flex; gap: 6px; margin-top: 12px; }

/* ============ UTILITÁRIOS ============ */

.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gap-sm { gap: 6px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.w-full { width: 100%; }

::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2.5px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }
