@font-face {
    font-family: "Cairo";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/cairo-arabic-400.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
    font-family: "Cairo";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/cairo-arabic-600.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
    font-family: "Cairo";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/cairo-arabic-700.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
    font-family: "Cairo";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/cairo-latin-400.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Cairo";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/cairo-latin-600.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Cairo";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/cairo-latin-700.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --ink: #12343a;
    --muted: #4d6b72;
    --line: rgba(18, 52, 58, .12);
    --paper: rgba(255, 255, 255, .82);
    --pine: #0f766e;
    --aqua: #14b8a6;
    --mint: #99f6e4;
    --gold: #f59e0b;
    --shadow: 0 18px 50px rgba(15, 80, 90, .12);
    --radius: 22px;
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(900px 480px at 100% -10%, rgba(153, 246, 228, .9), transparent 60%),
        radial-gradient(700px 420px at -10% 110%, rgba(251, 191, 36, .35), transparent 55%),
        linear-gradient(165deg, #f3fbfb 0%, #e7f7f4 48%, #fff8ee 100%);
    background-attachment: fixed;
}
body::before {
    content: "";
    position: fixed;
    inset: auto -80px -120px auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 184, 166, .28), transparent 68%);
    animation: float 9s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }

.shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px 16px;
    color: #f8fffd;
    background:
        linear-gradient(180deg, rgba(255,255,255,.08), transparent 30%),
        linear-gradient(165deg, #0f766e 0%, #115e59 48%, #134e4a 100%);
    box-shadow: inset -1px 0 0 rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.brand > span:not(.brand-mark) { display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 0; }
.brand strong { display: block; font-size: 18px; }
.brand span span { display: block; color: rgba(255,255,255,.72); font-size: 13px; }
.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #5eead4, #fbbf24);
    color: #134e4a;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(0,0,0,.15);
}
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav a {
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 14px;
    color: rgba(255,255,255,.86);
    transition: transform .2s ease, background .2s ease;
}
.side-nav a:hover { background: rgba(255,255,255,.1); transform: translateX(-3px); }
.side-nav a.is-active { background: rgba(255,255,255,.18); color: white; }
.nav-label {
    margin: 14px 12px 4px;
    color: rgba(255,255,255,.62);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.sidebar-foot { margin-top: auto; }
.sidebar-foot form { margin: 0; }
.mobile-bar, .nav-backdrop { display: none; }

.main { min-width: 0; max-width: 100%; padding: 28px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 22px; }
.top h1, .guest-card h1, .auth-card h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.25; }
.logout-btn {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 14px;
    background: transparent;
    color: white;
    cursor: pointer;
}
.btn-small { min-height: 36px; padding: 6px 10px; font-size: 14px; box-shadow: none; }
.stat b { display: block; font-size: 28px; margin-bottom: 4px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid white; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.scan-box { min-height: 240px; overflow: hidden; border-radius: 16px; background: #082f2c; }
.result { padding: 12px; border-radius: 14px; background: #ecfdf5; }
.actions input, .actions select { flex: 1 1 180px; min-width: 0; width: auto; }
.auth-body { display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(460px, 100%); }
.lede, .meta, .hint { color: var(--muted); }
.eyebrow { margin: 0 0 4px; color: #0f766e; font-weight: 700; letter-spacing: .02em; }

.grid-2 > *, .stats > *, .share-card, .panel, .table-wrap { min-width: 0; max-width: 100%; }
.panel, .guest-card, .auth-card {
    background: var(--paper);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    padding: 22px;
}
.panel h2, .guest-card h2 { margin: 0 0 8px; font-size: 22px; }
.stack { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 18px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 18px 0; }
.stat {
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(255,255,255,.92), rgba(236, 253, 245, .9));
    border: 1px solid rgba(15, 118, 110, .1);
    box-shadow: var(--shadow);
    transition: transform .25s ease;
}
.stat:hover { transform: translateY(-4px); }
.stat strong { display: block; font-size: 28px; margin-top: 4px; }
.share-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .94), rgba(13, 148, 136, .88) 55%, rgba(245, 158, 11, .82));
    color: white;
}
.share-card .eyebrow, .share-card p, .share-card h2 { color: white; }
.share-url {
    margin: 8px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.16);
    overflow-wrap: anywhere;
    font-size: 14px;
}
.share-card .btn { background: white; color: #115e59; }
.share-card .btn-ghost { background: transparent; color: white; border-color: rgba(255,255,255,.55); }

.btn, button.btn, a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 14px;
    text-decoration: none;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    box-shadow: 0 10px 20px rgba(15, 118, 110, .22);
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 24px rgba(15, 118, 110, .28); }
.btn-ghost, .btn-danger {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}
.btn-danger { color: #b42318; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.form-grid, .form-row { display: grid; gap: 14px; }
.form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: block; margin-bottom: 6px; font-weight: 600; }
input, select, textarea {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(15, 118, 110, .18);
    background: rgba(255,255,255,.9);
    color: var(--ink);
    transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, .18);
}
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; min-height: 0; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type="color"] { width: 52px; padding: 4px; }
.file-link { color: #0f766e; font-weight: 700; }

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 12px 10px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); font-size: 13px; font-weight: 700; }

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 13px;
    font-weight: 700;
}
.badge-pending { background: #fff7ed; color: #c2410c; }
.badge-declined, .badge-closed { background: #fef2f2; color: #b42318; }
.badge-draft { background: #f1f5f9; color: #475569; }

.alert { padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; }
.alert-success { background: #ecfdf5; color: #047857; }
.alert-error { background: #fef2f2; color: #b42318; }
.errors { margin: 0 0 12px; padding: 12px 18px 12px 12px; border-radius: 14px; background: #fef2f2; color: #b42318; }

.pager { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.pager a, .pager span { min-width: 36px; min-height: 36px; display: grid; place-items: center; border-radius: 10px; text-decoration: none; background: white; }

.guest-body {
    background:
        radial-gradient(800px 420px at 100% 0%, color-mix(in srgb, var(--secondary) 72%, white), transparent 62%),
        radial-gradient(700px 480px at 0% 100%, color-mix(in srgb, var(--primary) 55%, white), transparent 58%),
        linear-gradient(165deg, color-mix(in srgb, var(--primary) 82%, #042f2e), color-mix(in srgb, var(--secondary) 55%, #0f766e));
}
.guest-wrap { position: relative; z-index: 1; height: 100dvh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: stretch; gap: 0; padding: 8px; overflow: hidden; }
.guest-card { width: min(680px, 100%); }
.guest-logo { width: 52px; height: 52px; object-fit: contain; border-radius: 14px; background: white; }
.qr { width: min(240px, 100%); border-radius: 18px; background: white; padding: 8px; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; z-index: 1; }
.auth-card { width: min(440px, 100%); }
.rise { animation: rise .55s ease both; }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.event-card { display: block; text-decoration: none; min-height: 160px; }
.event-card h2 { margin-top: 10px; }
.locale-switch { display: flex; gap: 6px; }
.locale-switch button {
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.35);
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.locale-switch button.is-active { background: rgba(255,255,255,.18); }
.auth-card .locale-switch, .guest-wrap .locale-switch { justify-content: center; margin-bottom: 14px; }
.auth-card .locale-switch button { border-color: rgba(15, 118, 110, .28); color: #0f766e; }
.guest-wrap .locale-switch button { border-color: rgba(255,255,255,.55); color: white; }
.pass-card { width: min(430px, 100%); max-width: 100%; }
.pass-staff {
    margin: 10px 14px 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f3faf8;
    text-align: start;
    font-size: 14px;
}
.pass-card {
    flex: 1;
    height: auto;
    max-height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    text-align: center;
    font-size: 16px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 24px;
    box-shadow: var(--shadow);
}
.pass-scroll { flex: 1; min-height: 0; min-width: 0; max-width: 100%; overflow-x: hidden; overflow-y: auto; }
.pass-dock { flex: none; min-width: 0; max-width: 100%; background: rgba(255,255,255,.98); }
.pass-head { padding: 12px 16px 4px; }
.pass-head .eyebrow { margin: 0; color: #0f766e; font-size: 13px; }
.pass-head h1 { font-size: clamp(18px, 4.4vw, 22px); font-weight: 700; line-height: 1.3; text-wrap: balance; }
.pass-guest { margin: 2px 0 0; font-size: 15px; font-weight: 700; }
.pass-card .guest-logo { margin: 0 auto 6px; }
.pass-body { min-width: 0; max-width: 100%; overflow-wrap: anywhere; overflow: visible; padding: 6px 16px 12px; }
.pass-head, .pass-staff { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.pass-card .btn { max-width: 100%; white-space: normal; }
.pass-scroll .credit { width: auto; margin: 8px 14px 16px; border: 1px solid var(--line); }
.pass-form, .pass-body section[data-pass-panel="edit"], .pass-body section[data-pass-panel="about"], .pass-body section[data-pass-panel="register"] { text-align: start; }
.pass-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.96);
}
.pass-tabs a, .pass-tabs button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 76px;
    padding: 8px 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.pass-tabs svg { width: 22px; height: 22px; }
.pass-tabs .is-active { color: #0f766e; box-shadow: inset 0 -3px 0 #0f766e; }
.dock-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 8px 4px;
    border-top: 1px solid var(--line);
}
.credit-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #0e4d6b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}
.credit-mini img { height: 24px; width: auto; }
.credit-mini span { text-align: start; }
.lang-open {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-height: 36px;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: #0f766e;
    font-weight: 700;
    cursor: pointer;
    flex: none;
}
.logo-rails { min-width: 0; max-width: 100%; background: #f7fbfa; }
.logo-rail { padding: 6px 0 8px; }
.logo-rail + .logo-rail { border-top: 1px solid var(--line); }
.logo-rail p { margin: 0 12px 4px; color: #0f766e; font-size: 11px; font-weight: 700; }
.marquee { overflow: hidden; }
.marquee-track {
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    padding-inline: 8px;
    direction: ltr;
    animation: logo-marquee 24s linear infinite;
}
.marquee-track img {
    height: 40px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    padding: 4px 8px;
    border-radius: 10px;
    background: white;
}
@keyframes logo-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
.logo-admin { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.logo-admin figure { width: 140px; margin: 0; text-align: center; }
.logo-admin img { width: 100%; height: 64px; object-fit: contain; background: #f7fbfa; border-radius: 12px; }
.lang-open svg { width: 18px; height: 18px; }
.lang-modal {
    position: fixed;
    inset: 0;
    z-index: 85;
    display: grid;
    align-items: end;
    justify-items: center;
}
.lang-modal[hidden] { display: none; }
.lang-backdrop { position: absolute; inset: 0; border: 0; background: rgba(8, 30, 36, .45); cursor: pointer; }
.lang-sheet {
    position: relative;
    width: min(430px, 100%);
    display: grid;
    gap: 10px;
    padding: 18px 16px 20px;
    border-radius: 22px 22px 0 0;
    background: white;
}
.lang-sheet h2 { margin: 0; text-align: center; }
.lang-sheet form { display: grid; gap: 8px; }
.lang-sheet form button {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    font-weight: 700;
    cursor: pointer;
}
.lang-sheet form button.is-active { background: #0f766e; color: white; border-color: #0f766e; }
.qr-open {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
}
.qr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 16px;
    padding: 24px;
    background: #ffffff;
}
.qr-lightbox[hidden] { display: none; }
.qr-lightbox img { width: min(92vw, 78vh); height: auto; }
.qr-close {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    min-height: 44px;
    padding: 8px 14px;
    border: 0;
    border-radius: 12px;
    background: #12343a;
    color: white;
    cursor: pointer;
}
fieldset { border: 0; margin: 0; padding: 0; }
.credit {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    width: min(430px, 100%);
    margin-top: 4px;
    padding: 10px 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    color: #0e4d6b;
    font-size: 13px;
    font-weight: 700;
    text-align: start;
}
.credit img { height: 42px; width: auto; }
.main > .credit { width: 100%; margin-top: 28px; background: white; border: 1px solid var(--line); }
.map-open {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 74px;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid #cfe7e3;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(15,118,110,.1), rgba(255,255,255,.9));
    color: #0f766e;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.map-open small { color: var(--muted); font-weight: 600; }
.map-lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 72px 16px 16px;
    background: #f3faf8;
}
.map-lightbox[hidden] { display: none; }
.map-lightbox iframe {
    flex: 1;
    width: min(960px, 100%);
    min-height: 280px;
    border: 0;
    border-radius: 18px;
    background: white;
}
legend { font-weight: 700; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
    .marquee { overflow-x: auto; }
}

@media (max-width: 1100px) {
    .shell { display: block; }
    .mobile-bar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 40;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px;
        color: white;
        background: linear-gradient(135deg, #0f766e, #115e59);
    }
    .mobile-bar .brand span { color: rgba(255,255,255,.8); }
    .nav-toggle {
        min-height: 44px;
        padding: 8px 14px;
        border: 0;
        border-radius: 12px;
        background: rgba(255,255,255,.16);
        color: white;
        cursor: pointer;
    }
    .sidebar {
        display: none;
        position: fixed;
        z-index: 50;
        top: 72px;
        right: 12px;
        left: 12px;
        height: auto;
        max-height: calc(100vh - 92px);
        overflow: auto;
        border-radius: 22px;
    }
    .shell.nav-open .sidebar { display: flex; }
    .shell.nav-open .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 45;
        border: 0;
        background: rgba(8, 30, 36, .4);
        cursor: pointer;
    }
    .main { padding: 18px 14px 32px; }
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .share-card { flex-direction: column; align-items: stretch; }
}

@media (max-width: 720px) {
    .top, .form-row, .stats, .grid-2 { display: grid; grid-template-columns: 1fr; }
    .top { align-items: stretch; }
    .actions .btn, .share-card .btn { width: 100%; }
    .panel, .guest-card, .auth-card { padding: 16px; border-radius: 18px; }
    .auth-wrap { padding: 16px 12px; }
}
