/* Estilos Globais N70 Enterprise Mordomia Navy + Design System Corporativo Completo */
:root {
  --canvas: #f0f4f9;
  --panel: #ffffff;
  --nav: #0c192c;
  --nav-hover: #172a46;
  --nav-active: #1e365d;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue-primary: #2563eb;
  --blue-hover: #1d4ed8;
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --purple: #8b5cf6;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

/* Suporte a Temas Alternáveis */
[data-theme="light"] {
  --canvas: #ffffff;
  --panel: #f8fafc;
  --nav: #1e293b;
  --line: #cbd5e1;
}

[data-theme="emerald"] {
  --canvas: #f0fdf4;
  --panel: #ffffff;
  --nav: #064e3b;
  --blue-primary: #10b981;
  --blue-hover: #059669;
  --line: #dcfce7;
}

[data-theme="dark"] {
  --canvas: #080b11;
  --panel: #0f1624;
  --nav: #0f1624;
  --nav-hover: #1e293b;
  --nav-active: #2563eb;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --line: #233148;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  margin: 0;
  background-color: var(--canvas);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Encapsulamento Global de Cards (.n70-card / .card) */
.n70-card, .card, article.card, section.card {
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.n70-card:hover, .card:hover {
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.08);
}

/* Formulários, Inputs & Selects Globais */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background-color: #ffffff;
  color: var(--ink);
  padding: 0 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

textarea {
  height: auto;
  padding: 12px 16px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background-color: #ffffff;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Botões Globais */
.btn-primary, button[type="submit"], .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 24px;
  border-radius: 10px;
  background-color: var(--blue-primary);
  color: #ffffff;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover, button[type="submit"]:hover, .primary-button:hover {
  background-color: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-danger, .card-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  background-color: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-danger:hover, .card-logout:hover {
  background-color: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

/* Tipografia de Cabeçalho */
.eyebrow {
  color: var(--blue-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

h1, h2, h3 { color: var(--ink); margin-top: 0; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
.intro, p.muted-copy { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Grid da Shell */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

/* Sidebar Fixa Navy Mordomia */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  background: var(--nav);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  z-index: 30;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  text-decoration: none;
  color: #ffffff;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.brand strong { display: block; font-size: 20px; font-weight: 800; }
.brand small { display: block; color: #94a3b8; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1px; }

.sidebar nav { display: flex; flex-direction: column; gap: 6px; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar nav a:hover {
  background: var(--nav-hover);
  color: #ffffff;
}

.sidebar nav a.active {
  background: var(--nav-active);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

/* Rodapé da Sidebar */
.sidebar-profile {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-user {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #10b981);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.profile-info { flex-grow: 1; min-width: 0; }
.profile-info strong { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #ffffff; }
.profile-info small { display: block; font-size: 10px; color: #94a3b8; margin-top: 2px; }

.btn-logout-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-logout-sidebar:hover { background: #ef4444; color: #ffffff; }

/* Canvas Principal */
main {
  padding: 32px 40px 60px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.page-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

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

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge-status.sync { background: rgba(16, 185, 129, 0.12); color: #059669; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-status.prod { background: rgba(245, 158, 11, 0.12); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.3); }

.dot-green { width: 7px; height: 7px; border-radius: 50%; background: #10b981; }
.dot-yellow { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }

.btn-logout-topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-logout-topbar:hover { background: #ef4444; color: #ffffff; }

/* Botão Flutuante de Ajuda (?) */
.btn-floating-help {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--blue-primary);
  color: #ffffff;
  border: none;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  z-index: 100;
}

.btn-floating-help:hover { transform: scale(1.08); background: #1d4ed8; }

/* Grid de Form de 3 Colunas para Segurança */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
}
