/* Paleta Carol Boho */
:root {
  --bg: #F5F1ED;
  --surface: rgba(250, 248, 246, 0.95);
  --surface-strong: #FFFFFF;
  --text: #2D2622;
  --muted: #7A7570;
  --line: #E8E4E0;
  --teal: #2D7F76;
  --gold: #D4A437;
  --bronze: #B87333;
  --silver: #C9C9C9;
  --shadow: 0 12px 32px rgba(45, 127, 118, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Georgia, serif;
  color: var(--text);
  background: linear-gradient(135deg, #F5F1ED 0%, #FAFAF8 100%);
}

/* Header */
.app-header {
  background: var(--surface-strong);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--text);
}

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

.app-main {
  flex: 1;
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  gap: 2rem;
  padding: 2rem;
}

/* Sidebar */
.sidebar {
  width: 260px;
  flex-shrink: 0;
}

.nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface-strong);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.nav-tab {
  padding: 0.9rem 1.2rem;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 200ms ease;
  font-family: inherit;
}

.nav-tab:hover {
  background: rgba(45, 127, 118, 0.08);
  border-color: var(--teal);
}

.nav-tab.active {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}

/* Legenda */
.legend {
  background: var(--surface-strong);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.legend h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--text);
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--text);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Content */
.content {
  flex: 1;
  min-width: 0;
}

.section {
  display: none;
  background: var(--surface-strong);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.section.active {
  display: block;
}

.section h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.8rem;
  color: var(--text);
}

/* Calendário */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--line);
}

.calendar-header h2 {
  margin: 0;
  font-size: 1.5rem;
  min-width: 180px;
  text-align: center;
}

.nav-btn {
  padding: 0.7rem 1.2rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  transition: all 200ms ease;
}

.nav-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* Grid Calendário */
.calendar {
  margin-bottom: 2rem;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--teal);
  text-align: center;
  font-size: 0.9rem;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  min-height: 400px;
}

.day {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  min-height: 80px;
  cursor: pointer;
  transition: all 200ms ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.day:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 12px rgba(45, 127, 118, 0.15);
}

.day.other-month {
  opacity: 0.3;
}

.day.today {
  border: 2px solid var(--teal);
  background: rgba(45, 127, 118, 0.05);
}

.day-number {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  overflow: hidden;
}

.event-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  flex-shrink: 0;
}

/* Detalhes do dia */
.day-details {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.5rem;
  min-height: 200px;
}

.day-details h3 {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  color: var(--text);
}

.day-agendamentos {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.agendamento-card {
  background: white;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.agendamento-card h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.agendamento-card p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

/* Team Grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.team-category {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.5rem;
}

.team-category h3 {
  margin: 0 0 1rem 0;
  color: var(--text);
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.team-member {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
}

.team-member h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.team-member p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Tráfego */
.traffic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.traffic-period {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.traffic-period label {
  font-weight: 600;
  color: var(--text);
}

.traffic-period select {
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  background: white;
}

.traffic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.traffic-card {
  background: linear-gradient(135deg, rgba(212, 164, 55, 0.1), rgba(212, 164, 55, 0.05));
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.traffic-card label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.traffic-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
}

.traffic-details {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.traffic-details h3 {
  margin: 0 0 1rem 0;
  color: var(--text);
}

.traffic-expenses {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.traffic-expense-item {
  background: white;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.traffic-expense-item h4 {
  margin: 0 0 0.3rem 0;
  color: var(--text);
}

.traffic-expense-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.traffic-expense-value {
  font-weight: 700;
  color: var(--gold);
  font-size: 1.1rem;
}

.traffic-history {
  max-height: 400px;
  overflow-y: auto;
}

.traffic-month-row {
  background: white;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 2rem;
}

.traffic-month-row p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.traffic-month-row strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.3rem;
}

/* Financeiro */
.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.finance-card {
  background: linear-gradient(135deg, rgba(45, 127, 118, 0.1), rgba(212, 164, 55, 0.05));
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.finance-card label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.finance-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--teal);
}

.finance-details {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.finance-details h3 {
  margin: 0 0 1rem 0;
  color: var(--text);
}

.package-finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.package-finance-item {
  background: white;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 1rem;
}

.package-finance-item h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.package-finance-item p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.finance-agendamentos {
  max-height: 400px;
  overflow-y: auto;
}

.finance-agendamento-row {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  border-left: 4px solid;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.finance-agendamento-row p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

/* Pacotes */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.package-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 1rem;
  align-items: center;
}

.package-info input {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  margin-bottom: 0.5rem;
}

.package-color input {
  width: 100%;
  height: 50px;
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.package-actions {
  display: flex;
  gap: 0.5rem;
}

/* Botões */
button {
  font-family: inherit;
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  transition: all 200ms ease;
}

.primary {
  background: var(--teal);
  color: white;
  padding: 0.9rem 1.5rem;
  font-weight: 600;
}

.primary:hover {
  background: #1f5d54;
}

.small-btn {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
}

.danger {
  background: rgba(139, 105, 20, 0.12);
  color: #8B6914;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
}

.danger:hover {
  background: rgba(139, 105, 20, 0.2);
}

/* Responsivo */
@media (max-width: 1024px) {
  .app-main {
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .sidebar {
    width: 200px;
  }

  .section {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .app-main {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .sidebar {
    width: 100%;
    order: 2;
  }

  .content {
    order: 1;
  }

  .calendar-header {
    flex-direction: column;
    gap: 1rem;
  }

  .calendar-header h2 {
    min-width: auto;
  }

  .days {
    min-height: 300px;
  }

  .day {
    min-height: 60px;
    padding: 0.5rem;
  }

  .day-number {
    font-size: 0.85rem;
  }

  .weekdays {
    font-size: 0.8rem;
  }

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

  .package-item {
    grid-template-columns: 1fr;
  }

  .nav-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-tab {
    flex: 1 1 auto;
    min-width: 140px;
    padding: 0.7rem 0.8rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 1rem;
  }

  .app-header h1 {
    font-size: 1.3rem;
  }

  .day {
    min-height: 50px;
  }

  .day-number {
    font-size: 0.8rem;
  }

  .legend-items {
    gap: 0.5rem;
  }

  .legend-item {
    font-size: 0.85rem;
  }
}
