/* ═══════════════════════════════════════════
   RESET & VARIABLES
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1D4ED8;
  --primary-dark:  #1E3A8A;
  --primary-light: #DBEAFE;
  --success:       #059669;
  --warning:       #D97706;
  --danger:        #DC2626;
  --info:          #0891B2;

  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  --sb-w: 260px;
  --topbar-h: 64px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow:    0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.12), 0 4px 6px rgba(0,0,0,.05);
  --tx: all .18s ease;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.55;
}

a { text-decoration: none; color: inherit; }

/* ═══════════════════════════════════════════
   PAGES
═══════════════════════════════════════════ */
.page { display: none; min-height: 100vh; }
.page.active { display: flex; }

/* ═══════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════ */
#page-login {
  position: relative;
  /* Cor de fundo base (visível quando não há imagem ou enquanto carrega) */
  background-color: #0F172A;
  /* Imagem de fundo responsiva: cover = preenche sem distorcer, seja qual for a resolução */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

/* Overlay gradiente sobre a imagem — cria o efeito de marca d'água/segundo plano.
   A opacidade é controlada via CSS variable --login-overlay (padrão 1 = sem imagem). */
#page-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 45%, #2563EB 100%);
  opacity: var(--login-overlay, 1);
  transition: opacity .4s ease;
  z-index: 0;
}

/* Garante que o card de login fique acima do overlay */
.login-bg {
  position: relative;
  z-index: 1;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}
.brand-icon { font-size: 30px; }
.link-sm { font-size: 13px; color: var(--primary); text-decoration: none; }
.link-sm:hover { text-decoration: underline; }
.brand-name  { font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: -.5px; }
.brand-logo    { display: none; object-fit: contain; }
.brand-logo:not(.hidden) { display: block; }
.brand-logo-lg { width: 56px; height: 56px; }
.brand-logo-sm { width: 32px; height: 32px; }
.sidebar .brand-logo { filter: brightness(0) invert(1); }

.login-title { font-size: 20px; font-weight: 700; text-align: center; color: var(--gray-900); margin-bottom: 6px; }
.login-sub   { font-size: 14px; text-align: center; color: var(--gray-500); margin-bottom: 28px; }

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.req { color: var(--danger); }

input[type=checkbox], input[type=radio] {
  width: auto; padding: 0; border: none; box-shadow: none;
  background: none; appearance: auto; -webkit-appearance: auto;
}
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  background: #fff;
  transition: var(--tx);
  outline: none;
  appearance: none;
}
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
input:not([type=checkbox]):not([type=radio])::placeholder, textarea::placeholder { color: var(--gray-400); }
textarea { resize: vertical; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--tx);
  font-family: inherit;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-outline   { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-full { width: 100%; }
.btn-sm  { padding: 6px 12px; font-size: 13px; }
.btn-lg  { padding: 12px 20px; font-size: 15px; }

/* ═══════════════════════════════════════════
   CHIPS / BADGES
═══════════════════════════════════════════ */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.chip-blue  { background: #DBEAFE; color: #1D4ED8; }
.chip-teal  { background: #CCFBF1; color: #0F766E; }
.chip-green { background: #D1FAE5; color: #065F46; }
.chip-amber { background: #FEF3C7; color: #92400E; }
.chip-red   { background: #FEE2E2; color: #991B1B; }
.chip-purple{ background: #EDE9FE; color: #5B21B6; }
.chip-gray  { background: #F3F4F6; color: #374151; }
.chip-sm    { padding: 2px 7px; font-size: 11px; }

/* ═══════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════ */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-error   { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-warn    { background: #FFFBEB; color: #92400E; border: 1px solid #FCD34D; }
.alert-ok      { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.mfa-icon      { font-size: 40px; text-align: center; margin-bottom: 8px; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════
   DEMO BOX
═══════════════════════════════════════════ */
.demo-box { border-top: 1px solid var(--gray-200); margin-top: 24px; padding-top: 18px; }
.demo-title { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.demo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  color: var(--gray-600);
  transition: var(--tx);
  margin-bottom: 8px;
}
.demo-row:hover { background: var(--primary-light); border-color: var(--primary); }

/* ═══════════════════════════════════════════
   LAYOUT — SIDEBAR + MAIN
═══════════════════════════════════════════ */
.layout { flex-direction: row; }

/* Sidebar */
.sidebar {
  width: var(--sb-w);
  background: var(--gray-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .25s ease;
}

.sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar .brand-name { color: #fff; font-size: 20px; }
.sidebar .brand-icon { font-size: 20px; }

.sb-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: rgba(255,255,255,.65);
  transition: var(--tx);
  cursor: pointer;
  font-size: 14px;
  border-radius: 0;
  user-select: none;
}
.nav-item:hover  { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.ni { font-size: 17px; flex-shrink: 0; }

.sb-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sb-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sb-name { font-size: 13px; font-weight: 600; color: #fff; }
.sb-role { font-size: 11px; color: rgba(255,255,255,.45); }

/* Avatar */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.avatar-admin { background: var(--success); }
.avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.btn-logout {
  width: 100%;
  padding: 8px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  color: rgba(255,255,255,.65);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: var(--tx);
}
.btn-logout:hover { background: rgba(239,68,68,.2); border-color: rgba(239,68,68,.3); color: #FCA5A5; }

/* Main Wrap */
.main-wrap {
  flex: 1;
  margin-left: var(--sb-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.hamburger {
  display: none;
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--gray-600); padding: 4px;
}
.topbar-title { font-size: 18px; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Content */
.content { flex: 1; padding: 0; }
.sec { display: none; padding: 24px; }
.sec.active { display: block; }

/* Section header */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.sec-head h2 { font-size: 20px; font-weight: 700; color: var(--gray-900); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input  { min-width: 180px; width: auto; }
.filters select { min-width: 150px; width: auto; }

/* ═══════════════════════════════════════════
   STATS ROW
═══════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 0;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}
.stat-icon { font-size: 34px; }
.stat-val  { font-size: 30px; font-weight: 800; line-height: 1; }
.stat-lbl  { font-size: 13px; color: var(--gray-500); margin-top: 3px; }

/* ═══════════════════════════════════════════
   CARDS
═══════════════════════════════════════════ */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.card-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head h3 { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }
.mt { margin-top: 16px; }

/* ═══════════════════════════════════════════
   GRID HELPERS
═══════════════════════════════════════════ */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ═══════════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
.tbl th {
  background: var(--gray-50);
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.tbl td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--gray-700);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl .row-click { cursor: pointer; }
.tbl .row-click:hover td { background: var(--gray-50); }
.tk-id { font-family: monospace; font-weight: 700; color: var(--primary); font-size: 13px; }
.user-cell { display: flex; align-items: center; gap: 8px; }
.tk-title { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══════════════════════════════════════════
   BAR CHART (inline CSS chart)
═══════════════════════════════════════════ */
.bar-chart { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-lbl { width: 120px; font-size: 12px; color: var(--gray-600); text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; height: 18px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 4px; transition: width .5s ease; min-width: 2px; }
.bar-count { width: 28px; font-size: 12px; font-weight: 700; color: var(--gray-700); }

/* ═══════════════════════════════════════════
   FORM ACTIONS
═══════════════════════════════════════════ */
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ═══════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════ */
.empty { text-align: center; color: var(--gray-400); padding: 40px 20px; font-size: 14px; }
.empty-sm { text-align: center; color: var(--gray-400); padding: 16px; font-size: 13px; }

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px;
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; background: #fff; z-index: 10;
}
.modal-id { font-size: 11px; color: var(--primary); font-weight: 700; font-family: monospace; letter-spacing: .08em; margin-bottom: 4px; }
.modal-header h2 { font-size: 17px; font-weight: 700; color: var(--gray-900); }
.modal-close {
  background: var(--gray-100); border: none;
  border-radius: 50%; width: 32px; height: 32px;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--tx);
}
.modal-close:hover { background: var(--gray-200); }
.modal-body { padding: 24px; }
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 24px;
}
.modal-main { display: flex; flex-direction: column; gap: 20px; }
.modal-side { display: flex; flex-direction: column; gap: 14px; }

.detail-block h4.detail-block-title {
  font-size: 11px; font-weight: 700;
  color: var(--gray-500); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 10px;
}
.detail-block p { font-size: 14px; color: var(--gray-700); white-space: pre-wrap; line-height: 1.65; }

/* Info card (right panel) */
.info-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px;
}
.info-card-title { font-size: 13px; font-weight: 700; color: var(--gray-700); margin-bottom: 12px; }
.info-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-200);
  gap: 8px;
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 12px; color: var(--gray-500); font-weight: 500; flex-shrink: 0; }
.info-val   { font-size: 13px; color: var(--gray-800); text-align: right; }

/* Admin actions inside modal */
#admin-acoes .field { margin-bottom: 12px; }

/* Comments */
.comment {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.comment-hdr {
  display: flex; align-items: center;
  gap: 8px; margin-bottom: 8px;
}
.comment-hdr strong { font-size: 13px; }
.comment-date { font-size: 12px; color: var(--gray-400); margin-left: auto; }
.comment-txt  { font-size: 13px; color: var(--gray-700); white-space: pre-wrap; }
.comment-internal { background: #FFFBEB; border-color: #FCD34D; }
.comment-internal-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: #D97706;
  background: #FEF3C7; border-radius: 4px; padding: 1px 6px; margin-bottom: 6px;
}
.comment-form {
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 8px;
}

body.modal-open { overflow: hidden; }

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 13px 20px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}
.toast-ok  { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.toast-err { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ═══════════════════════════════════════════
   SIDEBAR OVERLAY (mobile)
═══════════════════════════════════════════ */
.sb-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 150;
}

/* ═══════════════════════════════════════════
   FILE UPLOAD ZONE
═══════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--tx);
  background: var(--gray-50);
  user-select: none;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-zone.has-files { border-style: solid; border-color: var(--primary); }
.upload-icon { font-size: 30px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: var(--gray-700); font-weight: 500; margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

.preview-anexos { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}
.file-icon { font-size: 22px; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 11px; color: var(--gray-400); }
.file-remove {
  background: none; border: none;
  color: var(--gray-400); cursor: pointer;
  font-size: 18px; padding: 2px 6px;
  border-radius: 4px; transition: var(--tx); line-height: 1;
  flex-shrink: 0;
}
.file-remove:hover { color: var(--danger); background: #FEF2F2; }
.file-dl {
  font-size: 12px; color: var(--primary); text-decoration: none;
  padding: 3px 8px; border-radius: 4px; background: var(--primary-light);
  font-weight: 500; white-space: nowrap; flex-shrink: 0;
}
.file-dl:hover { background: #BFDBFE; }
.field-hint { font-size: 12px; color: var(--gray-400); margin-top: 5px; }

/* ═══════════════════════════════════════════
   USER MANAGEMENT
═══════════════════════════════════════════ */
.modal-sm { max-width: 480px; }
.papel-chip { display: inline-flex; }
.user-actions { display: flex; gap: 6px; }
.btn-icon {
  background: none; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 5px 9px;
  cursor: pointer; font-size: 14px; transition: var(--tx);
  line-height: 1;
}
.btn-icon:hover { background: var(--gray-100); }
.btn-icon.danger:hover { background: #FEF2F2; border-color: #FECACA; }
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 6px 0; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .modal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .hamburger { display: block; }
  .grid2 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .filters { flex-direction: column; align-items: flex-start; }
  .filters input, .filters select { width: 100%; min-width: unset; }
  .sec-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
}

/* ═══════════════════════════════════════════
   NOVOS ESTILOS — v2
═══════════════════════════════════════════ */

/* Chip personalizado (prioridades com cor dinâmica) */
.chip-custom {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid currentColor;
}

/* Colunas de tempo no dashboard */
.col-tempo {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--gray-600);
}

/* Linhas inativas na tabela de parâmetros */
.row-inativo td { opacity: .5; }

/* Tabs de parâmetros */
.param-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 2px solid var(--gray-200);
}
.param-tab {
  padding: 8px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--tx);
}
.param-tab:hover  { color: var(--primary); }
.param-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Upload zone compacto para o modal */
.upload-zone-sm {
  padding: 12px 16px;
  min-height: unset;
}
.upload-zone-sm .upload-text { font-size: 13px; }

/* Seção de configurações — info-row */
.cfg-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.cfg-info-row:last-child { border-bottom: none; }

/* ── E-mail templates ──────────────────────── */
#email-body {
  font-family: monospace;
  font-size: 13px;
  resize: vertical;
  min-height: 180px;
}

/* Grade de variáveis disponíveis */
.email-vars-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  align-items: baseline;
  font-size: 13px;
}
.email-vars-grid code {
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  color: var(--primary);
}
.email-vars-grid span {
  color: var(--gray-500);
}

/* ── Aparência — preview da imagem de fundo ── */
.bg-preview-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
}
.bg-preview-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.bg-preview-badge {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 11px;
  color: #fff;
  background: rgba(0,0,0,.55);
  padding: 2px 8px;
  border-radius: 4px;
}
input[type="range"] {
  width: 100%;
  margin-top: 6px;
  accent-color: var(--primary);
  cursor: pointer;
}
.bg-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.bg-spec-chip {
  font-size: 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  padding: 3px 10px;
  font-weight: 500;
}

/* ── LGPD — ações do titular ───────────────── */
.lgpd-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lgpd-action-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.lgpd-action-item:last-child { border-bottom: none; }
.lgpd-action-item strong { font-size: 14px; }
.lgpd-action-item .field-hint { margin-top: 4px; }
.lgpd-action-item button { white-space: nowrap; flex-shrink: 0; }

/* Botão destrutivo */
.btn-danger {
  background: #DC2626;
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #B91C1C; }

/* ── Tabela de auditoria ───────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-100);
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}
.table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--gray-50); }

