/* hub.css — A2 — Design system Hub Contractor (Jardins de Victoria)
   Dark-only v1 · verde profundo + dourado · mobile-first */

/* ============ tokens ============ */
:root {
  --bg: #0b1510;
  --bg2: #0f1d15;
  --bg3: #0a120d; /* superfície mais funda (pre, stage de plantas) */
  --card: #132419cc;
  --line: #1f3527;
  --gold: #c9a961;
  --gold2: #e3c98a;
  --ink: #e8ede9;
  --ink-dim: #9fb0a6;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 232px;
  --sidebar-w-min: 72px;
  --topbar-h: 60px;
  --bnav-h: 62px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --t: 150ms ease;
}

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

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

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(201, 169, 97, 0.05), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(31, 53, 39, 0.5), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100dvh;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.25;
}
h1 { font-size: 1.35rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 0.9em; }

a { color: var(--gold2); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: rgba(31, 53, 39, 0.55);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}
pre {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  overflow-x: auto;
}
pre code { background: none; border: 0; padding: 0; }

img { max-width: 100%; }

/* highlight de busca (oráculo, vault) — dourado sobre o dark, não o amarelo default */
mark {
  background: rgba(201, 169, 97, 0.25);
  color: var(--gold2);
  border-radius: 3px;
  padding: 0 2px;
}

::selection { background: rgba(201, 169, 97, 0.3); }

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

/* scrollbar sutil */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============ banner MODO DEV ============ */
.dev-banner {
  position: sticky;
  top: 0;
  z-index: 90;
  background: repeating-linear-gradient(-45deg, #3d2f10, #3d2f10 12px, #46370f 12px, #46370f 24px);
  color: var(--warn);
  border-bottom: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 5px 10px;
}

/* ============ shell / layout ============ */
.shell { display: flex; min-height: 100dvh; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100dvh;
  width: var(--sidebar-w);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 12px;
  background: linear-gradient(180deg, rgba(15, 29, 21, 0.92), rgba(11, 21, 16, 0.92));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.has-dev-banner .sidebar { height: calc(100dvh - 28px); top: 28px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mono {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--gold2);
  border: 1px solid rgba(201, 169, 97, 0.45);
  border-radius: 10px;
  background: radial-gradient(circle at 30% 20%, rgba(201, 169, 97, 0.14), transparent 70%);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub { font-size: 0.68rem; color: var(--ink-dim); letter-spacing: 0.05em; }

.sidenav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-dim);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.nav-item .icon { flex: 0 0 auto; opacity: 0.9; }
.nav-item:hover { background: rgba(31, 53, 39, 0.45); color: var(--ink); text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(201, 169, 97, 0.13), rgba(201, 169, 97, 0.04));
  border-color: rgba(201, 169, 97, 0.35);
  color: var(--gold2);
}

.side-foot { border-top: 1px solid var(--line); padding-top: 8px; }
.side-foot form { margin: 0; }
.nav-logout:hover { color: var(--err); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 10px clamp(14px, 3vw, 28px);
  background: rgba(11, 21, 16, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.has-dev-banner .topbar { top: 28px; }
.page-title { margin: 0; font-size: 1.15rem; letter-spacing: 0.02em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.logout-form { margin: 0; }

.content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1200px;
  padding: clamp(16px, 3vw, 28px);
  margin: 0 auto;
}

/* ============ botões ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  min-height: 38px;
  font: 600 0.9rem var(--font);
  letter-spacing: 0.02em;
  color: var(--ink);
  background: rgba(31, 53, 39, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t), box-shadow var(--t);
  user-select: none;
}
.btn:hover { background: rgba(31, 53, 39, 0.85); border-color: #2b4936; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-gold {
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  border-color: var(--gold);
  color: #14200f;
}
.btn-gold:hover {
  background: linear-gradient(180deg, #eed9a0, var(--gold2));
  border-color: var(--gold2);
  box-shadow: 0 4px 18px rgba(201, 169, 97, 0.25);
}

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-dim); }
.btn-ghost:hover { background: rgba(31, 53, 39, 0.5); color: var(--ink); border-color: var(--line); }

.btn-danger { border-color: rgba(248, 113, 113, 0.4); color: var(--err); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); border-color: var(--err); }

.btn-sm { padding: 5px 10px; min-height: 30px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; min-height: 48px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; min-width: 38px; }

/* ============ inputs / forms ============ */
.input, select.input, textarea.input {
  width: 100%;
  padding: 11px 13px;
  min-height: 44px;
  font: 400 0.95rem var(--font);
  color: var(--ink);
  background: rgba(15, 29, 21, 0.75);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: rgba(159, 176, 166, 0.55); }
.input:hover { border-color: #2b4936; }
.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.18);
  background: rgba(15, 29, 21, 0.95);
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }

.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.field-hint { font-size: 0.78rem; color: var(--ink-dim); margin-top: 4px; }

/* ============ card ============ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(14px, 2.5vw, 20px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
a.card { display: block; color: inherit; }
a.card:hover, .card.card-link:hover {
  text-decoration: none;
  border-color: rgba(201, 169, 97, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 10px;
}

/* ============ grid ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.grid-tight { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ============ kpi ============ */
.kpi { text-align: left; }
.kpi-num {
  display: block;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--gold2);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-top: 4px;
}
.kpi-sub { font-size: 0.8rem; color: var(--ink-dim); margin-top: 6px; }

/* ============ chips ============ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-dim);
  background: rgba(31, 53, 39, 0.5);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.chip-admin { color: var(--gold2); border-color: rgba(201, 169, 97, 0.45); background: rgba(201, 169, 97, 0.1); }
.chip-viewer { color: var(--ink-dim); }
.chip-ok { color: var(--ok); border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.08); }
.chip-warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.chip-err { color: var(--err); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.chip-user { padding: 5px 12px; }
.chip-role {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  border-left: 1px solid currentColor;
  padding-left: 6px;
  margin-left: 2px;
}

/* ============ tabelas ============ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(15, 29, 21, 0.5);
  -webkit-overflow-scrolling: touch;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 480px; }
.table th, .table td {
  padding: 9px 13px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td.wrap, .table th.wrap { white-space: normal; }
.table th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: rgba(15, 29, 21, 0.9);
  position: sticky;
  top: 0;
}
.table tbody tr { transition: background var(--t); }
.table tbody tr:hover { background: rgba(31, 53, 39, 0.35); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============ file-row / listas de arquivos ============ */
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  transition: background var(--t), border-color var(--t);
}
.file-row:last-child { border-bottom-color: transparent; }
.file-row:hover { background: rgba(31, 53, 39, 0.4); text-decoration: none; }
.file-row .icon { flex: 0 0 auto; color: var(--gold); opacity: 0.85; }
.file-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-meta { flex: 0 0 auto; font-size: 0.78rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.file-list { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: rgba(15, 29, 21, 0.5); }

/* ============ breadcrumbs ============ */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.breadcrumbs a { color: var(--ink-dim); }
.breadcrumbs a:hover { color: var(--gold2); }
.breadcrumbs .sep { opacity: 0.45; margin: 0 2px; }
.breadcrumbs .current { color: var(--ink); font-weight: 600; }

/* ============ callouts ============ */
.callout {
  position: relative;
  margin: 0.9rem 0;
  padding: 12px 16px 12px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-dim);
  border-radius: var(--radius-sm);
  background: rgba(31, 53, 39, 0.32);
  font-size: 0.92rem;
}
.callout > :last-child { margin-bottom: 0; }
.callout-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.callout-summary { border-left-color: var(--gold); background: rgba(201, 169, 97, 0.07); }
.callout-summary .callout-title { color: var(--gold2); }
.callout-info { border-left-color: #60a5fa; background: rgba(96, 165, 250, 0.07); }
.callout-info .callout-title { color: #93c5fd; }
.callout-warning { border-left-color: var(--warn); background: rgba(251, 191, 36, 0.07); }
.callout-warning .callout-title { color: var(--warn); }
.callout-todo { border-left-color: var(--ok); background: rgba(74, 222, 128, 0.06); }
.callout-todo .callout-title { color: var(--ok); }
.callout-danger, .callout-error { border-left-color: var(--err); background: rgba(248, 113, 113, 0.07); }
.callout-danger .callout-title, .callout-error .callout-title { color: var(--err); }

/* ============ searchbar ============ */
.searchbar {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 16px;
}
.searchbar .input { flex: 1 1 auto; }
.searchbar .btn { flex: 0 0 auto; }

/* ============ empty state ============ */
.empty {
  text-align: center;
  padding: 44px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-dim);
  background: rgba(15, 29, 21, 0.35);
}
.empty-title { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty-hint { font-size: 0.85rem; }

/* ============ toasts ============ */
.toasts {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  background: rgba(15, 29, 21, 0.96);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: toast-in 180ms ease both;
}
.toast-ok { border-left-color: var(--ok); }
.toast-warn { border-left-color: var(--warn); }
.toast-err { border-left-color: var(--err); }
.toast.leaving { animation: toast-out 160ms ease both; }
.toast-close {
  flex: 0 0 auto;
  background: none;
  border: 0;
  color: var(--ink-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0 0 4px;
}
.toast-close:hover { color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(8px); } }

/* ============ modal ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 10, 7, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade-in 140ms ease both;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 560px;
  max-height: min(84dvh, 720px);
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  animation: modal-in 170ms ease both;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.modal-header h2, .modal-header h3 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ============ skeleton ============ */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(31, 53, 39, 0.4);
  border-radius: 8px;
  min-height: 14px;
  color: transparent !important;
  user-select: none;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(232, 237, 233, 0.07), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ============ bottom-nav + sheet (mobile) ============ */
.bottomnav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  height: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(11, 21, 16, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.bnav-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 6px 2px;
  color: var(--ink-dim);
  font: 500 0.62rem/1.1 var(--font);
  letter-spacing: 0.03em;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color var(--t);
}
.bnav-item:hover { text-decoration: none; color: var(--ink); }
.bnav-item.active { color: var(--gold2); }
.bnav-item.active .icon { filter: drop-shadow(0 0 6px rgba(201, 169, 97, 0.45)); }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(4, 10, 7, 0.6);
  animation: fade-in 140ms ease both;
}
.sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 160;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  padding: 8px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  animation: sheet-in 200ms ease both;
}
.sheet-grab {
  width: 40px; height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin: 4px auto 12px;
}
.sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 12px;
  min-height: 48px;
  border-radius: 10px;
  color: var(--ink);
  font: 500 0.95rem var(--font);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  transition: background var(--t), color var(--t);
}
.sheet-item:hover { background: rgba(31, 53, 39, 0.5); text-decoration: none; }
.sheet-item.active { color: var(--gold2); }
.sheet-item .icon { color: var(--gold); }
.sheet-form { margin: 0; }
.sheet-logout { color: var(--err); }
.sheet-logout .icon { color: var(--err); }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }

/* ============ login ============ */
.login-body { background: var(--bg); }
.login-split { display: flex; min-height: 100dvh; }

.login-hero {
  position: relative;
  flex: 1 1 55%;
  min-height: 100dvh;
  overflow: hidden;
}
.login-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
}
.login-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(11, 21, 16, 0.9) 0%, rgba(11, 21, 16, 0.55) 45%, rgba(11, 21, 16, 0.3) 100%),
    linear-gradient(to top, rgba(11, 21, 16, 0.85), transparent 55%);
}
.login-hero-text {
  position: absolute;
  left: clamp(24px, 5vw, 64px);
  bottom: clamp(28px, 6vh, 72px);
  right: 24px;
}
.wordmark {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.2vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.32em;
  color: var(--gold2);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
  line-height: 1.35;
}
.wordmark .wm-de {
  display: inline-block;
  font-size: 0.5em;
  letter-spacing: 0.45em;
  margin: 0 0.7em;
  transform: translateY(-0.35em);
  opacity: 0.8;
}
.tagline {
  margin-top: 10px;
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

.login-side {
  flex: 1 1 45%;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 56px);
  background:
    radial-gradient(700px 400px at 80% 0%, rgba(201, 169, 97, 0.06), transparent 65%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  animation: modal-in 260ms ease both;
}
.login-mono {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--gold2);
  border: 1px solid rgba(201, 169, 97, 0.45);
  border-radius: 12px;
  margin-bottom: 22px;
  background: radial-gradient(circle at 30% 20%, rgba(201, 169, 97, 0.14), transparent 70%);
}
.login-title { font-size: 1.5rem; margin-bottom: 4px; }
.login-sub { color: var(--ink-dim); font-size: 0.88rem; margin-bottom: 24px; }
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.86rem;
  color: var(--err);
  background: rgba(248, 113, 113, 0.09);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: var(--radius-sm);
}
.login-card .btn-lg { margin-top: 6px; }
.login-foot {
  margin-top: 26px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(159, 176, 166, 0.55);
  text-align: center;
}

/* ============ utilitários ============ */
.muted { color: var(--ink-dim); }
.gold { color: var(--gold2); }
.small { font-size: 0.82rem; }
.mono { font-family: var(--font-mono); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; } .mb-1 { margin-bottom: 8px; }
.mt-2 { margin-top: 16px; } .mb-2 { margin-bottom: 16px; }
.mt-3 { margin-top: 24px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }

/* ============ responsivo ============ */
@media (max-width: 1100px) {
  .sidebar { width: var(--sidebar-w-min); padding: 16px 10px; align-items: center; }
  .sidebar .nav-label, .sidebar .brand-text { display: none; }
  .brand { justify-content: center; padding: 6px 0 14px; width: 100%; }
  .nav-item { justify-content: center; padding: 11px; width: auto; }
  .sidenav { width: 100%; align-items: stretch; }
  .sidenav .nav-item { justify-content: center; }
  .side-foot { width: 100%; display: flex; justify-content: center; }
}

@media (max-width: 720px) {
  .sidebar { display: none; }
  .bottomnav { display: flex; }
  .content { padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px) + 24px); }
  .toasts { bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px) + 12px); }
  .page-title { font-size: 1.02rem; }
  .chip-user { max-width: 46vw; overflow: hidden; }
  .chip-user .chip-role { display: none; }
  .logout-form { display: none; } /* logout fica no menu do bottom-nav */
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid > .card { min-width: 0; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 44px; } /* alvo de toque ≥44px no mobile (SPEC) */

  /* login: foto vira faixa superior */
  .login-split { flex-direction: column; }
  .login-hero { flex: 0 0 auto; min-height: 38vh; height: 38vh; }
  .login-hero-text { left: 20px; bottom: 20px; }
  .wordmark { font-size: 1.15rem; letter-spacing: 0.28em; }
  .login-side { flex: 1 1 auto; align-items: start; padding-top: 30px; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
