:root {
    --theme-bg: #f4fbf6;
    --theme-text: #103824;
    --theme-card-border: #d7eadc;
    --theme-soft: #eef9f0;
    --theme-primary: #0b7c3e;
    --theme-primary-dark: #075c2d;
    --theme-accent: #8de3b2;
    --theme-accent-soft: #dff7e8;
    --theme-warning-bg: #fff4e7;
    --theme-warning-text: #f18c00;
}

body {
    background: var(--theme-bg);
    color: var(--theme-text);
    -webkit-text-size-adjust: 100%;
}

.app-main--frameless {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-left: max(.85rem, env(safe-area-inset-left));
    padding-right: max(.85rem, env(safe-area-inset-right));
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.navbar-clean {
    border-radius: 0 0 22px 22px;
}

.hero-card,
.ticket-card,
.panel-card {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(11, 124, 62, 0.08);
}

.event-banner,
.ticket-page-banner,
.settings-preview-img {
    width: 100%;
    object-fit: cover;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--theme-primary-dark), var(--theme-primary));
}

.event-banner,
.ticket-page-banner {
    max-height: 320px;
}

.settings-preview-img {
    max-height: 220px;
}

.qr-box {
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: inset 0 0 0 1px #e9ecef;
}

.ticket-qr-box {
    background: #fff;
    padding: 10px;
    border-radius: 16px;
    display: inline-block;
    border: 1px solid #e9ecef;
}

.small-muted {
    font-size: 0.92rem;
    color: #6c757d;
}

#reader {
    width: 100%;
}

.ticket-mobile-shell {
    max-width: 760px;
    margin: 0 auto;
    padding-bottom: 108px;
}

.ticket-mobile-card {
    background: #fff;
    border: 1px solid var(--theme-card-border);
    border-radius: 28px;
    box-shadow: 0 14px 35px rgba(11, 124, 62, 0.06);
    padding: 1.25rem;
}

.mobile-alert {
    border-radius: 18px;
}

.event-card {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 1rem;
    align-items: center;
}

.event-card__image,
.payment-event-thumb__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 18px;
    display: block;
}

.event-card__title,
.payment-event-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    line-height: 1.15;
    font-weight: 800;
    margin-bottom: .5rem;
}

.event-card__meta,
.payment-event-meta {
    color: #4d6b58;
    font-size: 1rem;
    margin-bottom: .35rem;
}

.section-title {
    font-size: clamp(1.4rem, 4vw, 2rem);
    line-height: 1.15;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--theme-primary-dark);
}

.ticket-type-stack {
    display: grid;
    gap: 1rem;
}

.qty-card .section-title {
    text-align: center;
    line-height: 1.28;
    letter-spacing: .01em;
    margin-bottom: 1.35rem;
    padding: .1rem .45rem 0;
}


.qty-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.qty-row--card {
    border: 2px solid #cfe8d7;
    border-radius: 24px;
    padding: 1rem 1.1rem;
}

.qty-label {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: .35rem;
}

.qty-price {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--theme-primary-dark);
}

.qty-note,
.terms-content,
.modal-terms-content {
    color: #2f3c53;
    line-height: 1.7;
    font-size: 1rem;
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qty-btn {
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 18px;
    background: #e3f6ea;
    color: var(--theme-primary);
    font-size: 2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qty-number {
    min-width: 40px;
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
}

.mobile-bottom-bar {
    position: sticky;
    bottom: 0;
    z-index: 1030;
    margin: 1rem auto 0;
    max-width: 860px;
    background: var(--theme-primary-dark);
    border-radius: 24px 24px 0 0;
    color: #fff;
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 -8px 30px rgba(7, 92, 45, 0.16);
}

.mobile-bottom-bar__label {
    font-size: .95rem;
    opacity: .9;
}

.mobile-bottom-bar__amount {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

.mobile-bottom-bar__btn {
    min-width: 180px;
    min-height: 64px;
    border-radius: 20px;
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: var(--theme-primary-dark);
}

.buyer-summary {
    background: var(--theme-soft);
    border: 1px solid var(--theme-card-border);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    display: grid;
    gap: .75rem;
}

.buyer-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.buyer-summary__row--total {
    padding-top: .85rem;
    border-top: 1px solid var(--theme-card-border);
    font-size: 1.06rem;
}

.payment-header-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.payment-order-no {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 800;
}

.payment-price-pill {
    background: var(--theme-accent);
    color: var(--theme-primary-dark);
    border-radius: 18px;
    padding: .6rem 1rem;
    font-size: 1.6rem;
    font-weight: 800;
    white-space: nowrap;
}

.payment-event-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1rem;
    align-items: center;
}

.countdown-card__title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--theme-primary-dark);
}

.countdown-chip {
    display: inline-block;
    margin-top: .8rem;
    background: var(--theme-warning-bg);
    color: var(--theme-warning-text);
    border-radius: 999px;
    padding: .45rem .95rem;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.summary-list {
    display: grid;
    gap: .85rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    font-size: 1rem;
}

.summary-row span {
    color: #64748b;
}

.summary-row strong {
    text-align: right;
}

.summary-row--total {
    border-top: 1px solid var(--theme-card-border);
    padding-top: .9rem;
    margin-top: .3rem;
    font-size: 1.12rem;
}

.expired-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--theme-primary-dark);
    color: #fff;
    border: 0;
    text-align: left;
}

.expired-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: #ff5a1f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.expired-card__title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: .8rem;
}

.expired-card__text {
    color: #d9f0df;
    line-height: 1.7;
    font-size: 1.06rem;
}

.expired-card__order {
    border-top: 1px solid rgba(255,255,255,.2);
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    color: #d9f0df;
}

.line-connect-card {
    border-radius: 24px;
    border: 1px solid var(--theme-card-border);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(11, 124, 62, 0.06);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.line-connect-card--loading {
    background: #edf9f1;
    border-color: var(--theme-card-border);
}

.line-connect-card--success {
    background: linear-gradient(180deg, #f3fff8 0%, #ffffff 100%);
    border-color: #bfe4cf;
}

.line-connect-card--danger {
    background: linear-gradient(180deg, #fff5f5 0%, #ffffff 100%);
    border-color: #f2c6c6;
}

.line-connect-card__inner {
    display: flex;
    align-items: center;
    gap: .9rem;
}

.line-connect-card__avatar {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    max-height: 72px !important;
    border-radius: 999px !important;
    object-fit: cover !important;
    display: block;
    flex: 0 0 72px;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 20px rgba(11, 124, 62, 0.12);
    background: #dfe7f4;
}

.line-connect-card__avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-text);
    font-weight: 800;
    font-size: 1.5rem;
}

.line-connect-card__body {
    min-width: 0;
}

.line-connect-card__title {
    font-size: 1.1rem;
    line-height: 1.35;
    font-weight: 800;
    color: var(--theme-primary-dark);
}

.line-connect-card__name {
    margin-top: .25rem;
    color: #5a6d60;
    font-size: .96rem;
    word-break: break-word;
}

.line-status-inline,
.line-linked-badge {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
}

.line-linked-badge {
    background: #e9f9f0;
    color: #0f6d3d;
    border: 1px solid #bde8cc;
    border-radius: 999px;
    padding: .4rem .85rem;
    font-weight: 700;
}

.line-linked-badge small {
    display: block;
    color: #39536b;
    font-weight: 500;
}

.line-avatar,
.line-avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    background: #dfe7f4;
    color: var(--theme-text);
    font-weight: 700;
}

.line-avatar--large,
.line-avatar-placeholder--large {
    width: 48px;
    height: 48px;
}

.ticket-summary-list {
    display: grid;
    gap: .45rem;
}

.ticket-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

@media (max-width: 768px) {
    .navbar {
        margin-bottom: 1rem !important;
    }

    .event-card {
        grid-template-columns: 84px 1fr;
        gap: .85rem;
    }

    .ticket-mobile-card {
        border-radius: 24px;
        padding: 1rem;
    }

    .qty-row,
    .payment-header-top,
    .summary-row,
    .buyer-summary__row {
        flex-direction: column;
        align-items: stretch;
    }

    .qty-stepper {
        justify-content: space-between;
    }

    .qty-btn {
        width: 56px;
        height: 56px;
    }

    .mobile-bottom-bar {
        border-radius: 24px 24px 0 0;
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-bottom-bar__btn {
        width: 100%;
        min-width: 0;
    }

    .payment-event-row {
        grid-template-columns: 84px 1fr;
    }

    .countdown-chip {
        font-size: 1.6rem;
    }

    .expired-card__title {
        font-size: 1.7rem;
    }

    .line-status-inline {
        align-items: flex-start;
    }

    .line-connect-card__inner {
        align-items: center;
    }

    .line-connect-card__avatar {
        width: 64px !important;
        height: 64px !important;
        min-width: 64px !important;
        max-width: 64px !important;
        max-height: 64px !important;
        flex-basis: 64px;
    }

    .line-connect-card__title {
        font-size: 1rem;
    }
}



/* v7 UI hotfix for LINE profile card */
.line-connect-card {
    overflow: hidden;
}

.line-connect-card img {
    width: 56px;
    height: 56px;
    max-width: 56px;
    max-height: 56px;
    border-radius: 999px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .line-connect-card {
        padding: .95rem 1rem;
    }

    .line-connect-card__inner {
        gap: .75rem;
    }
}


.ticket-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    padding: .5rem .9rem;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ticket-status-badge--active {
    background: #198754;
    color: #fff;
}

.ticket-status-badge--used {
    background: #6c757d;
    color: #fff;
}

.ticket-status-badge--cancelled {
    background: #dc3545;
    color: #fff;
}

.ticket-status-badge--default {
    background: #f1f3f5;
    color: #495057;
}

.ticket-card .ticket-status-badge,
.ticket-mobile-card .ticket-status-badge {
    display: inline-flex;
    max-width: min(100%, 340px);
}

.ticket-page-status .ticket-status-badge {
    padding: .42rem .78rem;
    font-size: .88rem;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .ticket-status-badge {
        font-size: .9rem;
        padding: .55rem .8rem;
        border-radius: 18px;
    }

    .ticket-card .ticket-status-badge,
    .ticket-mobile-card .ticket-status-badge {
        max-width: 100%;
    }
}


.ticket-checkin-notice {
    width: 100%;
    padding: .9rem 1rem;
    border-radius: 14px;
    border: 1px solid #fdba74;
    background: #fff7ed;
    color: #9a3412;
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.ticket-checkin-notice--used {
    border-color: #ced4da;
    background: #f8f9fa;
    color: #495057;
}

.ticket-checkin-notice--cancelled {
    border-color: #f5c2c7;
    background: #f8d7da;
    color: #842029;
}

.ticket-checkin-notice--default {
    border-color: #dee2e6;
    background: #f8f9fa;
    color: #495057;
}


.table .ticket-status-badge,
.table-responsive .ticket-status-badge {
    padding: .35em .65em;
    border-radius: .375rem;
    font-size: .78rem;
    line-height: 1.15;
    font-weight: 700;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}


.app-powered-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0 calc(1.15rem + env(safe-area-inset-bottom));
    text-align: center;
}

.app-powered-footer__link {
    color: #5a6d60;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.app-powered-footer__link:hover,
.app-powered-footer__link:focus {
    color: var(--theme-text);
    text-decoration: none;
}


body {
    background: var(--theme-bg);
    color: var(--theme-text);
}

a {
    color: var(--theme-primary);
}

a:hover,
a:focus {
    color: var(--theme-primary-dark);
}

.navbar-clean {
    background: #ffffff;
}

.navbar-brand {
    color: var(--theme-primary-dark) !important;
}

.btn-primary {
    --bs-btn-bg: var(--theme-primary);
    --bs-btn-border-color: var(--theme-primary);
    --bs-btn-hover-bg: var(--theme-primary-dark);
    --bs-btn-hover-border-color: var(--theme-primary-dark);
    --bs-btn-active-bg: var(--theme-primary-dark);
    --bs-btn-active-border-color: var(--theme-primary-dark);
    --bs-btn-disabled-bg: var(--theme-primary);
    --bs-btn-disabled-border-color: var(--theme-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--theme-primary);
    --bs-btn-border-color: var(--theme-primary);
    --bs-btn-hover-bg: var(--theme-primary);
    --bs-btn-hover-border-color: var(--theme-primary);
    --bs-btn-active-bg: var(--theme-primary);
    --bs-btn-active-border-color: var(--theme-primary);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #9dd5b0;
    box-shadow: 0 0 0 .25rem rgba(11, 124, 62, .16);
}

.bank-transfer-card {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-radius: 24px;
    background: linear-gradient(180deg, #f3fff7 0%, #ffffff 100%);
    border: 1px solid var(--theme-card-border);
}

.bank-transfer-card__logo-wrap {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #d9e8de;
}

.bank-transfer-card__logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.bank-transfer-card__bank {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--theme-primary-dark);
}

.bank-transfer-card__name {
    color: #4d6b58;
    font-weight: 600;
    margin-top: .15rem;
}

.bank-transfer-card__number {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: .35rem;
    letter-spacing: .03em;
}

.copy-account-btn {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: 2px solid var(--theme-primary-dark);
    background: #fff;
    color: var(--theme-primary-dark);
    font-size: 1.45rem;
    font-weight: 700;
}

.copy-account-btn.is-copied {
    background: var(--theme-primary-dark);
    color: #fff;
}


.promptpay-qr-card {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid var(--theme-card-border);
    text-align: center;
}

.promptpay-qr-card__title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--theme-primary-dark);
    margin-bottom: .85rem;
}

.promptpay-qr-card__image {
    width: 100%;
    max-width: 360px;
    border-radius: 20px;
    border: 1px solid #dbe9df;
    background: #fff;
    display: block;
    margin: 0 auto;
}

.promptpay-qr-card__meta {
    margin-top: .85rem;
    color: #587162;
    line-height: 1.6;
}

.slip-upload-box {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 240px;
    padding: 1.5rem 1rem;
    border: 2px dashed #c9e6d4;
    border-radius: 24px;
    background: #fbfffc;
    cursor: pointer;
}

.slip-upload-box__icon {
    font-size: 2.4rem;
    line-height: 1;
    color: #34b46f;
}

.slip-upload-box__title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--theme-primary-dark);
    margin-top: .45rem;
}

.slip-upload-box__hint {
    color: #6b7f73;
    margin-top: .35rem;
}

.payment-slip-status {
    background: var(--theme-soft);
    border: 1px solid var(--theme-card-border);
    border-radius: 18px;
    padding: 1rem 1.1rem;
}

.payment-slip-status__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1rem;
}

.payment-slip-status__message {
    margin-top: .65rem;
    color: #304f3a;
    line-height: 1.6;
}

.slip-preview {
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--theme-card-border);
    background: #fff;
}

.slip-preview__img {
    width: 100%;
    display: block;
}

.badge.text-bg-warning {
    background: #fff1cc !important;
    color: #805b00 !important;
}

.badge.text-bg-success {
    background: #dff4e5 !important;
    color: #0b6b35 !important;
}

.badge.text-bg-danger {
    background: #fde1e4 !important;
    color: #9c2431 !important;
}

.unsupported-transfer-modal__content {
    border: 0;
    border-radius: 32px;
    padding: 2.1rem 1.65rem 1.8rem;
    text-align: center;
    box-shadow: 0 24px 60px rgba(18, 37, 28, .18);
}

.unsupported-transfer-modal__icon {
    width: 86px;
    height: 86px;
    margin: 0 auto 1rem;
    display: grid;
    place-items: center;
    font-size: 3rem;
    color: #f0a04b;
    line-height: 1;
}

.unsupported-transfer-modal__title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--theme-primary-dark);
    margin-bottom: 1rem;
}

.unsupported-transfer-modal__item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--theme-primary-dark);
    line-height: 1.35;
}

.unsupported-transfer-modal__item + .unsupported-transfer-modal__item {
    margin-top: .55rem;
}

.unsupported-transfer-modal__logo {
    display: block;
    object-fit: contain;
    flex: 0 0 auto;
}

.unsupported-transfer-modal__logo--bank {
    width: 54px;
    height: 54px;
}

.unsupported-transfer-modal__logo--wallet {
    width: 70px;
    height: 34px;
}

.unsupported-transfer-modal__button {
    min-width: 140px;
    border-radius: 20px;
    margin-top: 1.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    padding: .9rem 1.35rem;
}

@media (max-width: 768px) {
    .unsupported-transfer-modal__content {
        border-radius: 28px;
        padding: 1.85rem 1.2rem 1.55rem;
    }

    .unsupported-transfer-modal__icon {
        width: 72px;
        height: 72px;
        font-size: 2.55rem;
        margin-bottom: .8rem;
    }

    .unsupported-transfer-modal__title {
        font-size: 1.6rem;
        margin-bottom: .85rem;
    }

    .unsupported-transfer-modal__item {
        font-size: 1.05rem;
        gap: .5rem;
    }

    .unsupported-transfer-modal__logo--bank {
        width: 42px;
        height: 42px;
    }

    .unsupported-transfer-modal__logo--wallet {
        width: 56px;
        height: 28px;
    }

    .unsupported-transfer-modal__button {
        min-width: 120px;
        font-size: 1.15rem;
        padding: .8rem 1.15rem;
    }

    .bank-transfer-card {
        grid-template-columns: 64px 1fr 52px;
        gap: .85rem;
    }

    .bank-transfer-card__logo-wrap {
        width: 64px;
        height: 64px;
    }

    .bank-transfer-card__logo {
        width: 48px;
        height: 48px;
    }

    .bank-transfer-card__bank {
        font-size: 1.05rem;
    }

    .bank-transfer-card__number {
        font-size: 1.4rem;
    }

    .copy-account-btn {
        width: 52px;
        height: 52px;
    }

    .payment-slip-status__row {
        flex-direction: column;
    }
}
