/* Terra Home — Panel Interactivo */
:root {
  --bg: #faf5ee;
  --bg-soft: #f3ebde;
  --bg-card: #fffbf4;
  --ink: #3d2f24;
  --ink-soft: #6b5a4a;
  --ink-mute: #9c8a78;
  --line: #e7dccb;
  --line-soft: #f0e7d6;
  --terra: #b88566;
  --terra-deep: #8e5c40;
  --terra-soft: #d9b89a;
  --rose: #c79a96;
  --rose-soft: #e8cfc9;
  --sage: #8a9a78;
  --sage-soft: #c8d2bb;
  --gold: #b59866;
  --shadow-sm: 0 1px 2px rgba(75, 50, 30, 0.04);
  --shadow-md: 0 8px 24px -12px rgba(75, 50, 30, 0.12), 0 2px 4px rgba(75, 50, 30, 0.04);
  --shadow-lg: 0 24px 60px -30px rgba(75, 50, 30, 0.25), 0 8px 16px -8px rgba(75, 50, 30, 0.08);
  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --script: 'Italiana', 'Cormorant Garamond', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; }

/* ─── App shell ─── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  background: linear-gradient(180deg, #f7eee0 0%, #f3e8d4 100%);
  border-right: 1px solid var(--line);
  padding: 36px 22px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--terra-soft);
  margin-bottom: 12px;
  background: rgba(255,255,255,0.4);
}
.brand-mark svg { width: 28px; height: 28px; stroke: var(--terra-deep); fill: none; stroke-width: 1; }
.brand-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.18em;
  color: var(--ink);
  margin: 0;
  text-transform: uppercase;
}
.brand-tag {
  font-size: 9px;
  letter-spacing: 0.4em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-top: 4px;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .25s ease;
  border-left: 1px solid transparent;
}
.nav-item:hover { color: var(--ink); background: rgba(255,255,255,0.4); }
.nav-item.active {
  color: var(--terra-deep);
  background: rgba(255,255,255,0.65);
  border-left-color: var(--terra);
}
.nav-item .ico {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none; stroke-width: 1.2;
  opacity: .75;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-mute);
  text-align: center;
  text-transform: uppercase;
}

/* ─── Main ─── */
.main {
  padding: 0;
  min-width: 0;
  background: var(--bg);
}
.page-head {
  padding: 38px 56px 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
}
.page-head-l { display: flex; flex-direction: column; gap: 6px; }
.eyebrow {
  font-size: 10px; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--ink-mute);
}
.page-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 44px;
  line-height: 1;
  margin: 0;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.page-title em { font-style: italic; color: var(--terra-deep); }
.page-sub {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 300;
  margin-top: 6px;
  max-width: 540px;
}

.page-body { padding: 32px 56px 64px; }

/* ─── Buttons ─── */
.btn {
  border: 1px solid var(--terra);
  background: var(--terra);
  color: #fff;
  padding: 10px 22px;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 400;
  border-radius: 2px;
  transition: all .2s ease;
}
.btn:hover { background: var(--terra-deep); border-color: var(--terra-deep); }
.btn.ghost {
  background: transparent;
  color: var(--terra-deep);
  border-color: var(--terra);
}
.btn.ghost:hover { background: rgba(184,133,102,0.08); }
.btn.tiny { padding: 6px 14px; font-size: 10px; }
.btn.icon { padding: 8px 10px; }

/* ─── Cards / Panels ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

/* ─── Forms ─── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 400;
}
.input, .select, .textarea {
  background: #fff;
  border: 1px solid var(--line);
  padding: 11px 13px;
  font-size: 13px;
  border-radius: 2px;
  color: var(--ink);
  font-weight: 300;
  transition: border-color .2s ease;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--terra);
}
.textarea { min-height: 80px; resize: vertical; font-family: var(--sans); }

/* ─── Modal ─── */
.modal-veil {
  position: fixed; inset: 0;
  background: rgba(60, 40, 25, 0.35);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fade .2s ease;
}
.modal {
  background: var(--bg-card);
  border-radius: 6px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: rise .3s ease;
}
.modal-head {
  padding: 28px 32px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 28px;
  margin: 0;
  letter-spacing: 0.01em;
}
.modal-close {
  background: transparent; border: none; color: var(--ink-mute);
  font-size: 22px; padding: 4px 8px;
  border-radius: 50%;
  transition: color .2s;
}
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 24px 32px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { padding: 16px 32px 28px; display: flex; gap: 10px; justify-content: flex-end; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Chips ─── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 400;
}
.chip.terra { background: rgba(184,133,102,0.1); border-color: var(--terra-soft); color: var(--terra-deep); }
.chip.sage { background: rgba(138,154,120,0.12); border-color: var(--sage-soft); color: #5c6e4d; }
.chip.rose { background: rgba(199,154,150,0.15); border-color: var(--rose-soft); color: #8a5d59; }

/* ─── Number + emphasis ─── */
.num-serif {
  font-family: var(--serif);
  font-weight: 300;
  font-variant-numeric: oldstyle-nums;
}
.divider-orn {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; color: var(--terra-soft);
  margin: 18px 0;
}
.divider-orn::before, .divider-orn::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

/* ─── Empty states ─── */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-mute);
  font-style: italic;
  font-family: var(--serif);
  font-size: 18px;
}

/* ─── Scroll ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--terra-soft); }
