@font-face {
  font-family: "HK Grotesk";
  src:
    url("/fonts/hk-grotesk/HKGrotesk-Regular.woff2") format("woff2"),
    url("/fonts/hk-grotesk/HKGrotesk-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "HK Grotesk";
  src:
    url("/fonts/hk-grotesk/HKGrotesk-Medium.woff2") format("woff2"),
    url("/fonts/hk-grotesk/HKGrotesk-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "HK Grotesk";
  src:
    url("/fonts/hk-grotesk/HKGrotesk-SemiBold.woff2") format("woff2"),
    url("/fonts/hk-grotesk/HKGrotesk-SemiBold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "HK Grotesk";
  src:
    url("/fonts/hk-grotesk/HKGrotesk-Bold.woff2") format("woff2"),
    url("/fonts/hk-grotesk/HKGrotesk-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root{
  --bg: #0b1220;
  --bg2: #050a14;

  --panel: rgba(255,255,255,.06);
  --card: rgba(255,255,255,.08);
  --line: rgba(255,255,255,.12);

  --text: rgba(255,255,255,.96);
  --muted: rgba(255,255,255,.68);

  --teal: #5bbab2;
  --teal2: #3aa39a;
  --amber: #feb501;

  --teal-rgb: 91,186,178;
  --amber-rgb: 254,181,1;

  --danger: #ef4444;

  --shadow: 0 16px 60px rgba(0,0,0,.45);
  --radius: 18px;
  --radius2: 14px;

  --font: "HK Grotesk", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
a{ color: inherit; }

html{
  background: transparent !important;
  position: relative;
}

body{
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: transparent !important;
  position: relative;
  z-index: 0;
}

/* Fundo global FIXO */
html::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(var(--teal-rgb),.22), transparent 55%),
    radial-gradient(900px 520px at 90% 0%, rgba(var(--amber-rgb),.16), transparent 60%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

/* =========================
   COMPONENTES BÁSICOS
   ========================= */

.card{
  background: var(--card);
  border: 1px solid rgba(var(--teal-rgb), .55);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.muted{ color: var(--muted); }
.tiny{ font-size: 12px; }
.mono{ font-variant-numeric: tabular-nums; }

.btn,
.primary,
.ghost{
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}

.btn:disabled,
.primary:disabled{
  opacity: .6;
  cursor: not-allowed;
}

.primary{
  background: linear-gradient(180deg, var(--teal) 0%, var(--teal2) 100%);
  color: #05210f;
}

.primary:hover{ filter: brightness(1.03); }

.ghost{
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.90);
}

.ghost:hover{
  border-color: rgba(var(--teal-rgb),.45);
  background: rgba(0,0,0,.28);
}

input, select, textarea{
  font-family: var(--font);
}

/* =========================
   INDEX / LOGIN
   (mantém o "esqueleto" do legacy: header + card centrado + grid 2 cols no desktop)
   ========================= */

body.varsForm{
  /* layout (legacy) */
  --bar-h: 86px;

  margin: 0;
  min-height: 100vh;
  color: var(--text);

  padding-bottom: 16px; /* index não usa .bar; deixa discreto */
}

body.varsForm header{
  padding: 22px 16px 8px;
}

body.varsForm .title{
  font-size: 34px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: -.02em;
}

body.varsForm main{
  padding: 12px 16px 40px;
  max-width: 560px;
  margin: 0 auto;
}

body.varsForm .card{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(var(--teal-rgb), .55);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}

body.varsForm .card h2{
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,.92);
}

body.varsForm .grid{
  display: grid;
  gap: 10px;
}

body.varsForm .field{
  padding: 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(0,0,0,.20);
  position: relative;
}

body.varsForm label{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  color: rgba(255,255,255,.78);
  font-weight: 650;
  font-size: 14px;
}

body.varsForm input,
body.varsForm select{
  width: 100%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.92);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 15px;
  outline: none;
}

body.varsForm input::placeholder{
  color: rgba(255,255,255,.35);
}

body.varsForm input:focus,
body.varsForm select:focus{
  border-color: rgba(var(--teal-rgb),.55);
  box-shadow: 0 0 0 4px rgba(var(--teal-rgb),.18);
}

body.varsForm .note{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

body.varsForm .actionsRow{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body.varsForm .actionsRow .primary,
body.varsForm .actionsRow .ghost{
  flex: 1 1 180px;
  height: 44px;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 12px;
}

/* Mesmo que o body tenha varsForm--light no HTML, o login fica no tema escuro (pedido). */
body.varsForm.varsForm--light{
  color: var(--text);
}

@media (min-width: 900px){
  body.varsForm main{ max-width: 920px; }
  body.varsForm .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================
   APP (páginas internas) — base reutilizável
   ========================= */

.page-app{
  position: relative;
}

/* Marca d'água fixa (padrão v1) */
.page-app::before,
.page-dashboard::before{
  content:"";
  position: fixed;
  inset: 0;
  background-image: url("/images/logoCores.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(60vw, 620px);
  opacity: .08;
  pointer-events: none;
  z-index: -1;
}

.page-app > *,
.page-dashboard > *{
  position: relative;
  z-index: 1;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(5,10,20,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(var(--teal-rgb), .55);
}

.topbar::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-1px;
  height:2px;
  background: linear-gradient(90deg, rgba(var(--teal-rgb),.85), rgba(var(--amber-rgb),.85));
  pointer-events:none;
  opacity:.9;
}

.topbar__left,
.topbar__right{
  display:flex;
  align-items:center;
  gap:12px;
}

.brand{
  display:flex;
  flex-direction: column;
  line-height: 1;
}

.brand__name{
  font-size: 20px;
  font-weight: 400;
  letter-spacing: .2px;
}
.brand__sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.brand__logo{
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-left: 4px;
  margin-right: 2px;
  opacity: .95;
}

.iconbtn{
  height: 40px;
  width: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.20);
  color: rgba(255,255,255,.90);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.iconbtn:hover{ background: rgba(0,0,0,.28); }
.iconbtn:active{ transform: translateY(1px); }

.hamburger{
  width: 18px;
  height: 12px;
  position: relative;
  display: block;
}
.hamburger::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height:2px;
  border-radius:2px;
  background: rgba(255,255,255,.90);
  box-shadow: 0 5px 0 rgba(255,255,255,.90), 0 10px 0 rgba(255,255,255,.90);
}

.userpill{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  max-width: 220px;
}
.userpill__dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(var(--teal-rgb),.18);
  flex: 0 0 auto;
}
.userpill__name{
  font-size: 13px;
  color: rgba(255,255,255,.90);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scrim{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 49;
}

.drawer{
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(320px, 86vw);
  background: rgba(5,10,20,.96);
  border-right: 1px solid rgba(var(--teal-rgb), .55);
  box-shadow: var(--shadow);
  transform: translateX(-110%);
  transition: transform .18s ease;
  z-index: 50;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.drawer.is-open{ transform: translateX(0); }

.drawer__header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 6px 6px 8px;
}
.drawer__title{
  font-size: 24px;
  font-weight: 600;
}
.drawer__nav{
  display:flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
}
.drawer__link{
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(var(--amber-rgb), .85);
  background: rgba(0,0,0,.18);
  text-decoration: none;
}
.drawer__link:hover{
  border-color: rgba(var(--teal-rgb),.45);
  background: rgba(var(--teal-rgb),.10);
}

.page{
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.pagehead{
  display:flex;
  align-items:flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 14px;
}
.pagehead h1{
  margin: 0;
  font-size: 42px;
  letter-spacing: -0.01em;
}
.pagehead p{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.pagehead__right{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tableCard{
  border: 1px solid rgba(var(--teal-rgb), .55);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.06);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
  overflow: hidden;
}

.tableScroll{
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

table{
  width: 100%;
  border-collapse: collapse;
}

th, td{
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}

th{
  background: rgba(var(--teal-rgb),.12);
  color: rgba(255,255,255,.92);
  font-size: 12px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

tr:last-child td{ border-bottom: 0; }

@media (max-width: 980px){
  .userpill{ max-width: 140px; }
}


/* =========================
   COMPAT: HEADER LEGADO DO DASHBOARD
   (se o dashboard ainda tiver <header class="topHeader">..., ele fica com a mesma identidade do topbar novo)
   ========================= */

.topHeader{
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: rgba(5,10,20,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(var(--teal-rgb), .55);
}

.topHeader::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-1px;
  height:2px;
  background: linear-gradient(90deg, rgba(var(--teal-rgb),.85), rgba(var(--amber-rgb),.85));
  pointer-events:none;
  opacity:.9;
}

.topHeaderInner{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

.topActions{
  display:flex;
  align-items:center;
  gap: 10px;
}

.topTitle{
  font-size: 18px;
  font-weight: 650;
  color: rgba(255,255,255,.92);
  text-align: center;
}

.topBack{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.20);
  color: rgba(255,255,255,.90);
  text-decoration:none;
  font-weight: 700;
}

.topBack:hover{
  border-color: rgba(var(--teal-rgb),.45);
  background: rgba(0,0,0,.28);
}

/* Novo: classe para o centro do topbar, se você quiser tirar inline-style depois */
.topbar__center{
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 1;
}

/* Evita que elementos do topo fiquem "colados" na borda em páginas legadas */
.dashboard .wrap{
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}
