/* ==========================================================================
   LEVVI — GLOBAL CSS
   Identidade: Minimalista, Premium, Health-tech, SaaS
   Cores: Verde (#508D3F), Grafite (#292929), Off-White (#F2EEE5), Branco (#FFFFFF)
   ========================================================================== */

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

:root {
  /* Paleta Primária LEVVI */
  --levvi-green: #508D3F;
  --levvi-green-hover: #437634;
  --levvi-green-light: #EAF4E7;
  --levvi-green-glow: rgba(80, 141, 63, 0.18);
  
  /* Tons Neutros e Escuros */
  --levvi-dark: #202320;
  --levvi-dark-sidebar: #1C1F1C;
  --levvi-dark-hover: #292E29;
  --levvi-dark-active: #323832;
  
  /* Fundo e Superfícies */
  --levvi-bg: #F4F0E8;
  --levvi-bg-subtle: #ECE7DE;
  --levvi-card: #FFFFFF;
  --levvi-card-muted: #FBF9F5;
  
  /* Tipografia */
  --levvi-text: #222522;
  --levvi-text-secondary: #585F57;
  --levvi-text-muted: #848D83;
  --levvi-text-light: #A4ACA2;
  --levvi-text-white: #FFFFFF;
  
  /* Bordas e Linhas */
  --levvi-border: #E8E3D8;
  --levvi-border-subtle: rgba(0, 0, 0, 0.06);
  --levvi-border-focus: rgba(80, 141, 63, 0.4);
  
  /* Status & Badges */
  --status-active-bg: #EAF4E7;
  --status-active-text: #3B722C;
  --status-pending-bg: #FEF6E6;
  --status-pending-text: #B7791F;
  --status-inactive-bg: #F3F4F6;
  --status-inactive-text: #6B7280;
  --status-danger-bg: #FDE8E8;
  --status-danger-text: #C53030;
  --status-info-bg: #EBF5FF;
  --status-info-text: #2B6CB0;
  --status-purple-bg: #F3E8FF;
  --status-purple-text: #6B21A8;

  /* Geometria e Sombras */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);

  /* Layout */
  --sidebar-width: 250px;
  --header-height: 72px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--levvi-bg);
  color: var(--levvi-text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Links & Textos */
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
  transition: var(--transition);
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--levvi-text);
}

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

/* ==========================================================================
   LAYOUT GERAL: SIDEBAR FIXA + ÁREA PRINCIPAL
   ========================================================================== */

.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Fixa */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background-color: var(--levvi-dark-sidebar);
  color: #D2D8D1;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-header {
  padding: 24px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--levvi-text-white);
}

.brand-logo .brand-dot {
  width: 7px;
  height: 7px;
  background-color: var(--levvi-green);
  border-radius: 50%;
  display: inline-block;
  margin-left: 2px;
  align-self: flex-end;
  margin-bottom: 5px;
}

.brand-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 3px 8px;
  background: rgba(80, 141, 63, 0.18);
  color: #85CE72;
  border-radius: var(--radius-full);
}

/* Navegação da Sidebar */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6C746B;
  padding: 14px 12px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: #A9B3A8;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  background-color: var(--levvi-dark-hover);
  color: var(--levvi-text-white);
}

.nav-item.active {
  background-color: var(--levvi-dark-active);
  color: var(--levvi-text-white);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3.5px;
  background-color: var(--levvi-green);
  border-radius: 0 4px 4px 0;
}

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

.nav-item:hover svg,
.nav-item.active svg {
  opacity: 1;
  color: var(--levvi-green);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: #E2E6E1;
  font-weight: 600;
}

.nav-badge.badge-green {
  background: var(--levvi-green);
  color: #FFFFFF;
}

/* Rodapé da Sidebar */
.sidebar-footer {
  padding: 12px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-top: 6px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  transition: var(--transition);
}

.user-profile-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: #363B35;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #FFFFFF;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.25;
}

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

.user-role {
  font-size: 0.73rem;
  color: #8C968B;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Área de Conteúdo Principal */
.main-wrapper {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 28px 36px 48px;
  max-width: 1600px;
  width: 100%;
}

/* Header Superior da Página */
.page-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
}

.page-title-group h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--levvi-text);
  line-height: 1.2;
}

.page-title-group p {
  font-size: 0.92rem;
  color: var(--levvi-text-secondary);
  margin-top: 4px;
}

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

.date-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--levvi-card);
  border: 1px solid var(--levvi-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--levvi-text-secondary);
}

.date-indicator svg {
  width: 15px;
  height: 15px;
  color: var(--levvi-green);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--levvi-card);
  border: 1px solid var(--levvi-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--levvi-text-secondary);
  position: relative;
  transition: var(--transition);
}

.icon-button:hover {
  background: #FFFFFF;
  border-color: #D8D2C6;
  color: var(--levvi-text);
}

.notification-badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background-color: var(--levvi-green);
  border-radius: 50%;
  border: 2px solid var(--levvi-card);
}

@media (max-width: 1200px) {
  :root {
    --sidebar-width: 230px;
  }
  .main-content {
    padding: 20px 24px 36px;
  }
}
