:root {
  --bg: #f4f6f8;
  --text: #0b1b2b;
  --muted: #5a6b7c;
  --card: #fff;
  --border: #d8dee6;
  --primary: #1a5f7a;
  --primary-hover: #144a5f;
  --danger: #b42318;
  --success: #1d6b3a;
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a:visited { color: blue;}

.wrap { max-width: 950px; margin: 0 auto; padding: 0 1.25rem; }
.admin-dashboard-wrap { max-width: 1280px; }
.site-header {
  background: var(--card);
  background-color: #fefefe;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  max-width: 1080px;
}
.site-footer { margin-top: 3rem; padding-bottom: 2rem; }
.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.header-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-nav a { color: var(--primary); text-decoration: none; }
.header-nav a:hover { text-decoration: underline; }

img {
  border: 1px solid #aaa;
  padding: 3px;
}

hr {
  border: 0;
  height: 1px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  margin-top: 30px;
  margin-bottom: 30px;
}

h1 { 
  margin-bottom: 0;
  margin-top: 50px;
  font-size: 2.95rem; margin-top: 0; 
  font-family: "Playfair Display", serif;
  font-optical-sizing: auto;
  font-weight: <weight>;
  font-style: normal;
}
h3 {
  font-family: "Playfair Display", serif;
  font-optical-sizing: auto;
  font-weight: <weight>;
  font-style: normal;
}
h2 { font-size: 1.2rem; }
.lead { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: ui-monospace, monospace; }
.break-all { word-break: break-all; }

.flashes { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash {
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.flash-success { background: #e7f6ec; color: #174d29; }
.flash-error { background: #fde8e6; color: #7a2318; }
.flash-warning { background: #fff4e0; color: #6a4b00; }
.flash-info { background: #e8f0ff; color: #243e7a; }

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 640px;
}
.stack-form.narrow { max-width: 420px; }
.stack-form label { display: flex; flex-direction: column; font-weight: 600; font-size: 0.9rem; gap: 0.35rem; }
.stack-form input:not([type="checkbox"]),
.stack-form textarea,
.stack-form select {
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
@media (max-width: 560px) { .grid-two { grid-template-columns: 1fr; } }

.checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  font-weight: 500 !important;
}

.content {
  font-size: 1.1rem;
  font-family: Georgia, serif;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gallery-thumb {
  display: inline-block;
}

.gallery-thumb img {
  display: block;
}

.gallery-modal[hidden] {
  display: none;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.gallery-modal-content {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1200px);
  max-height: 92vh;
  margin: 4vh auto;
  padding: 2.25rem 1rem 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.gallery-modal-content img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 4rem);
  margin: 0 auto;
}

.gallery-modal-close {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  border: none;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  color: #111;
  cursor: pointer;
}

body.gallery-modal-open {
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  border: none;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: #e8eef3; color: var(--text); }
.btn.success { background: var(--success); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger.ghost { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
}

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th { background: #eef2f6; }
.data-table a { color: var(--primary); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-pending { background: #fff4e0; color: #6a4b00; }
.status-approved { background: #e7f6ec; color: #174d29; }
.status-rejected { background: #fde8e6; color: #7a2318; }
.status-cancelled { background: #eef2f6; color: #415062; }

.kv { display: grid; grid-template-columns: 8rem 1fr; gap: 0.35rem 1rem; }
.kv dt { margin: 0; font-weight: 600; color: var(--muted); }
.kv dd { margin: 0; }

.sign-field { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; }
#sig-canvas {
  width: 100%;
  max-width: 100%;
  height: 200px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: #fff;
  touch-action: none;
}
.sig-actions { margin-top: 0.5rem; }
.sig-preview {
  max-width: 320px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.button-row form { display: inline; }

.danger-zone { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.user-list { padding-left: 1.2rem; }

.invoice-notes {
  white-space: pre-wrap;
  background: var(--card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.inline-form { margin-top: 0.5rem; }

#bookings-calendar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.fc .cal-approved {
  background-color: #1d6b3a;
  border-color: #1d6b3a;
}

.fc .cal-pending {
  background-color: #9b6b00;
  border-color: #9b6b00;
}

.fc .cal-rejected {
  background-color: #b42318;
  border-color: #b42318;
}
