/* ═══════════════════════════════════════════════════════════════
   PORTUS — Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --primary:        #D97706;
  --primary-hover:  #B45309;
  --primary-light:  #FEF3C7;
  --accent:         #00C9A7;
  --accent-light:   #E6FAF7;

  --success:   #10B981;
  --warning:   #F59E0B;
  --danger:    #EF4444;
  --info:      #3B82F6;

  --bg:        #F5F6FA;
  --surface:   #FFFFFF;
  --surface-2: #F9FAFB;
  --border:    #E5E7EB;
  --border-2:  #D1D5DB;

  --text:      #1A1D23;
  --text-2:    #4B5563;
  --text-3:    #9CA3AF;
  --on-primary: #FFFFFF;

  --sidebar-w:   240px;
  --sidebar-col: 64px;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.10), 0 10px 10px -5px rgba(0,0,0,.04);

  --transition: 0.18s ease;

  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* ── Sidebar navy tokens ── */
  --sidebar-bg:        #0D1B2A;
  --sidebar-border:    rgba(255,255,255,.06);
  --sidebar-text:      #94a3b8;
  --sidebar-text-hover:#e2e8f0;
  --sidebar-active-bg: rgba(217,119,6,.15);
  --sidebar-active-fg: #F59E0B;

  /* Alternância de colunas Kanban — light */
  --col-a: #F9FAFB;
  --col-b: #F0F2F7;
}

/* ── Font helpers ─────────────────────────────────────────────── */
.font-display {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

/* Dark theme (TV mode) */
[data-theme="dark"] {
  --sidebar-bg:        #060d14;
  --sidebar-border:    rgba(255,255,255,.05);
  --sidebar-text:      #64748b;
  --sidebar-text-hover:#cbd5e1;
  --bg:        #0F1117;
  --surface:   #1A1D23;
  --surface-2: #22262F;
  --border:    #2A2D36;
  --border-2:  #3A3D4A;
  --text:      #F0F2F8;
  --text-2:    #9CA3AF;
  --text-3:    #6B7280;
  --primary:   #4D8BFF;
  --primary-light: #1e2b44;
  --accent:    #00E5BD;
  --accent-light: #0d2e29;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 20px rgba(0,0,0,.5);

  /* Alternância de colunas Kanban — dark */
  --col-a: #22262F;
  --col-b: #1C1F27;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

.font-mono { font-family: var(--font-mono); }


/* ═══════════════════════════════════════════════════════════════
   LAYOUT — Sidebar + Main
   ═══════════════════════════════════════════════════════════════ */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width var(--transition);
}

.sidebar.collapsed { width: var(--sidebar-col); }

/* Brand */
.sidebar-brand {
  height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #D97706, #F59E0B);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 1.125rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
}

.sidebar.collapsed .brand-name { opacity: 0; width: 0; }

.sidebar-collapse-btn {
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.3);
  font-size: 1.25rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  margin-bottom: 2px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover { background: rgba(255,255,255,.06); color: var(--sidebar-text-hover); }

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-fg);
  font-weight: 600;
}

.nav-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 20px; }

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
}
.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

.nav-divider { height: 1px; background: var(--sidebar-border); margin: 10px 8px; }

/* Seletor global de planta */
.sidebar-plant {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--sidebar-border);
  overflow: hidden;
}
.sidebar-plant-icon {
  color: rgba(255,255,255,.3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.sidebar-plant-select {
  flex: 1;
  min-width: 0;
  font-size: .8rem;
  padding: 4px 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
  cursor: pointer;
  transition: opacity var(--transition), width var(--transition);
}
.sidebar-plant-select:focus { outline: none; border-color: var(--sidebar-active-fg); }
.sidebar.collapsed .sidebar-plant-select { opacity: 0; width: 0; padding: 0; border: none; }

/* Footer */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  margin-bottom: 4px;
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D97706, #F59E0B);
  color: #fff;
  font-weight: 700;
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: .8125rem; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .6875rem; color: rgba(255,255,255,.35); }

.sidebar.collapsed .user-info { opacity: 0; width: 0; }

.logout-item { color: #f87171 !important; }
.logout-item:hover { background: rgba(239,68,68,.1) !important; }

/* Main */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 28px 32px 0;
  transition: margin-left var(--transition);
  display: flex;
  flex-direction: column;
}

.page-body {
  flex: 1;
  padding-bottom: 28px;
}

.app-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.875rem;
}

.app-footer-nav {
  display: flex;
  gap: 16px;
}

.app-footer-nav a:hover {
  color: var(--text);
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-col); }
.main-content.no-sidebar { margin-left: 0; }


/* ═══════════════════════════════════════════════════════════════
   KANBAN PANEL — Layout especial
   ═══════════════════════════════════════════════════════════════ */

/* Quando é o painel, o main-content ocupa toda a altura e não tem padding */
.main-content.panel-main {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.main-content.panel-main .page-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

/* Toolbar do painel */
.panel-toolbar {
  height: 52px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
}

.panel-toolbar-left,
.panel-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Kanban board: scroll lateral */
.kanban-board {
  flex: 1;
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  scroll-snap-type: x proximity;
}

/* Scrollbar estilizada */
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: var(--bg); }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.kanban-board::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* Coluna do Kanban */
.kanban-column {
  min-width: 280px;
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  scroll-snap-align: start;
}

.kanban-column:nth-child(odd)  { background: var(--col-a); }
.kanban-column:nth-child(even) { background: var(--col-b); }

.kanban-column:last-child { border-right: none; }

.column-header {
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  /* A borda colorida no topo vem do style inline (stage.color) */
}

.column-title {
  font-weight: 700;
  font-size: .9375rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-count {
  background: var(--border);
  color: var(--text-2);
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

.column-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.column-body::-webkit-scrollbar { width: 4px; }
.column-body::-webkit-scrollbar-track { background: transparent; }
.column-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

/* Card do Kanban */
.kanban-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  padding: 12px;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kanban-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* Kanban Cards Logs */
.card-log-input {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.log-field {
  flex: 1;
  font-size: 0.75rem;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  resize: none;
  height: 32px;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--text);
}

.log-field:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.btn-save-log {
  background: var(--success);
  color: white;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: opacity var(--transition);
}

.btn-save-log:hover {
  opacity: 0.8;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.card-plate {
  font-family: var(--font-mono);
  font-size: .9375rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .07em;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--text-3);
}

.card-partner {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-driver {
  font-size: .75rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-total-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  align-self: flex-start;
  font-variant-numeric: tabular-nums;
}

[data-tv="true"] .card-total-time { font-size: .8125rem; padding: 3px 10px; }

.detail-kv-highlight {
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin: -2px;
}
.detail-kv-highlight > span  { color: var(--accent) !important; }
.detail-kv-highlight > strong { color: var(--accent); font-size: 1.0625rem; }

.card-actions {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn-advance {
  width: 100%;
  padding: 6px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  font-weight: 600;
  text-align: center;
  transition: background var(--transition);
}
.btn-advance:hover { background: var(--primary); color: #fff; }

/* Timers de etapa e total no card */
.card-timers {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.card-timer-stage,
.card-timer-total {
  font-size: .72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  color: var(--text-3);
}
.card-timer-stage { color: var(--primary); }
.card-timer-total { color: var(--text-3); }

/* ── Modo TV ──────────────────────────────────────────────────────────────── */
/* Ativado via data-tv="true" no <html>. Colapsa sidebar, oculta "Avançar",   */
/* exibe tempo decorrido e aumenta fontes para legibilidade à distância.       */

[data-tv="true"] .sidebar {
  width: var(--sidebar-col) !important;
}
[data-tv="true"] .main-content {
  margin-left: var(--sidebar-col) !important;
}
[data-tv="true"] .brand-name,
[data-tv="true"] .nav-label,
[data-tv="true"] .user-info,
[data-tv="true"] .sidebar-plant-select { opacity: 0 !important; width: 0 !important; overflow: hidden; }
[data-tv="true"] .sidebar-collapse-btn { display: none; }

[data-tv="true"] .btn-advance { display: none; }
[data-tv="true"] .card-actions { display: none; }

[data-tv="true"] .card-timers { display: flex; }

[data-tv="true"] .card-plate    { font-size: 1.125rem; letter-spacing: .08em; }
[data-tv="true"] .card-partner  { font-size: .9375rem; }
[data-tv="true"] .card-driver   { font-size: .8125rem; }
[data-tv="true"] .card-meta     { font-size: .8125rem; }
[data-tv="true"] .card-timer-stage,
[data-tv="true"] .card-timer-total { font-size: .8125rem; }
[data-tv="true"] .column-title  { font-size: 1.0625rem; }
[data-tv="true"] .kanban-card   { gap: 8px; padding: 14px; }

/* Empty state do painel */
.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1;
  color: var(--text-3);
  font-size: .9375rem;
}

/* Indicador de conexão SocketIO */
.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.connection-dot.online  { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.connection-dot.offline { background: var(--text-3); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 1.0625rem; font-weight: 700; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  font-size: .9375rem;
  line-height: 1.6;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

.tl-item {
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border-left: 3px solid var(--border-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .875rem;
}

.tl-item strong { font-weight: 600; color: var(--text); }
.tl-item span   { color: var(--text-3); font-size: .8125rem; }


/* ═══════════════════════════════════════════════════════════════
   PAGE — Header, Titles, Layout
   ═══════════════════════════════════════════════════════════════ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.page-subtitle {
  font-size: .875rem;
  color: var(--text-3);
  margin-top: 2px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  margin-top: 4px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

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

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS — Buttons
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .875rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition),
              box-shadow var(--transition), border-color var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(217,119,6,.35); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.5);
}
.btn-outline-white:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.8); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

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

.btn-block { width: 100%; padding: 12px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: .8125rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS — Forms
   ═══════════════════════════════════════════════════════════════ */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 760px;
  box-shadow: var(--shadow-sm);
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217,119,6,.12);
}

select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.form-row-space-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  color: var(--text-2);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

.link-sm { font-size: .875rem; color: var(--primary); font-weight: 500; }
.link-sm:hover { text-decoration: underline; }

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS — Tables
   ═══════════════════════════════════════════════════════════════ */

.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.table thead {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.row-inactive { opacity: .5; }

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS — Badges & Status
   ═══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--border);
  color: var(--text-2);
}

.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-primary { background: var(--primary-light); color: var(--primary); }

.op-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.op-coleta  { background: var(--primary-light); color: var(--primary); }
.op-entrega { background: var(--accent-light); color: var(--accent); }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
}

.status-scheduled    { background: #EFF6FF; color: #1D4ED8; }
.status-awaiting_data{ background: #FEF3C7; color: #92400E; }
.status-data_confirmed{background: #ECFDF5; color: #065F46; }
.status-in_progress  { background: #F0FDF4; color: #15803D; }
.status-completed    { background: #F0FDF4; color: #166534; }
.status-cancelled    { background: #FEF2F2; color: #991B1B; }

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS — Cards & Info
   ═══════════════════════════════════════════════════════════════ */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-label { font-size: .8125rem; color: var(--text-3); font-weight: 500; }

.summary-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.summary-value.accent  { color: var(--accent); }
.summary-value.success { color: var(--success); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.info-card-header h3 { font-size: 1rem; font-weight: 700; }

.info-row {
  font-size: .875rem;
  color: var(--text-2);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-3); font-weight: 500; min-width: 120px; }

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS — Notifications
   ═══════════════════════════════════════════════════════════════ */

.notification-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.notification-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background var(--transition);
}

.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: var(--surface-2); }

.notification-item.unread { background: #FFFBEB; border-left: 3px solid #F59E0B; }
.notification-item.unread:hover { background: #FEF3C7; }

.notif-title  { font-size: .875rem; font-weight: 600; color: var(--text); }
.notif-body   { font-size: .8125rem; color: var(--text-2); line-height: 1.4; }
.notif-time   { font-size: .75rem; color: var(--text-3); }

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS — Stage List (Empresa)
   ═══════════════════════════════════════════════════════════════ */

.stage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.stage-order {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stage-info {
  flex: 1;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.stage-info strong { font-weight: 600; }
.stage-info small  { font-size: .8125rem; color: var(--text-3); }

/* ═══════════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════ */

.flash-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: .875rem;
  animation: slideInRight .25s ease-out;
  border: 1px solid var(--border);
}

@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.alert-success { border-left: 4px solid var(--success); }
.alert-danger, .alert-error { border-left: 4px solid var(--danger); }
.alert-warning { border-left: 4px solid var(--warning); }
.alert-info    { border-left: 4px solid var(--info); }

.alert-close {
  color: var(--text-3);
  font-size: 1.125rem;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}
.alert-close:hover { color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════ */

.login-page { background: #fff; overflow: hidden; }

.login-layout { display: flex; height: 100vh; }

.login-hero {
  flex: 1.1;
  background: linear-gradient(140deg, #060d14 0%, #0D1B2A 50%, #162232 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: -150px;
  right: -150px;
}

.login-hero::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(0,201,167,.1);
  bottom: -80px;
  left: -80px;
}

.hero-content { position: relative; z-index: 1; max-width: 420px; }

.hero-brand   { font-size: 3.5rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 20px; }
.hero-slogan  { font-size: 1.375rem; font-weight: 600; line-height: 1.35; margin-bottom: 12px; opacity: .95; }
.hero-desc    { font-size: 1.0625rem; opacity: .75; line-height: 1.6; }

.login-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  padding: 36px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: fadeUp .35s ease-out;
}

@keyframes fadeUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.login-title { font-size: 1.625rem; font-weight: 700; margin-bottom: 28px; }

/* Tabs login */
.tab-group {
  display: flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 9px 12px;
  font-size: .875rem;
  font-weight: 600;
  border-radius: 7px;
  color: var(--text-3);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

.tab-badge {
  font-size: .6rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: .04em;
}

.partner-hint {
  background: #EFF6FF;
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  font-size: .8125rem;
  color: #1e40af;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   PORTAL HEADER (parceiros)
   ═══════════════════════════════════════════════════════════════ */

.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
}

.portal-brand { font-weight: 700; font-size: 1rem; }

.portal-header nav { display: flex; gap: 20px; }

.portal-header nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.portal-header nav a:hover { color: var(--primary); border-bottom-color: var(--primary); }

.portal-user {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-1);
  padding: 6px 0;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: .9375rem;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN — Hero additions
   ═══════════════════════════════════════════════════════════════ */

.hero-features-preview {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9375rem;
  opacity: .85;
  color: #fff;
}

.hero-feature-item svg { flex-shrink: 0; opacity: .8; }

.hero-about-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  font-size: .9375rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  border-bottom: 1px solid rgba(255,255,255,.3);
  padding-bottom: 2px;
  transition: color var(--transition), border-color var(--transition);
}

.hero-about-link:hover {
  color: #fff;
  border-color: rgba(255,255,255,.7);
}

/* ── Login footer ────────────────────────────────────────────── */

.login-footer {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 50%;   /* alinha com o login-panel */
  padding: 12px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--text-3);
  z-index: 10;
}

.login-footer-links {
  display: flex;
  gap: 20px;
}

.login-footer-links a {
  color: var(--text-3);
  transition: color var(--transition);
}

.login-footer-links a:hover { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   APP FOOTER (base.html — páginas autenticadas)
   ═══════════════════════════════════════════════════════════════ */

.app-footer {
  margin: 0 -32px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.app-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: .8125rem;
  color: var(--text-3);
}

.app-footer-brand {
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: -.01em;
}

.app-footer-nav {
  display: flex;
  gap: 20px;
  flex: 1;
}

.app-footer-nav a {
  color: var(--text-3);
  transition: color var(--transition);
}

.app-footer-nav a:hover { color: var(--primary); }

.app-footer-copy { margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════
   PUBLIC NAV
   ═══════════════════════════════════════════════════════════════ */

.sobre-page { background: #fff; }

.public-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pub-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #D97706, #F59E0B);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pub-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

/* ═══════════════════════════════════════════════════════════════
   SOBRE — Hero
   ═══════════════════════════════════════════════════════════════ */

.sobre-hero {
  background: linear-gradient(140deg, #060d14 0%, #0D1B2A 50%, #162232 100%);
  color: #fff;
  padding: 80px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
  min-height: 520px;
  position: relative;
  overflow: hidden;
}

.sobre-hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  top: -200px; right: -200px;
}

.sobre-hero-inner {
  max-width: 520px;
  position: relative;
  z-index: 1;
}

.sobre-badge {
  display: inline-block;
  background: rgba(0,201,167,.2);
  color: #00E5BD;
  border: 1px solid rgba(0,201,167,.3);
  font-size: .8125rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.sobre-hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 20px;
}

.sobre-hero-sub {
  font-size: 1.125rem;
  opacity: .8;
  line-height: 1.65;
  margin-bottom: 36px;
}

.sobre-hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Mock kanban illustration */
.sobre-hero-visual {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.mock-kanban {
  display: flex;
  gap: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.mock-col {
  width: 130px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mock-col-header {
  font-size: .75rem;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 4px;
}

.mock-card {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .8125rem;
  font-weight: 500;
  color: #fff;
  position: relative;
}

.mock-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
}

.mock-card.green::before  { background: #10B981; }
.mock-card.blue::before   { background: #3B82F6; }
.mock-card.orange::before { background: #F59E0B; }
.mock-card.purple::before { background: #8B5CF6; }

/* ═══════════════════════════════════════════════════════════════
   SOBRE — Features section
   ═══════════════════════════════════════════════════════════════ */

.sobre-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

.sobre-features {
  padding: 80px 0;
  background: #fff;
}

.sobre-section-header {
  text-align: center;
  margin-bottom: 56px;
}

.sobre-section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 12px;
  color: var(--text);
}

.sobre-section-header p {
  font-size: 1.0625rem;
  color: var(--text-2);
  max-width: 480px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-2);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.feature-icon--blue   { background: #EEF3FD; color: #2D6BE4; }
.feature-icon--green  { background: #D1FAE5; color: #059669; }
.feature-icon--orange { background: #FEF3C7; color: #D97706; }
.feature-icon--purple { background: #EDE9FE; color: #7C3AED; }
.feature-icon--teal   { background: #CCFBF1; color: #0D9488; }

.feature-card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.feature-card p {
  font-size: .9375rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 16px;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feature-list li {
  font-size: .875rem;
  color: var(--text-2);
  padding-left: 18px;
  position: relative;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   SOBRE — Stats
   ═══════════════════════════════════════════════════════════════ */

.sobre-stats {
  background: linear-gradient(135deg, #0f2a6e 0%, #1a45b5 100%);
  padding: 56px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
}

.stat-label {
  font-size: .9rem;
  color: rgba(255,255,255,.65);
}

/* ═══════════════════════════════════════════════════════════════
   SOBRE — CTA final
   ═══════════════════════════════════════════════════════════════ */

.sobre-cta-section {
  padding: 80px 0;
  background: var(--bg);
}

.sobre-cta-inner {
  text-align: center;
}

.sobre-cta-inner h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 12px;
}

.sobre-cta-inner p {
  font-size: 1.0625rem;
  color: var(--text-2);
  margin-bottom: 32px;
}

.sobre-cta-inner .sobre-hero-cta {
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   PUBLIC FOOTER
   ═══════════════════════════════════════════════════════════════ */

.public-footer {
  background: #0f1729;
  color: rgba(255,255,255,.65);
  padding: 56px 40px 0;
}

.public-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-brand-col .footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand .pub-logo {
  background: linear-gradient(135deg, #1a45b5 0%, #2D6BE4 100%);
}

.footer-brand .pub-name { color: #fff; }

.footer-tagline {
  font-size: .9rem;
  line-height: 1.6;
  max-width: 220px;
}

.footer-links-col h4 {
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.45);
  margin-bottom: 16px;
}

.footer-links-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.footer-links-col a {
  font-size: .9rem;
  color: rgba(255,255,255,.6);
  transition: color var(--transition);
}

.footer-links-col a:hover { color: #fff; }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8125rem;
  color: rgba(255,255,255,.35);
}

/* ═══════════════════════════════════════════════════════════════
   LEGAL PAGE
   ═══════════════════════════════════════════════════════════════ */

.legal-page {
  padding: 60px 40px 80px;
  background: #fff;
  min-height: calc(100vh - 60px - 280px);
}

.legal-container {
  max-width: 760px;
  margin: 0 auto;
}

.legal-container h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 8px;
}

.legal-updated {
  font-size: .9rem;
  color: var(--text-3);
  margin-bottom: 48px;
}

.legal-container section {
  margin-bottom: 36px;
}

.legal-container h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.legal-container p {
  font-size: .9375rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 10px;
}

.legal-container ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.legal-container ul li {
  font-size: .9375rem;
  color: var(--text-2);
  line-height: 1.6;
}

.legal-container a { color: var(--primary); }
.legal-container a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar { width: var(--sidebar-col); }
  .sidebar .brand-name,
  .sidebar .nav-label,
  .sidebar .user-info { opacity: 0; width: 0; }
  .main-content { margin-left: var(--sidebar-col); padding: 20px 16px 0; }
  .login-hero { display: none; }
  .login-panel { padding: 24px; }
  .kanban-column { min-width: 250px; width: 250px; }

  /* Public pages responsive */
  .sobre-hero { flex-direction: column; padding: 48px 24px; gap: 40px; min-height: auto; }
  .sobre-hero-title { font-size: 2rem; }
  .sobre-hero-visual { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .public-footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; }
  .public-nav { padding: 0 20px; }
  .sobre-container { padding: 0 20px; }
  .login-footer { width: 100%; position: static; }
  .app-footer { margin: 0 -16px; }
}
