/* ===== Design tokens ===== */
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/heebo-hebrew.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/heebo-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/heebo-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --primary: #F59E0B;
  --primary-hover: #D97706;
  --primary-ink: #111827;      /* text on the orange (white on #F59E0B fails contrast) */
  --primary-text: #9A3F05;     /* orange used as text on white, AA contrast */
  --yellow-soft: #FEF3C7;
  --peach: #FFEDD5;
  --orange-light: #FDBA74;
  --bg: #EBE7DE;           /* page background: warm grey so white cards stand out */
  --surface-2: #F8FAFC;    /* tinted areas inside a card (table header, hints) */
  --bg-warm: #FFFBF5;
  --card: #FFFFFF;
  --ink: #111827;
  --ink-2: #4B5A6E;
  --line: #E2E8F0;
  --card-line: #E6E1D8;
  --success: #22C55E; --success-soft: #DCFCE7; --success-ink: #15803D;
  --error: #EF4444; --error-soft: #FEE2E2; --error-ink: #B91C1C;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .07);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .05), 0 10px 28px rgba(15, 23, 42, .08);
  --ring: 0 0 0 3px rgba(245, 158, 11, .28);
  --sidebar-w: 268px;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 'Heebo', system-ui, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-text); }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.num { direction: ltr; unicode-bidi: plaintext; text-align: right; }
.icon { flex: none; display: inline-block; vertical-align: middle; }

/* ===== App shell ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--card); border-inline-end: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 16px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--yellow-soft); color: var(--primary-hover);
}
.brand-name { font-weight: 800; font-size: 1.15rem; line-height: 1.1; }
.brand-sub { font-size: .8rem; color: var(--ink-2); }
.nav { display: grid; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; border: 0; background: transparent;
  padding: 12px 14px; border-radius: 12px; color: var(--ink-2); font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--yellow-soft); color: var(--ink); font-weight: 700; }
.nav-item[aria-current="page"] .icon { color: var(--primary-hover); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.usercard { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.usercard .who-name { font-weight: 700; line-height: 1.2; }
.usercard .who-role { font-size: .8rem; color: var(--ink-2); }
.logout { color: var(--error-ink); }
.logout:hover { background: var(--error-soft); color: var(--error-ink); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--peach); color: #9A3412; font-weight: 800;
}
.avatar.lg { width: 52px; height: 52px; font-size: 1.2rem; }

.content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--header-h); display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.greet { display: grid; line-height: 1.2; }
.greet strong { font-size: 1.15rem; font-weight: 800; }
.greet span { font-size: .85rem; color: var(--ink-2); }
.spacer { flex: 1; }
.event-chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--bg-warm); border: 1px solid #FDE7C2; color: var(--ink);
  padding: 8px 14px; border-radius: 999px; font-size: .9rem; white-space: nowrap;
}
.event-chip .icon { color: var(--primary-hover); }
.event-chip b { font-weight: 700; }
button.event-chip { cursor: pointer; font: inherit; }
.btn.menu-btn { display: none; }
.page { padding: 28px; width: 100%; max-width: 1320px; margin: 0 auto; display: grid; gap: 22px; align-content: start; }
.page > * { min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .titles { display: grid; gap: 4px; margin-inline-end: auto; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.scrim { display: none; }

/* ===== Cards ===== */
.card {
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--yellow-soft); color: var(--primary-hover); flex: none; }
.card-head .grow { margin-inline-end: auto; display: grid; }
.card-head .grow small { color: var(--ink-2); font-size: .85rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; }
.grid-2 > * { min-width: 0; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (min-width: 1580px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
.kpi {
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px; transition: box-shadow .2s, transform .2s;
}
.kpi:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.kpi .ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.kpi .lbl { color: var(--ink-2); font-size: .88rem; }
.kpi .val { font-size: 1.9rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--ink-2); font-size: .8rem; }
.tone-orange { background: var(--yellow-soft); color: var(--primary-hover); }
.tone-yellow { background: #FEF9C3; color: #A16207; }
.tone-peach { background: var(--peach); color: #C2410C; }
.tone-green { background: var(--success-soft); color: var(--success-ink); }
.tone-red { background: var(--error-soft); color: var(--error-ink); }
.tone-slate { background: #F1F5F9; color: #475569; }

/* ===== Forms ===== */
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #64748B; }
input:hover, select:hover, textarea:hover { border-color: #CBD5E1; }
input:focus, select:focus, textarea:focus { outline: 2px solid transparent; border-color: var(--primary); box-shadow: var(--ring); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
select {
  appearance: none; cursor: pointer; padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center;
}
textarea { resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--primary); cursor: pointer; }
input[type=file] { max-width: 100%; padding: 8px; font-size: .9rem; }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=search] { appearance: none; }
label { display: grid; gap: 6px; font-size: .85rem; font-weight: 500; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; font-size: .9rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 150px; }
.row > .grow2 { flex: 2 1 240px; }
.row > .fixed { flex: 0 0 auto; }
.error { color: var(--error-ink); min-height: 1.4em; font-size: .9rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: var(--radius-sm); font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s; text-decoration: none;
}
.btn:hover { border-color: #CBD5E1; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 700; box-shadow: 0 2px 6px rgba(245, 158, 11, .3); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 4px 12px rgba(217, 119, 6, .32); }
.btn.danger { color: var(--error-ink); }
.btn.danger:hover { background: var(--error-soft); border-color: #FCA5A5; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn.icon-btn { min-height: 36px; width: 36px; padding: 0; border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.icon-btn:hover { background: var(--yellow-soft); color: var(--primary-hover); }
.btn.icon-btn.danger:hover { background: var(--error-soft); color: var(--error-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible, .nav-item:focus-visible, a:focus-visible, summary:focus-visible, .fab:focus-visible, button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px rgba(255, 255, 255, .85); }
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

/* badges */
.badge, .chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: #F1F5F9; color: #475569; margin-inline-start: 6px; white-space: nowrap;
}
.badge.orange, .chip.side { background: var(--yellow-soft); color: #92400E; }
.badge.peach { background: var(--peach); color: #9A3412; }
.badge.green { background: var(--success-soft); color: var(--success-ink); }
.badge.red, .chip.dup { background: var(--error-soft); color: var(--error-ink); }
.badge.slate { background: #F1F5F9; color: #475569; }
.p-A { background: var(--orange-light); color: #7C2D12; }
.p-B { background: var(--yellow-soft); color: #92400E; }
.p-C { background: #F1F5F9; color: #475569; }
.note { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-warm); border: 1px solid #FDE7C2; color: var(--ink); display: flex; gap: 10px; align-items: flex-start; }
.note .icon { color: var(--primary-hover); margin-top: 2px; }

/* ===== Guests ===== */
.addcard { padding: 18px 20px; }
.addgrid { display: grid; grid-template-columns: 2.2fr 1.4fr .8fr 1.2fr 1.4fr auto; gap: 12px; align-items: end; }
.addgrid.with-owner { grid-template-columns: 2fr 1.3fr .8fr 1.2fr 1.3fr 1.3fr auto; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar > * { flex: 1 1 150px; }
.toolbar .search { flex: 2 1 260px; position: relative; }
.toolbar .search input { padding-inline-start: 42px; }
.toolbar .search .icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: #94A3B8; pointer-events: none; }
.toolbar .check { flex: 0 0 auto; background: var(--surface-2); border: 1px solid var(--line); padding: 0 14px; min-height: 44px; border-radius: var(--radius-sm); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters > * { flex: 1 1 150px; }
.filters .check { flex: 0 0 auto; }
.tablewrap { overflow-x: auto; }
.count { color: var(--ink-2); font-size: .9rem; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: start; font-size: .8rem; color: var(--ink-2); font-weight: 600; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
th:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
td { padding: 14px; border-bottom: 1px solid #EEF2F6; vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--bg-warm); }
tbody tr:last-child td { border-bottom: 0; }
.name-cell { font-weight: 600; }
td.act { white-space: nowrap; text-align: end; }
td .phone { display: inline-flex; align-items: center; gap: 6px; }
td .phone .icon { color: #94A3B8; }
td select.prio { min-height: 34px; padding: 4px 12px 4px 30px; border: 0; border-radius: 999px; font-weight: 700; font-size: .85rem; width: auto; background-position: left 10px center; }
.cat-pill { display: inline-block; background: #F1F5F9; color: #475569; border-radius: 8px; padding: 2px 10px; font-size: .85rem; }
.realname { margin-top: 6px; min-height: 36px; padding: 6px 12px; }

.empty-state { text-align: center; padding: 44px 16px; display: grid; gap: 12px; justify-items: center; }
.empty-state h3 { font-size: 1.2rem; }
.empty-state p { color: var(--ink-2); max-width: 380px; }
.empty-state .btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.empty { text-align: center; color: var(--ink-2); padding: 32px 10px; }

.fab {
  display: none; position: fixed; inset-inline-start: 18px; bottom: 20px; z-index: 35; height: 56px; padding: 0 22px 0 20px; gap: 8px;
  border: 0; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-weight: 800; align-items: center;
  box-shadow: 0 8px 24px rgba(217, 119, 6, .4); cursor: pointer;
}
.fab:active { transform: scale(.97); }

/* ===== Dashboard visuals ===== */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { position: relative; width: 168px; height: 168px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .track { stroke: #F1F5F9; }
.donut .prog { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.donut .prog.over { stroke: var(--error); }
.donut .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .mid b { font-size: 2rem; font-weight: 800; line-height: 1; }
.donut .mid span { font-size: .8rem; color: var(--ink-2); }
.facts { display: grid; gap: 10px; flex: 1; min-width: 180px; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.fact:last-child { border-bottom: 0; padding-bottom: 0; }
.fact span { color: var(--ink-2); }
.fact b { font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #F1F5F9; margin: 10px 0 8px; gap: 2px; }
.stack > div { height: 100%; min-width: 0; width: 0; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.seg-A { background: var(--primary); } .seg-B { background: var(--orange-light); } .seg-C { background: #CBD5E1; }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-inline-end: 6px; }
.hbars { display: grid; gap: 14px; }
.hbar .top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: .92rem; }
.hbar .top b { font-variant-numeric: tabular-nums; }
.hbar .track { height: 10px; background: #F1F5F9; border-radius: 999px; overflow: hidden; }
.hbar .fill { height: 100%; width: 0; border-radius: 999px; background: var(--primary); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.hbar:nth-child(3n+2) .fill { background: #FB923C; }
.hbar:nth-child(3n+3) .fill { background: var(--orange-light); }
.sidehead { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }

/* ===== Users ===== */
.usergrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.usercard-big { display: grid; gap: 14px; align-content: start; }
.usercard-big .head { display: flex; gap: 12px; align-items: center; }
.usercard-big .head .nm { font-weight: 800; line-height: 1.2; }
.usercard-big .head .em { color: var(--ink-2); font-size: .85rem; overflow-wrap: anywhere; }
.perm { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.perm .icon { margin-top: 2px; color: var(--primary-hover); }
.usercard-big .foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.usercard-big .foot .stat { margin-inline-end: auto; font-size: .88rem; color: var(--ink-2); }
.invite-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.invite-link input { direction: ltr; text-align: left; flex: 1 1 220px; font-size: .85rem; }

/* ===== Import screen ===== */
.srcgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.srcgrid > * { min-width: 0; }
.srcgrid .card { display: grid; gap: 12px; align-content: start; }
.srcgrid .card .card-head { margin-bottom: 0; }
.steps { margin: 8px 0 0; padding-inline-start: 20px; color: var(--ink-2); font-size: .9rem; display: grid; gap: 4px; }
details summary { cursor: pointer; color: var(--primary-text); font-weight: 600; }
.bulkbar {
  position: sticky; bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: #fff;
  border: 1px solid #FDE7C2; border-radius: 14px; padding: 12px 16px; margin-top: 14px; box-shadow: 0 10px 30px rgba(15, 23, 42, .14);
}
.bulkbar select, .bulkbar input { width: auto; flex: 1 1 140px; }

/* ===== Auth ===== */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(900px 420px at 85% -10%, #FFF1D6 0%, transparent 60%), radial-gradient(700px 380px at 0% 110%, #FFE9DA 0%, transparent 60%), var(--bg-warm); }
.auth-card { width: min(440px, 100%); display: grid; gap: 18px; padding: 32px 28px; }
.auth-card form { display: grid; gap: 14px; }
.auth-top { display: grid; justify-items: center; gap: 10px; text-align: center; }
.auth-top .brand-mark { width: 56px; height: 56px; border-radius: 18px; }

/* ===== Dialog / sheet ===== */
dialog { border: 0; border-radius: 20px; background: #fff; color: var(--ink); padding: 0; width: min(580px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 80px rgba(15, 23, 42, .28); }
dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
dialog[open] { animation: pop .18s ease-out; }
dialog form, dialog .sheet-body { display: grid; gap: 14px; padding: 22px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
dialog .actions { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
dialog .actions .end { display: flex; gap: 8px; }
.preview { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ===== Toast + skeleton ===== */
#toast {
  position: fixed; inset: auto 16px 24px 16px; margin: 0 auto; border: 0; overflow: visible; width: max-content; max-width: min(440px, calc(100vw - 32px)); z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .3);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; font-weight: 500;
}
#toast::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-inline-end: 10px; }
#toast.show { opacity: 1; transform: none; }
.skeleton { border-radius: 14px; background: linear-gradient(90deg, #EEF2F6 25%, #F8FAFC 37%, #EEF2F6 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skel-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.skel-kpis .skeleton { height: 90px; }
.skel-block { height: 240px; }

@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.page > * { animation: rise .35s ease both; }
.page > *:nth-child(2) { animation-delay: .04s; } .page > *:nth-child(3) { animation-delay: .08s; } .page > *:nth-child(4) { animation-delay: .12s; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .addgrid, .addgrid.with-owner { grid-template-columns: 1fr 1fr 1fr; }
  .addgrid .span-all { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
  .nav-open .sidebar { transform: none; visibility: visible; transition-delay: 0s; box-shadow: -20px 0 60px rgba(15, 23, 42, .25); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 38; background: rgba(15, 23, 42, .4); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .event-chip .long { display: none; }
  .page { padding: 18px 14px 96px; }
  h1 { font-size: 1.45rem; }
}
@media (max-width: 760px) {
  .addcard { display: none; }
  .fab { display: inline-flex; }
  .greet span { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .kpi .val { font-size: 1.6rem; }
  .card { padding: 16px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 calc(50% - 6px); white-space: nowrap; }
  .addgrid, .addgrid.with-owner { grid-template-columns: 1fr 1fr; }
  .addgrid .span-all { grid-column: 1 / -1; }
  .toolbar .check { flex: 1 1 100%; }
  dialog { margin: auto 0 0; width: 100%; max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; overflow: auto; }
  dialog[open] { animation: sheet .22s ease-out; }
  .btn { min-height: 48px; }
  input, select { min-height: 48px; }
  .btn.small { min-height: 38px; }
  .btn.icon-btn { min-height: 42px; width: 42px; }

  /* table rows become cards */
  .guests thead { display: none; }
  .guests, .guests tbody, .guests tr, .guests td { display: block; width: 100%; }
  .guests tr { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; background: #fff; }
  .guests tbody tr:hover { background: #fff; }
  .guests td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .guests td[data-label]::before { content: attr(data-label); color: var(--ink-2); font-size: .82rem; }
  .guests td.name-cell { font-size: 1.05rem; font-weight: 700; flex-wrap: wrap; justify-content: flex-start; }
  .guests td.act { justify-content: flex-end; border-top: 1px solid #EEF2F6; margin-top: 6px; padding-top: 8px; }
  .bulkbar { bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.skel-title { height: 38px; width: 240px; max-width: 70%; }
.badge.yellow { background: #FEF9C3; color: #A16207; }

.toolbar-more { display: contents; }
.btn.filter-toggle { display: none; flex: 0 0 auto; }
@media (max-width: 760px) {
  .toolbar .search { flex: 1 1 0; min-width: 0; }
  .btn.filter-toggle { display: inline-flex; }
  .toolbar-more { display: none; }
  .toolbar-more.open { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
  .toolbar-more.open .check { grid-column: 1 / -1; }
}

/* list scope switch (admins): my list / all lists */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--card-line); border-radius: 999px; justify-self: start; box-shadow: var(--shadow); }
.seg button { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink-2); min-height: 40px; white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--yellow-soft); color: var(--ink); box-shadow: inset 0 0 0 1px #FDE7C2; }
.seg button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (max-width: 760px) { .seg { justify-self: stretch; } .seg button { flex: 1; padding: 8px 10px; } }

/* history screen */
.hday { margin: 18px 0 8px; font-size: .85rem; color: var(--ink-2); font-weight: 700; }
.hday:first-child { margin-top: 0; }
.hrow { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid #EEF2F6; }
.hrow:last-child { border-bottom: 0; }
.hrow.undone { opacity: .7; }
.hico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.hbody { flex: 1; min-width: 0; }
.htitle { font-weight: 700; overflow-wrap: anywhere; }
.hdetail { font-size: .88rem; color: var(--ink); background: var(--surface-2); border-radius: 8px; padding: 3px 10px; margin-top: 4px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.hmeta { font-size: .82rem; color: var(--ink-2); margin-top: 3px; }
.small-note { font-size: .8rem; }
@media (max-width: 760px) { .hrow { flex-wrap: wrap; } .hrow > .btn, .hrow > .badge, .hrow > .small-note { margin-inline-start: 52px; } }
/* toast with an action button (undo) */
#toast.has-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
#toast button { border: 0; background: transparent; color: var(--orange-light); font-weight: 800; cursor: pointer; padding: 6px 4px; font-size: 1rem; }
#toast button:hover { text-decoration: underline; }

/* headcount field in the pool table */
input.count-in { width: 72px; min-height: 38px; padding: 6px 8px; text-align: center; }
@media (max-width: 760px) { input.count-in { width: 88px; } }

.bulkbar input.bulk-count { flex: 0 0 96px; width: 96px; }

/* category picker inside the pool table */
td select.pool-cat { min-height: 36px; padding: 4px 30px 4px 10px; width: auto; min-width: 150px; max-width: 190px; font-size: .88rem; background-position: left 10px center; }
@media (max-width: 760px) { td select.pool-cat { max-width: 60%; } }

/* pool source tabs */
.seg.wrap { flex-wrap: wrap; border-radius: 18px; margin-bottom: 14px; }

td.num { white-space: nowrap; }

/* pool: Facebook lookup link, summary line */
.fb-find { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 10px; font-size: .8rem; font-weight: 600; color: var(--primary-text); text-decoration: none; background: var(--yellow-soft); border-radius: 999px; padding: 1px 9px; }
.fb-find:hover { background: var(--peach); }
.summary-line { font-size: .92rem; color: var(--ink); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.chip.slate { background: #F1F5F9; color: #475569; }

/* "same person?" suggestions under a pool name */
.suggest { margin-top: 8px; padding: 8px 10px; background: var(--bg-warm); border: 1px solid #FDE7C2; border-radius: 10px; font-size: .85rem; font-weight: 400; display: grid; gap: 8px; }
.sug-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.sug-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-inline-start: auto; }
.suggest .btn.small { min-height: 30px; padding: 0 10px; font-size: .82rem; }
.lvl { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.lvl-high { background: #FED7AA; color: #7C2D12; }
.lvl-medium { background: var(--yellow-soft); color: #92400E; }
.lvl-family { background: #F1F5F9; color: #475569; }
.link-btn { border: 0; background: none; color: var(--primary-text); cursor: pointer; font-size: .8rem; font-weight: 600; padding: 0; text-align: start; }
.link-btn:hover { text-decoration: underline; }

/* suggestion line: full width under the row on desktop, inside the card on phones */
tr.has-sug > td { border-bottom: 0; }
tr.sug-tr > td { padding: 0 14px 14px; border-bottom: 1px solid #EEF2F6; }
tr.sug-tr .suggest { grid-template-columns: 1fr; }
tbody tr.sug-tr:hover { background: transparent; }
.suggest.inline { display: none; }
@media (max-width: 760px) {
  .suggest.inline { display: grid; }
  tr.sug-tr { display: none !important; }
  .sug-actions { margin-inline-start: 0; }
}

/* same-name note */
.ns-note { color: var(--ink-2); }

/* names to fix */
.fixbar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--yellow-soft); color: #92400E; }
.fixbar.hidden { display: none; }
.fixbar .grow { flex: 1; }
.namefix { max-height: 70vh; overflow: auto; }
.fixrow { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line, #E5E7EB); border-radius: 12px; background: #fff; }
.fixhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.fixedit { display: flex; flex-wrap: wrap; gap: 8px; }
.fixedit input { flex: 1 1 200px; min-width: 0; }

/* budget */
.budgetbar { height: 10px; border-radius: 99px; background: #E7E2D6; overflow: hidden; margin: -4px 0 4px; }
.budgetbar .fill { height: 100%; background: var(--primary, #F59E0B); border-radius: 99px; transition: width .4s; }
.budgetbar .fill.over { background: #DC2626; }
.soon { display: grid; gap: 8px; margin-top: 6px; }
.soonrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.soonrow .grow { flex: 1; min-width: 0; }
.facts.row3 { grid-template-columns: repeat(3, 1fr); gap: 12px; }
.facts.row3 .fact { flex-direction: column; border: 0; padding: 0; }
.actions-row { margin-top: 12px; }
table.budget td.num { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .facts.row3 { grid-template-columns: 1fr; } }

/* budget v2 */
.estgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.estgrid label, .estimate input { min-width: 0; }
table.estimate th[scope=row] { text-align: start; font-weight: 600; }
table.estimate th small { display: block; font-weight: 400; }
table.estimate tr.sumrow th, table.estimate tr.sumrow td, table.flow tr.sumrow td { font-weight: 700; background: #FFF7E6; }
table.estimate td.num, table.flow td.num { font-variant-numeric: tabular-nums; }
td.neg { color: var(--error-ink, #B91C1C); }
.paybox { display: grid; gap: 8px; }
.payrow { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr auto auto; gap: 8px; align-items: center; }
.payhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row.hidden { display: none; }
@media (max-width: 760px) { .payrow { grid-template-columns: 1fr 1fr; } table.estimate th[scope=row] { display: block; padding: 6px 0; } }

/* budget v3: steps, scenarios, profit / loss */
.step { border-inline-start: 4px solid var(--primary, #F59E0B); }
.stephead { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.stephead h3 { margin: 0; }
.stephead p { margin: 2px 0 0; }
.stepno { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--primary, #F59E0B); color: #1F2937; font-weight: 800; display: grid; place-items: center; }
.scengrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 8px; }
.scencard { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line, #E5E7EB); border-radius: 14px; background: #FFFBF2; align-content: start; }
.scencard.sc-medium { border-color: var(--primary, #F59E0B); background: #FFF4D6; }
.scencard strong { font-size: 1.05rem; }
.pos { color: #15803D; font-weight: 800; }
.neg { color: #B91C1C; font-weight: 800; }
tr.resultrow td { font-size: 1.1rem; }

/* phones to fill */
.fixhint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #F0FDF4; color: #166534; }
.fixhint span { flex: 1 1 200px; }

/* hall quotes */
.qline { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: center; }
.qadd { display: flex; gap: 6px; }
.card.quote { border-inline-start: 4px solid #E5E7EB; }
.card.quote.chosen { border-inline-start-color: #16A34A; }
.card.quote h3 .badge { margin-inline-start: 8px; }
.qnotes { white-space: pre-line; }
.actions-row.top { margin: 0 0 4px; }
table.qtable td.num { font-variant-numeric: tabular-nums; }
table.cmp td small, table.cmp th small { display: block; font-weight: 400; }
table.cmp td.best { background: #F0FDF4; color: #166534; font-weight: 700; }
@media (max-width: 760px) { .qline { grid-template-columns: 1fr 1fr; } .qline input:first-child { grid-column: 1 / -1; } }

/* quote review banner */
.note.ok { background: #F0FDF4; color: #166534; }
.note.warn { background: #FEF2F2; color: #991B1B; }
.actions-row.top .btn { margin-inline-end: 8px; }

/* attendance override */
.attendhint { display: block; padding-top: 2px; }
.scencard input:disabled { background: #F3F4F6; color: #9CA3AF; }

.envunit { display: grid; gap: 4px; margin: 0 0 12px; max-width: 460px; }

/* events */
.event-switch { display: grid; gap: 4px; margin: 4px 14px 10px; font-size: .8rem; color: var(--ink-2); }
.event-switch select { width: 100%; }
.rolesel { display: grid; gap: 4px; font-size: .85rem; margin-top: 6px; }
table.platform td .muted { display: block; font-size: .8rem; }

/* brand logo */
.brand-logo { width: 40px; height: 40px; flex: none; object-fit: contain; }
.auth-logo { width: min(260px, 72%); height: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* plans */
.plan-chip { background: var(--bg-warm); border: 1px solid #FDE7C2; border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 8px; }
.plan-row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.plan-chip .bar { height: 8px; border-radius: 999px; background: #F3E9D6; overflow: hidden; }
.plan-chip .plan-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #FBBF24, #EA580C); }
.upgrade { display: grid; gap: 16px; }
.upgrade-price { display: grid; gap: 2px; }
.upgrade-price b { font-size: 44px; font-weight: 800; line-height: 1.1; }
.upgrade-price span { color: var(--ink-2); font-weight: 600; }
.upgrade-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.upgrade-list li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.upgrade-list .icon { color: var(--success-ink); flex: none; margin-top: 2px; }

/* ===== Accessibility ===== */
.skip { position: absolute; inset-inline-start: 12px; top: -64px; z-index: 200; background: var(--ink); color: #fff; padding: 12px 18px; border: 0; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }
.skip:focus { top: 12px; }
.a11y-float { position: fixed; z-index: 60; inset-inline-end: 14px; bottom: 14px; width: 48px; height: 48px; border-radius: 50%; border: 2px solid #fff; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); padding: 0; }
.a11y-float[hidden] { display: none; }
.a11y-panel { position: fixed; z-index: 90; inset-inline-end: 14px; top: 80px; width: min(320px, calc(100vw - 28px)); max-height: calc(100dvh - 100px); overflow: auto; background: #fff; color: var(--ink); border: 1px solid var(--card-line); border-radius: 18px; box-shadow: var(--shadow-hover); padding: 14px; font-size: 15px; }
.a11y-panel[hidden] { display: none; }
.a11y-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 17px; }
.a11y-panel button { font: inherit; cursor: pointer; }
.a11y-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 22px; line-height: 1; }
.a11y-size { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 10px; }
.a11y-size button { flex: none; min-width: 64px; height: 44px; border-radius: 12px; border: 1px solid var(--ink); background: #fff; font-weight: 800; font-size: 17px; }
.a11y-size span { flex: 1; text-align: center; font-weight: 700; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-opt { min-height: 46px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600; text-align: center; }
.a11y-opt[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.a11y-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.a11y-reset { background: none; border: 0; text-decoration: underline; padding: 8px 0; }
.a11y-foot a { color: var(--primary-text); font-weight: 700; }
@media (max-width: 640px) { .a11y-panel { top: 72px; inset-inline-end: 10px; } }

html.a11y-fs-1 { zoom: 1.1; }
html.a11y-fs-2 { zoom: 1.22; }
html.a11y-fs-3 { zoom: 1.38; }
html.a11y-gray { filter: grayscale(1); }
html.a11y-font body, html.a11y-font button, html.a11y-font input, html.a11y-font select, html.a11y-font textarea { font-family: Arial, 'Segoe UI', sans-serif !important; }
html.a11y-space body { letter-spacing: .04em; word-spacing: .12em; line-height: 1.9; }
html.a11y-links a { text-decoration: underline !important; text-underline-offset: 3px; }
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-contrast { --bg: #fff; --bg-warm: #fff; --surface-2: #fff; --card: #fff; --ink: #000; --ink-2: #000; --line: #000; --card-line: #000; --primary: #FFD400; --primary-hover: #FFC400; --primary-text: #000; --yellow-soft: #fff; --peach: #fff; --shadow: none; --shadow-hover: none; }
html.a11y-contrast .card, html.a11y-contrast input, html.a11y-contrast select, html.a11y-contrast textarea { border: 2px solid #000; }
html.a11y-contrast .btn { border: 2px solid #000; }
html.a11y-contrast a { text-decoration: underline; }
html.a11y-contrast ::placeholder { color: #000; }
