/* ---- Tokens ---- */
:root {
  --pine: #2C4A3E;
  --pine-dark: #1D3229;
  --paper: #FAF6EC;
  --paper-raised: #FFFFFF;
  --ink: #2A2A28;
  --ink-soft: #6B675E;
  --lingon: #A63D40;
  --gold: #C9A24B;
  --line: #E4DFD1;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(30, 30, 20, 0.06), 0 4px 14px rgba(30, 30, 20, 0.05);
  --font-display: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--pine); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--pine-dark);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

/* ---- Top bar ---- */
.topbar {
  background: var(--pine);
  color: var(--paper);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar .brand {
  font-family: var(--font-display);
  font-size: 20px;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

.topbar nav {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar nav a {
  color: #E7E2D2;
  text-decoration: none;
  font-size: 14px;
}

.topbar nav a:hover, .topbar nav a.active { color: #fff; text-decoration: underline; }

.topbar .user-pill {
  background: rgba(255,255,255,0.12);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
}

/* ---- Layout ---- */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.container.narrow { max-width: 460px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.page-header p { color: var(--ink-soft); margin: 4px 0 0; }

/* ---- Cards ---- */
.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.cottage-card h3 { margin-bottom: 4px; }
.cottage-card .meta { color: var(--ink-soft); font-size: 14px; margin-bottom: 12px; }
.cottage-card .photo {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 12px;
  background: var(--line);
}

/* ---- Forms ---- */
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 5px; color: var(--ink); }
label:first-child { margin-top: 0; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
}

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

.field-hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-body);
}

.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:hover { background: var(--pine-dark); }
.btn-approve { background: #3E7A4F; color: #fff; }
.btn-reject { background: var(--lingon); color: #fff; }
.btn-secondary { background: #fff; color: var(--pine); border: 1px solid var(--line); }
.btn-small { padding: 6px 12px; font-size: 13px; }

form.inline { display: inline; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
}
.badge-pending { background: #F5E9D0; color: #8A6A1D; }
.badge-approved { background: #DEEEDF; color: #2C6B39; }
.badge-rejected { background: #F5DEDD; color: var(--lingon); }
.badge-cancelled { background: #EAE7DD; color: var(--ink-soft); }

/* ---- Table ---- */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-soft); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---- Flash messages ---- */
.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; font-size: 14.5px; }
.flash-success { background: #DEEEDF; color: #2C6B39; }
.flash-error { background: #F5DEDD; color: var(--lingon); }
.flash-info { background: #EDF1F3; color: #3A5A6B; }

/* ---- Misc ---- */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-soft);
}

.divider-wave {
  height: 14px;
  background: linear-gradient(135deg, var(--gold) 0 2px, transparent 2px 100%) 0 0/14px 14px;
  opacity: 0.5;
  margin: 28px 0;
}

.stat {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--pine);
}
.stat-label { color: var(--ink-soft); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Calendar ---- */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  max-width: 340px;
}

.calendar-month-label {
  margin: 0;
  font-size: 16px;
  text-align: center;
  flex: 1;
}

.calendar-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  max-width: 340px;
}

.legend-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

.legend-approved { background: var(--lingon); }
.legend-pending-mine { background: var(--gold); }
.legend-pending-other { background: #D9D3C2; border: 1px dashed var(--ink-soft); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  margin: 0 0 8px;
  max-width: 340px;
}

.calendar-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding-bottom: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #F3EFE3;
  font-size: 12.5px;
  color: var(--ink);
  cursor: default;
}

.calendar-day-empty { background: transparent; }

.calendar-day-today {
  box-shadow: inset 0 0 0 2px var(--pine);
  font-weight: 700;
}

.calendar-day-approved {
  background: var(--lingon);
  color: #fff;
  font-weight: 600;
}

.calendar-day-pending-mine {
  background: #FBEFD2;
  color: #8A6A1D;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--gold);
}

.calendar-day-pending-other {
  background: #EAE7DD;
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--ink-soft);
  border-style: dashed;
}

@media (max-width: 600px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  th, td { font-size: 13px; }
  .calendar-grid { gap: 3px; padding: 8px; max-width: 100%; }
  .calendar-day { font-size: 11.5px; border-radius: 4px; }
  .calendar-month-label { font-size: 15px; }
  .calendar-nav, .calendar-legend { max-width: 100%; }
}
