/* ══════════════════════════════════════════════════════════════
   ElJoaoAntonio · sistema visual
   Fundo branco, contraste sóbrio, densidade de ferramenta de trabalho.
   ══════════════════════════════════════════════════════════════ */

:root{
  /* superfícies */
  --bg:            #FFFFFF;
  --bg-sunken:     #FAFAFB;
  --bg-raised:     #FFFFFF;
  --bg-hover:      #F5F6F8;
  --bg-active:     #EFF1F4;
  --bg-inverse:    #12141A;

  /* traços */
  --line:          #E7E9EE;
  --line-soft:     #F0F1F4;
  --line-strong:   #D6DAE2;

  /* texto */
  --ink:           #14161C;
  --ink-2:         #464B57;
  --ink-3:         #6E7482;
  --ink-4:         #9AA0AC;
  --ink-inverse:   #FFFFFF;

  /* acentos */
  --accent:        #2B5CE6;
  --accent-hover:  #1F49C4;
  --accent-soft:   #EEF3FE;
  --accent-line:   #C9D8FB;

  --amber:         #C87A0A;
  --amber-soft:    #FDF6E7;
  --green:         #0E7A50;
  --green-soft:    #ECF8F2;
  --red:           #C0342B;
  --red-soft:      #FDF0EE;
  --violet:        #6D4AA8;
  --violet-soft:   #F4F0FB;

  /* forma */
  --r-sm: 6px;
  --r:    9px;
  --r-lg: 14px;
  --r-full: 999px;

  --shadow-sm: 0 1px 2px rgba(18,20,26,.05);
  --shadow:    0 1px 3px rgba(18,20,26,.06), 0 6px 16px -8px rgba(18,20,26,.10);
  --shadow-lg: 0 12px 40px -12px rgba(18,20,26,.22), 0 2px 8px rgba(18,20,26,.06);

  /* medidas */
  --sidebar: 252px;
  --sidebar-collapsed: 66px;
  --topbar: 56px;
  --content-max: 1180px;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --ease: cubic-bezier(.2,.7,.3,1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  font-feature-settings: 'cv02','cv03','cv04','ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,h2,h3,h4,h5{ margin: 0; font-weight: 620; letter-spacing: -.015em; line-height: 1.25; }
h1{ font-size: 22px; }
h2{ font-size: 17px; }
h3{ font-size: 15px; }
p { margin: 0 0 10px; }
a { color: inherit; text-decoration: none; }
hr{ border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

::selection{ background: #D8E2FB; }

:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─────────────── ESTRUTURA ─────────────── */

.shell{ display: flex; min-height: 100vh; }

/* barra lateral */
.sidebar{
  width: var(--sidebar);
  flex: none;
  background: var(--bg-sunken);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width .18s var(--ease);
  z-index: 40;
}
.sidebar-brand{
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.brand-mark{
  width: 26px; height: 26px; flex: none;
  border-radius: 7px;
  background: var(--bg-inverse);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: -.04em;
}
.brand-text{ min-width: 0; }
.brand-name{
  font-size: 13.5px; font-weight: 620; letter-spacing: -.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub{
  font-family: var(--mono);
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-4); white-space: nowrap;
}

.sidebar-scroll{ flex: 1; overflow-y: auto; padding: 12px 10px 16px; }
.sidebar-scroll::-webkit-scrollbar{ width: 8px; }
.sidebar-scroll::-webkit-scrollbar-thumb{ background: #DEE1E7; border-radius: 99px; border: 2px solid var(--bg-sunken); }

.nav-label{
  font-family: var(--mono);
  font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-4);
  padding: 14px 8px 6px;
}
.nav-item{
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 13.5px; font-weight: 480;
  transition: background .12s, color .12s;
  position: relative;
  white-space: nowrap;
}
.nav-item:hover{ background: var(--bg-active); color: var(--ink); }
.nav-item.is-active{ background: var(--bg-inverse); color: #fff; font-weight: 540; }
.nav-item.is-active .nav-icon{ opacity: 1; }
.nav-icon{ width: 16px; height: 16px; flex: none; opacity: .62; }
.nav-item .nav-badge{
  margin-left: auto;
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-4);
  background: var(--bg-active);
  padding: 1px 5px; border-radius: var(--r-full);
}
.nav-item.is-active .nav-badge{ background: rgba(255,255,255,.16); color: rgba(255,255,255,.82); }

.nav-sub{ margin: 2px 0 8px 0; padding-left: 8px; border-left: 1px solid var(--line); margin-left: 17px; }
.nav-sub .nav-item{
  font-size: 13px; padding: 5px 9px; color: var(--ink-3);
}
.nav-sub .nav-item.is-active{
  background: var(--accent-soft); color: var(--accent); font-weight: 560;
}
.tool-dot{ width: 7px; height: 7px; border-radius: 99px; flex: none; }

.sidebar-foot{
  flex: none; border-top: 1px solid var(--line); padding: 10px;
}
.sidebar-user{
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: var(--r-sm);
  width: 100%; border: 0; background: none; cursor: pointer; text-align: left;
  font: inherit; color: var(--ink);
}
.sidebar-user:hover{ background: var(--bg-active); }
.avatar{
  width: 26px; height: 26px; flex: none; border-radius: var(--r-full);
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 650; color: #fff;
  background: var(--bg-inverse);
  letter-spacing: .02em;
}
.sidebar-user-name{ font-size: 13px; font-weight: 540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-mail{ font-size: 11px; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* recolhida */
.sidebar.is-collapsed{ width: var(--sidebar-collapsed); }
.sidebar.is-collapsed .brand-text,
.sidebar.is-collapsed .nav-item span:not(.nav-badge),
.sidebar.is-collapsed .nav-label,
.sidebar.is-collapsed .nav-sub,
.sidebar.is-collapsed .sidebar-user-info,
.sidebar.is-collapsed .nav-badge{ display: none; }
.sidebar.is-collapsed .nav-item{ justify-content: center; padding: 8px; }
.sidebar.is-collapsed .sidebar-brand{ justify-content: center; padding: 0; }

/* área principal */
.main{ flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar{
  height: var(--topbar); flex: none;
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
}
.crumbs{ display: flex; align-items: center; gap: 7px; font-size: 13px; min-width: 0; }
.crumbs a{ color: var(--ink-3); }
.crumbs a:hover{ color: var(--ink); }
.crumbs .sep{ color: var(--ink-4); }
.crumbs .now{ font-weight: 560; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer{ flex: 1; }

.searchbox{ position: relative; }
.searchbox input{
  width: 210px; height: 32px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg-sunken);
  padding: 0 10px 0 30px;
  font: inherit; font-size: 13px; color: var(--ink);
  transition: width .18s var(--ease), border-color .12s, background .12s;
}
.searchbox input::placeholder{ color: var(--ink-4); }
.searchbox input:focus{ width: 300px; background: #fff; border-color: var(--accent-line); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox svg{ position: absolute; left: 9px; top: 8px; width: 15px; height: 15px; color: var(--ink-4); pointer-events: none; }
.search-results{
  position: absolute; top: 38px; right: 0; width: 340px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
  max-height: 400px; overflow-y: auto; display: none;
}
.search-results.on{ display: block; }
.search-group{
  font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-4); padding: 8px 8px 4px;
}
.search-hit{ display: block; padding: 7px 9px; border-radius: var(--r-sm); }
.search-hit:hover{ background: var(--bg-hover); }
.search-hit b{ display: block; font-weight: 520; font-size: 13px; }
.search-hit small{ color: var(--ink-4); font-size: 11.5px; }

.content{ flex: 1; padding: 26px 22px 80px; }
.container{ max-width: var(--content-max); margin: 0 auto; }
.container-wide{ max-width: 1420px; margin: 0 auto; }

/* ─────────────── CABEÇALHOS DE PÁGINA ─────────────── */

.page-head{
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-title{ font-size: 22px; font-weight: 640; letter-spacing: -.022em; }
.page-sub{ color: var(--ink-3); font-size: 13.5px; margin-top: 3px; max-width: 68ch; }
.page-actions{ display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.section-head{
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin: 30px 0 12px;
}
.section-head:first-child{ margin-top: 0; }
.section-title{ font-size: 14.5px; font-weight: 620; letter-spacing: -.012em; }
.section-meta{
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4);
}
.section-note{ color: var(--ink-3); font-size: 13px; max-width: 72ch; margin: -4px 0 14px; }

/* ─────────────── CARTÕES ─────────────── */

.card{
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card-pad{ padding: 18px; }
.card-head{
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-body{ padding: 18px; }
.card-foot{ padding: 12px 18px; border-top: 1px solid var(--line-soft); background: var(--bg-sunken); border-radius: 0 0 var(--r) var(--r); }

.grid{ display: grid; gap: 14px; }
.grid-2{ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3{ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4{ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* cartão de ferramenta no painel */
.tool-card{
  display: block;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; transition: border-color .14s, box-shadow .14s, transform .14s;
  position: relative; overflow: hidden;
}
.tool-card:hover{ border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.tool-card::before{
  content:''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--tc, var(--accent));
  opacity: 0; transition: opacity .14s;
}
.tool-card:hover::before{ opacity: 1; }
.tool-card-top{ display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.tool-glyph{
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--tc-soft, var(--accent-soft)); color: var(--tc, var(--accent));
}
.tool-glyph svg{ width: 18px; height: 18px; }
.tool-card h3{ font-size: 14.5px; font-weight: 620; }
.tool-card p{ color: var(--ink-3); font-size: 13px; margin: 0; }
.tool-stats{
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.tool-stat-n{ font-family: var(--mono); font-size: 17px; font-weight: 600; letter-spacing: -.02em; display: block; }
.tool-stat-l{ font-size: 11px; color: var(--ink-4); }

/* ─────────────── NÚMEROS ─────────────── */

.stat{
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px;
}
.stat-label{
  font-size: 11.5px; color: var(--ink-3); font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.stat-value{
  font-family: var(--mono); font-size: 25px; font-weight: 600;
  letter-spacing: -.03em; line-height: 1.2; margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.stat-foot{ font-size: 11.5px; color: var(--ink-4); margin-top: 3px; }
.stat.is-key{ border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), #fff 60%); }

.delta{ font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.delta.up{ color: var(--green); }
.delta.down{ color: var(--red); }
.delta.flat{ color: var(--ink-4); }

/* barra de progresso */
.progress{
  height: 6px; border-radius: 99px; background: var(--bg-active); overflow: hidden;
}
.progress span{
  display: block; height: 100%; border-radius: 99px;
  background: var(--ink); transition: width .5s var(--ease);
}
.progress.amber span{ background: var(--amber); }
.progress.green span{ background: var(--green); }

/* ─────────────── BOTÕES ─────────────── */

.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 33px; padding: 0 13px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 520;
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
}
.btn:hover{ background: var(--bg-hover); border-color: var(--ink-4); }
.btn:active{ background: var(--bg-active); }
.btn svg{ width: 15px; height: 15px; }

.btn-primary{ background: var(--bg-inverse); border-color: var(--bg-inverse); color: #fff; }
.btn-primary:hover{ background: #22252E; border-color: #22252E; }

.btn-accent{ background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover{ background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost{ border-color: transparent; box-shadow: none; background: none; color: var(--ink-2); }
.btn-ghost:hover{ background: var(--bg-hover); border-color: transparent; color: var(--ink); }

.btn-danger{ color: var(--red); border-color: #EFD5D2; }
.btn-danger:hover{ background: var(--red-soft); border-color: var(--red); }

.btn-sm{ height: 27px; padding: 0 9px; font-size: 12px; }
.btn-sm svg{ width: 13px; height: 13px; }
.btn-lg{ height: 38px; padding: 0 18px; font-size: 14px; }
.btn-icon{ width: 33px; padding: 0; }
.btn-icon.btn-sm{ width: 27px; }
.btn:disabled{ opacity: .45; cursor: not-allowed; }
.btn-block{ width: 100%; }

.btn-group{ display: inline-flex; }
.btn-group .btn{ border-radius: 0; margin-left: -1px; box-shadow: none; }
.btn-group .btn:first-child{ border-radius: var(--r-sm) 0 0 var(--r-sm); margin-left: 0; }
.btn-group .btn:last-child{ border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.btn-group .btn.is-on{ background: var(--bg-inverse); border-color: var(--bg-inverse); color: #fff; z-index: 1; }

/* ─────────────── FORMULÁRIOS ─────────────── */

.field{ margin-bottom: 14px; }
.label{
  display: block; font-size: 12px; font-weight: 560; color: var(--ink-2); margin-bottom: 5px;
}
.label .opt{ font-weight: 400; color: var(--ink-4); }
.hint{ font-size: 11.5px; color: var(--ink-4); margin-top: 5px; }

.input, .select, .textarea{
  width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: #fff; color: var(--ink);
  font: inherit; font-size: 13.5px; line-height: 1.3;
  padding: 7px 10px;
  transition: border-color .12s, box-shadow .12s;
}
/* altura fixa + padding vertical corta as descidas das letras: o padding
   vertical fica a zero e o texto centra-se sozinho na caixa. */
.input{ height: 33px; padding-top: 0; padding-bottom: 0; }
.textarea{ min-height: 70px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus{
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder{ color: var(--ink-4); }
.input:disabled, .textarea:disabled{ background: var(--bg-sunken); color: var(--ink-3); }
.select{
  height: 33px; appearance: none; cursor: pointer;
  padding: 0 28px 0 10px;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E7482' stroke-width='2.2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
/* alturas pequenas definidas nas vistas herdam o padding vertical zero */
.select option{ color: var(--ink); background: #fff; }
.input-mono{ font-family: var(--mono); font-size: 12.5px; }
.field-row{ display: flex; gap: 10px; flex-wrap: wrap; }
.field-row > .field{ flex: 1; min-width: 150px; }

/* caixa de verificação */
.check{
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; padding: 9px 0;
}
.check input{ position: absolute; opacity: 0; width: 0; height: 0; }
.check .box{
  width: 17px; height: 17px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--line-strong); border-radius: 5px;
  background: #fff; display: grid; place-items: center;
  transition: background .13s, border-color .13s;
}
.check .box svg{ width: 11px; height: 11px; stroke: #fff; stroke-width: 3.4; fill: none; opacity: 0; transition: opacity .13s; }
.check:hover .box{ border-color: var(--ink-4); }
.check input:checked + .box{ background: var(--green); border-color: var(--green); }
.check input:checked + .box svg{ opacity: 1; }
.check input:checked ~ .check-text{ color: var(--ink-4); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.check input:focus-visible + .box{ outline: 2px solid var(--accent); outline-offset: 2px; }
.check-text{ font-size: 13.5px; line-height: 1.5; transition: color .13s; }
.check-list .check{ border-bottom: 1px solid var(--line-soft); }
.check-list .check:last-child{ border-bottom: 0; }

/* interruptor */
.switch{ display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input{ position: absolute; opacity: 0; }
.switch .track{
  width: 34px; height: 20px; border-radius: 99px; background: var(--line-strong);
  position: relative; transition: background .15s; flex: none;
}
.switch .track::after{
  content:''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 99px; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform .15s var(--ease);
}
.switch input:checked + .track{ background: var(--green); }
.switch input:checked + .track::after{ transform: translateX(14px); }

/* ─────────────── ETIQUETAS ─────────────── */

.chip{
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px;
  border-radius: var(--r-full);
  background: var(--bg-active); color: var(--ink-2);
  font-size: 11.5px; font-weight: 520; white-space: nowrap;
}
.chip .dot{ width: 6px; height: 6px; border-radius: 99px; flex: none; }
.chip-line{ background: none; border: 1px solid var(--line); }
.chip-mono{ font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.chip.green{ background: var(--green-soft); color: var(--green); }
.chip.amber{ background: var(--amber-soft); color: var(--amber); }
.chip.red{   background: var(--red-soft);   color: var(--red); }
.chip.blue{  background: var(--accent-soft);color: var(--accent); }
.chip.violet{background: var(--violet-soft);color: var(--violet); }
.chip.plain{ background: var(--bg-active); color: var(--ink-3); }

.kbd{
  font-family: var(--mono); font-size: 10.5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; color: var(--ink-3); background: #fff;
}

/* ─────────────── TABELAS ─────────────── */

.table-wrap{ overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
table.tbl{ width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th{
  text-align: left; padding: 9px 14px;
  background: var(--bg-sunken); border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .11em;
  text-transform: uppercase; font-weight: 600; color: var(--ink-3);
  white-space: nowrap;
}
.tbl td{ padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:last-child td{ border-bottom: 0; }
.tbl tbody tr:hover{ background: var(--bg-sunken); }
.tbl td.num, .tbl th.num{ text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl td.tight{ width: 1%; white-space: nowrap; }
.tbl .row-title{ font-weight: 540; }

/* ─────────────── SEPARADORES ─────────────── */

.tabs{
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  margin-bottom: 20px; overflow-x: auto;
}
.tab{
  padding: 9px 13px; font-size: 13.5px; font-weight: 500; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; cursor: pointer; background: none; border-top:0; border-left:0; border-right:0;
  font-family: inherit; transition: color .12s, border-color .12s;
}
.tab:hover{ color: var(--ink); }
.tab.is-on{ color: var(--ink); border-bottom-color: var(--ink); font-weight: 580; }
.tab .tab-count{ font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); margin-left: 5px; }

.segmented{
  display: inline-flex; background: var(--bg-active); border-radius: var(--r-sm); padding: 2px; gap: 2px;
}
.segmented button{
  border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 520;
  color: var(--ink-3); padding: 4px 11px; border-radius: 5px; cursor: pointer;
  transition: background .12s, color .12s;
}
.segmented button.is-on{ background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ─────────────── ESTADOS ─────────────── */

.empty{
  border: 1px dashed var(--line-strong); border-radius: var(--r);
  padding: 40px 24px; text-align: center; color: var(--ink-3);
  background: var(--bg-sunken);
}
.empty-glyph{
  width: 38px; height: 38px; margin: 0 auto 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-4);
}
.empty h3{ font-size: 14.5px; margin-bottom: 5px; color: var(--ink); }
.empty p{ font-size: 13px; max-width: 44ch; margin: 0 auto 14px; }

.note{
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  padding: 11px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13px; line-height: 1.55; color: #6B4A08;
}
.note.blue{ border-color: var(--accent); background: var(--accent-soft); color: #1B3A8F; }
.note.green{ border-color: var(--green); background: var(--green-soft); color: #0A5638; }
.note.red{ border-color: var(--red); background: var(--red-soft); color: #8C241D; }
.note b, .note strong{ font-weight: 640; }

.callout{
  background: var(--bg-inverse); color: #D9DEE8;
  border-radius: var(--r); padding: 18px 20px;
  font-size: 13.5px; line-height: 1.6;
}
.callout b{ color: #fff; font-weight: 600; }

/* mensagens flash */
.flash-stack{ position: fixed; top: 14px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.flash{
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--ink);
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  padding: 10px 14px; font-size: 13px; max-width: 380px;
  animation: flashIn .22s var(--ease);
}
.flash.ok{ border-left-color: var(--green); }
.flash.erro{ border-left-color: var(--red); }
@keyframes flashIn{ from{ opacity:0; transform: translateY(-8px);} to{ opacity:1; transform:none; } }

/* aviso rápido no fundo */
.toast{
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 60px);
  background: var(--bg-inverse); color: #fff;
  padding: 9px 16px; border-radius: var(--r-full);
  font-size: 12.5px; z-index: 95;
  opacity: 0; transition: .22s var(--ease); pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.on{ transform: translate(-50%, 0); opacity: 1; }

/* ─────────────── BLOCO DE CÓPIA ─────────────── */

.copyblock{ position: relative; }
.copyblock pre{
  margin: 0; background: var(--bg-sunken);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 46px 14px 14px;
  white-space: pre-wrap; word-wrap: break-word;
  font-family: var(--sans); font-size: 13.5px; line-height: 1.6; color: var(--ink-2);
}
.copyblock.mono pre{
  font-family: var(--mono); font-size: 12px; line-height: 1.65;
  background: var(--bg-inverse); color: #CDD5E3; border-color: var(--bg-inverse);
}
.copyblock.hash pre{ font-family: var(--mono); font-size: 12px; color: var(--accent); }
.copybtn{
  position: absolute; top: 7px; right: 7px;
  height: 24px; padding: 0 8px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .08em;
  background: #fff; border: 1px solid var(--line-strong); color: var(--ink-3);
  border-radius: 5px; cursor: pointer; transition: .12s;
}
.copybtn:hover{ background: var(--bg-inverse); color: #fff; border-color: var(--bg-inverse); }
.copybtn.done{ background: var(--green); border-color: var(--green); color: #fff; }
.copyblock.mono .copybtn{ background: #262A34; border-color: #3A4050; color: #A9B3C6; }

/* ─────────────── DIÁLOGO ─────────────── */

.overlay{
  position: fixed; inset: 0; z-index: 80;
  background: rgba(18,20,26,.42); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 5vh 16px 40px; overflow-y: auto;
}
.overlay.on{ display: flex; }
.modal{
  background: #fff; border-radius: var(--r-lg);
  width: 100%; max-width: 540px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s var(--ease);
}
.modal.wide{ max-width: 820px; }
@keyframes modalIn{ from{ opacity:0; transform: translateY(-10px) scale(.99);} to{ opacity:1; transform:none; } }
.modal-head{
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.modal-title{ font-size: 15.5px; font-weight: 620; }
.modal-sub{ font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.modal-body{ padding: 18px; max-height: 66vh; overflow-y: auto; }
.modal-foot{
  padding: 13px 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-sunken);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-close{
  width: 28px; height: 28px; flex: none; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink-3);
  cursor: pointer; display: grid; place-items: center; font-size: 15px; line-height: 1;
}
.modal-close:hover{ background: var(--bg-inverse); color: #fff; border-color: var(--bg-inverse); }

/* ─────────────── UTILITÁRIOS ─────────────── */

.mono{ font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted{ color: var(--ink-3); }
.dim{ color: var(--ink-4); }
.small{ font-size: 12px; }
.tiny{ font-size: 11px; }
.strong{ font-weight: 600; }
.center{ text-align: center; }
.right{ text-align: right; }
.nowrap{ white-space: nowrap; }
.truncate{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row{ display: flex; align-items: center; gap: 10px; }
.row-tight{ display: flex; align-items: center; gap: 6px; }
.col{ display: flex; flex-direction: column; gap: 6px; }
.wrap{ flex-wrap: wrap; }
.between{ justify-content: space-between; }
.spacer{ flex: 1; }
.mt-0{ margin-top: 0; } .mt-1{ margin-top: 6px; } .mt-2{ margin-top: 12px; } .mt-3{ margin-top: 20px; } .mt-4{ margin-top: 30px; }
.mb-0{ margin-bottom: 0; } .mb-1{ margin-bottom: 6px; } .mb-2{ margin-bottom: 12px; } .mb-3{ margin-bottom: 20px; } .mb-4{ margin-bottom: 30px; }
.hidden{ display: none !important; }
.divider{ height: 1px; background: var(--line); margin: 18px 0; }

/* ─────────────── ENTRAR ─────────────── */

.auth-wrap{
  min-height: 100vh; display: grid; place-items: center;
  padding: 24px; background: var(--bg-sunken);
}
.auth-card{
  width: 100%; max-width: 380px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 30px 28px;
}
.auth-brand{ display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-card h1{ font-size: 19px; margin-bottom: 4px; }
.auth-card .page-sub{ margin-bottom: 20px; }

/* ─────────────── ADAPTAÇÃO ─────────────── */

@media (max-width: 1000px){
  .sidebar{
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .2s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open{ transform: none; }
  .sidebar.is-collapsed{ width: var(--sidebar); }
  .sidebar.is-collapsed .brand-text,
  .sidebar.is-collapsed .nav-item span,
  .sidebar.is-collapsed .nav-label,
  .sidebar.is-collapsed .nav-sub,
  .sidebar.is-collapsed .sidebar-user-info{ display: revert; }
  .sidebar-scrim{
    position: fixed; inset: 0; background: rgba(18,20,26,.35); z-index: 39; display: none;
  }
  .sidebar-scrim.on{ display: block; }
  .content{ padding: 20px 16px 70px; }
  .searchbox input{ width: 150px; }
  .searchbox input:focus{ width: 200px; }
}
@media (min-width: 1001px){
  .menu-toggle{ display: none; }
}
@media (max-width: 640px){
  .topbar{ padding: 0 14px; gap: 10px; }
  .crumbs .sep, .crumbs a{ display: none; }
  .page-head{ gap: 12px; }
  .searchbox{ display: none; }
}

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

@media print{
  .sidebar, .topbar, .page-actions, .btn, .copybtn{ display: none !important; }
  .content{ padding: 0; }
  .card{ break-inside: avoid; box-shadow: none; }
}

/* ─────────── CALENDÁRIO ─────────── */

.cal{ border:1px solid var(--line); border-radius: var(--r); overflow:hidden; background:#fff; }
.cal-head{
  display:grid; grid-template-columns: repeat(7, 1fr);
  background: var(--bg-sunken); border-bottom:1px solid var(--line);
}
.cal-head span{
  padding:8px 10px; font-family: var(--mono); font-size:9.5px; letter-spacing:.11em;
  text-transform:uppercase; color: var(--ink-3); font-weight:600;
}
.cal-grid{ display:grid; grid-template-columns: repeat(7, 1fr); }
.cal-day{
  min-height: 116px; border-right:1px solid var(--line-soft); border-bottom:1px solid var(--line-soft);
  padding:7px 8px; position:relative; transition: background .12s;
}
.cal-grid > .cal-day:nth-child(7n){ border-right:0; }
.cal-day.is-empty{ background: var(--bg-sunken); }
.cal-day.is-today{ background: var(--accent-soft); }
.cal-day.is-drop{ background: var(--green-soft); outline:2px dashed var(--green); outline-offset:-3px; }
.cal-num{
  font-family: var(--mono); font-size:11.5px; color: var(--ink-4);
  font-variant-numeric: tabular-nums; display:block; margin-bottom:5px;
}
.cal-day.is-today .cal-num{ color: var(--accent); font-weight:700; }
.cal-item{
  display:block; font-size:11.5px; line-height:1.35;
  padding:4px 6px; border-radius:5px; margin-bottom:3px;
  border-left:3px solid var(--ic, var(--ink-4));
  background: var(--bg-hover); color: var(--ink-2);
  cursor: grab; overflow:hidden; text-overflow:ellipsis;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
.cal-item:hover{ background: var(--bg-active); color: var(--ink); }
.cal-item.is-pub{ opacity:.55; text-decoration: line-through; }
.cal-item.dragging{ opacity:.4; }
.cal-pool{
  display:flex; flex-wrap:wrap; gap:6px;
}
.cal-pool .cal-item{ margin:0; max-width: 230px; }
@media (max-width: 800px){
  .cal-day{ min-height: 82px; padding:5px; }
  .cal-item{ font-size:10.5px; -webkit-line-clamp:1; }
}

/* ─────────── SMART SCHEDULE ─────────── */

.smart{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  border:1px solid var(--line); border-radius: var(--r);
  background: var(--bg-sunken);
  padding:11px 15px; margin-bottom:16px;
  transition: border-color .15s, background .15s;
}
.smart.is-on{ border-color: var(--accent-line); background: var(--accent-soft); }
.smart-text{ display:flex; flex-direction:column; gap:1px; min-width:0; flex:1; }
.smart-name{
  display:flex; align-items:center; gap:5px;
  font-size:12.5px; font-weight:620; letter-spacing:-.01em;
}
.smart.is-on .smart-name{ color: var(--accent); }
.smart-name svg{ opacity:.85; }
.smart-hint{ font-size:12px; color: var(--ink-3); }
.smart-hint b{ font-weight:620; color: var(--ink-2); }
.smart-keep{ flex:none; }
.smart-keep .check-text{ color: var(--ink-2); }
@media (max-width: 700px){
  .smart{ gap:10px; }
  .smart-keep{ width:100%; padding-top:4px !important; border-top:1px solid var(--accent-line); }
}

/* aviso com acção (anular) */
.toast{ display:flex; align-items:center; gap:12px; }
.toast-action{
  background:none; border:0; padding:0; cursor:pointer; font:inherit;
  color:#8FB0FF; font-weight:600; text-decoration:underline; text-underline-offset:2px;
  pointer-events:auto; white-space:nowrap;
}
.toast-action:hover{ color:#fff; }
.toast.has-action{ pointer-events:auto; }

/* conteúdo que acabou de ser deslocado pelo Smart Schedule */
@keyframes puxado{
  0%   { background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
  100% { background: var(--bg-hover);    box-shadow: none; }
}
.cal-item.puxado{ animation: puxado 1.5s var(--ease); }

/* ─────────── O meu contexto · escolha de plataformas ─────────── */

.plataformas{ display: flex; flex-wrap: wrap; gap: 7px; }

.plataforma{
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 13px;
  font-size: 13px; color: var(--ink-3);
  background: var(--bg-sunken); border: 1px solid transparent;
  border-radius: var(--r-full); cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.plataforma:hover{ background: var(--bg-active); }
.plataforma input{ margin: 0; cursor: pointer; }
.plataforma.is-on{
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent-line); font-weight: 540;
}

/* ─────────── o quadro do painel ─────────── */

.quadro{
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px 14px; margin-bottom: 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s;
}
.quadro:focus-within{ border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.quadro-destinos{ display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.destino{
  display: inline-flex; align-items: center; gap: 5px;
  height: 27px; padding: 0 10px;
  font: 500 12px/1 var(--sans); color: var(--ink-3);
  background: var(--bg-sunken); border: 1px solid transparent;
  border-radius: var(--r-full); cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.destino:hover{ background: var(--bg-active); color: var(--ink-2); }
.destino svg{ opacity: .6; }
.destino.is-on{
  background: #fff; color: var(--tc, var(--ink));
  border-color: var(--line-strong); box-shadow: var(--shadow-sm);
}
.destino.is-on svg{ opacity: 1; }

.quadro .textarea{
  border: 0; box-shadow: none !important; padding: 2px;
  font-size: 14.5px; line-height: 1.55; resize: none; min-height: 28px;
}
.quadro .textarea:focus{ outline: none; }

.quadro-fundo{ display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.quadro-numeros{
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
  width: 190px; flex: 0 0 auto; min-height: 26px;
  padding: 5px 8px !important;
  background: var(--bg-sunken); border-radius: var(--r-sm) !important;
}
.quadro-numeros[hidden]{ display: none; }
.quadro-fundo .tiny b{ color: var(--ink-3); font-weight: 600; }

@media (max-width: 640px){
  .quadro-numeros{ width: 100%; }
  .quadro-hint{ display: none; }
}
