﻿:root {
  --bg: #f6f1ee;
  --panel: #ffffff;
  --border: #e8ddd7;
  --text: #231815;
  --muted: #7c6b63;
  --primary: #b78f7b;
  --primary-dark: #9f7663;
  --shadow: 0 10px 30px rgba(35, 24, 21, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
}

button,
select,
input,
a {
  font: inherit;
}

a {
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(246, 241, 238, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-badge {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  overflow: hidden;
  background: #c19a84;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(35, 24, 21, 0.08);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 999px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.1;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.view-btn,
.secondary-btn,
.primary-link,
.secondary-link,
.icon-btn {
  border: 0;
  cursor: pointer;
  transition: 0.2s ease;
}

.view-btn {
  padding: 10px 14px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}

.view-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.sidebar,
.details-drawer {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 18px;
  align-self: start;
  position: sticky;
  top: 92px;
}

.sidebar-section + .sidebar-section {
  margin-top: 16px;
}

.sidebar h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.sidebar label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.sidebar select,
.sidebar input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fffdfa;
  color: var(--text);
}

.secondary-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f3ebe7;
  color: var(--text);
}

.secondary-btn:hover {
  background: #eaded8;
}

.stats-box {
  padding: 14px;
  border-radius: 14px;
  background: #fcf8f6;
  border: 1px solid var(--border);
}

.stats-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.stats-number {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.content {
  min-width: 0;
}

.panel-view {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}

.hidden {
  display: none !important;
}

/* CALENDÁRIO */
#calendarView {
  padding: 12px;
  overflow: visible;
  min-height: 760px;
}

.fc {
  max-width: 100%;
}

.fc .fc-toolbar-title {
  font-size: 20px;
}

.fc .fc-button {
  background: var(--primary);
  border: 0;
}

.fc .fc-button:hover,
.fc .fc-button:focus {
  background: var(--primary-dark);
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--primary-dark);
}

.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
  border-color: #efe4df;
}

/* MAPA */
#mapView {
  height: calc(100vh - 130px);
  min-height: 620px;
  overflow: hidden;
}

#mapView .leaflet-container {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  cursor: grab;
}

#mapView .leaflet-container:active {
  cursor: grabbing;
}

.leaflet-container {
  z-index: 1;
}

.leaflet-popup-pane,
.leaflet-control,
.leaflet-top,
.leaflet-bottom {
  z-index: 2;
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
}

.map-popup {
  line-height: 1.45;
}

.map-popup strong {
  display: block;
  margin-bottom: 6px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(35, 24, 21, 0.32);
  z-index: 5000;
}

.details-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100vh;
  z-index: 5001;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.drawer-category {
  margin: 0 0 6px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.drawer-header h3 {
  margin: 0;
  font-size: 22px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f5efeb;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.drawer-body {
  padding: 22px;
  overflow: auto;
}

.info-item + .info-item {
  margin-top: 16px;
}

.info-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-value {
  font-size: 15px;
  line-height: 1.5;
}

.paragraph {
  margin: 0;
  white-space: pre-line;
}

.drawer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.primary-link,
.secondary-link {
  padding: 12px 16px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
}

.primary-link {
  background: var(--primary);
  color: white;
}

.primary-link:hover {
  background: var(--primary-dark);
}

.secondary-link {
  background: #f3ebe7;
  color: var(--text);
}

.secondary-link:hover {
  background: #eaded8;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    top: auto;
  }

  #calendarView {
    min-height: 720px;
  }

  #mapView {
    height: 70vh;
    min-height: 560px;
  }
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

.topbar-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
}

.view-btn {
  flex: 1;
  min-width: 0;
}

.submit-btn {
  width: 100%;
  margin-top: 6px;
}

  .topbar h1 {
    font-size: 20px;
  }

  .layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
  }

  .sidebar {
    width: 100%;
  }

  .content {
    width: 100%;
  }

  #calendarView {
    min-height: 680px;
    padding: 8px;
  }

  #mapView {
    height: 68vh;
    min-height: 500px;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .fc .fc-toolbar-title {
    font-size: 18px;
  }

  .fc .fc-header-toolbar {
    margin-bottom: 12px;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 64px;
  }
}

@media (max-width: 640px) {
  body {
    overflow-y: auto;
  }

  .topbar {
    padding: 14px 16px;
  }

  .brand-badge {
    width: 48px;
    height: 48px;
  }

  .layout {
    padding: 12px;
  }

  .sidebar {
    padding: 16px;
  }

  .details-drawer {
    width: 100%;
  }
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: white;
  border: 1px solid var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.submit-btn:hover {
  background: #3a2b26;
  border-color: #3a2b26;
  transform: translateY(-1px);
}