:root {
  /* Paleta Carol Boho */
  --bg: #F5F1ED;
  --bg-light: #FAFAF8;
  --surface: rgba(250, 248, 246, 0.95);
  --surface-strong: #FFFFFF;
  --text: #2D2622;
  --muted: #7A7570;
  --line: #E8E4E0;

  /* Cores Primárias */
  --accent: #2D7F76;
  --accent-soft: rgba(45, 127, 118, 0.1);
  --gold: #D4A437;
  --bronze: #B87333;
  --silver: #C9C9C9;

  /* Status */
  --danger: #8B6914;
  --success: #2D7F76;

  /* Sombra Elegante */
  --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, "Times New Roman", serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 28%),
              radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 24%),
              linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

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

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

.logo-area h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text);
}

.header-actions button {
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
}

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

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

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

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface-strong);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nav-item {
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  transition: all 200ms ease;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
}

.nav-item:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.nav-item.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Content Area */
.content-area {
  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-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

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

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.date-display {
  color: var(--accent);
  font-weight: 600;
}

/* Forms */
.form-grid {
  display: grid;
  gap: 2rem;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 0;
}

legend {
  padding: 0 0.5rem;
  font-weight: 600;
  color: var(--text);
  font-size: 1.1rem;
}

fieldset > label {
  display: block;
  margin-bottom: 1.2rem;
}

fieldset > .full-span {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label span {
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
}

input, select, textarea {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 200ms ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  resize: vertical;
  font-family: Georgia, serif;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.form-actions button {
  flex: 1;
}

/* Agendamentos List */
.agendamentos-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.agendamento-item {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

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

.agendamento-info .time {
  font-weight: 600;
  color: var(--accent);
  font-size: 1.1rem;
}

/* Link Display */
.gerar-link-form {
  max-width: 600px;
}

.gerar-link-form label {
  margin-bottom: 1.5rem;
}

.link-display {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.link-display.hidden {
  display: none;
}

.link-box {
  display: flex;
  gap: 0.8rem;
  margin: 1rem 0;
}

.link-box input {
  flex: 1;
  padding: 0.8rem 1rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.link-box button {
  padding: 0.8rem 1.2rem;
}

/* Buttons */
button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 0.9rem 1.15rem;
  transition: all 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.primary {
  background: var(--accent);
  color: white;
}

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

.secondary {
  background: rgba(255, 255, 255, 0.45);
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary:hover {
  background: var(--accent-soft);
}

.small-btn {
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
}

/* Notices */
.notice {
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.notice.success {
  background: rgba(47, 125, 84, 0.12);
  border: 1px solid var(--success);
  color: var(--success);
}

.notice.error {
  background: rgba(150, 47, 47, 0.12);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.notice.hidden {
  display: none;
}

.notice.small {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.muted {
  color: var(--muted);
}

.muted.small {
  font-size: 0.85rem;
}

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

/* Time Slots */
.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.time-slot {
  padding: 0.8rem;
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 200ms ease;
  background: white;
}

.time-slot:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.time-slot.selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.time-slot.blocked {
  background: rgba(150, 47, 47, 0.12);
  border-color: var(--danger);
  color: var(--danger);
  cursor: not-allowed;
  opacity: 0.6;
}

.time-slot.blocked:hover {
  transform: none;
  background: rgba(150, 47, 47, 0.12);
}

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

  .sidebar {
    width: 100%;
  }

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

  .nav-item {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .section {
    padding: 1.5rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .agendamento-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
