/* ---------- Buttons: every hover fills up from the bottom, arrows glide, press squishes ---------- */
.btn {
  --bg: var(--ink); --fg: #fff; --bd: transparent; --fill: var(--accent); --fill-fg: var(--on-accent);
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1.5px solid var(--bd);
  background: var(--bg); color: var(--fg); font-weight: 700; font-size: .98rem; letter-spacing: -.005em;
  white-space: nowrap; overflow: hidden; transition: color .35s var(--ease), border-color .35s, box-shadow .35s, transform .3s var(--ease);
  -webkit-tap-highlight-color: transparent; user-select: none; cursor: pointer;
}
.btn::before { content: ''; position: absolute; inset: -2px; z-index: -1; background: var(--fill); transform: translateY(104%); border-radius: 50% 50% 0 0 / 60% 60% 0 0; transition: transform .55s var(--ease), border-radius .55s var(--ease); }
.btn:hover, .btn:focus-visible { color: var(--fill-fg); border-color: var(--fill); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); border-radius: 0; }
.btn:active { transform: translateY(0) scale(.975); transition-duration: .1s; }
.btn svg { width: 20px; height: 20px; flex: none; transition: transform .4s var(--ease); }
.btn:hover svg:last-child:not(:first-child) { transform: translateX(5px); }
.btn:hover svg:first-child:not(:last-child) { transform: scale(1.12) rotate(-6deg); }
.btn-accent { --bg: var(--accent); --fg: var(--on-accent); --fill: var(--ink); --fill-fg: #fff; }
.btn-brand { --bg: var(--ink); --fg: #fff; --fill: var(--accent); --fill-fg: var(--on-accent); }
.btn-ghost { --bg: transparent; --fg: var(--text); --bd: var(--line-2); --fill: var(--ink); --fill-fg: #fff; }
.btn-light { --bg: #fff; --fg: var(--ink); --fill: var(--accent); --fill-fg: var(--on-accent); }
.btn-outline-light { --bg: transparent; --fg: #fff; --bd: rgba(255, 255, 255, .35); --fill: #fff; --fill-fg: var(--ink); }
.btn-danger { --bg: var(--bad-50); --fg: var(--bad); --bd: #efc3c0; --fill: var(--bad); --fill-fg: #fff; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: .88rem; }
.btn-lg { min-height: 58px; padding: 0 32px; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::after { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn .ripple { position: absolute; z-index: 2; border-radius: 50%; background: rgba(255, 255, 255, .3); transform: scale(0); pointer-events: none; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; transition: background .25s, transform .25s var(--ease); cursor: pointer; }
.icon-btn:hover { background: rgba(12, 22, 30, .08); transform: scale(1.06); }
.icon-btn svg { width: 22px; height: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tooltip: icon-only controls always get a visible label on hover / focus */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 12px); left: 50%; transform: translate(-50%, -6px); padding: 6px 11px; border-radius: 9px; background: var(--night); color: #fff; font: 600 .76rem/1.2 var(--font-body); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); z-index: 5; box-shadow: var(--shadow-2); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.hwrap { display: inline-flex; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 0 16px; background: #fff; border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm); transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
.textarea { padding: 12px 16px; min-height: 96px; resize: vertical; }
.select { padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6977' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.input::placeholder { color: var(--muted-2); }
.input[aria-invalid='true'] { border-color: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 12%, transparent); }
.field-error { color: var(--bad); font-size: .8rem; font-weight: 600; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 639px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: .92rem; }
.check input { appearance: none; width: 22px; height: 22px; flex: none; margin-top: 1px; border: 1.8px solid var(--line-2); border-radius: 7px; background: #fff; display: grid; place-items: center; transition: .15s; cursor: pointer; }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { content: ''; width: 10px; height: 6px; border: 2.4px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.seg { display: inline-flex; padding: 4px; background: var(--paper-2); border-radius: 999px; gap: 2px; }
.seg button { padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--muted); transition: .2s; }
.seg button[aria-pressed='true'] { background: #fff; color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- Cards, chips, badges ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card-pad { padding: clamp(18px, 2.4vw, 28px); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line-2); font-weight: 600; font-size: .9rem; white-space: nowrap; transition: .2s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip svg { width: 18px; height: 18px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: var(--paper-2); color: var(--muted); }
.badge.ok { background: var(--ok-50); color: var(--ok); }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.bad { background: var(--bad-50); color: var(--bad); }
.badge.brand { background: var(--brand-50); color: var(--brand-600); }
.badge.accent { background: var(--accent-50); color: var(--accent-600); }
.badge.dark { background: var(--ink); color: #fff; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.icon { width: 20px; height: 20px; flex: none; }

/* ---------- Skeleton ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--paper-2); border-radius: var(--r-sm); min-height: 16px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- Header: the colour follows whatever section it floats over ---------- */
.site-header { --h-fg: #fff; --h-bg: rgba(12, 22, 30, .76); position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--header-h); color: var(--h-fg); background: transparent; transition: background .4s var(--ease-in-out), box-shadow .4s, color .4s var(--ease-in-out), transform .45s var(--ease); }
.site-header.is-light { --h-fg: var(--ink); --h-bg: rgba(245, 247, 250, .82); }
.site-header:not(.is-top) { background: var(--h-bg); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); box-shadow: 0 1px 0 color-mix(in srgb, var(--h-fg) 12%, transparent); }
.site-header .inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 1.3rem/1 var(--font-display); letter-spacing: -.04em; }
.logo-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; color: var(--on-accent); transition: transform .5s var(--ease); }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
.logo-mark svg { width: 20px; height: 20px; }
.nav { position: relative; display: flex; gap: 2px; margin-left: 12px; }
.nav a { position: relative; z-index: 1; padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .94rem; opacity: .78; transition: opacity .25s; }
.nav a:hover, .nav a[aria-current='page'] { opacity: 1; }
.nav-ind { position: absolute; z-index: 0; top: 0; left: 0; height: 100%; width: 0; border-radius: 999px; background: color-mix(in srgb, var(--h-fg) 14%, transparent); transition: transform .45s var(--ease), width .45s var(--ease), opacity .25s; opacity: 0; pointer-events: none; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.hbtn { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; height: 44px; min-width: 44px; padding: 0; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--h-fg) 28%, transparent); color: var(--h-fg); background: transparent; font-weight: 700; font-size: .9rem; cursor: pointer; transition: color .35s var(--ease), border-color .35s, transform .3s var(--ease); }
.hbtn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform: translateY(105%); border-radius: 50% 50% 0 0 / 70% 70% 0 0; transition: transform .5s var(--ease), border-radius .5s var(--ease); }
.hbtn:hover, .hbtn:focus-visible { color: var(--on-accent); border-color: var(--accent); transform: translateY(-2px); }
.hbtn:hover::before, .hbtn:focus-visible::before { transform: translateY(0); border-radius: 0; }
.hbtn svg { width: 20px; height: 20px; flex: none; margin: 0 11px; transition: transform .4s var(--ease); }
.hbtn:hover svg { transform: scale(1.1) rotate(-6deg); }
.hbtn-phone > span { max-width: 0; overflow: hidden; opacity: 0; white-space: nowrap; transition: max-width .5s var(--ease), opacity .3s, margin .5s var(--ease); }
.hbtn-phone:hover > span, .hbtn-phone:focus-visible > span { max-width: 170px; opacity: 1; margin-right: 18px; }
.hbtn-phone:hover svg, .hbtn-phone:focus-visible svg { margin-right: 8px; }
.hbtn-solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hbtn-solid::before { background: var(--h-fg); }
.site-header.is-dark .hbtn-solid:hover { color: var(--night); border-color: #fff; }
.site-header.is-light .hbtn-solid:hover { color: #fff; border-color: var(--ink); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
@media (max-width: 899px) { .nav, .header-actions .hide-m { display: none; } .site-header .inner { gap: 12px; } }

/* ---------- Bottom nav (mobile/tablet portrait) ---------- */
.bottom-nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 55; height: var(--bottom-nav-h);
  display: none; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px; border-radius: 26px;
  background: rgba(12, 22, 30, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-3);
}
.bottom-nav a { display: grid; place-items: center; align-content: center; gap: 3px; color: rgba(255, 255, 255, .62); font-size: .68rem; font-weight: 700; border-radius: 20px; transition: .25s var(--ease); }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a[aria-current='page'] { color: var(--accent); background: rgba(255, 255, 255, .1); }
@media (max-width: 899px) { .bottom-nav { display: grid; } body.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + 24px + var(--safe-b)); } body.kiosk-mode .bottom-nav, body.admin-mode .bottom-nav { display: none; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: rgba(255, 255, 255, .72); margin-top: 96px; padding: 64px 0 32px; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; letter-spacing: 0; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1.6fr repeat(3, 1fr); }
.footer-grid li + li { margin-top: 10px; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: .85rem; }
@media (max-width: 899px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } .site-footer { margin-top: 72px; } }

/* ---------- Sheet / modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; align-items: end; justify-items: center; }
.overlay-bg { position: absolute; inset: 0; background: rgba(8, 20, 32, .55); backdrop-filter: blur(3px); }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: min(86dvh, 760px); display: flex; flex-direction: column; background: var(--paper); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-3); overflow: hidden; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; }
.sheet-head h3 { flex: 1; }
.sheet-body { overflow: auto; padding: 4px 20px 24px; overscroll-behavior: contain; }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 10px auto 0; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 28px; } .sheet-grab { display: none; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 120; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-nav-h) + 28px + var(--safe-b)); display: grid; gap: 10px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 28px; } }
.toast { pointer-events: auto; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--night); color: #fff; box-shadow: var(--shadow-3); font-weight: 600; font-size: .92rem; }
.toast svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast.error { background: #7a1d1d; }
.toast.success svg { color: #6FD39A; }

/* ---------- Tables (admin + lists) ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .04); }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--muted-2); }

/* ---------- Page transition curtain ---------- */
.curtain { position: fixed; inset: 0; z-index: 90; background: var(--night); transform: translateY(100%); pointer-events: none; display: grid; place-items: center; visibility: hidden; }
.curtain-mark { display: flex; align-items: center; gap: 12px; color: #fff; font: 800 1.4rem var(--font-display); opacity: 0; }
.curtain-mark i { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); display: block; }
