/* =========================================================
   Sistema de Gestão Empresarial — Tema
   Roxo (principal) + Laranja (destaque) — Dark Theme
   ========================================================= */

:root {
  --bg-primary: #120f1b;
  --bg-secondary: #1c1730;
  --bg-elevated: #241d3d;
  --border: #2c2547;

  --purple: #7c5cff;
  --purple-dark: #5a3fd6;
  --purple-glow: rgba(124, 92, 255, 0.25);

  --orange: #ff7a3d;
  --orange-soft: rgba(255, 122, 61, 0.15);

  --text-primary: #f1eefc;
  --text-muted: #9d94c2;

  --success: #34d399;
  --danger: #f4576b;
  --warning: #ffc857;

  --font-heading: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, .app-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--orange); }

/* ---------- Layout ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, #17122a 100%);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  color: var(--text-primary);
  padding: 0 8px 24px;
}

.app-brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 12px var(--orange);
}

.nav-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}

.nav-link-app {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 2px;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link-app:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-link-app.active {
  background: var(--purple-glow);
  color: var(--text-primary);
}

.nav-link-app.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}

.nav-link-app i { font-size: 1.05rem; width: 20px; text-align: center; }

.app-main {
  flex: 1;
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 15, 27, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.app-search input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 8px 16px 8px 38px;
  font-size: 0.88rem;
}

.app-search input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}

.app-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.app-content { padding: 28px; }

/* ---------- Cards ---------- */
.card-app {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: 3px solid var(--purple);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-top-color: var(--orange);
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 600;
  margin-top: 4px;
}

.stat-card.alert { border-top-color: var(--orange); }
.stat-card.alert .stat-value { color: var(--orange); }

/* ---------- Buttons ---------- */
.btn-app-primary {
  background: var(--orange);
  border: none;
  color: #1a1108;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  transition: filter 0.15s ease;
}
.btn-app-primary:hover { filter: brightness(1.08); color: #1a1108; }

.btn-app-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
}
.btn-app-secondary:hover { border-color: var(--purple); background: var(--bg-elevated); }

/* ---------- Login page ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, var(--purple-glow), transparent 40%),
    radial-gradient(circle at 80% 80%, var(--orange-soft), transparent 40%),
    var(--bg-primary);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
}

.login-card .form-control {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.login-card .form-control:focus {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}

@media (max-width: 900px) {
  .app-sidebar { position: fixed; left: -280px; z-index: 20; transition: left 0.2s ease; }
  .app-sidebar.open { left: 0; }
  .app-content { padding: 18px; }
}
