:root {
    --green-900: #0d2b1d;
    --green-800: #10462c;
    --green-700: #156b3e;
    --green-600: #1c8f4f;
    --green-500: #2ab061;
    --green-400: #4ed382;
    --accent: #ffc94a;
    --red: #e24a4a;
    --amber: #f5a524;
    --bg: #f3f6f3;
    --panel: #ffffff;
    --ink: #0f1b14;
    --ink-soft: #4a5a52;
    --muted: #8a998f;
    --line: #e4ebe4;
    --line-soft: #eef3ee;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 70, 44, .04), 0 10px 30px rgba(16, 70, 44, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .25em; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p  { margin: 0 0 .5em; }
small, .small { font-size: 12px; color: var(--muted); }

/* layout */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--green-900);
    color: #e4f3ea;
    padding: 22px 18px;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand-mark {
    background: var(--accent); color: var(--green-900);
    width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center;
    font-weight: 800; font-size: 15px; letter-spacing: .02em;
}
.brand strong { color: #fff; font-size: 16px; display: block; }
.brand small { color: #9bc7ab; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-link {
    display: block; padding: 10px 12px; border-radius: 10px;
    color: #b7d5c2; font-weight: 500; font-size: 14px;
    transition: background .15s, color .15s;
}
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side-link.active { background: var(--green-700); color: #fff; }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.admin-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-avatar {
    background: var(--green-600); color: #fff;
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700;
}
.admin-chip strong { color: #fff; font-size: 13px; display: block; }
.admin-chip small { color: #9bc7ab; font-size: 11px; }

.main { padding: 28px 32px 60px; max-width: 1280px; }

/* flash */
.flash {
    border-radius: 10px; padding: 12px 14px; margin-bottom: 20px;
    font-weight: 500; font-size: 13px;
}
.flash-success { background: #e6f8ec; color: var(--green-800); border: 1px solid #b9e6c7; }
.flash-error   { background: #fde8e8; color: #8a1f1f;        border: 1px solid #f3bdbd; }
.flash-info    { background: #eaf1fb; color: #1d3d7a;        border: 1px solid #c4d7f2; }

/* page head */
.page-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head .eyebrow {
    color: var(--green-700); font-size: 11px; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px;
}
.page-head h1 { margin: 0; }
.page-head p { color: var(--ink-soft); margin: 4px 0 0; }

/* panels */
.panel {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 20px; }
.panel-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px; gap: 10px;
}
.panel-head h2, .panel-head h3 { margin: 0; }

/* grids */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
    .side-nav { flex-direction: row; flex: 1 1 100%; overflow-x: auto; }
    .sidebar-footer { width: 100%; }
}

/* stats */
.stat {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px 20px;
    box-shadow: var(--shadow);
}
.stat .label {
    color: var(--muted); font-size: 11px; font-weight: 600;
    letter-spacing: .09em; text-transform: uppercase;
}
.stat .value { font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.stat .hint  { color: var(--ink-soft); font-size: 12px; margin-top: 4px; }
.stat.danger  .value { color: var(--red); }
.stat.warn    .value { color: var(--amber); }
.stat.success .value { color: var(--green-600); }

/* table */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.data th, table.data td { padding: 11px 14px; text-align: left; }
table.data th {
    background: #fafcfa; color: var(--ink-soft); font-weight: 600; font-size: 11px;
    letter-spacing: .06em; text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}
table.data tbody tr { border-top: 1px solid var(--line-soft); }
table.data tbody tr:hover { background: #fafcfa; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .primary { font-weight: 600; }
table.data a.row-link { color: var(--ink); }
table.data .muted-cell { color: var(--muted); }

/* pills */
.pill {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: .03em;
}
.pill-paid    { background: #daf3e3; color: var(--green-800); }
.pill-pending { background: #fde4e4; color: #8a1f1f; }
.pill-partial { background: #fff1cf; color: #7a5000; }
.pill-muted   { background: #edf1ed; color: var(--ink-soft); }
.pill-guest   { background: #e4eeff; color: #1d3d7a; }
.pill-info    { background: #e4eeff; color: #1d3d7a; }

/* buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 13px;
    border: 1px solid transparent; cursor: pointer; transition: all .15s;
    text-decoration: none; background: var(--green-700); color: #fff;
}
.btn:hover { background: var(--green-800); text-decoration: none; }
.btn-block { display: flex; width: 100%; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: #fafcfa; }
.btn-ghost { background: transparent; color: #e4f3ea; border-color: rgba(255,255,255,.15); }
.btn-ghost:hover { background: rgba(255,255,255,.06); color: #fff; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #b83d3d; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px 9px; }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.form-field input, .form-field select, .form-field textarea {
    padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
    font-family: inherit; font-size: 13px; background: #fff; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: none; border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(42, 176, 97, .12);
}
.form-field textarea { resize: vertical; min-height: 70px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* login */
.login-shell {
    min-height: 100vh; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--green-900), var(--green-700));
    padding: 24px;
}
.login-card {
    background: #fff; border-radius: 18px; padding: 32px;
    width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-card h1 { font-size: 22px; margin: 10px 0 4px; }
.login-card .brand-mark { width: 44px; height: 44px; border-radius: 12px; }

/* participants checkbox grid */
.participant-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px; margin-top: 10px;
}
.participant-card {
    border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #fff; transition: all .15s;
}
.participant-card.selected { border-color: var(--green-500); background: #f4fbf7; }
.participant-card .pname { font-weight: 600; font-size: 13px; }
.participant-card .psub  { font-size: 11px; color: var(--muted); }
.participant-card label { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; }
.participant-card input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--green-600); }
.participant-card .guest-toggle {
    font-size: 11px; color: var(--ink-soft); display: flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 6px; background: #f3f6f3;
}
.participant-card .guest-toggle input[type="checkbox"] { width: 13px; height: 13px; }

/* qr */
.qr-box {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 20px; background: #fafcfa; border: 1px dashed var(--line);
    border-radius: 12px;
}
.qr-box img { max-width: 260px; border-radius: 10px; background: #fff; padding: 8px; }
.qr-box code {
    background: #fff; border: 1px solid var(--line); padding: 8px 12px;
    border-radius: 8px; font-size: 12px; word-break: break-all;
    max-width: 100%; display: block;
}

/* breadcrumb */
.crumbs { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.crumbs a { color: var(--ink-soft); }
.crumbs .sep { margin: 0 6px; }

/* dropzone */
.dropzone {
    border: 2px dashed var(--line); border-radius: 14px;
    padding: 22px; background: #fafcfa;
    transition: all .15s; cursor: pointer; margin-bottom: 18px;
}
.dropzone:hover, .dropzone.is-over {
    border-color: var(--green-500); background: #f1faf4;
}
.dropzone.is-uploading { opacity: .6; pointer-events: none; }
.dz-body {
    display: flex; align-items: center; gap: 16px; justify-content: space-between;
}
.dz-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--green-700); color: #fff; font-size: 22px; font-weight: 700;
    display: grid; place-items: center;
}
.dz-copy { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.dz-copy strong { font-size: 14px; color: var(--ink); }
.dz-filename { margin-top: 10px; font-size: 13px; color: var(--green-700); font-weight: 600; }

/* misc */
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state {
    text-align: center; padding: 40px 20px; color: var(--muted);
    border: 1px dashed var(--line); border-radius: 12px; background: #fafcfa;
}
.inline-info { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-soft); font-size: 13px; }
.inline-info strong { color: var(--ink); }
.kbd { font-family: ui-monospace, monospace; background: #f3f6f3; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
