/* Event Manager — private management area styles (same palette as the public site) */
:root {
  --cream: #fbf7ef; --paper: #fffdf8; --sage: #5f8f7b; --sage-dark: #46705f; --sage-light: #d6e7df; --sage-mist: #edf4f0;
  --pink: #f3bfc8; --pink-soft: #fbe6ea; --butter-soft: #fdf3d6; --sky-soft: #e9f4f6; --lilac-soft: #efeaf8;
  --ink: #2f3b4c; --ink-soft: #5f6978; --line: #e8dfd0; --danger: #c85a5a; --danger-soft: #fbe9e9;
  --font-body: 'Quicksand', 'Segoe UI', system-ui, sans-serif; --radius: 16px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: var(--font-body); font-weight: 500; color: var(--ink); background: var(--cream); line-height: 1.5; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
code { background: var(--sage-mist); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
a { color: var(--sage-dark); }
:focus-visible { outline: 3px solid rgba(95, 143, 123, .5); outline-offset: 2px; border-radius: 6px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .7rem 1.3rem; border-radius: 999px; border: 2px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .2s, transform .15s; line-height: 1.2; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--sage); color: #fff; }
.btn-primary:hover { background: var(--sage-dark); }
.btn-ghost { background: var(--paper); color: var(--sage-dark); border-color: var(--line); }
.btn-ghost:hover { background: var(--sage-mist); }
.btn-danger { background: var(--danger-soft); color: #8a3b3b; }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }
.btn-xs { padding: .3rem .6rem; font-size: .78rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 380px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 2rem; display: grid; gap: .75rem; box-shadow: 0 24px 60px -36px rgba(47,59,76,.35); text-align: center; }
.login-mark { width: 90px; height: 90px; margin: 0 auto; }
.login-card label { text-align: left; font-weight: 700; font-size: .9rem; margin-top: .5rem; }
.login-card input { font: inherit; padding: .75rem .9rem; border: 2px solid var(--line); border-radius: 12px; width: 100%; }
.login-card input:focus { outline: none; border-color: var(--sage); }

.alert { background: var(--danger-soft); color: #8a3b3b; border: 1px solid #f1c9c9; border-radius: 12px; padding: .7rem .9rem; font-size: .9rem; text-align: left; }
.alert ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.alert.info { background: var(--sky-soft); color: var(--ink); border-color: #cfe1e4; }

/* layout */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.25rem; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-brand { display: flex; align-items: center; gap: .7rem; }
.topbar-brand svg { width: 40px; height: 40px; }
.topbar-title { font-family: 'Caveat', cursive; font-size: 1.6rem; font-weight: 700; color: var(--sage-dark); line-height: 1; }
.topbar-sub { font-size: .78rem; }
.topbar-actions { display: flex; gap: .5rem; }
.tabs { display: flex; gap: .25rem; padding: .75rem 1.25rem 0; max-width: 1100px; margin: 0 auto; overflow-x: auto; }
.tab { font: inherit; font-weight: 700; padding: .6rem 1rem; border: 0; background: transparent; color: var(--ink-soft); border-radius: 999px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--sage-light); color: var(--sage-dark); }
.tab .count { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--paper); font-size: .78rem; text-align: center; margin-left: .2rem; }
.content { max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem 4rem; }
.panel { display: grid; gap: 1.25rem; }
.form { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem; display: grid; gap: 1.25rem; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head.small h3 { margin-bottom: .1rem; }
.section-head .muted { font-size: .9rem; }
.top-gap { margin-top: .5rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.subsection { border-top: 1px dashed var(--line); padding-top: 1.25rem; display: grid; gap: .9rem; }

/* fields */
.grid { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; }
.grid .span-2 { grid-column: 1 / -1; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
label { display: grid; gap: .3rem; font-weight: 700; font-size: .88rem; }
label.check { grid-template-columns: auto 1fr; align-items: start; font-weight: 500; }
label.check input { margin-top: .25rem; width: 18px; height: 18px; }
input, textarea, select { font: inherit; font-weight: 500; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: .65rem .85rem; width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 4px rgba(95,143,123,.15); }
textarea { resize: vertical; }
.form-actions { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.save-note { font-size: .85rem; color: var(--sage-dark); font-weight: 700; }

.details-list { display: grid; gap: .6rem; }
.detail-row { display: grid; grid-template-columns: 160px 1fr auto; gap: .6rem; align-items: start; }
@media (max-width: 640px) { .detail-row { grid-template-columns: 1fr; } }

/* tables */
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 680px; }
.table th, .table td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); background: var(--sage-mist); position: sticky; top: 0; }
.table tr:last-child td { border-bottom: 0; }
.table .actions-col { width: 1%; white-space: nowrap; }
.table .actions { display: flex; gap: .3rem; flex-wrap: nowrap; }
.table .empty { text-align: center; color: var(--ink-soft); padding: 2rem; }
.item-title { font-weight: 700; }
.item-sub { font-size: .8rem; color: var(--ink-soft); }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge.yes { background: var(--sage-light); color: var(--sage-dark); }
.badge.no { background: var(--pink-soft); color: #9b4a5a; }
.badge.maybe { background: var(--butter-soft); color: #8a6a1e; }
.badge.cat { background: var(--sky-soft); color: var(--ink); }
.pre { white-space: pre-line; }
.note-cell { max-width: 260px; font-size: .85rem; color: var(--ink-soft); }
.link-chip { font-size: .8rem; }

/* totals */
.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
@media (max-width: 520px) { .totals { grid-template-columns: repeat(2, 1fr); } }
.total { font: inherit; display: grid; justify-items: center; gap: .1rem; padding: .8rem; border-radius: 16px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 700; color: var(--ink-soft); }
.total-num { font-size: 1.6rem; color: var(--ink); line-height: 1; }
.total.yes .total-num { color: var(--sage-dark); }
.total.no .total-num { color: #9b4a5a; }
.total.maybe .total-num { color: #8a6a1e; }
.total[aria-pressed="true"] { border-color: var(--sage); background: var(--sage-mist); color: var(--sage-dark); }
.toolbar input { max-width: 380px; }

/* dialogs */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(94vw, 620px); box-shadow: 0 30px 70px -30px rgba(47,59,76,.5); }
dialog::backdrop { background: rgba(47, 59, 76, .35); backdrop-filter: blur(2px); }
.dialog-form { border: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-weight: 700; font-size: .9rem; z-index: 50; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.toast.error { background: var(--danger); }
