/* Business dashboard layout and controls. */
/* Manage business: one editor with a switchable preview. */
body[data-page='business'] .program-settings {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    margin: 28px 0 40px;
}
body[data-page='business'] .program-editor {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}
body[data-page='business'] :is(#settings-form, #program-form) label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
body[data-page='business']
    :is(#settings-form, #program-form)
    :is(input:not([type='checkbox']), textarea) {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 8px 0 20px;
    border: 1px solid #bdd1dc;
    border-radius: 10px;
    padding: 12px;
    font: inherit;
    color: #19394a;
    background: #ffffffbd;
}
body[data-page='business'] #settings-form input[type='color'] {
    height: 48px;
}
body[data-page='business'] #settings-form input[type='checkbox'] {
    width: auto;
    margin-right: 8px;
}
body[data-page='business'] :is(#settings-form, #program-form) :is(input, textarea):focus-visible {
    outline: 3px solid #429ed0;
    outline-offset: 2px;
}
body[data-page='business'] #settings-form .muted {
    font-size: 13px;
    line-height: 1.6;
    color: #527383;
}
body[data-page='business'] .program-preview-panel {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 24px;
    min-width: 0;
}
body[data-page='business'] .preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
body[data-page='business'] .preview-heading span {
    font-size: 13px;
    color: #527888;
}
body[data-page='business'] .program-preview-stack {
    position: relative;
    isolation: isolate;
    margin-top: 18px;
}
body[data-page='business'] .program-preview-stack[data-count='2']::before,
body[data-page='business'] .program-preview-stack[data-count='3']::before,
body[data-page='business'] .program-preview-stack[data-count='3']::after {
    content: '';
    position: absolute;
    top: -9px;
    left: 14px;
    right: 14px;
    height: 140px;
    border: 1px solid #b3d3e4;
    border-radius: 30px;
    background: #c8e2ef;
    z-index: -1;
}
body[data-page='business'] .program-preview-stack[data-count='3']::after {
    top: -17px;
    left: 25px;
    right: 25px;
    z-index: -2;
    background: #e3eff5;
}
body[data-page='business'] #program-preview .wallet-preview {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
body[data-page='business'] #program-preview .wallet-preview > p:first-child {
    display: none;
}
body[data-page='business'] #program-preview .wallet-preview-card {
    max-width: none;
    border-radius: 18px;
}
body[data-page='business'] #program-preview .wallet-preview-card header strong {
    min-width: 0;
}
body[data-page='business'] #program-preview .wallet-preview-card header img {
    width: auto;
    max-width: 80px;
}
body[data-page='business'] .preview-switcher {
    display: grid;
    gap: 6px;
    margin: 18px 0 12px;
}
body[data-page='business'] .preview-program {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    text-align: left;
    background: #ffffff80;
    color: #19394a;
    border: 1px solid transparent;
    padding: 10px 14px;
    font-size: 14px;
}
body[data-page='business'] .preview-program[aria-pressed='true'] {
    border-color: #4e899f;
    background: #d6eaf5;
}
body[data-page='business'] .preview-dot {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid #19394a33;
}
body[data-page='business'] #new-program {
    width: 100%;
}
body[data-page='business'] #program-access-note {
    font-size: 12px;
    line-height: 1.5;
}
body[data-page='business'] .stamp-shape-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
body[data-page='business'] .stamp-shape-choices button {
    background: #ffffff80;
    color: #19394a;
    padding: 10px 12px;
    border: 1px solid #b9d2df;
}
body[data-page='business'] .stamp-shape-choices button[aria-pressed='true'] {
    background: #c5e1ef;
    border-color: #4e899f;
}
body[data-page='business'] .branding-panel details {
    margin-top: 22px;
}
body[data-page='business'] .branding-panel > label {
    display: block;
}
body[data-page='business'] .branding-panel > button {
    margin-bottom: 14px;
}
body[data-page='business'] .dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
@media (max-width: 760px) {
    body[data-page='business'] .program-settings {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
    body[data-page='business'] .program-preview-panel {
        position: static;
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        max-width: 390px;
        margin-inline: auto;
    }
    body[data-page='business'] .program-editor {
        grid-row: 2;
    }
}
:root {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #19394a;
    font-synthesis: none;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
main {
    max-width: 1050px;
    margin: auto;
    padding: 32px 40px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dce3df;
    padding-bottom: 26px;
}
.brand {
    font-size: 38px;
    letter-spacing: -2px;
    font-weight: 750;
    text-decoration: none;
    color: #19394a;
    display: flex;
    align-items: center;
    gap: 22px;
}
.brand span {
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 600;
}
.badge {
    font-size: 10px;
    letter-spacing: 1px;
    background: #e8ede6;
    padding: 9px 12px;
    border-radius: 30px;
    color: #4e6555;
}
.intro {
    padding: 43px 0 32px;
}
.eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 650;
    color: #647f89;
}
.intro h1 {
    font-family: Georgia, serif;
    font-weight: 400;
    font-size: 46px;
    letter-spacing: -1.4px;
    margin: 12px 0;
}
.intro > p:last-child {
    color: #70828a;
    font-size: 15px;
}
.layout {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 56px;
    align-items: center;
}
.pass {
    background: rgb(156, 201, 232);
    border-radius: 22px;
    box-shadow: 0 18px 30px #274c6110;
    overflow: hidden;
}
.pass header {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 24px 24px 8px;
}
.cats {
    width: 79px;
    height: 59px;
    object-fit: contain;
}
.pass h2 {
    font-size: 24px;
    margin: 0 0 5px;
}
.pass header p {
    font-size: 12px;
    margin: 0;
    color: #406682;
}
.customer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 27px;
}
.customer span,
.card-bottom span {
    font-size: 10px;
    letter-spacing: 1px;
    color: #406682;
}
.customer strong {
    font-size: 16px;
    font-weight: 500;
}
.stamps {
    display: flex;
    justify-content: space-between;
    padding: 17px 26px 28px;
    gap: 10px;
}
.stamp {
    width: 59px;
    aspect-ratio: 1;
    border: 1.5px dashed #769bb3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6087a0;
    background: #ffffff30;
    overflow: hidden;
    flex: 1;
    max-width: 64px;
}
.stamp img {
    width: 107%;
    height: 107%;
    object-fit: cover;
}
.stamp.filled {
    border: 0;
}
.card-bottom {
    display: flex;
    justify-content: space-between;
    padding: 5px 27px 23px;
}
.card-bottom > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.card-bottom strong {
    font-size: 16px;
    font-weight: 550;
}
.card-bottom .count {
    text-align: right;
}
.count strong {
    font-size: 22px;
}
.pass footer {
    border-top: 1px solid #7eaac744;
    padding: 13px 27px;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #406682;
}
.desk h2 {
    font-family: Georgia, serif;
    font-size: 31px;
    font-weight: 400;
    margin: 12px 0;
}
.desk > p:not(.eyebrow) {
    color: #647c88;
    font-size: 14px;
    line-height: 1.7;
}
button {
    border: 0;
    font: inherit;
    font-size: 14px;
    padding: 15px 19px;
    border-radius: 9px;
    background: #214d60;
    color: white;
    cursor: pointer;
}
button:hover:not(:disabled) {
    background: #31657b;
}
button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
button:focus-visible,
a:focus-visible {
    outline: 3px solid #429ed0;
    outline-offset: 4px;
}
#visit {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin: 22px 0 10px;
}
.secondary {
    background: transparent;
    color: #214d60;
    border: 1px solid #c6d5d7;
}
.secondary:hover:not(:disabled) {
    background: #e6eeed;
}
.desk > .secondary {
    width: 100%;
}
.text-button {
    padding: 2px;
    background: none;
    color: #527483;
    text-decoration: underline;
    font-size: 12px;
}
.wallet-note {
    margin-top: 24px;
    padding-top: 19px;
    border-top: 1px solid #dce3df;
    font-size: 12px;
    color: #6f8189;
    line-height: 1.5;
}
.wallet-note p {
    margin-bottom: 0;
}
.wallet-note strong {
    font-weight: 600;
    color: #4c6774;
}
#message {
    min-height: 20px;
    margin-bottom: 8px;
}
#message.error {
    color: #a13d2d;
}
.summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 32px 0;
    margin-top: 25px;
    border-bottom: 1px solid #dce3df;
}
.summary div {
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.summary span {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #70858d;
}
.summary strong {
    font-size: 28px;
    font-weight: 500;
}
.history {
    margin-top: 27px;
}
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-title h2 {
    font-size: 18px;
    font-weight: 550;
}
.section-title span {
    font-size: 12px;
    color: #839299;
}
ol {
    list-style: none;
    padding: 0;
}
li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e9e6;
    font-size: 13px;
    color: #516f7c;
}
li time {
    color: #85969d;
    font-size: 12px;
}
.page-footer {
    font-size: 11px;
    color: #91a0a5;
    padding: 25px 0;
}
dialog {
    border: 0;
    border-radius: 18px;
    padding: 28px;
    max-width: 430px;
    color: #19394a;
}
dialog::backdrop {
    background: #132e4588;
}
dialog p {
    line-height: 1.6;
    color: #647c88;
}
.dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
@media (max-width: 720px) {
    main {
        padding: 24px 20px;
    }
    .layout {
        grid-template-columns: 1fr;
        gap: 26px;
    }
    .intro {
        padding-top: 25px;
    }
    .intro h1 {
        font-size: 35px;
    }
    .brand span {
        display: none;
    }
    .summary {
        gap: 12px;
    }
    .summary span {
        font-size: 9px;
    }
    .stamp {
        max-width: 64px;
    }
    .desk {
        padding: 0 4px;
    }
}

.lookup {
    margin: 0 0 32px;
    padding: 22px;
    border: 1px solid #dce3df;
    border-radius: 14px;
}
.lookup label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
}
.lookup > div {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.lookup input {
    flex: 1;
    min-width: 180px;
    border: 1px solid #c6d5d7;
    border-radius: 9px;
    padding: 12px;
    font: inherit;
    color: #19394a;
    background: white;
}
.lookup p {
    font-size: 12px;
    color: #647c88;
    line-height: 1.5;
}
.lookup input:focus-visible {
    outline: 3px solid #429ed0;
    outline-offset: 2px;
}
#lookup-result:empty {
    display: none;
}

[hidden] {
    display: none !important;
}
#login-form input {
    display: block;
    width: 100%;
    margin: 10px 0 18px;
}
#logout {
    margin-bottom: 20px;
}
details.lookup summary {
    cursor: pointer;
    font-weight: 600;
}
details.lookup form {
    margin-top: 20px;
}
.lookup form input,
.lookup select {
    display: block;
    width: 100%;
    margin: 10px 0 18px;
}
.lookup select {
    padding: 12px;
    border: 1px solid #c6d5d7;
    border-radius: 9px;
    font: inherit;
}
.lookup input[type='color'] {
    height: 48px;
}
.stamps {
    flex-wrap: wrap;
}
.stamp {
    flex: 0 0 50px;
}
#staff-list {
    padding: 0;
}

body[data-session-state='checking']
    :is(#login-form, #login, #logout, #business-content, #workspace, #dashboard),
body[data-session-state='error']
    :is(#login-form, #login, #logout, #business-content, #workspace, #dashboard) {
    display: none !important;
}
#session-loading {
    padding: 1rem 0;
    color: #647c88;
}

.desk-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}
.desk-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.desk-tabs [aria-selected='false'] {
    background: transparent;
    color: #214d60;
    border: 1px solid #c6d5d7;
}
.desk-navigation #logout {
    margin: 0;
}
.desk-tabs [aria-selected='true'] {
    box-shadow: inset 0 -3px 0 #80bad1;
}
#home-panel .lookup {
    margin: 1.25rem 0;
}
#manage-panel {
    padding-top: 0.5rem;
}
#customer-details {
    margin-top: 1.5rem;
}
/* Browser-style program tabs and the combined enrollment/scanning workspace. */
body[data-page='business'] .program-tabs {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    padding: 0 10px;
    border-bottom: 1px solid #afc9d5;
}
body[data-page='business'] .program-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 15px 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid #afc9d5;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    background: #c8e0ec80;
    color: #315b6e;
    font-weight: 600;
}
body[data-page='business'] .program-tabs[data-count='1'] .program-tab {
    flex: 0 1 auto;
    max-width: 16rem;
}
body[data-page='business'] .program-tab[aria-selected='true'] {
    position: relative;
    bottom: -1px;
    padding-top: 18px;
    background: #f3f8fb;
    color: #173a47;
    box-shadow: inset 0 3px 0 #7bb4cf;
}
body[data-page='business'] #program-workspace {
    border: 1px solid #afc9d5;
    border-top: 0;
    border-radius: 0 0 20px 20px;
    padding: 26px;
    background: #ffffff30;
}
body[data-page='business'] .enrollment-card {
    text-align: center;
    padding: 0 0 28px;
}
body[data-page='business'] .enrollment-card h2 {
    margin: 0 0 20px;
    font-size: 22px;
}
body[data-page='business'] .enrollment-card .poster-actions {
    justify-content: center;
}
body[data-page='business'] #enrollment-link {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 20px;
    line-height: 0;
    border-radius: 12px;
    overflow: hidden;
}
body[data-page='business'] #enrollment-qr svg {
    display: block;
    max-width: 100%;
    height: auto;
}
body[data-page='business'] .scanner-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 650;
    box-shadow: 0 8px 22px #214d601f;
}
body[data-page='business'] .inline-scanner {
    max-width: 620px;
    margin: 0 auto;
}
body[data-page='business'] .scanner-view {
    position: relative;
    overflow: hidden;
    background: #13232a;
    border-radius: 16px;
}
body[data-page='business'] #scanner-video {
    display: block;
    width: 100%;
    min-height: 260px;
    max-height: 460px;
    object-fit: cover;
}
body[data-page='business'] .scanner-target {
    position: absolute;
    width: 55%;
    aspect-ratio: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #ffffffc0;
    border-radius: 20px;
    pointer-events: none;
}
body[data-page='business'] #stop-scanner {
    width: 100%;
    margin-top: 12px;
}
body[data-page='business'] :is(#message, #poster-status, #scanner-status):empty {
    display: none;
}
body[data-page='business'] :is(#poster-status, #scanner-status) {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0;
}
@media (max-width: 600px) {
    .desk-navigation {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    body[data-page='business'] #program-workspace {
        padding: 22px 16px;
    }
    body[data-page='business'] .program-tabs {
        padding: 0 5px;
    }
    body[data-page='business'] .program-tab {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Visit-protection settings and manager-only attempt history. */
#visit-policy-enabled {
    width: auto;
    min-height: 0;
    display: inline-block;
    margin-right: 0.5rem;
}
#visit-protection ul,
#visit-protection ol {
    padding-left: 1.5rem;
    overflow-wrap: anywhere;
}
#visit-protection li {
    margin: 0.75rem 0;
}
#visit-cooldown-dialog {
    max-width: min(32rem, calc(100% - 2rem));
    overflow-wrap: anywhere;
}

/* Audited correction dialog, shared by the business desk and /scan route. */
body[data-page='business'] #visit-removal-confirm {
    width: min(430px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    overflow: auto;
}
body[data-page='business'] #visit-removal-confirm label {
    display: block;
    font-size: 14px;
}
body[data-page='business'] #visit-removal-phrase {
    display: block;
    width: 100%;
    margin: 10px 0 20px;
    padding: 12px;
    border: 1px solid #c6d5d7;
    border-radius: 10px;
    background: white;
    color: #19394a;
    font: inherit;
    font-size: 16px;
}
body[data-page='business'] #visit-removal-phrase:focus-visible {
    outline: 3px solid #91c6e5;
    outline-offset: 2px;
}
body[data-page='business'] #visit-removal-submit {
    background: #9c2637;
    color: white;
}
