:root{
  --bg: #f6f8fc;
  --surface: rgba(255,255,255,.75);
  --surface-solid: #ffffff;
  --text: #0c1220;
  --muted: rgba(12,18,32,.65);
  --border: rgba(12,18,32,.10);
  --shadow: 0 12px 35px rgba(12,18,32,.10);

  --primary: #2563eb;
  --primary-2: #5b8cff;

  --danger: #ef4444;
  --radius: 18px;
  --radius-2: 26px;

  --blur: 16px;
  --max: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", "Noto Sans", "Liberation Sans", sans-serif;
}

html, body { height: 100%; }
body{
  margin:0;
  font-family: var(--font);
  background:
    radial-gradient(900px 380px at 10% 0%, rgba(37,99,235,.18), transparent 55%),
    radial-gradient(900px 380px at 90% 0%, rgba(91,140,255,.14), transparent 55%),
    var(--bg);
  color: var(--text);
}

*{ box-sizing: border-box; }
a{ color: inherit; }

.app{ min-height:100%; display:flex; flex-direction:column; }
.main{ flex:1; display:flex; }

/* ===== Topbar (mini) =====
   Fica flutuando no topo (não empurra o conteúdo).
   Mantém só o avatar no canto superior direito.
*/
.topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;

  display: flex;
  align-items: center;
  justify-content: flex-end;

  height: 52px;
  padding: 10px 14px;

  /* visual discreto */
  border-bottom: none;
  background: transparent;
  backdrop-filter: none;
}

.brand{ display:flex; gap:12px; align-items:center; }
.brand-mark{
  width:42px; height:42px;
  border-radius: 14px;
  display:grid; place-items:center;
  color:#fff;
  font-weight:800;
  letter-spacing:.6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 28px rgba(37,99,235,.25);
}
.brand-title{ font-weight:800; line-height:1.05; }
.brand-subtitle{ font-size:12px; color: var(--muted); margin-top:2px; }

.topbar-actions{ display:flex; align-items:center; gap:10px; }

.user-pill{
  display:flex; gap:10px; align-items:center;
  padding: 8px 10px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.7);
  border-radius: 999px;
  backdrop-filter: blur(var(--blur));
}
.avatar{
  width:34px; height:34px;
  border-radius: 999px;
  display:grid; place-items:center;
  font-weight:700;
  background: rgba(37,99,235,.12);
  border:1px solid rgba(37,99,235,.18);
}
.user-name{ font-weight:700; font-size:13px; }
.user-role{ font-size:12px; color: var(--muted); margin-top:1px; }

.view{ width:100%; padding: 18px; }

.container{ width:100%; max-width: var(--max); margin: 0 auto; }

.auth-grid{
  width:100%;
  max-width: var(--max);
  margin: 28px auto;
  display:grid;
  grid-template-columns: 420px 1fr;
  gap: 18px;
}
@media (max-width: 960px){
  .auth-grid{ grid-template-columns: 1fr; }
  .auth-side{ display:none; }
  .hide-sm{ display:none; }
}

.auth-card{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  border-radius: var(--radius-2);
  padding: 22px;
}

.auth-header h1{ margin:0 0 6px 0; font-size: 28px; }
.auth-header p{ margin:0 0 18px 0; color: var(--muted); }

.form{ display:flex; flex-direction:column; gap: 12px; }
.field{ display:flex; flex-direction:column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input{
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 0 12px;
  outline:none;
  background: rgba(255,255,255,.85);
  color: var(--text);
}
.field input:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.btn{
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.7);
  color: var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 0 14px;
  font-weight:700;
}
.btn:disabled{ opacity:.55; cursor:not-allowed; }
.btn.primary{
  border: none;
  color:#fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 28px rgba(37,99,235,.22);
}
.btn.ghost{ background: transparent; }
.btn.link{
  background: transparent;
  border: none;
  color: rgba(37,99,235,.95);
  height: auto;
  padding: 0;
  justify-content:flex-start;
}
.btn.danger{
  border: 1px solid rgba(239,68,68,.25);
  background: rgba(239,68,68,.10);
  color: #b91c1c;
}

.alert{
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(239,68,68,.22);
  background: rgba(239,68,68,.08);
  color: #991b1b;
  font-size: 13px;
}

.auth-side .glass{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  border-radius: var(--radius-2);
  padding: 22px;
  height: 100%;
}
.auth-side h2{ margin:0 0 10px 0; font-size: 26px; }
.auth-side p{ margin:0 0 16px 0; color: var(--muted); line-height: 1.55; }
.bullets{ margin:0; padding-left: 18px; color: var(--muted); line-height:1.9; }
.hint{
  margin-top: 16px;
  display:flex;
  gap:10px;
  align-items:flex-start;
  color: var(--muted);
  font-size: 13px;
}
.dot{
  width:10px; height:10px; border-radius:99px;
  background: rgba(37,99,235,.35);
  box-shadow: 0 0 0 6px rgba(37,99,235,.10);
  margin-top: 4px;
}

.page-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-top: 6px;
  margin-bottom: 14px;
}
.page-header h1{ margin:0; font-size: 28px; }
.muted{ color: var(--muted); margin: 6px 0 0 0; }

.chips{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.chip{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.7);
  color: rgba(12,18,32,.75);
  font-size: 12px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.card{
  grid-column: span 4;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor:pointer;
  position:relative;
  overflow:hidden;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 45px rgba(12,18,32,.12);
}
.card .title{ font-weight:800; margin:0; }
.card .desc{ color: var(--muted); margin: 6px 0 0 0; line-height:1.45; font-size: 13px; }
.card .meta{ margin-top: 12px; display:flex; gap:8px; flex-wrap:wrap; }
.badge{
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.7);
}

@media (max-width: 980px){
  .card{ grid-column: span 6; }
}
@media (max-width: 620px){
  .card{ grid-column: span 12; }
}

.panel{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 16px;
}

.footer-note{
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  display:flex; gap:10px; align-items:center;
}
.kbd{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.7);
  padding: 6px 8px;
  border-radius: 10px;
  font-weight: 800;
}

/* ===== Modais ===== */
.modal{ position:fixed; inset:0; z-index:50; display:block; }
.modal[hidden]{ display:none; }
.modal-backdrop{
  position:absolute; inset:0;
  background: rgba(12,18,32,.45);
  backdrop-filter: blur(6px);
}
.modal-card{
  position:relative;
  width: min(820px, calc(100% - 24px));
  margin: 60px auto;
  border-radius: var(--radius-2, 18px);
  border: 1px solid var(--border, rgba(12,18,32,.10));
  background: rgba(255,255,255,.92);
  box-shadow: 0 22px 70px rgba(12,18,32,.22);
  overflow:hidden;
}
.modal-header{
  padding: 16px 16px 10px 16px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border-bottom: 1px solid var(--border, rgba(12,18,32,.10));
}
.modal-header h2{ margin:0; }
.modal-body{ padding: 14px 16px; }
.modal-footer{
  padding: 14px 16px;
  border-top: 1px solid var(--border, rgba(12,18,32,.10));
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
.panel.subtle{
  background: rgba(12,18,32,.02);
  border: 1px dashed rgba(12,18,32,.14);
}

/* ===== Chips selecionáveis ===== */
.chips-select{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding: 10px;
  border: 1px solid rgba(12,18,32,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.65);
}
.chip-option{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(12,18,32,.14);
  background: rgba(255,255,255,.9);
  cursor:pointer;
  user-select:none;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
  font-size: 13px;
}
.chip-option:hover{ transform: translateY(-1px); }
.chip-option .dot{
  width: 8px; height: 8px;
  border-radius: 999px;
  background: rgba(12,18,32,.35);
}
.chip-option.selected{
  border-color: rgba(249,115,22,.45);
  background: rgba(249,115,22,.10);
}
.chip-option.selected .dot{
  background: rgba(249,115,22,.95);
}
.badge.small{
  font-size: 11px;
  padding: 4px 8px;
}

/* ===== Table ===== */
.table table{ width:100%; border-collapse: collapse; }
.table th, .table td{ padding: 10px 10px; border-bottom: 1px solid rgba(12,18,32,.08); text-align:left; }
.table th{ font-size: 12px; color: rgba(12,18,32,.65); }
.table td{ font-size: 13px; }
.action-row{ display:flex; gap:8px; }
.btn.sm{ padding: 6px 10px; font-size: 12px; border-radius: 12px; }



/* =========================
   LOGIN (split modern)
   ========================= */
.login-split{
  min-height: 100vh;
  display: grid;
  grid-template-columns: 30% 70%; /* login / roxo */
  background: #fff;
}


.login-left{
  padding: 48px 12px 48px 32px; /* menos espaço à direita para encostar no roxo */
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  align-items: flex-start; /* card e textos “colam” mais no painel roxo */
}

.login-brand{
  width: 100%;
  display: flex;
  justify-content: center; /* CENTRALIZA o logo */
  margin-bottom: 24px;
}

/* Logo imagem (substitui o badge de texto) */
.login-logo-img{
  width: 300px;
  max-width: 100%;
  height: auto;
  display: block;
}

.logo-badge{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  box-shadow: 0 10px 25px rgba(12,18,32,.06);
}
.logo-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #5b5bd6;
  box-shadow: 0 0 0 6px rgba(91,91,214,.15);
}
.logo-text{
  font-weight: 800;
  letter-spacing: .2px;
}

.login-head h1{
  margin: 0;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.login-head .muted{ margin-top: 8px; }

.login-card{
  width: 100%;
  max-width: 520px;
  padding: 26px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  box-shadow: 0 18px 45px rgba(12,18,32,.10);
}

.pwd-wrap{
  position: relative;
  display:block; /* evita o input encolher */
}
.pwd-wrap input{
  width: 100%;
  padding-right: 46px; /* espaço pro olho */
}
.pwd-toggle{
  position:absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
  opacity: .75;
}
.pwd-toggle:hover{ opacity: 1; }


.login-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-top: 6px;
  margin-bottom: 14px;
}

.check{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  color: rgba(12,18,32,.75);
}
.check input{ width: 16px; height: 16px; }

.link-btn{
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #5b5bd6;
}
.link-btn:hover{ text-decoration: underline; }

.login-btn{
  width: 100%;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: #5b5bd6;
}
.login-btn:hover{ filter: brightness(1.03); }

.login-note{
  margin-top: 14px;
  font-size: 12px;
}

.login-right{
  background: radial-gradient(1200px 900px at 30% 20%, rgba(255,255,255,.18), transparent 50%),
              linear-gradient(135deg, #5b5bd6, #6a5cff 55%, #5b8cff);
  padding: 0; /* menos espaço à esquerda */
  display:flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
}

.login-illustration{
  width: min(720px, 90%);
  border-radius: 20px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 20px 55px rgba(0,0,0,.18);
  padding: 18px;
}
.login-illustration img{
  width: 100%;
  height: auto;
  display:block;
  border-radius: 14px;
}

.login-right-text{
  text-align:center;
  color: rgba(255,255,255,.92);
}
.login-right-title{
  font-weight: 900;
  font-size: 20px;
  letter-spacing: .2px;
}
.login-right-sub{
  margin-top: 6px;
  font-weight: 600;
  font-size: 14px;
  color: rgba(255,255,255,.78);
}

@media (max-width: 980px){
  .login-split{ grid-template-columns: 1fr; }
  .login-right{ display:none; }
  .login-left{ padding: 34px 18px; align-items: stretch; }
  .login-card{ max-width: 520px; }
}


.is-login .topbar{ display:none; }

.login-left > *{
  width: 100%;
  max-width: 520px;
}

.field input{ width:100%; }


.result-card{
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(12,18,32,.10);
  background: rgba(255,255,255,.88);
  box-shadow: 0 18px 45px rgba(12,18,32,.08);
}

.result-card.hidden{ display:none; }

.result-card.success{
  border-color: rgba(46, 204, 113, .35);
  background: rgba(46, 204, 113, .08);
}

.result-card.error{
  border-color: rgba(231, 76, 60, .35);
  background: rgba(231, 76, 60, .08);
}

.result-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.result-title h4{
  margin:0;
  font-size: 14px;
  font-weight: 900;
}

.result-body{
  font-size: 13px;
  color: rgba(12,18,32,.85);
  line-height: 1.35;
}

.result-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.kv{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  justify-content:space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(12,18,32,.08);
}

.kv b{ font-size: 12px; color: rgba(12,18,32,.65); }
.kv code{
  font-size: 12px;
  word-break: break-all;
  color: rgba(12,18,32,.92);
}

.result-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn-mini{
  border: 1px solid rgba(12,18,32,.10);
  background: rgba(255,255,255,.75);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 800;
  font-size: 13px;
}

.btn-mini.primary{
  background: #5b5bd6;
  border-color: rgba(91,91,214,.35);
  color: #fff;
}

.btn-mini:hover{ filter: brightness(1.03); }


/* =========================
   MODAL EMPRESA - POLIMENTO
   ========================= */

/* deixa o header mais alinhado e com “respiro” */
.modal-header{
  align-items: center;
}

.modal-header-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

/* botão X do modal (se estiver usando classe btn-ghost no X) */
.btn.btn-ghost{
  border: 1px solid rgba(12,18,32,.10);
  background: rgba(255,255,255,.75);
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 14px;
  display:grid;
  place-items:center;
}
.btn.btn-ghost:hover{
  background: rgba(12,18,32,.04);
  border-color: rgba(12,18,32,.14);
}

/* =========================
   BOTÕES (compatibilidade com app.js)
   ========================= */

.btn.btn-secondary{
  border: 1px solid rgba(12,18,32,.12);
  background: rgba(255,255,255,.70);
  color: rgba(12,18,32,.88);
}
.btn.btn-secondary:hover{
  background: rgba(12,18,32,.03);
}

.btn.btn-danger{
  border: 1px solid rgba(239,68,68,.25);
  background: rgba(239,68,68,.10);
  color: #b91c1c;
}
.btn.btn-danger:hover{
  background: rgba(239,68,68,.14);
}

/* =========================
   BADGES (status)
   ========================= */

.badge-success{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34,197,94,.25);
  background: rgba(34,197,94,.10);
  color: rgba(12,18,32,.88);
}
.badge-danger{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(239,68,68,.25);
  background: rgba(239,68,68,.10);
  color: rgba(153,27,27,.95);
}

/* bolinha antes do texto do badge (opcional, fica lindo) */
.badge-success::before,
.badge-danger::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  display:inline-block;
  background: currentColor;
  opacity:.7;
}

/* =========================
   TABELA - mais bonita
   ========================= */

/* garante scroll horizontal no mobile */
.table{
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(12,18,32,.10);
  background: rgba(255,255,255,.65);
}

/* tabela mais “clean” */
.table table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px; /* evita quebrar colunas no modal */
}

.table th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(246,248,252,.92);
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: rgba(12,18,32,.65);
}

.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(12,18,32,.06);
}

/* zebra + hover */
.table tbody tr:nth-child(even){
  background: rgba(12,18,32,.015);
}
.table tbody tr:hover{
  background: rgba(37,99,235,.05);
}

/* =========================
   CÉLULA COM TÍTULO + SUBTEXTO
   (se o app.js renderizar <div class="cell-main"> e <div class="cell-sub">)
   ========================= */

.cell-main{
  font-weight: 800;
  color: rgba(12,18,32,.92);
  line-height: 1.15;
}
.cell-sub{
  margin-top: 2px;
  font-size: 12px;
  color: rgba(12,18,32,.60);
  line-height: 1.2;
}

/* =========================
   AÇÕES - ícones e botões pequenos
   ========================= */

.actions{
  display:flex;
  gap:8px;
  justify-content:flex-start;
  align-items:center;
}

.btn.sm{
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 12px;
}

/* input pequeno caso use class="input small" */
.input.small{
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(12,18,32,.12);
  padding: 0 10px;
  background: rgba(255,255,255,.85);
  outline: none;
}
.input.small:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}



/* =========================
   APP LAYOUT (SIDEBAR + CONTENT)
   ========================= */

.main{
  flex: 1;
  display: flex;
  align-items: stretch;
}

/* esconde menu no login */
.is-login .sidebar{ display:none !important; }

/* Sidebar */
.sidebar{
  width: 76px; /* recolhido */
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(var(--blur));
  position: sticky;
  top: 0;
  height: calc(100vh - 0px);
  overflow: hidden;
  transition: width .18s ease;
}
.sidebar:not([hidden]){ display:block; }
.sidebar[hidden]{ display:none; }

.sidebar.expanded{ width: 260px; }

.sidebar-inner{
  height: 100%;
  display:flex;
  flex-direction: column;
  padding: 10px 10px;
  gap: 10px;
}

.sidebar-top{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 6px 6px 10px 6px;
}

.icon-btn{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(12,18,32,.10);
  background: rgba(255,255,255,.78);
  cursor:pointer;
  display:grid;
  place-items:center;
  font-weight: 900;
}
.icon-btn:hover{
  background: rgba(12,18,32,.04);
  border-color: rgba(12,18,32,.14);
}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.sidebar-brand-logo{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: contain;
  border: 1px solid rgba(12,18,32,.10);
  background: rgba(255,255,255,.65);
  padding: 6px;
}
.sidebar-brand-text{
  display:none;
  min-width: 0;
}
.sidebar.expanded .sidebar-brand-text{ display:block; }

.sidebar-brand-title{
  font-weight: 900;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-brand-sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Nav items */
.sidebar-nav{
  display:flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 4px 10px 4px;
}

.nav-item{
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  cursor:pointer;
  border-radius: 16px;
  padding: 10px 10px;
  display:flex;
  align-items:center;
  gap: 12px;
  position: relative;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
  color: rgba(12,18,32,.88);
}

.nav-item:hover{
  background: rgba(37,99,235,.08);
  border-color: rgba(37,99,235,.18);
  transform: translateY(-1px);
}

.nav-item.active{
  background: rgba(37,99,235,.12);
  border-color: rgba(37,99,235,.22);
}

.nav-ico{
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: saturate(1.05);
}

.nav-label{
  display:none;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.expanded .nav-label{
  display:block;
}

/* tooltip (quando recolhido) */
.sidebar:not(.expanded) .nav-item::after{
  content: attr(data-tooltip);
  position: absolute;
  left: 66px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(12,18,32,.92);
  color: #fff;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  box-shadow: 0 18px 45px rgba(12,18,32,.18);
}
.sidebar:not(.expanded) .nav-item:hover::after{
  opacity: 1;
  transform: translateY(-50%) translateX(4px);
}

/* separador */
.sidebar-sep{
  height: 1px;
  background: rgba(12,18,32,.08);
  margin: 6px 6px;
}

/* Conteúdo */
.content{
  flex: 1;
  min-width: 0;
}

/* Ajuste para área view existente */
.view{
  width: 100%;
  padding: 18px;
}

/* Avatar com imagem */
.avatar{
  overflow:hidden;
  padding: 0;
}
.avatar-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}


/* ===== Layout tweaks (jan/2026) ===== */
.topbar{
  padding: 10px 16px;
}
.brand .brand-title{
  font-size: 14px;
  line-height: 1.2;
}
.brand .brand-sub{
  font-size: 12px;
  margin-top: 2px;
}
.user-pill{
  padding: 6px 10px;
}
.user-avatar{
  width: 36px;
  height: 36px;
}
.sidebar{
  cursor: pointer; /* clique na barra alterna expandir/recolher */
}
.sidebar .nav-item{
  cursor: pointer;
}
.sidebar-top{
  padding-bottom: 4px;
}


/* ===== Topbar minimal ===== */
.topbar-left{ display:none; }
.topbar-right{ display:flex; align-items:center; gap:10px; margin-left:auto; }


.avatar-btn{
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
}
.avatar-btn:focus-visible{
  outline: 0;
  box-shadow: 0 0 0 4px rgba(37,99,235,.18);
}

/* ===== Sidebar icons: allow SVG too ===== */
.nav-ico-svg{
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: currentColor;
  opacity: .9;
}

/* logout visual */
.nav-item.danger{
  color: rgba(153,27,27,.92);
}
.nav-item.danger:hover{
  background: rgba(239,68,68,.10);
}


/* =========================
   USER AVATAR DROPDOWN
   ========================= */

.user-menu{
  position: relative;
}

.avatar-btn{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(12,18,32,.10);
  background: rgba(255,255,255,.75);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}
.avatar-btn:hover{
  border-color: rgba(12,18,32,.16);
  background: rgba(255,255,255,.92);
}
.avatar-btn:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.avatar-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.avatar-fallback{
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: rgba(12,18,32,.85);
  user-select: none;
}

.dropdown{
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 200px;
  border-radius: 16px;
  border: 1px solid rgba(12,18,32,.10);
  background: rgba(255,255,255,.95);
  box-shadow: 0 20px 45px rgba(12,18,32,.12);
  padding: 8px;
  display: none;
  z-index: 80;
}

.dropdown.open{
  display: block;
  animation: dropdownIn .12s ease-out;
}

@keyframes dropdownIn{
  from{ opacity: 0; transform: translateY(-6px) scale(.98); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item{
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: rgba(12,18,32,.85);
  font-weight: 650;
  text-align: left;
}
.dropdown-item:hover{
  background: rgba(37,99,235,.08);
}
.dropdown-item.danger{
  color: rgba(153,27,27,.95);
}
.dropdown-item.danger:hover{
  background: rgba(239,68,68,.10);
}

.dropdown-ico{
  width: 22px;
  display: grid;
  place-items: center;
  color: currentColor;
  opacity: .9;
}

.dropdown-sep{
  height: 1px;
  background: rgba(12,18,32,.08);
  margin: 6px 6px;
}


/* ===== PATCH: topbar sem faixa, avatar fixo no canto superior direito ===== */
.topbar{
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 0; /* remove a faixa superior */
  padding: 0;
  border: 0;
  background: transparent;
  z-index: 60;
}
.topbar-left{ display:none !important; }
.topbar-right{
  position: fixed;
  top: 14px;
  right: 14px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 10px;
}
.user-menu{ position: relative; }

/* ===== Ajuste vertical do header do dashboard ===== */

.page-header{
  margin-top: 40px; /* desce título + subtítulo */
}

.page-header h1{
  margin-bottom: 6px;
}

.page-header p{
  margin-bottom: 24px; /* distância até o card */
}


/* ===== Perfil (modal editar perfil) ===== */
.profile-modal{
  max-width: 720px;
}

.profile-grid{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 720px){
  .profile-grid{
    grid-template-columns: 1fr;
  }
}

.avatar-preview{
  width: 140px;
  height: 140px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.55);
  border: 4px solid rgba(255,255,255,.75);
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
  overflow: hidden;
}

.avatar-preview img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none; /* o JS ativa quando tiver URL */
}

.avatar-preview span{
  font-weight: 800;
  font-size: 28px;
  color: rgba(12,18,32,.75);
}

.profile-photo-actions{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
