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

:root {
  --accent: #2f5d46;
  --accent-ink: #fff;
  --bg: #f5f2ea;
  --paper: #fffdf8;
  --ink: #1d2621;
  --muted: #66706a;
  --line: #e3ddd0;
  --soft: #ece7db;
  --danger: #a33a2b;
  --warn: #b7791f;
  --ok: #2f7a4f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(30, 35, 30, .06), 0 8px 24px rgba(30, 35, 30, .06);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); font-weight: 650; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(28px, 4vw, 42px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight: 500; text-decoration: none; color: var(--ink); transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { border-color: #cfc7b6; background: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: #e7c9c3; }
.btn.danger:hover { background: #fbefec; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.block { width: 100%; }

/* forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
label.field > small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { resize: vertical; min-height: 70px; }
input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.check { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--ink); }
.badge.ok { background: #e3f1e8; color: var(--ok); }
.badge.warn { background: #fbf0dc; color: var(--warn); }
.badge.danger { background: #f8e3df; color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* capacity bar */
.cap { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.cap > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(25, 30, 27, .45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; animation: fade .15s; }
.modal { background: var(--paper); border-radius: 16px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: pop .18s ease-out; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-body { padding: 16px 22px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 22px; flex-wrap: wrap; }
.x { border: 0; background: var(--soft); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0 } }

/* toast */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); animation: pop .18s; }
.toast.err { background: var(--danger); }

.error-box { background: #fbefec; color: var(--danger); border: 1px solid #efcfc8; padding: 10px 12px; border-radius: 9px; font-size: 14px; margin-bottom: 12px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { opacity: .35; margin-bottom: 8px; }

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

/* summary box */
.summary { background: var(--soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; display: grid; gap: 2px; font-size: 14px; }
.summary b { font-size: 15px; }
