:root {
  --leather: #3d1f24;
  --leather-dark: #2a1519;
  --parchment: #f5eedc;
  --parchment-card: #fffbf1;
  --ink: #2f2013;
  --ink-muted: #7d6a52;
  --gold: #af8a45;
  --gold-bright: #c9a227;
  --oxblood: #7c2530;
  --oxblood-dark: #5e1c24;
  --rule: #e4d7b8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Lora", Georgia, serif;
  background: var(--parchment);
  color: var(--ink);
}

h1, h2, h3 {
  margin: 0 0 0.5em 0;
  font-family: "Playfair Display", Georgia, serif;
}

h4 {
  margin: 0 0 0.5em 0;
  font-family: "Lora", Georgia, serif;
}

a {
  color: var(--oxblood);
}

/* ---------- buttons & forms ---------- */

.btn {
  display: inline-block;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: var(--oxblood);
  color: var(--parchment-card);
  font-family: "Lora", Georgia, serif;
  font-size: 15px;
  cursor: pointer;
}

.btn:hover {
  background: var(--oxblood-dark);
}

.btn-secondary {
  background: var(--ink-muted);
}

.btn-secondary:hover {
  background: var(--ink);
}

.btn-danger {
  background: #93332c;
}

.btn-danger:hover {
  background: #73271f;
}

.btn-small {
  padding: 5px 10px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 70px;
}

.inline-fields {
  display: flex;
  gap: 10px;
}

.inline-fields .form-group {
  flex: 1;
}

.error-text {
  color: var(--oxblood-dark);
  font-size: 14px;
  margin-top: 6px;
}

.hint-text {
  color: var(--ink-muted);
  font-size: 13px;
  margin-top: 4px;
}

.empty-state, .loading-state {
  color: var(--ink-muted);
  font-style: italic;
  padding: 14px 0;
}

/* ---------- login page ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--leather);
  background-image: linear-gradient(160deg, var(--leather) 0%, var(--leather-dark) 100%);
}

.login-box {
  background: var(--parchment-card);
  border-radius: 8px;
  padding: 34px 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  border-top: 3px solid var(--gold);
}

.login-box h1 {
  font-style: italic;
  color: var(--ink);
}

.login-box p.subtitle {
  color: var(--ink-muted);
  margin-top: -6px;
  margin-bottom: 20px;
  font-size: 14px;
}

/* ---------- admin page ---------- */

.admin-header {
  background: var(--leather);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--gold);
}

.admin-header h2 {
  color: var(--parchment-card);
  font-style: italic;
  margin: 0;
}

.admin-header .hint-text {
  color: var(--gold-bright);
}

.admin-content {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.admin-section {
  background: var(--parchment-card);
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: 0 1px 4px rgba(61,31,36,0.12);
  border: 1px solid var(--rule);
}

.admin-section h3 {
  border-bottom: 1px solid var(--gold);
  padding-bottom: 6px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

th {
  color: var(--ink-muted);
  font-weight: 600;
}

/* ---------- app layout (sidebar + main) ---------- */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--leather);
  color: var(--parchment-card);
  padding: 20px 16px;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 30;
  overflow-y: auto;
  border-right: 3px solid var(--gold);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar h2 {
  font-size: 20px;
  font-style: italic;
  color: var(--parchment-card);
}

.sidebar .user-name {
  color: var(--gold-bright);
  font-size: 14px;
  margin-bottom: 20px;
}

.trip-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.trip-list li {
  padding: 10px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 4px;
  color: #e6d9c2;
}

.trip-list li:hover {
  background: var(--leather-dark);
}

.trip-list li.active {
  background: var(--gold);
  color: var(--leather-dark);
  font-weight: 600;
}

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 20;
}

.drawer-overlay.open {
  display: block;
}

.hamburger-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  background: var(--leather);
  color: var(--parchment-card);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
}

.main-content {
  flex: 1;
  padding: 60px 18px 90px 18px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.trip-title {
  margin-bottom: 4px;
  font-style: italic;
}

.trip-dates {
  color: var(--ink-muted);
  margin-bottom: 20px;
}

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--rule);
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 15px;
  font-family: "Lora", Georgia, serif;
  cursor: pointer;
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab-btn.active {
  color: var(--oxblood);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ---------- activity list ---------- */

.leg-group {
  margin-bottom: 26px;
}

.leg-group h3 {
  font-size: 20px;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 6px;
}

.spot-group {
  margin: 14px 0;
}

.spot-group h4 {
  font-size: 15px;
  color: var(--ink-muted);
  margin: 0 0 8px 0;
}

.activity-card {
  background: var(--parchment-card);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(61,31,36,0.12);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
}

.activity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.activity-row-main {
  flex: 1;
  min-width: 0;
}

.activity-type-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--parchment);
  color: var(--oxblood);
  border: 1px solid var(--gold);
  margin-bottom: 6px;
}

.activity-desc {
  margin: 4px 0;
}

.activity-meta {
  font-size: 13px;
  color: var(--ink-muted);
}

.activity-chevron {
  flex-shrink: 0;
  font-size: 20px;
  color: var(--ink-muted);
  transition: transform 0.15s ease;
}

.activity-card.expanded .activity-chevron {
  transform: rotate(90deg);
}

.join-toggle-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--parchment);
  color: var(--ink-muted);
  border: 1px solid var(--rule);
  cursor: pointer;
}

.join-toggle-btn.joined {
  background: var(--oxblood);
  color: var(--parchment-card);
  border-color: var(--oxblood);
}

.activity-details {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}

.activity-card.expanded .activity-details {
  display: block;
}

.activity-participants {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 8px;
}

.suggest-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.suggest-form input {
  width: auto;
}

/* ---------- add-activity FAB + modal ---------- */

.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  border-radius: 30px;
  padding: 14px 22px;
  font-size: 16px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.35);
  border: 2px solid var(--gold);
  z-index: 25;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42,21,25,0.55);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--parchment-card);
  border-radius: 6px;
  padding: 24px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  border-top: 3px solid var(--gold);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--ink-muted);
  line-height: 1;
}

/* ---------- desktop ---------- */

@media (min-width: 800px) {
  .hamburger-btn {
    display: none;
  }

  .sidebar {
    position: static;
    transform: none;
  }

  .drawer-overlay {
    display: none !important;
  }

  .main-content {
    padding-top: 30px;
  }
}
