/* ============================================================
   MONITORAMENTO NEXT ROUTER — CSS Principal
   Suporte a tema Dark / Light via CSS Custom Properties
   ============================================================ */

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

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

/* ── Variáveis: Tema Dark (padrão) ────────────────────────── */
:root {
  --bg-primary:       #0f1117;
  --bg-secondary:     #1a1d27;
  --bg-card:          #1e2130;
  --bg-hover:         #252840;
  --sidebar-bg:       #141720;
  --sidebar-width:    260px;
  --sidebar-collapsed:64px;
  --topbar-height:    58px;

  --accent:           #4f7ef7;
  --accent-hover:     #3a66db;
  --accent-light:     rgba(79, 126, 247, 0.12);
  --danger:           #e05c5c;
  --success:          #3dba7b;
  --warning:          #f0a832;
  --info:             #38b4d8;

  --text-primary:     #e8eaf6;
  --text-secondary:   #8b90a7;
  --text-muted:       #565b72;
  --border:           #2a2d3e;
  --border-light:     #33374e;
  --shadow:           0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-sm:        0 2px 8px rgba(0, 0, 0, 0.3);

  --radius:           10px;
  --radius-sm:        6px;
  --transition:       0.22s ease;
}

/* ── Variáveis: Tema Light ────────────────────────────────── */
[data-theme="light"] {
  --bg-primary:       #f0f2f7;
  --bg-secondary:     #e8eaf0;
  --bg-card:          #ffffff;
  --bg-hover:         #eef0f8;
  --sidebar-bg:       #1e2a3a;

  --text-primary:     #1e2130;
  --text-secondary:   #5a6079;
  --text-muted:       #9099b2;
  --border:           #dde1ee;
  --border-light:     #e8eaf5;
  --shadow:           0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-sm:        0 2px 8px rgba(0, 0, 0, 0.06);
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.04);
}

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

/* Logo / Marca */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  height: var(--topbar-height);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  color: #fff;
}

.sidebar-brand .brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.sidebar-brand .brand-name span {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar.collapsed .brand-name { display: none; }

/* Navegação */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 16px 22px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-section-title { opacity: 0; }

/* Item de nav com submenu */
.nav-item { list-style: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin: 2px 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.nav-link.active {
  color: #fff;
  background: var(--accent);
}

.nav-link .nav-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.nav-link .nav-label { flex: 1; }

.nav-link .nav-arrow {
  font-size: 0.7rem;
  transition: transform var(--transition);
  opacity: 0.6;
}

.nav-item.open > .nav-link .nav-arrow { transform: rotate(90deg); }

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-arrow { display: none; }

/* Badge de alertas não lidos */
.nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 1.3rem;
  text-align: center;
  line-height: 1.4;
}

/* Submenu */
.nav-submenu {
  list-style: none;
  display: none;
  padding: 0 0 4px;
}

.nav-item.open .nav-submenu { display: block; }

.nav-submenu .nav-link {
  padding: 8px 18px 8px 50px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  margin: 1px 8px;
}

.nav-submenu .nav-link::before {
  content: '';
  position: absolute;
  left: 34px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
}

.nav-submenu .nav-link.active::before,
.nav-submenu .nav-link:hover::before {
  background: var(--accent);
}

.sidebar.collapsed .nav-submenu { display: none !important; }

/* Toggle do sidebar */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 12px;
}

.sidebar-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all var(--transition);
}

.sidebar-toggle-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar.collapsed .sidebar-toggle-btn span { display: none; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.app-wrapper {
  display: flex;
  width: 100%;
}

.main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition), width var(--transition);
}

.main-content.expanded {
  margin-left: var(--sidebar-collapsed);
  width: calc(100% - var(--sidebar-collapsed));
}

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

.topbar-breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.topbar-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.topbar-breadcrumb a:hover { color: var(--accent); }

.topbar-breadcrumb .separator { opacity: 0.4; }

.topbar-breadcrumb .current {
  color: var(--text-primary);
  font-weight: 600;
}

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

/* Botão de tema */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Avatar do usuário */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition);
}

.user-menu:hover { border-color: var(--accent); }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.user-info { line-height: 1.2; }
.user-info .user-name { font-size: 0.8rem; font-weight: 600; }
.user-info .user-role { font-size: 0.7rem; color: var(--text-muted); }

/* ── Área de Conteúdo ─────────────────────────────────────── */
.content-area {
  flex: 1;
  padding: 28px 28px;
  overflow-y: auto;
}

/* Cabeçalho da página */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Cards de Estatística (Dashboard) ─────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-icon.accent   { background: var(--accent-light); color: var(--accent); }
.stat-icon.success  { background: rgba(61,186,123,0.12); color: var(--success); }
.stat-icon.danger   { background: rgba(224,92,92,0.12); color: var(--danger); }
.stat-icon.warning  { background: rgba(240,168,50,0.12); color: var(--warning); }
.stat-icon.info     { background: rgba(56,180,216,0.12); color: var(--info); }

.stat-body { flex: 1; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.stat-delta { font-size: 0.72rem; margin-top: 6px; }
.stat-delta.up   { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ============================================================
   CARD GENÉRICO
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

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

.card-header .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  flex: 1;
}

.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   GRID / TABELA DE DADOS
   ============================================================ */
.data-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.data-toolbar .toolbar-left { flex: 1; display: flex; gap: 10px; }
.data-toolbar .toolbar-right { display: flex; gap: 8px; }

/* Campo de busca */
.search-input-wrap {
  position: relative;
  min-width: 240px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  transition: border-color var(--transition);
  outline: none;
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); }

/* Select de filtro */
.filter-select {
  padding: 7px 30px 7px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238b90a7' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-select:focus { border-color: var(--accent); }

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

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

.data-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.data-table thead th:hover { color: var(--accent); }

.data-table thead th.sorted-asc::after  { content: ' ↑'; color: var(--accent); }
.data-table thead th.sorted-desc::after { content: ' ↓'; color: var(--accent); }

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }

.data-table tbody td {
  padding: 12px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table .col-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Badges de status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success { background: rgba(61,186,123,0.12); color: var(--success); }
.badge-success::before { background: var(--success); }

.badge-danger  { background: rgba(224,92,92,0.12);  color: var(--danger); }
.badge-danger::before  { background: var(--danger); }

.badge-warning { background: rgba(240,168,50,0.12); color: var(--warning); }
.badge-warning::before { background: var(--warning); }

.badge-info    { background: rgba(56,180,216,0.12); color: var(--info); }
.badge-info::before    { background: var(--info); }

.badge-muted   { background: rgba(139,144,167,0.12); color: var(--text-muted); }
.badge-muted::before   { background: var(--text-muted); }

/* Paginação */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-nav {
  display: flex;
  gap: 4px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

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

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: rgba(224,92,92,0.1);
  color: var(--danger);
  border-color: rgba(224,92,92,0.25);
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-success {
  background: rgba(61,186,123,0.1);
  color: var(--success);
  border-color: rgba(61,186,123,0.25);
}
.btn-success:hover { background: var(--success); color: #fff; border-color: var(--success); }

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-icon.danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(224,92,92,0.1); }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ============================================================
   ALERTAS / MENSAGENS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success { background: rgba(61,186,123,0.08);  border-color: var(--success); color: var(--success); }
.alert-danger  { background: rgba(224,92,92,0.08);   border-color: var(--danger);  color: var(--danger); }
.alert-warning { background: rgba(240,168,50,0.08);  border-color: var(--warning); color: var(--warning); }
.alert-info    { background: rgba(56,180,216,0.08);  border-color: var(--info);    color: var(--info); }

/* ============================================================
   PÁGINA DE LOGIN
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--bg-primary);
}

.login-left {
  flex: 1;
  background: linear-gradient(135deg, #0f1117 0%, #1a1d27 50%, #0d1b38 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,126,247,0.15) 0%, transparent 70%);
  top: -100px;
  right: -100px;
}

.login-left::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,126,247,0.08) 0%, transparent 70%);
  bottom: -50px;
  left: -50px;
}

.login-illustration {
  text-align: center;
  position: relative;
  z-index: 1;
}

.login-illustration .logo-big {
  width: 72px;
  height: 72px;
  background: var(--accent);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px rgba(79,126,247,0.4);
}

.login-illustration h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.login-illustration p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.45);
  max-width: 300px;
  line-height: 1.6;
}

/* Grelha de monitoramento decorativa */
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 40px;
  max-width: 320px;
}

.monitor-cell {
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  position: relative;
  overflow: hidden;
}

.monitor-cell.active {
  background: rgba(79,126,247,0.15);
  border-color: rgba(79,126,247,0.3);
}

.monitor-cell.pulse {
  animation: pulse-cell 2s infinite;
}

@keyframes pulse-cell {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Login - Formulário */
.login-right {
  width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--bg-secondary);
}

.login-box { width: 100%; }

.login-box .login-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-box .login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.login-form .form-control {
  background: var(--bg-primary);
  padding: 11px 14px;
  font-size: 0.9rem;
}

.login-submit {
  width: 100%;
  padding: 12px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 8px;
  letter-spacing: 0.03em;
}

.login-submit:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79,126,247,0.35);
}

.login-submit:active { transform: translateY(0); }

.forgot-link {
  text-align: right;
  margin-top: -10px;
  margin-bottom: 18px;
}

.forgot-link a {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
}

.forgot-link a:hover { text-decoration: underline; }

.login-version {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 32px;
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */
@media (max-width: 1024px) {
  .login-left { display: none; }
  .login-right { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }

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

  .main-content,
  .main-content.expanded {
    margin-left: 0;
    width: 100%;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
  }

  .content-area { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .data-toolbar { flex-direction: column; align-items: flex-start; }
  .toolbar-right { width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .user-info { display: none; }
  .topbar { padding: 0 16px; }
}

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.d-flex    { display: flex; }
.gap-2     { gap: 8px; }
.gap-3     { gap: 12px; }
.mt-1      { margin-top: 4px; }
.mt-2      { margin-top: 8px; }
.mt-3      { margin-top: 16px; }
.mb-3      { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm   { font-size: 0.78rem; }
.fw-bold   { font-weight: 700; }
.w-100     { width: 100%; }

/* Indicador de loading */
.loading-row td {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast de notificação */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  min-width: 280px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
  animation: slideInRight 0.3s ease;
}

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