/* Daawaat — Omani UI Atlas v3 integration layer */
:root {
    --ou-font-ar: "Cairo", sans-serif;
    --ou-font-en: "Cairo", sans-serif;
    --ou-font-sans: "Cairo", sans-serif;
    --bs-body-font-family: "Cairo", sans-serif;
    --brand: var(--ou-primary, #9a642f);
    --brand-dark: #70451f;
    --brand-deep: #4c2f18;
    --brand-soft: rgba(154, 100, 47, .11);
    --secondary: var(--ou-secondary, #087f73);
    --secondary-dark: #075f57;
    --secondary-soft: rgba(8, 127, 115, .10);
    --accent: var(--ou-accent, #b78a45);
    --ink: var(--ou-text, #241f1a);
    --muted: var(--ou-text-muted, #6d665e);
    --surface: var(--ou-surface, #fffdf9);
    --surface-soft: var(--ou-bg-subtle, #f8f3e9);
    --canvas: var(--ou-bg, #fcfaf5);
    --line: var(--ou-border, #e4d9c8);
    --danger: var(--ou-danger, #a13d3d);
    --success: var(--ou-success, #227154);
    --warning: var(--ou-warning, #94641e);
    --shadow-sm: 0 8px 28px rgba(76, 47, 24, .075);
    --shadow-lg: 0 28px 76px rgba(76, 47, 24, .15);
    --radius-sm: var(--ou-radius-md, 12px);
    --radius: var(--ou-radius-lg, 20px);
    --radius-lg: 30px;
}

*, *::before, *::after { box-sizing: border-box; }
html { max-width: 100%; overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--canvas);
    max-width: 100%;
    overflow-x: clip;
    font-family: "Cairo", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
::selection { background: rgba(183, 138, 69, .28); color: var(--brand-deep); }
:focus-visible { outline: 3px solid rgba(8, 127, 115, .28); outline-offset: 3px; }

.atlas-icon {
    width: 1.15em;
    height: 1.15em;
    display: inline-block;
    flex: 0 0 auto;
    color: currentColor;
    fill: currentColor;
    vertical-align: -.16em;
}

.skip-link {
    position: fixed;
    z-index: 9999;
    inset-block-start: 10px;
    inset-inline-start: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--brand-deep);
    color: #fff;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(154, 100, 47, .16);
    background: rgba(252, 250, 245, .91);
    box-shadow: 0 4px 22px rgba(76, 47, 24, .035);
    backdrop-filter: blur(18px);
}
.site-header::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--secondary), transparent);
    opacity: .42;
}
.nav-shell { min-height: 76px; display: flex; align-items: center; gap: 28px; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-deep);
    text-decoration: none;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.brand img { width: 43px; height: 43px; object-fit: contain; filter: drop-shadow(0 5px 8px rgba(76,47,24,.12)); }
.site-nav { display: flex; align-items: center; justify-content: center; gap: 25px; margin-inline: auto; }
.site-nav a { position: relative; color: #574e44; text-decoration: none; font-size: 14px; font-weight: 750; }
.site-nav a::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -10px;
    height: 2px;
    border-radius: 99px;
    background: var(--brand);
    transform: scaleX(0);
    transition: transform .18s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--brand); }
.site-nav a:hover::after, .site-nav a:focus-visible::after { transform: scaleX(1); }
.nav-actions, .portal-actions { display: flex; align-items: center; gap: 8px; }
.language-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.language-switch a { min-width: 42px; padding: 7px 9px; border-radius: 8px; color: var(--muted); text-align: center; text-decoration: none; font-size: 12px; font-weight: 850; }
.language-switch a.active { background: var(--brand-soft); color: var(--brand-dark); }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--brand-deep); cursor: pointer; }
.menu-button .atlas-icon { width: 21px; height: 21px; }

/* Controls */
.button, button.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 850;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--brand); color: #fff; box-shadow: 0 10px 25px rgba(112, 69, 31, .22); }
.button-primary:hover { background: var(--brand-dark); color: #fff; }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--brand-deep); }
.button-secondary:hover { border-color: rgba(154,100,47,.45); background: #fffaf1; }
.button-danger { border-color: rgba(161,61,61,.24); background: #fff5f3; color: var(--danger); }
.button-small { min-height: 38px; padding: 8px 13px; font-size: 13px; }
.button[disabled], button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Landing */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(64px, 9vw, 116px) 0 70px;
    background:
        radial-gradient(circle at 12% 12%, rgba(183,138,69,.16), transparent 27%),
        radial-gradient(circle at 87% 42%, rgba(8,127,115,.11), transparent 29%),
        linear-gradient(180deg, #fffdf8 0%, #f8f1e5 100%);
}
.hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: url("/assets/omani-ui/patterns/door-panels.svg") center / 330px auto repeat;
    opacity: .025;
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset-inline: 0;
    inset-block-end: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand) 0 30%, var(--accent) 30% 62%, var(--secondary) 62%);
    opacity: .76;
}
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 62px; align-items: center; }
.eyebrow { margin: 0 0 16px; color: var(--secondary-dark); font-size: 13px; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 30px; height: 3px; display: inline-block; margin-inline-end: 9px; border-radius: 99px; background: var(--accent); vertical-align: middle; }
.hero h1 { max-width: 730px; margin: 0; color: var(--brand-deep); font-size: clamp(42px, 6vw, 70px); line-height: 1.14; letter-spacing: -.042em; }
.hero-copy { max-width: 650px; margin: 21px 0 0; color: #665d53; font-size: clamp(17px, 1.7vw, 20px); line-height: 1.9; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.hero-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.product-preview { position: relative; min-height: 505px; display: grid; place-items: center; }
.atlas-hero-illustration { position: absolute; z-index: -1; width: 94%; max-height: 520px; inset-inline-end: -8%; inset-block-start: -1%; opacity: .20; object-fit: contain; filter: sepia(.2) saturate(.8); }
.preview-window { width: min(520px, 100%); overflow: hidden; border: 1px solid rgba(154,100,47,.19); border-radius: 26px; background: rgba(255,253,249,.94); box-shadow: var(--shadow-lg); backdrop-filter: blur(12px); }
.preview-bar { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(154,100,47,.06), transparent); }
.preview-brand { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 900; }
.preview-brand > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--brand); color: #fff; }
.preview-brand .atlas-icon { width: 17px; height: 17px; }
.preview-status { padding: 6px 10px; border-radius: 999px; background: #e8f5ef; color: var(--success); font-size: 11px; font-weight: 850; }
.preview-body { padding: 18px; }
.preview-title { margin: 0 0 14px; color: var(--brand-deep); font-size: 19px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.metric { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.metric strong { display: block; color: var(--brand-dark); font-size: 23px; }
.metric span { color: var(--muted); font-size: 11px; font-weight: 700; }
.guest-list { display: grid; gap: 8px; margin-top: 14px; }
.guest-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.55); }
.guest-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--secondary-soft); color: var(--secondary-dark); font-weight: 900; }
.guest-row strong { display: block; font-size: 12px; }
.guest-row small { color: var(--muted); font-size: 10px; }
.status-dot, .status-badge { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; font-weight: 850; }
.status-dot { padding: 5px 8px; font-size: 9px; }
.status-confirmed { background: #e8f5ef; color: var(--success); }
.status-pending { background: #fff1d8; color: var(--warning); }
.status-declined { background: #fbe9e7; color: var(--danger); }
.floating-ticket { position: absolute; inset-inline-end: -16px; bottom: 18px; width: 192px; padding: 16px; border: 1px solid rgba(154,100,47,.18); border-radius: 18px; background: rgba(255,253,249,.97); box-shadow: var(--shadow-sm); }
.floating-ticket::before { content: ""; position: absolute; inset-inline: 17px; inset-block-start: -1px; height: 3px; border-radius: 0 0 99px 99px; background: linear-gradient(90deg, var(--accent), var(--secondary)); }
.qr-mark { width: 74px; height: 74px; margin: 0 auto 10px; border: 8px solid #fff; background: repeating-conic-gradient(var(--brand-deep) 0 25%, #fff 0 50%) 50% / 14px 14px; box-shadow: 0 0 0 1px var(--line); }
.floating-ticket p { margin: 0; text-align: center; font-size: 12px; font-weight: 850; }

.trust-strip { border-block: 1px solid var(--line); background: var(--surface); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-item { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 20px 14px; color: #51483f; text-align: center; font-size: 13px; font-weight: 850; }
.trust-item .atlas-icon { width: 20px; height: 20px; color: var(--secondary); }
.trust-item + .trust-item { border-inline-start: 1px solid var(--line); }

.section { position: relative; padding: clamp(64px, 8vw, 100px) 0; }
.section-soft { background: var(--surface-soft); }
.section-soft::before { content: ""; position: absolute; inset: 0; background: url("/assets/omani-ui/patterns/diamond-grid.svg") center / 430px repeat; opacity: .018; pointer-events: none; }
.section-soft > * { position: relative; }
.section-heading { max-width: 650px; margin-bottom: 34px; }
.section-heading.center { margin-inline: auto; text-align: center; }
.section-heading h2 { margin: 0; color: var(--brand-deep); font-size: clamp(32px, 4.2vw, 49px); line-height: 1.28; letter-spacing: -.032em; }
.section-heading p { margin: 12px 0 0; color: var(--muted); font-size: 16px; line-height: 1.85; }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step-card, .feature-card, .plan-card, .surface-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.step-card, .feature-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.step-card:hover, .feature-card:hover { transform: translateY(-3px); border-color: rgba(154,100,47,.38); box-shadow: 0 15px 34px rgba(76,47,24,.10); }
.step-card { padding: 24px; }
.step-number { width: 46px; height: 46px; position: relative; display: grid; place-items: center; border-radius: 14px; background: var(--brand); color: #fff; }
.step-number .atlas-icon { width: 22px; height: 22px; }
.step-number span { position: absolute; inset-inline-end: -6px; inset-block-end: -6px; min-width: 20px; height: 20px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 999px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 900; }
.step-card h3, .feature-card h3 { margin: 18px 0 8px; color: var(--brand-deep); font-size: 18px; }
.step-card p, .feature-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.78; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-card { padding: 22px; }
.feature-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--secondary-soft); color: var(--secondary-dark); }
.feature-icon .atlas-icon { width: 22px; height: 22px; }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan-card { position: relative; padding: 26px; display: flex; flex-direction: column; }
.plan-card.featured { border-color: rgba(154,100,47,.56); box-shadow: 0 23px 55px rgba(112,69,31,.15); }
.plan-card.featured::before { content: ""; position: absolute; inset-inline: 25px; inset-block-start: -1px; height: 4px; border-radius: 0 0 99px 99px; background: linear-gradient(90deg, var(--accent), var(--brand), var(--secondary)); }
.plan-badge { position: absolute; inset-inline-end: 18px; top: 18px; padding: 5px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 10px; font-weight: 900; }
.plan-card h3 { margin: 0; color: var(--brand-deep); font-size: 22px; }
.plan-price { margin-top: 18px; color: var(--brand-dark); font-size: 34px; font-weight: 950; }
.plan-price small { color: var(--muted); font-size: 12px; font-weight: 700; }
.plan-list { margin: 20px 0 26px; padding: 0; display: grid; gap: 10px; list-style: none; color: #5c534a; font-size: 14px; }
.plan-list li::before { content: "✓"; margin-inline-end: 8px; color: var(--secondary); font-weight: 900; }
.plan-card .button { margin-top: auto; }
.cta-panel { position: relative; overflow: hidden; padding: clamp(34px, 5vw, 58px); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-radius: var(--radius-lg); background: var(--brand-deep); color: #fff; box-shadow: var(--shadow-lg); }
.cta-panel::after { content: ""; position: absolute; inset: 0; background: url("/assets/omani-ui/patterns/door-panels.svg") center / 290px repeat; opacity: .055; pointer-events: none; }
.cta-panel > * { position: relative; z-index: 1; }
.cta-panel h2 { margin: 0; font-size: clamp(29px, 4vw, 45px); }
.cta-panel p { margin: 10px 0 0; color: rgba(255,255,255,.72); }
.cta-panel .button-secondary { border-color: rgba(255,255,255,.25); background: #fff; }
.site-footer { padding: 34px 0; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-copy { color: var(--muted); font-size: 12px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: #5a5047; text-decoration: none; font-size: 12px; font-weight: 800; }
.footer-links a:hover { color: var(--brand); }

/* Auth and forms */
.auth-page { position: relative; padding: 54px 0 80px; }
.auth-page::before { content: ""; position: fixed; z-index: -1; inset: 0; background: url("/assets/omani-ui/patterns/diamond-grid.svg") center / 500px repeat; opacity: .016; }
.auth-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 22px; align-items: stretch; }
.auth-aside { position: relative; isolation: isolate; overflow: hidden; padding: clamp(30px, 5vw, 58px); border-radius: var(--radius-lg); background: linear-gradient(145deg, var(--brand-deep), var(--brand-dark)); color: #fff; box-shadow: var(--shadow-lg); }
.auth-aside::after { content: ""; position: absolute; z-index: -1; inset: 0; background: url("/assets/omani-ui/illustrations/hospitality.svg") bottom center / 92% auto no-repeat; opacity: .10; }
.auth-aside h1 { margin: 0; font-size: clamp(32px, 4vw, 47px); line-height: 1.28; }
.auth-aside p { margin: 16px 0 0; color: rgba(255,255,255,.74); line-height: 1.85; }
.auth-points { margin: 28px 0 0; padding: 0; display: grid; gap: 12px; list-style: none; }
.auth-points li { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 750; }
.auth-points li::before { content: "✓"; width: 27px; height: 27px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; background: rgba(255,255,255,.13); color: #f0cc8a; }
.auth-card { padding: clamp(26px, 4vw, 46px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.auth-card h2 { margin: 0 0 8px; color: var(--brand-deep); font-size: 28px; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.field { min-width: 0; display: grid; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label { color: #50483f; font-size: 13px; font-weight: 800; }
.field input, .field select, .field textarea, .inline-form input, .inline-form select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #ddd2c2;
    border-radius: 11px;
    background: #fffefa;
    color: var(--ink);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field textarea { min-height: 98px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #c6b59e; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-form input:focus, .inline-form select:focus { border-color: var(--secondary); background: #fff; box-shadow: 0 0 0 3px rgba(8,127,115,.11); }
.field input[type="file"] { padding: 7px; background: var(--surface-soft); }
.field input[type="file"]::file-selector-button { margin-inline-end: 9px; padding: 7px 10px; border: 0; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; cursor: pointer; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.65; }
.check-field { display: flex; gap: 9px; align-items: flex-start; color: #5f564d; font-size: 12px; line-height: 1.7; }
.check-field input { margin-top: 4px; accent-color: var(--brand); }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.form-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; font-size: 13px; }
.form-links a { color: var(--secondary-dark); font-weight: 800; text-decoration: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.login-access-note { display: flex; align-items: center; gap: 9px; margin: -10px 0 20px; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 800; }
.login-access-note .atlas-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.alert { margin-bottom: 16px; padding: 12px 14px; border-radius: 11px; font-size: 13px; font-weight: 750; }
.alert-error { border: 1px solid rgba(161,61,61,.23); background: #fff3f1; color: var(--danger); }
.alert-success { border: 1px solid rgba(34,113,84,.24); background: #edf8f2; color: var(--success); }
.legal-page { padding: 54px 0 90px; }
.legal-card { max-width: 860px; margin-inline: auto; padding: clamp(26px, 5vw, 54px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.legal-card h1 { margin: 0 0 28px; color: var(--brand-deep); font-size: clamp(34px, 5vw, 52px); }
.legal-card h2 { margin: 30px 0 10px; color: var(--brand-dark); font-size: 21px; }
.legal-card p, .legal-card li { color: #5f564d; font-size: 14px; line-height: 1.92; }
.legal-card ul { padding-inline-start: 22px; }

/* Client portal */
.portal-body { background: var(--surface-soft); }
.portal-body::before { content: ""; position: fixed; z-index: -1; inset: 0; background: url("/assets/omani-ui/patterns/diamond-grid.svg") center / 480px repeat; opacity: .018; }
.portal-shell { width: calc(100% - 28px); max-width: 1240px; margin: 0 auto; padding: 18px 0 50px; }
.portal-header { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.portal-header::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: linear-gradient(var(--brand), var(--accent), var(--secondary)); }
.portal-actions { flex-wrap: wrap; }
.portal-tabs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.portal-tabs a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: #665c52; text-decoration: none; font-size: 13px; font-weight: 850; }
.portal-tabs a .atlas-icon { width: 17px; height: 17px; color: var(--brand); }
.portal-tabs a:hover { border-color: rgba(154,100,47,.4); background: #fffbf4; }
.portal-tabs a.active { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(112,69,31,.18); }
.portal-tabs a.active .atlas-icon { color: #fff; }
.portal-content { min-width: 0; max-width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.portal-content > *, .split-grid > *, .surface-card { min-width: 0; max-width: 100%; }
.surface-card { padding: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h1, .card-head h2, .card-head h3 { margin: 0; color: var(--brand-deep); }
.card-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; }
.stat-card { position: relative; overflow: hidden; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.stat-card::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--accent)); opacity: .58; }
.stat-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.stat-icon .atlas-icon { width: 18px; height: 18px; }
.stat-card span:not(.stat-icon) { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; font-size: 11px; font-weight: 750; }
.stat-card strong { display: block; margin-top: 5px; color: var(--brand-dark); font-size: 28px; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; font-size: 12px; }
th { color: var(--muted); background: rgba(248,243,233,.58); font-weight: 850; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(248,243,233,.55); }
tbody tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.status-badge { padding: 5px 9px; background: #f0ece5; color: #635b52; font-size: 10px; font-weight: 900; }
.status-badge.confirmed, .status-badge.checked_in, .status-badge.sent, .status-badge.delivered, .status-badge.success { background: #e7f4ed; color: var(--success); }
.status-badge.declined, .status-badge.cancelled, .status-badge.failed, .status-badge.expired, .status-badge.blocked, .status-badge.companions_exceeded { background: #fae9e7; color: var(--danger); }
.status-badge.pending, .status-badge.opened, .status-badge.draft, .status-badge.already_used { background: #fff0d4; color: var(--warning); }
.pagination-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
.inline-form { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-height: 38px; padding: 7px 9px; }
.empty-state { padding: 36px 18px; color: var(--muted); text-align: center; }
.record-card { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .16s ease, box-shadow .16s ease; }
.record-card[open] { border-color: rgba(154,100,47,.40); box-shadow: var(--shadow-sm); }
.record-card > summary { position: relative; padding: 14px 44px 14px 14px; cursor: pointer; color: #51483f; overflow-wrap: anywhere; font-weight: 800; list-style: none; }
[dir="rtl"] .record-card > summary { padding: 14px 14px 14px 44px; }
.record-card > summary::-webkit-details-marker { display: none; }
.record-card > summary::after { content: "+"; position: absolute; inset-inline-end: 14px; top: 50%; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand); transform: translateY(-50%); font-size: 17px; }
.record-card[open] > summary::after { content: "−"; }
.record-card-body { padding: 16px; border-top: 1px solid var(--line); background: #fffefa; }
.record-form { margin-top: 14px; }
.section-divider { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
.page-title { margin: 0; color: var(--brand-deep); font-size: clamp(36px,5vw,56px); }
.current-plan-card { margin-bottom: 18px; }
.stat-date { font-size: 18px !important; }
.center-note { margin-top: 18px; text-align: center; }
.center-actions { justify-content: center; }
.result-card { max-width: 680px; margin: auto; padding: clamp(34px,6vw,64px); text-align: center; }
.result-card .hero-copy { margin-inline: auto; }
.result-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 20px; }
.result-icon .atlas-icon { width: 29px; height: 29px; }
.result-success { background: #e7f4ed; color: var(--success); }
.result-pending { background: #fff0d4; color: var(--warning); }
.result-error { background: #fae9e7; color: var(--danger); }
.result-reference { margin-top: 14px; }

/* Portal workflow, contacts and gate check-in */
.workflow-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.workflow-grid a { position: relative; min-height: 104px; display: grid; align-content: center; justify-items: center; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); color: var(--brand-deep); text-align: center; text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.workflow-grid a:hover { transform: translateY(-2px); border-color: rgba(154,100,47,.45); box-shadow: var(--shadow-sm); }
.workflow-grid a > span { position: absolute; inset-block-start: 9px; inset-inline-start: 10px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 900; }
.workflow-grid .atlas-icon { width: 25px; height: 25px; color: var(--brand); }
.workflow-grid strong { font-size: 13px; }
.contact-import-card { border-color: rgba(154,100,47,.3); }
.contact-picker-actions, .scanner-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.contact-picker-actions .button, .scanner-actions .button { gap: 8px; }
.contact-picker-actions .atlas-icon, .scanner-actions .atlas-icon { width: 18px; height: 18px; }
.contact-picker-status { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: #f1eee8; color: var(--muted); font-size: 12px; font-weight: 750; }
.contact-picker-status[data-tone="success"] { background: #edf8f2; color: var(--success); }
.contact-picker-status[data-tone="warning"] { background: #fff5df; color: var(--warning); }
.contact-picker-status[data-tone="error"] { background: #fff3f1; color: var(--danger); }
.contact-review-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--brand-deep); }
.contact-review-head span { color: var(--muted); font-size: 12px; }
.contact-review-list { display: grid; gap: 9px; margin-top: 10px; }
.contact-review-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: end; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fffefa; }
.contact-review-row .field > span { color: #50483f; font-size: 12px; font-weight: 800; }
.contact-review-row input { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #ddd2c2; border-radius: 10px; background: #fff; font: inherit; }
.contact-remove { min-height: 43px; }
.contact-empty { padding-block: 22px; }
.scanner-actions { margin-bottom: 15px; }
.scanner-reader { width: min(100%, 560px); margin: 0 auto 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #16120f; }
.scanner-reader video, .scanner-reader img { max-width: 100% !important; border-radius: 14px; }
.scanner-reader > div { border: 0 !important; }
.scanner-feedback { display: grid; gap: 3px; margin-bottom: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.scanner-feedback strong { font-size: 17px; }
.scanner-feedback span { color: inherit; font-size: 13px; }
.scanner-feedback[data-tone="success"] { border-color: rgba(34,113,84,.26); background: #edf8f2; color: var(--success); }
.scanner-feedback[data-tone="warning"] { border-color: rgba(169,101,17,.25); background: #fff5df; color: var(--warning); }
.scanner-feedback[data-tone="error"] { border-color: rgba(161,61,61,.24); background: #fff3f1; color: var(--danger); }
.scanner-feedback[data-tone="neutral"] { color: var(--brand-dark); }
.gate-scan-form { padding-top: 4px; }
.scan-history { display: grid; gap: 8px; }
.scan-history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fffefa; }
.scan-history-row > div { min-width: 0; display: grid; gap: 2px; }
.scan-history-row strong, .scan-history-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-history-row > div span, .scan-history-row time { color: var(--muted); font-size: 11px; }
.gate-links-card { border-color: rgba(154,100,47,.30); }
.gate-link-form { padding-top: 2px; }
.gate-link-ready { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-bottom: 18px; padding: 15px; border: 1px solid rgba(34,113,84,.25); border-radius: 14px; background: #edf8f2; }
.gate-link-ready > div:first-child { grid-column: 1 / -1; display: grid; gap: 2px; color: var(--success); }
.gate-link-ready > div:first-child span { font-size: 12px; }
.gate-link-ready input { min-width: 0; width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid rgba(34,113,84,.22); border-radius: 10px; direction: ltr; background: #fff; color: #3d463f; font: inherit; font-size: 12px; }
.gate-link-actions { display: flex; align-items: center; gap: 7px; }
.gate-link-status { grid-column: 1 / -1; color: var(--success); font-size: 12px; font-weight: 800; }
.gate-link-list { display: grid; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.gate-link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, auto) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fffefa; }
.gate-link-row > div:first-child { min-width: 0; display: grid; gap: 2px; }
.gate-link-row > div:first-child strong, .gate-link-row > div:first-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate-link-row > div:first-child span, .gate-link-meta > span:not(.status-badge) { color: var(--muted); font-size: 11px; }
.gate-link-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.gate-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 15px; }
.gate-context > div { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.gate-context span, .gate-context strong { display: block; }
.gate-context span { color: var(--muted); font-size: 10px; }
.gate-context strong { margin-top: 3px; color: var(--brand-deep); font-size: 14px; }
.gate-access-body { min-height: 100vh; }
.gate-access-shell { width: min(760px, calc(100% - 24px)); margin: 0 auto; padding: 14px 0 32px; }
.gate-access-header { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.gate-access-header::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: linear-gradient(var(--brand), var(--accent), var(--secondary)); }
.gate-access-header .brand { font-size: 18px; }
.gate-access-content { display: grid; gap: 12px; margin-top: 12px; }
.gate-access-content .gate-scan-card .card-head h1 { font-size: clamp(27px, 7vw, 38px); }
.gate-access-footer { padding: 17px 0 0; color: var(--muted); text-align: center; font-size: 11px; }

/* Public invitation */
.invitation-page { min-height: 100vh; padding: 28px 0 60px; background: radial-gradient(circle at 50% 0, rgba(183,138,69,.14), transparent 30%), var(--surface-soft); }
.invitation-shell { width: min(560px, calc(100% - 24px)); margin: 0 auto; }
.invitation-card { overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-lg); }
.invitation-cover { position: relative; isolation: isolate; overflow: hidden; padding: 42px 28px; background: linear-gradient(145deg, var(--brand-deep), var(--brand-dark)); color: #fff; text-align: center; }
.invitation-cover::before { content: ""; position: absolute; z-index: -1; inset: 0; background: url("/assets/omani-ui/patterns/door-panels.svg") center / 260px repeat; opacity: .065; }
.invitation-cover::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--secondary)); }
.invitation-cover h1 { margin: 0; font-size: clamp(30px, 7vw, 44px); }
.invitation-cover p { margin: 10px 0 0; color: rgba(255,255,255,.76); }
.invitation-body { padding: 24px; }
.invite-guest { text-align: center; }
.invite-guest span { color: var(--muted); font-size: 12px; }
.invite-guest h2 { margin: 4px 0 0; color: var(--brand-deep); font-size: 26px; }
.invite-details { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 20px; }
.invite-detail { position: relative; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.invite-detail .atlas-icon { float: inline-end; width: 19px; height: 19px; color: var(--secondary); }
.invite-detail span { display: block; color: var(--muted); font-size: 10px; }
.invite-detail strong { display: block; margin-top: 4px; font-size: 13px; }
.invite-qr { display: grid; place-items: center; margin: 24px auto 6px; }
.invite-qr svg { width: 170px; height: 170px; padding: 9px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(76,47,24,.08); }
.invite-code { margin: 8px 0 0; color: var(--muted); text-align: center; font-size: 11px; letter-spacing: .04em; }
.rsvp-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.rsvp-fields { margin-top: 12px; }
.rsvp-options { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.rsvp-option { position: relative; }
.rsvp-option input { position: absolute; opacity: 0; }
.rsvp-option label { min-height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 850; }
.rsvp-option input:focus-visible + label { outline: 3px solid rgba(8,127,115,.22); }
.rsvp-option input:checked + label { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.invite-actions { display: flex; gap: 8px; margin-top: 12px; }
.invite-actions .button { flex: 1; }

@media (max-width: 1050px) {
    .site-nav { gap: 16px; }
    .nav-actions .button-primary { display: none; }
    .hero-grid { grid-template-columns: 1fr; }
    .product-preview { min-height: 460px; }
    .steps-grid { grid-template-columns: repeat(2,1fr); }
    .stat-grid { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 780px) {
    .container { width: calc(100% - 22px); max-width: 1180px; }
    .nav-shell { min-height: 68px; gap: 10px; }
    .menu-button { display: inline-grid; place-items: center; margin-inline-start: auto; }
    .site-nav { position: absolute; top: calc(100% + 1px); inset-inline: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 10px 12px 16px; border-bottom: 1px solid var(--line); background: #fffdf8; box-shadow: var(--shadow-sm); }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 12px; border-radius: 9px; }
    .site-nav a::after { display: none; }
    .site-nav a:hover { background: var(--surface-soft); }
    .nav-actions { gap: 5px; }
    .nav-actions .nav-login-button { display: inline-flex; }
    .language-switch a { min-width: 38px; padding-inline: 6px; }
    .hero { padding-top: 58px; }
    .hero h1 { font-size: clamp(38px, 11vw, 56px); }
    .atlas-hero-illustration { inset-inline-end: 0; width: 100%; }
    .floating-ticket { inset-inline-end: 2px; }
    .trust-grid { grid-template-columns: repeat(2,1fr); }
    .trust-item:nth-child(3) { border-inline-start: 0; border-top: 1px solid var(--line); }
    .trust-item:nth-child(4) { border-top: 1px solid var(--line); }
    .features-grid, .plans-grid, .auth-grid, .split-grid { grid-template-columns: minmax(0, 1fr); }
    .cta-panel, .footer-grid, .portal-header { align-items: flex-start; flex-direction: column; }
    .portal-header { width: 100%; padding: 13px; }
    .portal-actions { width: 100%; flex-wrap: wrap; }
    .portal-actions > * { min-width: 0; }
    .portal-actions .language-switch { margin-inline-start: 0; }
    .portal-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
    .portal-tabs a { min-width: 0; justify-content: center; padding: 10px 8px; text-align: center; white-space: nowrap; }
    .portal-tabs .portal-scan-tab:last-child { grid-column: 1 / -1; }
    .surface-card { padding: 16px; }
    .card-head { align-items: flex-start; flex-direction: column; }
    .card-head h1 { font-size: clamp(26px, 8vw, 34px); }
    .card-head h2 { font-size: clamp(21px, 6vw, 27px); }
    table { min-width: 620px; }
    .workflow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .contact-review-row { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .contact-remove { width: 100%; }
    .gate-link-row { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .gate-link-meta { justify-content: flex-start; }
    .gate-link-row form, .gate-link-row form .button { width: 100%; }
}

@media (max-width: 560px) {
    .brand { font-size: 19px; }
    .brand img { width: 38px; height: 38px; }
    .hero-grid { gap: 32px; }
    .product-preview { min-height: 420px; }
    .floating-ticket { width: 158px; padding: 12px; }
    .metric strong { font-size: 19px; }
    .steps-grid, .features-grid, .plans-grid, .form-grid, .invite-details { grid-template-columns: minmax(0, 1fr); }
    .field-full { grid-column: auto; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stat-grid { gap: 8px; }
    .stat-card { min-height: 132px; padding: 13px; }
    .stat-card strong { font-size: 25px; }
    .stat-icon { width: 32px; height: 32px; margin-bottom: 8px; }
    .form-links, .invite-actions { flex-direction: column; }
    .rsvp-options { grid-template-columns: 1fr; }
    .invitation-body { padding: 18px; }
    .portal-shell { width: calc(100% - 18px); max-width: 1240px; padding-top: 9px; }
    .portal-header .brand { font-size: 18px; }
    .portal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .portal-actions .language-switch { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-actions .language-switch a { min-width: 0; }
    .portal-actions > a, .portal-actions > form, .portal-actions > form .button { width: 100%; }
    .portal-actions .portal-admin-button, .portal-actions .portal-logout { grid-column: 1 / -1; }
    .portal-tabs { gap: 7px; margin-top: 9px; }
    .portal-tabs a { font-size: 12px; }
    .portal-content { gap: 10px; margin-top: 10px; }
    .surface-card { padding: 14px; border-radius: 16px; }
    .table-wrap { border: 1px solid var(--line); border-radius: 11px; }
    table { min-width: 560px; }
    .contact-picker-actions, .scanner-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
    .contact-picker-actions .button, .scanner-actions .button { width: 100%; justify-content: center; }
    .scan-history-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
    .scan-history-row time { grid-column: 1 / -1; }
    .gate-link-ready { grid-template-columns: minmax(0, 1fr); }
    .gate-link-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gate-link-actions .button { width: 100%; }
    .gate-context { grid-template-columns: minmax(0, 1fr); }
    .gate-access-shell { width: calc(100% - 16px); padding-top: 8px; }
    .gate-access-header { padding: 11px; }
}

@media (max-width: 380px) {
    .site-header .brand span { display: none; }
    .nav-shell { gap: 7px; }
    .language-switch a { min-width: 35px; }
    .nav-actions .nav-login-button { padding-inline: 10px; }
    .stat-grid { grid-template-columns: minmax(0, 1fr); }
    .stat-card { min-height: 116px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
