:root {
  --navy: #0b2d6b;
  --navy-dark: #081f4d;
  --orange: #f58220;
  --green: #2e9e3e;
  --sky: #eaf3fd;
  --bs-primary: #0b2d6b;
  --bs-primary-rgb: 11, 45, 107;
  --bs-link-color: #0b4aa8;
  --bs-link-color-rgb: 11, 74, 168;
  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

body { background: var(--sky); color: #1c2536; }

.btn-primary { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: var(--navy-dark); --bs-btn-hover-border-color: var(--navy-dark); --bs-btn-active-bg: var(--navy-dark); --bs-btn-active-border-color: var(--navy-dark); --bs-btn-disabled-bg: var(--navy); --bs-btn-disabled-border-color: var(--navy); }
.btn-outline-primary { --bs-btn-color: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy); --bs-btn-active-bg: var(--navy); --bs-btn-active-border-color: var(--navy); }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--orange); --bs-btn-border-color: var(--orange); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #dd6f12; --bs-btn-hover-border-color: #dd6f12; --bs-btn-active-color: #fff; --bs-btn-active-bg: #c9640f; }
.text-navy { color: var(--navy) !important; }
.bg-navy { background: var(--navy) !important; }
.form-control:focus, .form-select:focus { border-color: #6f9be0; box-shadow: 0 0 0 .2rem rgba(11, 74, 168, .18); }
.card { border: 0; border-radius: 14px; box-shadow: 0 2px 10px rgba(11, 45, 107, .08); }
.tricolour { height: 5px; background: linear-gradient(90deg, var(--orange) 0 33.3%, #fff 33.3% 66.6%, var(--green) 66.6%); }

/* ---------- Public pages ---------- */
.public-body { min-height: 100vh; background: linear-gradient(180deg, #dcebfb 0%, #f4f9ff 40%, #fff 100%); }
.public-header { background: #fff; border-bottom: 1px solid #dbe6f5; }
.public-header img.emblems { height: 68px; }
.public-header .event-name { font-weight: 700; color: var(--navy); line-height: 1.15; }
.hero-logo { width: 180px; max-width: 60%; border-radius: 50%; }
.date-pill { display: inline-flex; align-items: center; gap: .5rem; background: var(--navy); color: #fff; font-weight: 700; padding: .45rem 1.1rem; border-radius: 999px; letter-spacing: .3px; }
.form-card { border-top: 5px solid var(--orange); }
.pass-frame { max-width: 400px; margin-inline: auto; }
.pass-frame img { width: 100%; height: auto; border-radius: 16px; box-shadow: 0 10px 30px rgba(11, 45, 107, .22); display: block; }
.status-banner { border-radius: 14px; padding: 1.1rem 1.25rem; color: #fff; display: flex; align-items: center; gap: 1rem; }
.status-banner i { font-size: 2.4rem; line-height: 1; }
.status-banner .h4 { margin: 0; font-weight: 800; letter-spacing: .3px; }
.status-valid { background: linear-gradient(135deg, #1f8f3a, #2fb152); }
.status-in { background: linear-gradient(135deg, #0b4aa8, #2a7de1); }
.status-warn { background: linear-gradient(135deg, #d97706, #f59e0b); }
.status-bad { background: linear-gradient(135deg, #b42318, #e5484d); }
.detail-list dt { color: #64708a; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.detail-list dd { font-weight: 600; margin-bottom: .85rem; word-break: break-word; }
.public-footer { color: #64708a; font-size: .85rem; }

.cat-badge { font-weight: 700; letter-spacing: .4px; padding: .45em .8em; border-radius: 6px; color: #fff; text-transform: uppercase; }
.cat-badge.cat-speaker { background: #8e1537; }
.cat-badge.cat-delegate { background: #0b4aa8; }
.cat-badge.cat-eminent_speaker { background: #54249a; }
.cat-badge.cat-student { background: #128042; }
.cat-badge.cat-official { background: #007680; }
.cat-badge.cat-volunteer { background: #d6620a; }
.cat-badge.cat-organizer { background: #282c38; }
.cat-badge.cat-patron { background: #a06a00; }
.cat-badge.cat-staff { background: #4e6a7a; }
.cat-badge.cat-cipet_director { background: #00695c; }
.access-hint { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .5rem; font-size: .85rem; color: #46506a; }
.access-hint .chip { padding: .2rem .6rem; border-radius: 999px; background: #e8f3ea; color: #1b5e2a; font-weight: 600; }
.access-hint .chip.none { background: #fdecec; color: #a11a1a; }
.cat-badge.cat-chairman { background: #5b1a9c; }
.cat-badge.cat-convenor { background: #123c8f; }
.cat-badge.cat-co_convenor { background: #1976d2; }
.cat-badge.cat-sponsor { background: #6d4c41; }
.cat-badge.cat-exhibitor { background: #7a7a12; }
.btn-outline-cat { font-weight: 700; border: 2px solid currentColor; background: #fff; }
.btn-outline-cat.cat-speaker { color: #5b2a9d; } .btn-outline-cat.cat-delegate { color: #0b4aa8; } .btn-outline-cat.cat-vvip { color: #b3121d; }
.btn-outline-cat:hover { background: #f3f6fb; }
.btn-check:checked + .btn-outline-cat.cat-speaker { background: #5b2a9d; border-color: #5b2a9d; color: #fff; }
.btn-check:checked + .btn-outline-cat.cat-delegate { background: #0b4aa8; border-color: #0b4aa8; color: #fff; }
.btn-check:checked + .btn-outline-cat.cat-vvip { background: #b3121d; border-color: #b3121d; color: #fff; }

/* ---------- Panel ---------- */
.panel-nav { background: var(--navy); }
.panel-nav .navbar-brand { font-weight: 800; letter-spacing: .3px; }
.panel-nav .navbar-brand img { height: 34px; width: 34px; border-radius: 50%; background: #fff; }
.panel-nav .nav-link { white-space: nowrap; color: rgba(255, 255, 255, .82); font-weight: 500; border-radius: 8px; padding: .45rem .7rem !important; }
.panel-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.panel-nav .nav-link.active { color: #fff; background: rgba(255, 255, 255, .16); }
.page-title { font-weight: 800; color: var(--navy); }
.stat-card { border-left: 5px solid var(--navy); }
.stat-card .value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat-card .label { color: #64708a; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat-card.s-green { border-left-color: var(--green); } .stat-card.s-green .value { color: #1f7d31; }
.stat-card.s-orange { border-left-color: var(--orange); } .stat-card.s-orange .value { color: #c9640f; }
.stat-card.s-grey { border-left-color: #94a3b8; } .stat-card.s-grey .value { color: #475569; }
.table > :not(caption) > * > * { padding: .65rem .75rem; vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .4px; color: #64708a; background: #f6f9fd; white-space: nowrap; }
.badge-status { font-weight: 600; padding: .4em .7em; border-radius: 999px; }
.badge-checked_in { background: #dcf5e3; color: #17692a; }
.badge-pending { background: #fff1d6; color: #9a5b00; }
.badge-cancelled { background: #fde2e1; color: #a1211a; }
.quick-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: 1.4rem .75rem; border-radius: 14px; background: #fff; color: var(--navy); font-weight: 700; text-decoration: none; box-shadow: 0 2px 10px rgba(11, 45, 107, .08); height: 100%; text-align: center; }
.quick-action i { font-size: 2rem; color: var(--orange); }
.quick-action:hover { background: var(--navy); color: #fff; }
#reader { width: 100%; max-width: 460px; margin-inline: auto; border-radius: 14px; overflow: hidden; background: #0b1730; min-height: 260px; }
#reader video { border-radius: 14px; display: block; width: 100% !important; height: auto !important; }
#readerHint { padding-top: 4.5rem !important; }
.checkin-btn { font-size: 1.35rem; font-weight: 800; padding: 1rem; border-radius: 14px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: linear-gradient(160deg, var(--navy) 0%, #164a9e 60%, #2a7de1 100%); }

/* ---------- Phones ---------- */
@media (max-width: 767.98px) {
  main.container-fluid, main.container { padding-left: .75rem; padding-right: .75rem; }
  .page-title { font-size: 1.4rem; }
  .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
  .btn-sm { min-height: 38px; }
  .btn-close, .navbar-toggler, .btn-link { min-height: 0; }
  .form-control, .form-select { font-size: 16px; min-height: 46px; } /* 16px stops iOS zooming into fields */
  textarea.form-control { min-height: 80px; }
  .card-body.p-4 { padding: 1.1rem !important; }
  .stat-card .value { font-size: 1.5rem; }
  .stat-card .label { font-size: .7rem; }
  .status-banner { padding: .9rem 1rem; gap: .75rem; }
  .status-banner i { font-size: 2rem; }
  .status-banner .h4 { font-size: 1.15rem; }
  .public-header img.emblems { height: 52px; }
  .hero-logo { width: 120px; }
  .pass-frame { max-width: 100%; }
  .nav-pills .nav-link { padding: .5rem .75rem; }
  .pagination { flex-wrap: wrap; }

  /* Tables marked .table-stack turn each row into a card */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: .8rem .9rem; border-bottom: 1px solid #e3eaf4; }
  .table-stack > :not(caption) > * > td { padding: .12rem 0; border: 0; text-align: left !important; white-space: normal !important; background: transparent; box-shadow: none; }
  .table-stack td[data-label]::before { content: attr(data-label) ": "; color: #64708a; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; margin-right: .3rem; }
  .table-stack td.stack-id { color: #64708a; font-size: .85rem; }
  .table-stack td.stack-title { font-size: 1.08rem; font-weight: 700; color: var(--navy); }
  .table-stack td.stack-inline { display: inline-block; width: auto; margin: .2rem .35rem .2rem 0; }
  .table-stack td.stack-actions { display: flex; gap: .5rem; margin-top: .55rem; }
  .table-stack td.stack-actions > .btn, .table-stack td.stack-actions > form { flex: 1 1 0; }
  .table-stack td.stack-actions > form > .btn { width: 100%; }
  .table-stack td:empty { display: none; }
}

@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .pass-frame { max-width: 3in; margin: 0 auto; } /* the real card size: 3 x 4 inches */
  .pass-back { page-break-before: always; margin-top: 0 !important; }
  .pass-frame img { box-shadow: none; border-radius: 0; }
}

/* ---------- Access points / live monitor ---------- */
.point-card { border-left: 6px solid var(--navy); }
.point-card.point-hall { border-left-color: #2e9e3e; }
.point-card.point-exit { border-left-color: #d97706; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2e9e3e; margin-right: 4px; animation: live-pulse 1.6s infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.status-banner a { text-decoration: underline; }

/* ---------- Registration page ---------- */
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("../fonts/Poppins-Bold.ttf") format("truetype"); }
.public-body { background: linear-gradient(180deg, #eef3fb 0%, #f7f9fd 50%, #fff 100%); }
.public-header .event-name { font-family: "Poppins", var(--bs-body-font-family); }

/* Full-width event banner, in the colours of the badge */
.reg-hero { position: relative; overflow: hidden; color: #fff; padding: 2.6rem 0 7.5rem;
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .12) 1px, transparent 1.5px) 0 0 / 24px 24px,
        radial-gradient(700px 420px at 92% -10%, rgba(245, 130, 32, .45), transparent 70%),
        radial-gradient(600px 400px at 0% 110%, rgba(46, 158, 62, .30), transparent 70%),
        linear-gradient(120deg, #0b2d6b 0%, #2a1a72 50%, #54249a 100%); }
.reg-hero-inner { display: flex; align-items: center; gap: 2.2rem; }
.reg-hero-logo { flex: 0 0 190px; width: 190px; height: 190px; padding: 7px; border-radius: 50%;
    background: linear-gradient(135deg, #ffd45a, #f58220); box-shadow: 0 14px 34px rgba(0, 0, 0, .35); }
.reg-hero-logo img { width: 100%; height: 100%; border-radius: 50%; display: block; background: #fff; }
.reg-hero-kicker { font-size: .78rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #ffd45a; }
.reg-hero-title { font-family: "Poppins", var(--bs-body-font-family); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2.6rem); line-height: 1.15; margin: .35rem 0 .5rem; }
.reg-hero-tagline { color: rgba(255, 255, 255, .85); font-size: 1.1rem; margin-bottom: 1.2rem; max-width: 44rem; }
.reg-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; }
.reg-hero-date { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.25rem; border-radius: 999px; font-weight: 800; letter-spacing: .4px;
    color: #2a1a72; background: linear-gradient(135deg, #ffe08a, #ffc233); box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.reg-hero-venue { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1rem; border-radius: 999px; color: #fff;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); }
.reg-hero-venue i { color: #ffb45a; }

/* Form card overlaps the banner */
.reg-wrap { max-width: 860px; margin: -6.2rem auto 0; position: relative; }
.reg-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; padding: 0; background: #fbfcff; border-bottom: 1px solid #eef2f8; }
.reg-steps li { display: flex; gap: .7rem; align-items: center; padding: .95rem 1.2rem; font-size: .88rem; line-height: 1.3; color: #5b667d; }
.reg-steps li + li { border-left: 1px solid #eef2f8; }
.reg-steps span { flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, #54249a, #0b2d6b); }
.reg-steps strong { display: block; color: var(--navy); }

.reg-card { border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px rgba(20, 24, 80, .18); }
.reg-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem 2rem 1.25rem;
    background: #fff; border-top: 6px solid var(--orange); border-bottom: 1px solid #eef2f8; color: #5b667d; }
.reg-card-title { font-family: "Poppins", var(--bs-body-font-family); font-weight: 700; font-size: 1.7rem; color: var(--navy); margin: 0 0 .15rem; }
.reg-badge-preview { text-align: right; flex-shrink: 0; }
.reg-badge-preview small { display: block; font-size: .68rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #8a94a8; margin-bottom: .25rem; }
.reg-badge-preview .cat-badge { font-size: .85rem; transition: background-color .2s; }
.reg-card-body { padding: 1.4rem 2rem 2rem; }

.form-section { display: flex; align-items: center; gap: .55rem; margin-top: .6rem; font-size: .78rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #54249a; }
.form-section i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-size: .95rem; color: #54249a; background: #f1eafb; }
.form-section::after { content: ""; flex: 1; height: 1px; background: #e8ecf5; }
.reg-form .form-label { font-size: .86rem; color: #33405a; margin-bottom: .35rem; }
.reg-form .form-control, .reg-form .form-select { border: 1.5px solid #d9e2f0; border-radius: 12px; background-color: #f7faff; font-size: 1rem;
    padding-top: .7rem; padding-bottom: .7rem; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.reg-form .form-control::placeholder { color: #a3adc0; }
.reg-form .form-control:hover, .reg-form .form-select:hover { border-color: #b9c8e2; }
.reg-form .form-control:focus, .reg-form .form-select:focus { background-color: #fff; border-color: #54249a; box-shadow: 0 0 0 .22rem rgba(84, 36, 154, .14); }
.reg-form .form-control.is-invalid, .reg-form .form-select.is-invalid { border-color: #dc3545; background-color: #fff8f8; }
.reg-form .form-text { color: #8a94a8; }
.reg-submit { border: 0; border-radius: 14px; padding: .95rem 1rem; font-size: 1.08rem; letter-spacing: .2px;
    background: linear-gradient(135deg, #ff9a3c, #f06a12); box-shadow: 0 10px 22px rgba(240, 106, 18, .32); transition: transform .12s, box-shadow .12s, filter .12s; }
.reg-submit:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 14px 26px rgba(240, 106, 18, .38); }
.reg-submit:active { transform: translateY(0); }
.reg-submit:disabled { background: linear-gradient(135deg, #ff9a3c, #f06a12); opacity: .8; }
.reg-privacy { display: flex; gap: .5rem; align-items: flex-start; margin: 1rem 0 0; padding: .7rem .9rem; border-radius: 12px; background: #f2f8f3; color: #46604b; font-size: .84rem; }
.reg-privacy i { color: var(--green); }

@media (max-width: 767.98px) {
  .reg-hero { padding: 1.6rem 0 6rem; text-align: center; }
  .reg-hero-inner { flex-direction: column; gap: 1rem; }
  .reg-hero-logo { flex-basis: auto; width: 124px; height: 124px; padding: 5px; }
  .reg-hero-tagline { font-size: .98rem; margin-bottom: .9rem; }
  .reg-hero-meta { justify-content: center; }
  .reg-hero-venue { font-size: .9rem; }
  .reg-wrap { margin-top: -5rem; }
  .reg-steps { display: none; }
  .reg-card-head { padding: 1.1rem 1.1rem 1rem; }
  .reg-card-title { font-size: 1.3rem; }
  .reg-card-head p { display: none; }
  .reg-card-body { padding: 1rem 1.1rem 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { .reg-submit, .reg-form .form-control, .reg-form .form-select { transition: none; } }

/* ---------- Home-screen shortcut ("Install app" card) ---------- */
.install-card { display: block; width: 100%; text-align: left; padding: 1.25rem 1.3rem 1.2rem; border-radius: 22px; background: #fff;
    border: 1.5px dashed #d5d9e4; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.install-card:hover, .install-card:focus-visible { border-color: #9aa6c2; box-shadow: 0 10px 26px rgba(11, 45, 107, .12); transform: translateY(-1px); outline: 0; }
.install-card:active { transform: translateY(0); }
.install-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; margin-bottom: 1rem; font-size: 1.45rem; color: #fff;
    background: linear-gradient(145deg, #8b8f9c, #5c606d); box-shadow: 0 6px 14px rgba(40, 44, 56, .25); }
.install-title { display: block; font-weight: 800; font-size: 1.15rem; color: #16181f; margin-bottom: .2rem; }
.install-sub { display: block; color: #8a8f9c; font-size: .93rem; line-height: 1.4; }
.install-steps { margin-top: .6rem; padding: .8rem .95rem; border-radius: 14px; background: #f3f7fd; color: #46506a; font-size: .85rem; display: grid; gap: .35rem; }
@media (display-mode: standalone) { .install-wrap { display: none; } .panel-nav { padding-top: env(safe-area-inset-top); } }
@media (prefers-reduced-motion: reduce) { .install-card { transition: none; } }

/* ---------- Access level ---------- */
.access-badge { font-weight: 700; letter-spacing: .3px; padding: .45em .8em; border-radius: 6px; text-transform: uppercase; color: #33405a; background: #e6ebf3; }
.access-badge.access-all { color: #5a3d00; background: #ffd45a; }
.access-badge.access-restricted { color: #fff; background: #b42318; }

/* ---------- Mass print: 4 pass fronts per A4 page ---------- */
.print-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.print-pass { margin: 0; }
.print-pass img { width: 100%; height: auto; display: block; border-radius: 8px; box-shadow: 0 4px 14px rgba(11, 45, 107, .18); background: #e9eef7; }
.print-pass figcaption { font-size: .78rem; margin-top: .35rem; color: #46506a; }
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  body:has(.print-sheet) { background: #fff !important; }
  body:has(.print-sheet) main, body:has(.print-sheet) .container, body:has(.print-sheet) .container-fluid { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .print-sheet { display: grid; grid-template-columns: 3in 3in; grid-auto-rows: 4in; gap: 6mm 8mm; justify-content: center; }
  .print-pass { width: 3in; height: 4in; break-inside: avoid; page-break-inside: avoid; }
  .print-pass:nth-child(4n) { break-after: page; page-break-after: always; }
  .print-pass:last-child { break-after: auto; page-break-after: auto; }
  .print-pass img { width: 3in; height: 4in; border-radius: 0; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
