/* ── uai-tech Portal de Testes — Design System ───────────────────────────── */

/* Variáveis de marca */
:root {
  --brand-primary:   #2563EB;   /* azul uai-tech */
  --brand-secondary: #F97316;   /* laranja uai-tech */
  --brand-dark:      #0F172A;   /* slate-900 */
  --brand-light:     #EFF6FF;   /* azul muito claro */

  /* Sidebar */
  --sidebar-w:          260px;
  --sidebar-bg:         #0B1629;
  --sidebar-border:     #1E2D45;
  --sidebar-text:       #94A3B8;
  --sidebar-text-hover: #E2E8F0;
  --sidebar-active-bg:  rgba(37,99,235,.18);
  --sidebar-active-txt: #60A5FA;
  --sidebar-icon:       #4B6A8F;

  /* Layout */
  --topbar-h:   60px;
  --body-bg:    #F1F5F9;
  --card-bg:    #FFFFFF;
  --border:     #E2E8F0;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 25px -5px rgba(0,0,0,.1);

  /* Tipografia */
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --text-xs:    .75rem;
  --text-sm:    .875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;

  /* Status */
  --green:   #10B981; --green-bg:  #ECFDF5;
  --red:     #EF4444; --red-bg:    #FEF2F2;
  --yellow:  #F59E0B; --yellow-bg: #FFFBEB;
  --gray:    #6B7280; --gray-bg:   #F9FAFB;
  --blue:    #3B82F6; --blue-bg:   #EFF6FF;
  --purple:  #8B5CF6; --purple-bg: #F5F3FF;
  --crimson: #7F1D1D; --crimson-bg:#FEF2F2;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size:   var(--text-sm);
  color:       #1E293B;
  background:  var(--body-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; }

/* ── Layout Admin ─────────────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1E2D45 transparent;
}

/* Marca no sidebar */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-primary), #1D4ED8);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand-icon svg { width: 20px; height: 20px; fill: #fff; }

.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.2; }

.sidebar-brand-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: #F1F5F9;
  letter-spacing: -.3px;
}

.sidebar-brand-name span { color: var(--brand-secondary); }

.sidebar-brand-sub {
  font-size: .65rem;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Logo personalizada */
.sidebar-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-section {
  padding: 16px 16px 4px;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--sidebar-icon);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
  position: relative;
}

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

.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-txt);
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--brand-primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-nav a svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
}

.sidebar-nav a.active svg,
.sidebar-nav a:hover svg { opacity: 1; }

/* Sub-itens */
.sidebar-sub a {
  padding-left: 44px;
  font-size: .8rem;
}

/* Divisor */
.sidebar-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 8px 16px;
}

/* Rodapé do sidebar */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: default;
}

.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), #7C3AED);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-user-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--sidebar-text-hover);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: .7rem;
  color: var(--sidebar-text);
}

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

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

.topbar-left { flex: 1; display: flex; align-items: center; gap: 12px; }

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: #64748B;
}

.topbar-toggle:hover { background: var(--body-bg); }

.breadcrumb-nav { display: flex; align-items: center; gap: 4px; }

.breadcrumb-nav a {
  font-size: var(--text-sm);
  color: #64748B;
  text-decoration: none;
}

.breadcrumb-nav a:hover { color: var(--brand-primary); }

.breadcrumb-sep { color: #CBD5E1; font-size: .7rem; }

.breadcrumb-current {
  font-size: var(--text-sm);
  color: #1E293B;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botão logout na topbar */
.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: #64748B;
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}

.btn-logout:hover {
  background: #FEF2F2;
  border-color: #FECACA;
  color: var(--red);
  text-decoration: none;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: #475569;
}

/* ── Conteúdo ─────────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 24px;
}

/* Cabeçalho de página */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header-left { min-width: 0; }

.page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -.3px;
  line-height: 1.3;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: #64748B;
  margin-top: 2px;
}

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 20px; }

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #FAFAFA;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Cards de métricas do dashboard */
.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .2s;
}

.metric-card:hover { box-shadow: var(--shadow); }

.metric-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.metric-icon svg { width: 24px; height: 24px; }

.metric-icon.blue   { background: var(--blue-bg);   color: var(--blue); }
.metric-icon.green  { background: var(--green-bg);  color: var(--green); }
.metric-icon.orange { background: #FFF7ED; color: var(--brand-secondary); }
.metric-icon.purple { background: var(--purple-bg); color: var(--purple); }
.metric-icon.red    { background: var(--red-bg);    color: var(--red); }

.metric-info { min-width: 0; }
.metric-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #0F172A;
  line-height: 1;
}
.metric-label {
  font-size: var(--text-xs);
  color: #64748B;
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.metric-change {
  font-size: var(--text-xs);
  margin-top: 4px;
  font-weight: 600;
}
.metric-change.up   { color: var(--green); }
.metric-change.down { color: var(--red); }

/* ── Tabelas ────────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748B;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid #F1F5F9;
  transition: background .1s;
}

.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: #F8FAFC; }

.table tbody td {
  padding: 12px 16px;
  color: #334155;
  vertical-align: middle;
}

.table .col-actions { white-space: nowrap; text-align: right; }

/* ── Formulários ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.form-label .required { color: var(--red); margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-size: var(--text-sm);
  font-family: inherit;
  color: #1E293B;
  background: #fff;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-control::placeholder { color: #9CA3AF; }

.form-control.is-invalid { border-color: var(--red); }

textarea.form-control { resize: vertical; min-height: 100px; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

.form-hint { font-size: var(--text-xs); color: #64748B; margin-top: 4px; }

.form-error {
  font-size: var(--text-xs);
  color: var(--red);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Botões ──────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-sm { padding: 5px 10px; font-size: var(--text-xs); }
.btn-lg { padding: 10px 20px; font-size: var(--text-base); }
.btn-icon { padding: 7px; }

.btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.btn-primary:hover {
  background: #1D4ED8;
  border-color: #1D4ED8;
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: #374151;
}
.btn-secondary:hover { background: var(--body-bg); border-color: #C7D2D8; }

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

.btn-warning {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #fff;
}

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

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #64748B;
}
.btn-ghost:hover { background: var(--body-bg); }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}

/* Resultado de caso de teste */
.badge-passou     { background: var(--green-bg);  color: #065F46; }
.badge-falhou     { background: var(--red-bg);    color: #991B1B; }
.badge-bloqueado  { background: var(--yellow-bg); color: #92400E; }
.badge-na         { background: var(--gray-bg);   color: #374151; }

/* Severidade de defeito */
.badge-critica    { background: #7F1D1D; color: #FEE2E2; }
.badge-alta       { background: var(--red-bg);    color: #991B1B; }
.badge-media      { background: var(--yellow-bg); color: #92400E; }
.badge-baixa      { background: var(--blue-bg);   color: #1E40AF; }

/* Status de defeito */
.badge-aberto         { background: var(--red-bg);    color: #991B1B; }
.badge-em_analise     { background: var(--blue-bg);   color: #1E40AF; }
.badge-resolvido      { background: var(--green-bg);  color: #065F46; }
.badge-fechado        { background: var(--gray-bg);   color: #374151; }
.badge-nao_reproducivel { background: var(--purple-bg); color: #5B21B6; }

/* Status de plano / execução */
.badge-rascunho      { background: var(--gray-bg);   color: #374151; }
.badge-ativo         { background: var(--green-bg);  color: #065F46; }
.badge-arquivado     { background: var(--gray-bg);   color: #6B7280; }
.badge-em_andamento  { background: var(--blue-bg);   color: #1E40AF; }
.badge-concluida     { background: var(--green-bg);  color: #065F46; }
.badge-cancelada     { background: var(--red-bg);    color: #991B1B; }

/* Prioridade */
.badge-critica-p  { background: #7F1D1D; color: #FEE2E2; }
.badge-alta-p     { background: var(--red-bg);    color: #991B1B; }
.badge-media-p    { background: var(--yellow-bg); color: #92400E; }
.badge-baixa-p    { background: var(--blue-bg);   color: #1E40AF; }

/* ── Alertas / Flash ─────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-success {
  background: var(--green-bg);
  border-color: #A7F3D0;
  color: #065F46;
}

.alert-error {
  background: var(--red-bg);
  border-color: #FECACA;
  color: #991B1B;
}

.alert-warning {
  background: var(--yellow-bg);
  border-color: #FDE68A;
  color: #92400E;
}

.alert-info {
  background: var(--blue-bg);
  border-color: #BFDBFE;
  color: #1E40AF;
}

/* ── Toast ─────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #1E293B;
  color: #F1F5F9;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn .3s ease;
  max-width: 380px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--yellow); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Paginação ──────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: #374151;
  border: 1px solid var(--border);
  background: var(--card-bg);
  text-decoration: none;
  transition: all .15s;
}

.pagination a:hover    { background: var(--body-bg); color: var(--brand-primary); border-color: var(--brand-primary); }
.pagination .current   { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); font-weight: 600; }
.pagination .disabled  { opacity: .4; cursor: not-allowed; }

/* ── Tela de execução caso a caso ────────────────────────────────────────────── */
.execution-case {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  transition: border-color .2s;
}

.execution-case.status-passou     { border-color: var(--green); }
.execution-case.status-falhou     { border-color: var(--red); }
.execution-case.status-bloqueado  { border-color: var(--yellow); }
.execution-case.status-na         { border-color: var(--gray); }

.case-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.case-number {
  width: 28px; height: 28px;
  background: var(--body-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: #64748B;
  flex-shrink: 0;
}

.case-title {
  font-weight: 600;
  color: #0F172A;
  flex: 1;
}

.result-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn-result {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 5px;
}

.btn-result.passou    { background: var(--green-bg);  color: #065F46; border-color: #A7F3D0; }
.btn-result.falhou    { background: var(--red-bg);    color: #991B1B; border-color: #FECACA; }
.btn-result.bloqueado { background: var(--yellow-bg); color: #92400E; border-color: #FDE68A; }
.btn-result.na        { background: var(--gray-bg);   color: #374151; border-color: #E5E7EB; }

.btn-result.selected.passou    { background: var(--green);  color: #fff; border-color: var(--green); }
.btn-result.selected.falhou    { background: var(--red);    color: #fff; border-color: var(--red); }
.btn-result.selected.bloqueado { background: var(--yellow); color: #fff; border-color: var(--yellow); }
.btn-result.selected.na        { background: var(--gray);   color: #fff; border-color: var(--gray); }

/* ── Barra de progresso ────────────────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--body-bg);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--brand-primary), var(--green));
  transition: width .4s ease;
}

/* ── Utilitários ────────────────────────────────────────────────────────────── */
.text-muted  { color: #64748B; }
.text-sm     { font-size: var(--text-sm); }
.text-xs     { font-size: var(--text-xs); }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.text-center { text-align: center; }
.w-100       { width: 100%; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #94A3B8;
}

.empty-state svg { width: 56px; height: 56px; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: var(--text-sm); }

/* ── Filtros ────────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
}

.filter-bar .form-control,
.filter-bar .form-select { width: auto; min-width: 160px; }

/* ── Modal confirm ──────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  padding: 28px;
}

.modal-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

.modal-icon.danger { background: var(--red-bg); color: var(--red); }

.modal-title { font-size: var(--text-lg); font-weight: 700; color: #0F172A; margin-bottom: 8px; }
.modal-desc  { font-size: var(--text-sm); color: #64748B; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0B1629 0%, #0F172A 40%, #1a2a4a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -30%; right: -20%;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.12) 0%, transparent 70%);
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -20%; left: -10%;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0,0,0,.4);
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--brand-primary), #1D4ED8);
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(37,99,235,.4);
}

.login-logo-wrap svg { width: 32px; height: 32px; fill: #fff; }

.login-brand-name {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #F1F5F9;
  letter-spacing: -.5px;
}

.login-brand-name span { color: var(--brand-secondary); }

.login-brand-sub {
  font-size: var(--text-xs);
  color: #94A3B8;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.login-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: #F1F5F9;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: var(--text-sm);
  color: #94A3B8;
  margin-bottom: 28px;
}

.login-card .form-label { color: #CBD5E1; }

.login-card .form-control {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.12);
  color: #F1F5F9;
}

.login-card .form-control:focus {
  background: rgba(255,255,255,.1);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.2);
}

.login-card .form-control::placeholder { color: #4B6A8F; }

.login-card .btn-primary {
  background: var(--brand-primary);
  font-size: var(--text-base);
  padding: 10px;
  justify-content: center;
}

.login-card .btn-primary:hover { background: #1D4ED8; }

/* ── Responsividade ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .topbar-toggle { display: flex; }

  .main-content { padding: 16px; }

  .page-title { font-size: var(--text-xl); }

  .metric-card { flex-direction: column; text-align: center; }
}

/* ── Scrollbar customizada ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ── Skeleton loading ─────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-wave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Divisor visual ──────────────────────────────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: #94A3B8;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
