/* VenueOS — clean professional SaaS, warm neutral palette */
:root {
  --cream: #faf6ef;
  --paper: #ffffff;
  --sand: #f3ede1;
  --ink: #2a241d;
  --muted: #776b5b;
  --line: #e7ddcc;
  --terra: #b4502e;
  --terra-dark: #94401f;
  --green: #3f7a52;
  --amber: #a97a1f;
  --red: #a33327;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 12px;
}

p { margin: 0 0 12px; }

a { color: var(--terra); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { color: var(--red); font-size: 14px; }

/* ---------- header ---------- */
.site-header, .app-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.brand a { color: var(--ink); }
.brand a:hover { text-decoration: none; }
.venue-name {
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-spacer { flex: 1; }
.back-link { font-size: 15px; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: var(--terra);
  color: #fff;
  border: 1px solid var(--terra);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--terra-dark); border-color: var(--terra-dark); text-decoration: none; color: #fff; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--terra); color: var(--terra); text-decoration: none; }
.btn-small { padding: 6px 12px; font-size: 14px; border-radius: 6px; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--line); }
.btn-danger:hover { border-color: var(--red); color: var(--red); background: transparent; }
.link-btn {
  background: none; border: none; padding: 0;
  color: var(--terra); font-size: 14px; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- hero / landing ---------- */
.hero { padding: 72px 0 48px; text-align: center; }
.hero h1 { font-size: 42px; margin-bottom: 16px; }
.hero p.lede { font-size: 20px; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  padding: 24px 0 48px;
}
.feature {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
}
.feature h3 { font-size: 19px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15px; margin: 0; }

.auth-section { padding: 24px 0 72px; }
.auth-card {
  max-width: 440px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tab {
  flex: 1;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 15px;
  cursor: pointer;
  color: var(--muted);
}
.auth-tab.active { background: var(--paper); color: var(--ink); border-color: var(--terra); font-weight: 600; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], input[type="number"],
input[type="tel"], input[type="url"], textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--terra);
  outline-offset: -1px;
  border-color: var(--terra);
}
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.checkbox-row label { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 15px; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--terra); }

/* ---------- app layout ---------- */
.page-section { padding: 28px 0; }
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 24px; }
.section-head .spacer { flex: 1; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.event-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  color: var(--ink);
}
.event-card:hover { border-color: var(--terra); text-decoration: none; }
.event-card-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.event-card-top strong { font-size: 17px; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.paid, .badge.won, .badge.confirmed { background: #e6f0e8; color: var(--green); border-color: #cfe0d3; }
.badge.pending, .badge.contract, .badge.proposal { background: #faf3df; color: var(--amber); border-color: #ecdfc0; }
.badge.lost, .badge.cancelled { background: #f7e7e4; color: var(--red); border-color: #e8c9c3; }

/* ---------- kanban ---------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(210px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  min-height: 120px;
}
.kanban-col h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 10px; font-family: inherit; }
.kanban-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
}
.kanban-card strong { display: block; font-size: 15px; }
.kanban-card .meta { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.kanban-card .card-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.move-btn {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}
.move-btn:hover:not(:disabled) { border-color: var(--terra); color: var(--terra); }
.move-btn:disabled { opacity: 0.35; cursor: default; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; }
table.table th, table.table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.table th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
table.table tr:last-child td { border-bottom: none; }

/* ---------- timeline ---------- */
.timeline-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-time { font-weight: 700; min-width: 86px; color: var(--terra-dark); }
.timeline-body { flex: 1; }
.timeline-body strong { display: block; }
.timeline-body .detail { color: var(--muted); font-size: 14px; }
.timeline-owner { font-size: 13px; color: var(--muted); }
.timeline-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ---------- vendors ---------- */
.vendor-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.vendor-card:last-child { border-bottom: none; }
.vendor-main { flex: 1; min-width: 200px; }
.vendor-main strong { display: block; }
.vendor-contact { font-size: 14px; color: var(--muted); }
.portal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin-top: 8px;
  overflow: hidden;
}
.portal-row code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  position: sticky;
  top: 61px;
  z-index: 10;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn.active { color: var(--ink); border-bottom-color: var(--terra); }
.tab-pane { display: none; padding: 24px 0 48px; }
.tab-pane.active { display: block; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 36, 29, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- toast ---------- */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
  max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- embed snippet ---------- */
pre.code {
  background: var(--ink);
  color: #f5efe4;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 13px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- BEO ---------- */
.beo-doc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 860px;
  margin: 0 auto 32px;
}
.beo-header { text-align: center; border-bottom: 2px solid var(--ink); padding-bottom: 20px; margin-bottom: 24px; }
.beo-header h1 { font-size: 30px; margin-bottom: 4px; }
.beo-header .beo-sub { color: var(--muted); }
.beo-couple { text-align: center; margin-bottom: 28px; }
.beo-couple h2 { font-size: 26px; margin-bottom: 4px; }
.beo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; margin-bottom: 28px; }
.beo-grid .row { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line); padding: 6px 0; }
.beo-grid .row .k { color: var(--muted); }
.beo-section { margin-bottom: 28px; }
.beo-section h3 { font-size: 18px; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 12px; }
.beo-notes { white-space: pre-wrap; }

@media (max-width: 720px) {
  .hero { padding: 48px 0 32px; }
  .hero h1 { font-size: 32px; }
  .form-row { grid-template-columns: 1fr; }
  .beo-doc { padding: 24px 18px; }
  .beo-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 12px 16px; }
  .wrap { padding: 0 16px; }
  .timeline-item { flex-wrap: wrap; }
  .timeline-actions { width: 100%; }
}

/* ---------- print ---------- */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .site-header, .app-header, .tabs, .site-footer { display: none !important; }
  .beo-doc { border: none; border-radius: 0; padding: 0; max-width: none; margin: 0; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
}
