/* ------------------------------------------------------------------
   Triagem · Pesquisa Clínica — sistema visual compartilhado (herdado do Portal Imagens)
   Identidade Ética Pesquisa Clínica (Instituto)
   ------------------------------------------------------------------ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Marca Ética */
  --brand-azul: #203668;
  --brand-azul-escuro: #18294F;
  --brand-azul-claro: #2C4A8C;
  --brand-laranja: #F28021;
  --brand-laranja-escuro: #EE6425;
  --brand-laranja-claro: #F69F21;

  /* Neutros */
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --subtle: #F1F5F9;
  --subtler: #F8FAFB;
  --fg: #0F1E26;
  --fg-secondary: #5A7A8C;
  --fg-tertiary: #94A3B8;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  /* Semânticas */
  --success: #1F9A5E;
  --success-light: #EDF7F2;
  --success-dark: #0F6038;
  --warning: #E09B2D;
  --warning-light: #FDF6EC;
  --warning-dark: #A06410;
  --danger: #D94F6A;
  --danger-light: #FDF0F2;
  --danger-dark: #9C2840;
  --info: #2C4A8C;
  --info-light: #EEF2FA;

  /* Raios */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-xs: 0 1px 2px rgba(15,30,38,.04);
  --shadow-sm: 0 1px 3px rgba(15,30,38,.06), 0 1px 2px rgba(15,30,38,.04);
  --shadow-md: 0 4px 6px -1px rgba(15,30,38,.06), 0 2px 4px -2px rgba(15,30,38,.04);
  --shadow-lg: 0 10px 15px -3px rgba(15,30,38,.08), 0 4px 6px -4px rgba(15,30,38,.04);

  --ring-laranja: 0 0 0 3px rgba(242,128,33,.18);
  --ring-azul: 0 0 0 3px rgba(32,54,104,.14);

  /* Layout */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(32,54,104,.18); color: var(--brand-azul-escuro); }

/* ------------------------------------------------------------------
   Shell — sidebar + topbar + main
   ------------------------------------------------------------------ */

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
}

/* --- sidebar --- */

.sidebar {
  grid-area: sidebar;
  background: linear-gradient(180deg, var(--brand-azul-escuro) 0%, var(--brand-azul) 60%, var(--brand-azul-claro) 140%);
  color: #fff;
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid rgba(255,255,255,.04);
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar__brand img { height: 34px; width: auto; }
.sidebar__brand .product {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.65); display: block; margin-top: 2px;
}

.sidebar__section-label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.5);
  padding: 8px 12px 4px;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-md);
  color: rgba(255,255,255,.8);
  text-decoration: none; font-weight: 500; font-size: 13.5px;
  transition: background 150ms ease-out, color 150ms ease-out;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.is-active {
  background: rgba(255,255,255,.11); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.nav-item.is-active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; background: var(--brand-laranja); border-radius: 0 3px 3px 0;
}
.nav-item .badge {
  margin-left: auto;
  background: var(--brand-laranja); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: var(--radius-full);
}

.sidebar__unit {
  margin-top: auto;
  padding: 12px; border-radius: var(--radius-md);
  background: rgba(255,255,255,.06);
  display: flex; gap: 10px; align-items: center;
}
.sidebar__unit .avatar {
  width: 34px; height: 34px; border-radius: var(--radius-full);
  background: var(--brand-laranja);
  display: grid; place-items: center; font-weight: 600; color: #fff; font-size: 13px;
}
.sidebar__unit .who { display: flex; flex-direction: column; line-height: 1.25; }
.sidebar__unit .who strong { font-size: 13px; font-weight: 600; }
.sidebar__unit .who span { font-size: 11.5px; color: rgba(255,255,255,.65); }

/* --- topbar --- */

.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 10;
}

.topbar__title { display: flex; flex-direction: column; }
.topbar__title h1 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.topbar__title .crumb { font-size: 12px; color: var(--fg-secondary); }

.topbar__search {
  flex: 1; max-width: 420px; margin: 0 8px;
  position: relative;
}
.topbar__search input {
  width: 100%; height: 38px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0 12px 0 36px;
  background: var(--subtler); color: var(--fg);
  font: inherit; font-size: 13.5px;
  transition: border 150ms, box-shadow 150ms, background 150ms;
}
.topbar__search input::placeholder { color: var(--fg-tertiary); }
.topbar__search input:focus {
  outline: none; border-color: var(--brand-azul); background: #fff;
  box-shadow: var(--ring-azul);
}
.topbar__search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--fg-tertiary);
}

.topbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar__iconbtn {
  width: 38px; height: 38px; border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius-md); display: grid; place-items: center;
  color: var(--fg-secondary); cursor: pointer; position: relative;
  transition: border 150ms, color 150ms;
}
.topbar__iconbtn:hover { border-color: var(--border-strong); color: var(--fg); }
.topbar__iconbtn .pip { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-laranja); }

.topbar__unit-switch {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: #fff; font-size: 13px; font-weight: 500; color: var(--fg);
  cursor: pointer;
}
.topbar__unit-switch strong { color: var(--brand-azul); font-weight: 600; }
.topbar__unit-switch .chev { width: 14px; height: 14px; color: var(--fg-tertiary); }

/* --- main --- */

.main { grid-area: main; padding: 24px 32px 48px; overflow-x: hidden; }

/* Page header */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.page-header__title h2 {
  margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--fg);
}
.page-header__title p { margin: 0; color: var(--fg-secondary); font-size: 13.5px; max-width: 640px; }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------
   Botões
   ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer;
  font: 500 13.5px/1 'Inter', sans-serif; color: var(--fg);
  background: var(--surface); border-color: var(--border);
  transition: background 150ms, border 150ms, box-shadow 150ms, color 150ms;
  white-space: nowrap; text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--border-strong); background: var(--subtler); }
.btn:focus-visible { outline: none; box-shadow: var(--ring-azul); }

.btn--primary {
  background: var(--brand-laranja); color: #fff; border-color: var(--brand-laranja);
  box-shadow: 0 1px 2px rgba(238,100,37,.25);
}
.btn--primary:hover { background: var(--brand-laranja-escuro); border-color: var(--brand-laranja-escuro); }
.btn--primary:focus-visible { box-shadow: var(--ring-laranja); }

.btn--dark {
  background: var(--brand-azul); color: #fff; border-color: var(--brand-azul);
}
.btn--dark:hover { background: var(--brand-azul-escuro); border-color: var(--brand-azul-escuro); }

.btn--ghost {
  background: transparent; border-color: transparent; color: var(--fg-secondary);
}
.btn--ghost:hover { background: var(--subtle); color: var(--fg); }

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

.btn--sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn--lg { height: 44px; padding: 0 18px; font-size: 14.5px; }
.btn--icon-only { padding: 0; width: 38px; }

/* ------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card__header h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.card__header .sub { font-size: 12px; color: var(--fg-secondary); }
.card__body { padding: 20px; }
.card__footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--subtler); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* KPI card */
.kpi { padding: 18px 20px; }
.kpi .label { font-size: 12px; font-weight: 500; color: var(--fg-secondary); text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { margin-top: 6px; font-family: 'JetBrains Mono', monospace; font-size: 30px; font-weight: 600; color: var(--fg); letter-spacing: -.02em; }
.kpi .delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 6px; font-weight: 500; }
.kpi .delta.up { color: var(--success-dark); }
.kpi .delta.down { color: var(--danger-dark); }
.kpi .delta.flat { color: var(--fg-secondary); }

/* ------------------------------------------------------------------
   Status pills
   ------------------------------------------------------------------ */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill--success { background: var(--success-light); color: var(--success-dark); border-color: rgba(31,154,94,.18); }
.pill--warning { background: var(--warning-light); color: var(--warning-dark); border-color: rgba(224,155,45,.22); }
.pill--danger { background: var(--danger-light); color: var(--danger-dark); border-color: rgba(217,79,106,.22); }
.pill--info { background: var(--info-light); color: var(--brand-azul); border-color: rgba(44,74,140,.18); }
.pill--neutral { background: var(--subtle); color: var(--fg-secondary); border-color: var(--border); }
.pill--brand { background: rgba(242,128,33,.10); color: var(--brand-laranja-escuro); border-color: rgba(242,128,33,.20); }

/* ------------------------------------------------------------------
   Tabelas
   ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
table.data {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
table.data thead th {
  text-align: left; font-weight: 600; color: var(--fg-secondary);
  padding: 11px 16px; background: var(--subtler);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
}
table.data tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--subtler); }
table.data .num { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------
   Formulários
   ------------------------------------------------------------------ */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.col-6 { grid-column: span 6; }
.field.col-4 { grid-column: span 4; }
.field.col-3 { grid-column: span 3; }
.field.col-12 { grid-column: span 12; }
.field__label { font-size: 12.5px; font-weight: 500; color: var(--fg-secondary); }
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: 12px; color: var(--fg-tertiary); }
.field__error { font-size: 12px; color: var(--danger-dark); display: none; align-items: center; gap: 4px; }
.field.field--error .field__error { display: inline-flex; }
.field.field--error .input, .field.field--error .select, .field.field--error .textarea { border-color: var(--danger); }

.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: #fff; color: var(--fg);
  font: inherit; font-size: 13.5px;
  transition: border 150ms, box-shadow 150ms;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-azul); box-shadow: var(--ring-azul);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A7A8C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}

.check, .radio {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--fg); cursor: pointer;
  user-select: none;
}
.check input[type="checkbox"], .radio input[type="radio"] {
  appearance: none; width: 18px; height: 18px;
  border: 1.5px solid var(--border-strong); border-radius: 5px;
  background: #fff; cursor: pointer;
  display: grid; place-items: center;
  transition: border 150ms, background 150ms;
}
.radio input[type="radio"] { border-radius: 50%; }
.check input:checked, .radio input:checked {
  background: var(--brand-azul); border-color: var(--brand-azul);
}
.check input:checked::after {
  content: ""; width: 10px; height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
}
.radio input:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }

.switch {
  --sw-w: 38px; --sw-h: 22px;
  position: relative; display: inline-block;
  width: var(--sw-w); height: var(--sw-h);
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--radius-full);
  transition: background 150ms;
}
.switch .slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 150ms;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--brand-azul); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* Segmented control */
.segment {
  display: inline-flex; padding: 3px; background: var(--subtle);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  gap: 2px;
}
.segment button {
  border: none; background: transparent; padding: 5px 12px;
  font: 500 12.5px/1 'Inter', sans-serif; color: var(--fg-secondary);
  border-radius: 7px; cursor: pointer;
  transition: background 150ms, color 150ms;
}
.segment button.is-active { background: #fff; color: var(--brand-azul); box-shadow: var(--shadow-xs); }
.segment button:hover:not(.is-active) { color: var(--fg); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--fg); cursor: pointer;
  transition: border 150ms, background 150ms;
}
.chip:hover { border-color: var(--border-strong); background: var(--subtler); }
.chip.is-active { background: var(--brand-azul); color: #fff; border-color: var(--brand-azul); }
.chip .close { color: var(--fg-tertiary); font-size: 14px; line-height: 1; }

/* ------------------------------------------------------------------
   Helpers
   ------------------------------------------------------------------ */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.text-secondary { color: var(--fg-secondary); }
.text-tertiary { color: var(--fg-tertiary); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.sep { height: 1px; background: var(--border); margin: 16px 0; border: none; }

/* Divider vertical */
.vsep { width: 1px; background: var(--border); align-self: stretch; }

/* ------------------------------------------------------------------
   Responsivo — mobile + tablet
   ------------------------------------------------------------------ */

/* Mobile toggle button (visible only on small screens) */
.sidebar-toggle {
  display: none; width: 38px; height: 38px;
  border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius-md); place-items: center; color: var(--fg-secondary);
  cursor: pointer;
}

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,30,38,.45); z-index: 40; }
.sidebar-backdrop.is-open { display: block; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "main";
  }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 50;
    width: 82vw; max-width: 320px;
    transform: translateX(-100%); transition: transform 220ms ease-out;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-toggle { display: grid; }
  .topbar__search { display: none; }
  .topbar__title { flex: 1; min-width: 0; }
  .topbar__title h1 { font-size: 15px; }
  .topbar__unit-switch strong { display: none; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main { padding: 16px 16px 40px; }
  .field.col-6, .field.col-4, .field.col-3 { grid-column: span 12; }
  .page-header__title h2 { font-size: 20px; }
}

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

/* Print (para relatórios) */
@media print {
  .sidebar, .topbar, .page-header__actions, .no-print { display: none !important; }
  .app { grid-template-columns: 1fr; grid-template-areas: "main"; }
  .main { padding: 0; }
  body { background: #fff; }
}
/* Auth split-layout (login) */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 55fr 45fr; }
.auth-brand { background: linear-gradient(160deg, var(--brand-azul-escuro) 0%, var(--brand-azul) 55%, var(--brand-azul-claro) 130%); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand__decor { position: absolute; inset: 0; pointer-events: none; }
.auth-brand__decor .ring { position: absolute; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.auth-brand__decor .ring--a { width: 420px; height: 420px; right: -140px; top: -140px; }
.auth-brand__decor .ring--b { width: 260px; height: 260px; right: 20px; top: 60px; border-color: rgba(242,128,33,.3); }
.auth-brand__decor .ring--c { width: 180px; height: 180px; left: -60px; bottom: -40px; border-color: rgba(255,255,255,.08); }
.auth-brand__logo { height: 42px; width: auto; position: relative; z-index: 1; }
.auth-brand__kicker { font: 500 12px/1 'Inter', sans-serif; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.7); display: block; margin-bottom: 20px; position: relative; z-index: 1; }
.auth-brand__headline { font-size: 36px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 20px; max-width: 440px; position: relative; z-index: 1; }
.auth-brand__headline em { font-style: italic; color: var(--brand-laranja-claro); font-weight: 500; }
.auth-brand__lede { font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,.78); max-width: 440px; position: relative; z-index: 1; margin: 0; }
.auth-brand__footer { font-size: 12px; color: rgba(255,255,255,.5); display: flex; gap: 20px; position: relative; z-index: 1; }
.auth-form-wrap { background: #fff; display: grid; place-items: center; padding: 40px; }
.auth-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; animation: fadeIn 400ms ease-out; }
.auth-form__logo-mobile { display: none; height: 40px; width: auto; margin: 0 auto 20px; }
.auth-form__header { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.auth-form__eyebrow { font: 500 11.5px/1 'Inter', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-azul); }
.auth-form__title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--fg); }
.auth-form__subtitle { margin: 0; color: var(--fg-secondary); font-size: 13.5px; }
.auth-form .input-shell { position: relative; }
.auth-form .input-icon--left { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--fg-tertiary); }
.auth-form .input--with-icon-left { padding-left: 38px; }
.auth-form .input--with-icon-right { padding-right: 38px; }
.auth-form .input-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: none; width: 28px; height: 28px; border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--fg-tertiary); cursor: pointer; }
.auth-form .input-toggle:hover { background: var(--subtle); color: var(--fg); }
.field-row { display: flex; justify-content: space-between; align-items: center; margin-top: -4px; }
.auth-form .link { color: var(--brand-azul); font-size: 13px; font-weight: 500; text-decoration: none; }
.auth-form .link:hover { text-decoration: underline; }
.auth-form__footer-txt { margin: 4px 0 0; text-align: center; font-size: 13px; color: var(--fg-secondary); }
.auth-form__footer-txt a { color: var(--brand-azul); font-weight: 500; text-decoration: none; }
.auth-form__legal { font-size: 11.5px; color: var(--fg-tertiary); line-height: 1.5; text-align: center; margin: 8px 0 0; }
.auth-form__legal a { color: var(--fg-secondary); text-decoration: underline; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1023px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form__logo-mobile { display: block; }
}
/* Timeline (auditoria) */
.audit-row { display: grid; grid-template-columns: 150px 36px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.audit-row:last-child { border-bottom: none; }
.audit-row .when { font: 500 12px/1.4 'JetBrains Mono', monospace; color: var(--fg-secondary); }
.audit-row .when strong { display: block; color: var(--fg); font-weight: 600; }
.audit-row .ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--info-light); color: var(--brand-azul); }
.audit-row .ico svg { width: 15px; height: 15px; }
.audit-row.evt-ok .ico { background: var(--success-light); color: var(--success-dark); }
.audit-row.evt-warn .ico { background: var(--warning-light); color: var(--warning-dark); }
.audit-row.evt-danger .ico { background: var(--danger-light); color: var(--danger-dark); }
.audit-row .what strong { font-weight: 600; font-size: 13.5px; display: block; }
.audit-row .what small { font-size: 12px; color: var(--fg-secondary); }
.audit-row .who-c { font-size: 12px; color: var(--fg-secondary); text-align: right; }
.audit-row .who-c strong { display: block; color: var(--fg); font-weight: 600; }
.audit-row .who-c small { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--fg-tertiary); }
@media (max-width: 900px) { .audit-row { grid-template-columns: 36px 1fr; grid-template-rows: auto auto; } .audit-row .when { grid-column: 2; grid-row: 2; text-align: left; } .audit-row .who-c { grid-column: 2; text-align: left; margin-top: 4px; } .audit-row .ico { grid-row: 1 / span 2; } }

/* Toolbar / filtros */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 0 16px; }
.toolbar .search-slim { flex: 1; min-width: 220px; position: relative; }
.toolbar .search-slim input { height: 36px; width: 100%; padding: 0 12px 0 34px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; font: inherit; font-size: 13px; }
.toolbar .search-slim svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--fg-tertiary); }

/* Dropzone + barra de progresso (herdados do Portal Imagens) */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--subtler); padding: 40px 24px; text-align: center; transition: border 150ms, background 150ms; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--brand-laranja); background: rgba(242,128,33,.04); }
.dropzone .icon { width: 56px; height: 56px; border-radius: 50%; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; color: var(--brand-azul); }
.dropzone .icon svg { width: 26px; height: 26px; }
.dropzone h4 { margin: 0; font-size: 16px; font-weight: 600; }
.dropzone p { margin: 0; color: var(--fg-secondary); font-size: 13px; max-width: 480px; }
.dropzone .formats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
/* Barra de progresso */
.progress { height: 6px; background: var(--subtle); border-radius: var(--radius-full); overflow: hidden; }
.progress__fill { height: 100%; background: linear-gradient(90deg, var(--brand-azul), var(--brand-azul-claro)); transition: width 300ms ease-out; }
.progress__fill--laranja { background: linear-gradient(90deg, var(--brand-laranja), var(--brand-laranja-claro)); }
.progress__fill--success { background: linear-gradient(90deg, var(--success), #3ec683); }
