@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,800&family=Inter:wght@400;500;600&display=swap');

:root {
  --cream: #fbf6ec;
  --paper: #ffffff;
  --ink: #2a211b;
  --muted: #7a6c60;
  --line: #eadfcd;
  --barn: #b23a2a;
  --barn-dark: #8a2a1e;
  --straw: #e9b949;
  --green: #4f6d3a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(42, 33, 27, .06), 0 8px 24px rgba(42, 33, 27, .06);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--barn); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.logo { font-family: Fraunces, serif; font-weight: 800; font-size: 1.3rem; text-decoration: none; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.nav-links { display: flex; gap: 12px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px; font: 600 15px Inter, sans-serif;
  background: var(--barn); color: #fff; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--barn-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: #fff; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.danger { background: #fff; color: var(--barn); border: 1.5px solid var(--barn); }
.btn.danger:hover { background: var(--barn); color: #fff; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 20px; }
.muted { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #f3ead9; color: var(--muted); text-transform: capitalize; }
.tag.active { background: #e4eedb; color: var(--green); }
.tag.past_due { background: #fbecc5; color: #8a6412; }
.tag.cancelled { background: #f6dcd7; color: var(--barn-dark); }

label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 14px; }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; font: 15px Inter, sans-serif; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--straw); }
textarea { resize: vertical; min-height: 70px; }
.error { color: var(--barn); font-size: 14px; min-height: 1.2em; margin: 0 0 10px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; opacity: 0;
  transition: .25s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }


/* ---- CCTV ---- */
.feed { position: relative; aspect-ratio: 16 / 9; background: #111; border-radius: 12px; overflow: hidden; }
.feed > img, .feed > video, .feed > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feed .hud { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; font: 600 12px ui-monospace, Menlo, monospace; color: #fff; text-shadow: 0 1px 2px #000; pointer-events: none; letter-spacing: .04em; }
.feed .rec::before { content: '●'; color: #ff3b30; margin-right: 6px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.feed .status { position: absolute; bottom: 10px; left: 12px; font: 12px ui-monospace, Menlo, monospace; color: #fff; background: rgba(0,0,0,.5); padding: 4px 8px; border-radius: 6px; pointer-events: none; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-scroll { overflow-x: auto; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); vertical-align: -1px; margin-right: 6px; }
