/* ==========================================================================
   AUDIOSYNC ENTERPRISE DESIGN SYSTEM
   Visual Moderno, Glassmorphism Dark Mode, Clean SVG Icons & Typography
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Core Palette */
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-primary-light: rgba(99, 102, 241, 0.12);
  --brand-primary-glow: rgba(99, 102, 241, 0.35);

  --brand-cyan: #06b6d4;
  --brand-cyan-light: rgba(6, 182, 212, 0.12);
  
  --brand-success: #10b981;
  --brand-success-light: rgba(16, 185, 129, 0.12);
  
  --brand-warning: #f59e0b;
  --brand-warning-light: rgba(245, 158, 11, 0.12);
  
  --brand-danger: #ef4444;
  --brand-danger-light: rgba(239, 68, 68, 0.12);

  /* Surface & Background (Glassmorphism Dark) */
  --bg-app: #090d16;
  --bg-radial: radial-gradient(circle at 50% 0%, rgba(30, 27, 75, 0.5) 0%, rgba(9, 13, 22, 1) 75%);
  --bg-sidebar: rgba(15, 23, 42, 0.85);
  --bg-card: rgba(30, 41, 59, 0.55);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: rgba(15, 23, 42, 0.7);
  
  /* Borders & Dividers */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(99, 102, 241, 0.4);
  
  /* Typography */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Shapes & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px inset rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.3);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-app);
  background-image: var(--bg-radial);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--brand-cyan);
}

/* Layout Container */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.1rem;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.sidebar-logo-icone {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.sidebar-logo-icone svg {
  width: 22px;
  height: 22px;
}

.sidebar-logo-texto {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  display: block;
}

.sidebar-logo-sub {
  font-size: 0.68rem;
  color: var(--brand-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  display: block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  opacity: 0.75;
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.05);
  transform: translateX(3px);
}

.nav-item:hover svg {
  opacity: 1;
  stroke: var(--brand-cyan);
}

.nav-item.ativo {
  background: var(--brand-primary-light);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-weight: 700;
}

.nav-item.ativo svg {
  opacity: 1;
  stroke: #818cf8;
}

.sidebar-rodape {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Main Content Area */
.conteudo-principal {
  margin-left: 270px;
  flex: 1;
  padding: 2.2rem;
  max-width: 1440px;
}

/* Top Bar / Header */
.topo-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.topo-titulo h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topo-titulo p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.topo-usuario {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge-usuario {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(10px);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Glassmorphism Cards & Panels */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.2rem;
}

.card-stat {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.card-stat:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
}

.card-stat-icone {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-stat-icone svg {
  width: 24px;
  height: 24px;
}

.stat-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.25); }
.stat-cyan   { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.25); }
.stat-emerald{ background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }
.stat-amber  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }

.card-stat-info h3 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.card-stat-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Sections & Forms Container */
.painel-secao {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.secao-cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.secao-cabecalho h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.secao-cabecalho h2 svg {
  width: 20px;
  height: 20px;
  color: var(--brand-primary);
}

/* Custom Table Design */
.tabela-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.tabela-custom {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.tabela-custom th {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.tabela-custom td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.tabela-custom tr:last-child td {
  border-bottom: none;
}

.tabela-custom tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges & Status Dots */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.badge-ativo   { background: var(--brand-success-light); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-ativo .status-dot { background: #34d399; box-shadow: 0 0 8px #34d399; }

.badge-inativo { background: var(--brand-danger-light); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-inativo .status-dot { background: #f87171; }

.badge-alerta  { background: var(--brand-warning-light); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-alerta .status-dot { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: var(--font-family);
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.btn-primario {
  background: linear-gradient(135deg, var(--brand-primary), #4338ca);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primario:hover {
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-secundario {
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secundario:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-perigo {
  background: var(--brand-danger-light);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-perigo:hover {
  background: var(--brand-danger);
  color: #ffffff;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
}

/* Forms & Controls */
.form-grupo {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  letter-spacing: 0.01em;
}

.form-controle {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-controle:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.9);
}

/* Flash Alerts */
.alerta {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.92rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.alerta-sucesso { background: var(--brand-success-light); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.alerta-erro    { background: var(--brand-danger-light); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.alerta-aviso   { background: var(--brand-warning-light); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.alerta-info    { background: var(--brand-cyan-light); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }

/* Login Page Styling */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top, #1e1b4b 0%, #090d16 80%);
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: rgba(30, 41, 59, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-cyan));
}

.login-cabecalho {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icone {
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-cyan));
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-glow);
}

.login-cabecalho h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-cabecalho p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

/* Responsive Media Queries */
@media (max-width: 868px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .layout-wrapper {
    flex-direction: column;
  }

  .conteudo-principal {
    margin-left: 0;
    padding: 1.25rem;
  }

  .grid-cards {
    grid-template-columns: 1fr;
  }
}
