/* فرحتي — dashboard, auth, door, family, ticket, admin. Builds on site.css. */
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: left; }
input.ltr { text-align: left; }
.dash-app { min-width: 0; overflow-wrap: anywhere; }
.dash-app .btn, .door-app .btn { min-height: 44px; }
.dash-app .seg button, .tabs button { min-height: 44px; }
.dash-app h1 { font-size: clamp(28px, 7vw, 42px); margin: 0; }
.dash-app h2 { font-size: clamp(22px, 5vw, 30px); margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-app h3 { margin: 0; }
.empty { padding: 34px 20px; }
.empty-icon { font-size: 42px; line-height: 1; }
.alert-wait { background: var(--wait-soft); color: var(--wait); }
.toast[hidden] { display: none; }
.toast-bad { background: var(--no); }
.ok-text { color: var(--ok); font-weight: 700; }
.badge.occ { background: var(--primary-soft); color: var(--primary); }

/* auth */
.auth { max-width: 460px; }
.auth h1 { margin-bottom: 4px; }

/* invitations list */
.inv-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; position: relative; overflow: hidden; padding-top: 28px; transition: transform .15s, box-shadow .15s; }
.inv-card:hover { transform: translateY(-2px); }
.inv-card h3 { font-size: 24px; }
.inv-card p { margin: 0; }
.inv-swatch { position: absolute; inset: 0 0 auto 0; height: 8px; }

/* one invitation */
.inv-page { padding: 18px 0 40px; }
.inv-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.inv-head p { margin: 0; }
.back { text-decoration: none; font-weight: 700; align-self: flex-start; min-height: 32px; }
.dash-tabs { position: sticky; top: 62px; z-index: 10; background: var(--bg); margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tabs button { padding: 10px 12px; }
[data-panel] { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-radius: var(--r); padding: 16px 18px; background: var(--gold-soft); color: #6B4E18; }
.banner p { margin: 2px 0 0; font-size: 15px; }
.banner b { font-size: 17px; }
.banner > div { flex: 1 1 220px; }
.banner-ok { background: var(--ok-soft); color: var(--ok); }
.banner-wait { background: var(--wait-soft); color: var(--wait); }
.banner-no { background: var(--no-soft); color: var(--no); }

.link-input { font-size: 15px; background: var(--bg); }
.actions .btn { flex: 1 1 auto; }
.stats .stat b { font-size: 28px; }
.dash-app .stats { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.qr-card { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.qr-card .stack { flex: 1 1 200px; }
.qr-card p { margin: 0; }
.qr { width: 180px; height: 180px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-inline: auto; }

.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 2fr 1.5fr 1fr; } .form-grid:has(> :nth-child(2):last-child) { grid-template-columns: 1fr 1fr; } }
.bulk summary { cursor: pointer; font-weight: 700; color: var(--primary); min-height: 44px; display: flex; align-items: center; }
.bulk form { margin-top: 8px; }

.toolbar { display: flex; flex-direction: column; gap: 10px; }
.toolbar .seg { display: grid; grid-template-columns: repeat(4, 1fr); }
.toolbar .seg button { padding: 7px 4px; }
.seg button[data-count]::after { content: attr(data-count); margin-inline-start: 5px; font-weight: 500; opacity: .7; }
@media (min-width: 760px) { .toolbar { flex-direction: row; align-items: center; } .toolbar .input { flex: 1; } .toolbar .seg { display: inline-flex; } .toolbar .seg button { padding: 7px 18px; } }

.g-cards { display: flex; flex-direction: column; gap: 10px; }
.g-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.g-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.g-card .g-actions .btn { flex: 1 1 auto; }
.g-table { display: none; }
.g-table td .g-actions { flex-wrap: nowrap; }
@media (min-width: 900px) { .g-cards { display: none; } .g-table { display: block; } }

.wish p { margin: 6px 0 10px; }
.wish-text { white-space: pre-wrap; }
.wish.is-hidden { opacity: .65; border-style: dashed; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.facts li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; font-size: 15px; }
.facts span { color: var(--muted); flex: none; }
.facts b { text-align: left; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 56px; }
.switch-row:last-child { border-bottom: 0; }
.switch-row small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 30px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: inset-inline-start .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { inset-inline-start: 25px; }
.switch:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.switch:disabled { opacity: .6; }
.slug-prefix { font-size: 14px; color: var(--muted); word-break: break-all; }
.danger { border-color: var(--no-soft); background: #FFF8F7; }
.danger h3 { color: var(--no); }

.price { text-align: center; font-family: var(--display); color: var(--primary); }
.price b { font-size: 56px; line-height: 1.1; }
.price span { font-size: 24px; }
.price small { display: block; font-family: var(--body); font-size: 15px; }
.steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 10px; }
.alias { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.alias b { font-size: 20px; background: var(--gold-soft); padding: 4px 12px; border-radius: 10px; }

/* ticket */
.tk-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px;
  background: radial-gradient(circle at 50% 0%, #9B4553 0%, var(--primary) 45%, #4A1620 100%); }
.ticket { width: min(380px, 100%); background: var(--paper); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55); text-align: center; }
.tk-head { padding: 26px 22px 18px; background: linear-gradient(180deg, var(--gold-soft), var(--paper)); }
.tk-head small { display: inline-block; font-weight: 700; letter-spacing: .5px; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 2px 14px; }
.tk-head h1 { font-size: clamp(30px, 9vw, 40px); margin: 10px 0 4px; }
.tk-head p { margin: 0; color: var(--muted); font-size: 15px; }
.tk-cut { position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 18px; }
.tk-cut::before, .tk-cut::after { content: ""; position: absolute; top: -15px; width: 28px; height: 28px; border-radius: 50%; background: #6E2531; }
.tk-cut::before { right: -33px; } .tk-cut::after { left: -33px; }
.tk-body { padding: 20px 22px 26px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tk-body p { margin: 0; }
.tk-guest { font-size: 24px; font-weight: 800; color: var(--ink); }
.tk-party { color: var(--muted); }
.tk-qr { width: 220px; max-width: 100%; aspect-ratio: 1; margin: 10px auto 4px; background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--line); }
.tk-qr svg { width: 100%; height: 100%; display: block; }
.tk-code { font-size: 34px; font-weight: 800; letter-spacing: 6px; color: var(--primary); font-variant-numeric: tabular-nums; text-align: center !important; }
.tk-hint { font-weight: 700; color: var(--gold); }
.tk-warn { font-size: 22px; font-weight: 800; color: var(--no); margin: 6px 0 !important; }
.tk-foot { color: #F6E9D8; font-size: 14px; text-align: center; margin: 0; }
.tk-foot a { color: #fff; }
@media print { .tk-wrap { background: #fff; } .tk-foot { display: none; } .ticket { box-shadow: none; border: 1px solid #ccc; } }

/* door */
.door-app { width: min(560px, 100% - 24px); margin-inline: auto; padding: 16px 0 40px; display: flex; flex-direction: column; gap: 12px; }
.door-head { text-align: center; }
.door-head small { color: var(--gold); font-weight: 700; }
.door-head h1 { font-size: clamp(26px, 7vw, 36px); margin: 2px 0; }
.door-head p { margin: 0; color: var(--muted); font-size: 14px; }
.door-count { grid-template-columns: 1fr 1fr; }
.door-result { border-radius: var(--r); padding: 20px 18px; color: #fff; text-align: center; display: flex; flex-direction: column; gap: 6px; animation: pop .25s ease; }
.door-result b { font-size: clamp(24px, 7vw, 32px); line-height: 1.3; }
.door-result span { font-size: 18px; opacity: .95; }
.door-result .row { justify-content: center; margin-top: 8px; }
.door-result .btn { background: rgba(255, 255, 255, .2); color: #fff; border-color: rgba(255, 255, 255, .6); min-width: 120px; }
.r-ok { background: var(--ok); } .r-wait { background: #C98A16; } .r-no { background: var(--no); } .r-info { background: var(--ink); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.cam { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 1; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-frame { position: absolute; inset: 18%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.door-code { display: flex; gap: 8px; }
.code-input { font-size: 26px !important; font-weight: 800; letter-spacing: 5px; text-align: center !important; text-transform: uppercase; min-width: 0; flex: 1; }
.door-hit { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 56px; padding: 10px 14px; font: inherit; font-size: 17px; text-align: start; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--ink); }
.door-hit:active { background: var(--gold-soft); }

/* family */
.fam header h1 { font-size: clamp(26px, 7vw, 38px); }
.fam header .badge { align-self: center; }

/* admin */
.admin-search { max-width: 340px; }
.input-sm { padding: 6px 10px; font-size: 14px; width: auto; min-height: 40px; }
.pay-card { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px; }
.pay-card > .stack { flex: 1 1 220px; gap: 8px; }
.receipt { flex: 0 0 110px; height: 140px; border-radius: 12px; overflow: hidden; background: var(--gold-soft); display: grid; place-items: center; text-align: center; font-size: 13px; text-decoration: none; }
.receipt img { width: 100%; height: 100%; object-fit: cover; }
