/* ============================================================
   Portal C.I. — Folha de estilos global
   Design: estilo CadUse — fundo cinza-azulado em gradiente,
   card branco central, azul #2563eb, verde #10b981, Inter.
   ============================================================ */

/* ─── Variáveis CSS ─────────────────────────────────────────── */
:root {
  --primary:        #2563eb;
  --primary-hover:  #1d4ed8;
  --primary-light:  #dbeafe;
  --success:        #10b981;
  --success-hover:  #059669;
  --success-bg:     #d1fae5;
  --success-text:   #065f46;
  --warning:        #f59e0b;
  --warning-bg:     #fef3c7;
  --warning-text:   #92400e;
  --danger:         #ef4444;
  --danger-hover:   #dc2626;
  --danger-bg:      #fee2e2;
  --danger-text:    #991b1b;
  --info:           #3b82f6;
  --info-bg:        #eff6ff;
  --info-text:      #1e40af;

  /* Fundo no estilo CadUse */
  --bg:             linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
  --bg-solid:       #f0f4f8;
  --surface:        #ffffff;
  --border:         #e2e8f0;
  --border-focus:   #2563eb;
  --text:           #1e293b;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  --sidebar-w:      248px;
  --topbar-h:       64px;
  --radius:         12px;
  --radius-sm:      8px;
  --shadow:         0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-sm:      0 1px 4px rgba(0,0,0,.06);
  --transition:     .18s ease;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout (sidebar + main) ───────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  background: #1e293b;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  z-index: 100;
  transition: transform var(--transition);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: rgba(37,99,235,.4);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-brand .brand-text h2 { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-brand .brand-text p  { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 10px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.75);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
  user-select: none;
}

.nav-item:hover  { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(37,99,235,.5);    color: #fff; }

.nav-item .nav-icon  { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 11px;
  color: rgba(255,255,255,.35);
}

/* ─── Main wrapper ──────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Topbar ────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.topbar-title { font-size: 17px; font-weight: 700; color: var(--text); flex: 1; }

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

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 2px solid #bfdbfe;
}

.user-info { text-align: right; }
.user-info .user-name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.user-info .user-role { font-size: 11px; color: var(--text-muted); }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}
.btn-logout:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger-text);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 22px;
  padding: 4px;
}

/* Overlay sidebar mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ─── Content area ──────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 28px;
}

.page-section         { display: none; }
.page-section.active  { display: block; }

/* ─── Page header ───────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--text); }
.page-header p  { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ─── Metric cards ──────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition);
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-card.blue   { border-color: var(--primary); }
.metric-card.green  { border-color: var(--success); }
.metric-card.yellow { border-color: var(--warning); }
.metric-card.red    { border-color: var(--danger); }

.metric-card .metric-icon  { font-size: 24px; margin-bottom: 8px; }
.metric-card .metric-value { font-size: 32px; font-weight: 800; line-height: 1; color: var(--text); }
.metric-card .metric-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ─── Card (surface genérico) ───────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.card-header h2 { font-size: 16px; font-weight: 700; color: var(--text); }
.card-body { padding: 24px; }

/* ─── Formulário ────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group:last-child { margin-bottom: 0; }

.form-group label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

::placeholder { color: #a0aec0; }

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

input.input-error, textarea.input-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}

textarea { resize: vertical; min-height: 130px; }

.form-error {
  font-size: 12px;
  color: var(--danger-text);
  font-weight: 500;
  display: block;
}

.form-hint { font-size: 12px; color: var(--text-muted); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-row-space {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Campo de senha */
.input-password { position: relative; }
.input-password input { padding-right: 42px; }
.btn-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center;
  padding: 4px;
  border-radius: 4px;
}
.btn-toggle-password svg { width: 18px; height: 18px; }
.btn-toggle-password:hover { color: var(--primary); }

/* ─── Botões ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}

.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary  { background: var(--primary);  color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled)  { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-success  { background: var(--success);  color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled)  { background: var(--success-hover); border-color: var(--success-hover); }

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

.btn-warning  { background: #d97706; color: #fff; border-color: #d97706; }
.btn-warning:hover:not(:disabled)  { background: #b45309; }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; }

.btn-sm   { padding: 6px 13px; font-size: 12.5px; }
.btn-full { width: 100%; }

/* Estado loading do botão */
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: 2px;
}

/* ─── Número de CI (código) ──────────────────────────────────── */
.num-ci {
  font-family: 'JetBrains Mono', 'Fira Code', monospace, monospace;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ─── Tabela ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: #f8fafc;
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover         { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable     { cursor: pointer; }

.table-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.table-empty .empty-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 10px;
  opacity: .6;
}

/* ─── Badges de status ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-info    { background: var(--info-bg);     color: var(--info-text); }
.badge-success { background: var(--success-bg);  color: var(--success-text); }
.badge-danger  { background: var(--danger-bg);   color: var(--danger-text); }
.badge-warning { background: var(--warning-bg);  color: var(--warning-text); }
.badge-muted   { background: #f1f5f9;            color: var(--text-muted); }

/* ─── Busca / filtro ────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-input-wrap .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
}
.search-input-wrap input { padding-left: 34px; }

.filter-select { min-width: 160px; }

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  padding: 20px;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0,0,0,.2);
  width: 94%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(-16px) scale(.98);
  transition: transform var(--transition);
  border: 1px solid var(--border);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-lg { max-width: 840px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--text); }

.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--text-muted); line-height: 1;
  padding: 2px 8px; border-radius: 6px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ─── Toasts ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 24px rgba(0,0,0,.14);
  font-size: 13.5px;
  font-weight: 500;
  pointer-events: all;
  min-width: 260px;
  max-width: 400px;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .25s, transform .25s;
  border-left: 4px solid transparent;
}
.toast.toast-visible { opacity: 1; transform: translateX(0); }

.toast-success { background: #f0fdf4; color: #065f46; border-color: #22c55e; }
.toast-error   { background: #fef2f2; color: #991b1b; border-color: #ef4444; }
.toast-warning { background: #fffbeb; color: #92400e; border-color: #f59e0b; }
.toast-info    { background: #eff6ff; color: #1e40af; border-color: #3b82f6; }

.toast-icon    { font-size: 16px; flex-shrink: 0; font-weight: 700; }
.toast-message { flex: 1; }
.toast-close   { background: none; border: none; cursor: pointer; opacity: .55; font-size: 18px; line-height: 1; }
.toast-close:hover { opacity: 1; }

/* ─── Alert inline ──────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: #6ee7b7; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger-text);  border-color: #fca5a5; }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-color: #fde68a; }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border-color: #93c5fd; }

/* ─── Banner (destaque dentro do modal) ─────────────────────── */
.banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}
.banner-danger  { background: var(--danger-bg);  border: 1px solid #fca5a5; color: var(--danger-text); }
.banner-warning { background: var(--warning-bg); border: 1px solid #fde68a; color: var(--warning-text); }
.banner-info    { background: var(--info-bg);    border: 1px solid #93c5fd; color: var(--info-text); }
.banner-icon    { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.banner-body    { flex: 1; }
.banner-body h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.banner-body p  { font-size: 13px; line-height: 1.5; }

/* ─── Checkbox custom ───────────────────────────────────────── */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
  user-select: none;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkbox-custom {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  background: var(--surface);
}
.checkbox-label input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-label input:checked + .checkbox-custom::after {
  content: '✓';
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ─── Detail info grid ──────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-item .detail-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.detail-item .detail-value { font-size: 14px; color: var(--text); }
.detail-item.full { grid-column: 1 / -1; }

.detail-motivo {
  background: #f8fafc;
  border-left: 3px solid #e2e8f0;
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
}

.detail-recusa {
  background: var(--danger-bg);
  border-left: 3px solid var(--danger);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--danger-text);
  line-height: 1.65;
}

/* ─── Timeline / histórico da CI ────────────────────────────── */
.timeline { display: flex; flex-direction: column; }

.timeline-item {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 32px;
  bottom: -4px;
  width: 2px;
  background: var(--border);
}
.timeline-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--primary);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  margin-top: 2px;
  z-index: 1;
}
.timeline-dot.success { background: var(--success-bg); border-color: var(--success); }
.timeline-dot.danger  { background: var(--danger-bg);  border-color: var(--danger); }
.timeline-dot.info    { background: var(--info-bg);    border-color: var(--info); }

.timeline-content { flex: 1; }
.timeline-action  { font-size: 13px; font-weight: 600; color: var(--text); }
.timeline-detail  { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.timeline-date    { font-size: 11px; color: var(--text-light); margin-top: 3px; }

/* ─── Paginação ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}
.page-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 700;
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-info { font-size: 13px; color: var(--text-muted); padding: 0 8px; }

/* ─── Utilitários ───────────────────────────────────────────── */
.mt-sm  { margin-top: 8px; }
.mt-md  { margin-top: 16px; }
.mb-sm  { margin-bottom: 8px; }
.mb-md  { margin-bottom: 16px; }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 11.5px; }
.font-bold    { font-weight: 700; }
.link-muted   { color: var(--text-muted); font-size: 13px; }
.link-muted:hover { color: var(--primary); }
.separator    { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ─── Spinner ───────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row td { text-align: center; padding: 32px; }

/* ════════════════════════════════════════════════════════════
   LOGIN PAGE — estilo CadUse fiel
   ════════════════════════════════════════════════════════════ */
.login-page {
  background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
  min-height: 100vh;
}

.login-bg {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Painel esquerdo: branding azul escuro */
.login-left {
  background: #1e3a5f;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  color: #fff;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 52px;
}
.login-brand .brand-icon {
  width: 64px; height: 64px;
  background: rgba(37,99,235,.5);
  border-radius: 18px;
  font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.login-brand h1 { font-size: 28px; font-weight: 800; color: #fff; }
.login-brand p  { font-size: 13px; color: rgba(255,255,255,.65); margin-top: 3px; }

.login-features { display: flex; flex-direction: column; gap: 20px; }
.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: rgba(255,255,255,.85);
  font-weight: 500;
}
.feature-icon { font-size: 22px; }

/* Painel direito: card de login */
.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 48px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.06);
  border: 1px solid rgba(255,255,255,.8);
}

.login-card-header { margin-bottom: 28px; }
.login-card-header h2 { font-size: 24px; font-weight: 800; color: var(--text); }
.login-card-header p  { font-size: 14px; color: var(--text-muted); margin-top: 5px; }

.login-card form { display: flex; flex-direction: column; gap: 18px; }

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Responsivo ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .login-left { padding: 40px; }
}

@media (max-width: 768px) {
  /* Login mobile */
  .login-bg { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { padding: 24px 20px; min-height: 100vh; background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%); }
  .login-card { padding: 28px 24px; border-radius: 14px; }

  /* App mobile */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 32px rgba(0,0,0,.2);
  }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; width: 100%; }
  .hamburger { display: flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }

  /* Grid */
  .detail-grid { grid-template-columns: 1fr; }
  .form-row    { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .user-info { display: none; }
  .search-bar { flex-direction: column; align-items: stretch; }
  .filter-select { min-width: 0; width: 100%; }
}

/* ─── Autocomplete Dropdown (Cubo dos Funcionários) ────────── */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border-focus);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0,0,0,.14);
  z-index: 1000;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 4px;
}
.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  font-size: 13.5px;
}
.autocomplete-item:hover, .autocomplete-item.active {
  background: var(--primary-light);
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

