/* ==========================================================================
   ThaiHao Wave 2 Dashboards, Prepaid Wallet & KYB Registration Stylesheet
   GFW-Safe, Zero External CDNs, Tabular Numerals, 44px Touch Floor
   Wave 3: tokens from thaihao_gfw_safe_tokens.css, one elevation per surface.
   ========================================================================== */

.o_thaihao_w2_section {
    margin-top: 32px;
    font-variant-numeric: tabular-nums;
}

.o_thaihao_w2_section:first-child {
    margin-top: 0;
}

.o_thaihao_w2_subblock {
    margin-top: 24px;
}

.o_thaihao_w2_wallet_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Prepaid wallet: the one brand-colored surface on the seller home tab.
   -------------------------------------------------------------------------- */
.o_thaihao_w2_wallet {
    margin-bottom: 8px;
}

.o_thaihao_w2_wallet_hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 20px;
    border-radius: var(--th-r-lg);
    background-color: var(--th-surface-brand);
    color: var(--th-on-brand);
    box-shadow: var(--th-e2);
}

/* The pointer light on the brand surface is warmer and a little stronger. */
@media (hover: hover) and (pointer: fine) {
    html.sc-ready .o_thaihao_w2_wallet_hero[data-sc-spotlight] {
        background-image: radial-gradient(420px circle at calc(var(--sc-mx, 0.5) * 100%) calc(var(--sc-my, 0.5) * 100%), rgba(247, 127, 0, calc(0.2 * var(--sc-lit, 0))), transparent 70%);
    }
}

.o_thaihao_w2_wallet_hero :focus-visible {
    outline-color: #FFFFFF;
}

.o_thaihao_w2_wallet_head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.o_thaihao_w2_wallet_title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: var(--th-lh-heading);
    color: var(--th-on-brand);
}

.o_thaihao_w2_wallet_hero .o_thaihao_badge_gold {
    background-color: rgba(197, 160, 89, 0.22);
    color: #F4E3BE;
}

.o_thaihao_w2_wallet_label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--th-on-brand-muted);
}

.o_thaihao_w2_wallet_amount {
    margin-top: 2px;
    font-size: var(--th-fs-hero);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: var(--th-tracking-tight);
    color: #FFFFFF;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.o_thaihao_w2_wallet_amount .o_thaihao_unit {
    color: var(--th-on-brand-muted);
}

.o_thaihao_w2_wallet_split {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.o_thaihao_w2_wallet_split > div {
    min-width: 0;
}

.o_thaihao_w2_wallet_split dt {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--th-on-brand-muted);
}

.o_thaihao_w2_wallet_split dd {
    margin: 2px 0 0;
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.o_thaihao_w2_wallet .o_thaihao_w2_alert {
    margin: 12px 0 0;
}

@media (min-width: 768px) {
    .o_thaihao_w2_wallet_body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
        align-items: end;
        gap: 24px;
    }

    .o_thaihao_w2_wallet_split {
        margin-top: 0;
        padding-top: 0;
        padding-left: 24px;
        border-top: 0;
        border-left: 1px solid rgba(255, 255, 255, 0.16);
    }
}

/* Quota / metric lists inside cards */
.o_thaihao_w2_quota {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px 16px;
    margin: 0;
}

.o_thaihao_w2_quota > div {
    min-width: 0;
}

.o_thaihao_w2_quota dt {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--o-thaihao-muted);
}

.o_thaihao_w2_quota dd {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--o-thaihao-ink);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.o_thaihao_w2_quota .is-depleted dd {
    font-weight: 600;
    color: var(--o-thaihao-muted);
}

.o_thaihao_w2_quota .is-negative dd {
    color: var(--th-risk-fg);
}

.o_thaihao_w2_note {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--o-thaihao-muted);
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.o_thaihao_w2_alert {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--th-border-subtle);
    border-radius: var(--th-r-md);
    background-color: var(--th-surface-card);
    color: var(--o-thaihao-ink);
    line-height: 1.5;
}

.o_thaihao_w2_alert p {
    margin: 0;
}

.o_thaihao_w2_alert:focus {
    outline: none;
}

.o_thaihao_w2_alert_head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-weight: 700;
}

.o_thaihao_w2_alert_hint {
    font-size: 13px;
}

.o_thaihao_w2_alert_error {
    border-color: var(--th-risk-bd);
    background-color: var(--th-risk-bg);
    color: var(--th-risk-fg);
}

.o_thaihao_w2_alert_success {
    border-color: var(--th-ok-bd);
    background-color: var(--th-ok-bg);
    color: var(--th-ok-fg);
}

.o_thaihao_w2_alert_warn {
    border-color: var(--th-warn-bd);
    background-color: var(--th-warn-bg);
    color: var(--th-warn-fg);
}

/* --------------------------------------------------------------------------
   /thaihao/register
   -------------------------------------------------------------------------- */
.o_thaihao_w2_register_body {
    padding-bottom: 32px;
}

.o_thaihao_w2_register {
    max-width: 760px;
}

.o_thaihao_w2_mode {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 2px 10px;
    border-radius: var(--th-r-pill);
    background-color: rgba(0, 0, 0, 0.24);
    color: var(--th-on-brand-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.o_thaihao_w2_label_en,
.o_thaihao_w2_legend_en {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--o-thaihao-muted);
}

.o_thaihao_w2_invite_banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(197, 160, 89, 0.55);
    border-radius: var(--th-r-md);
    background-color: var(--th-gold-bg);
    color: var(--th-gold-ink);
    line-height: 1.5;
}

.o_thaihao_w2_invite_bonus {
    margin-left: auto;
    font-size: 15px;
    font-weight: 700;
}

.o_thaihao_w2_form {
    display: flex;
    flex-direction: column;
}

.o_thaihao_w2_fieldset {
    min-width: 0;
    margin: 0;
    padding: 20px 0 22px;
    border: 0;
    border-top: 1px solid var(--th-border-subtle);
}

.o_thaihao_w2_fieldset:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.o_thaihao_w2_legend {
    margin: 0 0 14px;
    padding: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: var(--th-lh-heading);
    color: var(--o-thaihao-ink);
}

.o_thaihao_w2_legend_en {
    margin-left: 6px;
}

.o_thaihao_w2_fieldset_hint {
    margin: -6px 0 12px;
}

.o_thaihao_w2_form_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.o_thaihao_w2_field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.o_thaihao_w2_field_wide {
    grid-column: 1 / -1;
}

.o_thaihao_w2_field label {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--o-thaihao-ink);
}

.o_thaihao_w2_field input {
    width: 100%;
}

.o_thaihao_w2_input_code {
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
}

.o_thaihao_w2_req {
    font-size: 12px;
    font-weight: 700;
    color: var(--th-risk-fg);
}

.o_thaihao_w2_optional {
    font-size: 12px;
    font-weight: 600;
    color: var(--o-thaihao-muted);
}

.o_thaihao_w2_hint {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--o-thaihao-muted);
}

.o_thaihao_w2_hint.is-error {
    font-weight: 600;
    color: var(--th-risk-fg);
}

.o_thaihao_w2_counter {
    font-variant-numeric: tabular-nums;
}

.o_thaihao_w2_field.is-valid .o_thaihao_w2_counter {
    font-weight: 700;
    color: var(--th-ok-fg);
}

.o_thaihao_w2_hint_error {
    display: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--th-risk-fg);
}

.o_thaihao_w2_field.is-invalid .o_thaihao_w2_hint_error {
    display: block;
}

.o_thaihao_w2_field.is-invalid input {
    border-color: var(--th-risk-fg);
}

/* Document drop zones. The native file input covers the whole zone, so tap,
   keyboard, drag and drop all go through the real control. */
.o_thaihao_w2_files {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.o_thaihao_w2_file {
    position: relative;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-content: start;
    gap: 4px 12px;
    min-height: 88px;
    padding: 16px;
    border: 1.5px dashed var(--th-border-input);
    border-radius: var(--th-r-md);
    background-color: var(--th-surface-sunken);
    color: var(--o-thaihao-ink);
    cursor: pointer;
    transition: border-color var(--th-dur-quick) var(--th-ease-out),
                background-color var(--th-dur-quick) var(--th-ease-out);
}

.o_thaihao_w2_file_icon {
    grid-row: span 2;
    width: 24px;
    height: 24px;
    color: var(--o-thaihao-muted);
}

.o_thaihao_w2_file_title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.o_thaihao_w2_file_title .o_thaihao_w2_label_en {
    display: block;
}

.o_thaihao_w2_file_meta {
    font-size: 12px;
    line-height: 1.45;
    color: var(--o-thaihao-muted);
    overflow-wrap: anywhere;
}

.o_thaihao_pwa_body .o_thaihao_w2_file input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

@media (hover: hover) {
    .o_thaihao_w2_file:hover {
        border-color: var(--o-thaihao-crimson);
        background-color: #FFF8F9;
    }
}

.o_thaihao_w2_file.is-dragover {
    border-color: var(--o-thaihao-crimson);
    background-color: #FFF8F9;
}

.o_thaihao_w2_file:has(input:focus-visible) {
    outline: 2px solid var(--o-thaihao-crimson);
    outline-offset: 2px;
}

@supports not selector(:has(*)) {
    .o_thaihao_w2_file:focus-within {
        outline: 2px solid var(--o-thaihao-crimson);
        outline-offset: 2px;
    }
}

.o_thaihao_w2_file:has(input:user-invalid) {
    border-color: var(--th-risk-fg);
}

.o_thaihao_w2_file.has-file {
    border-style: solid;
    border-color: var(--th-ok-bd);
    background-color: var(--th-ok-bg);
}

.o_thaihao_w2_file.has-file .o_thaihao_w2_file_icon,
.o_thaihao_w2_file.has-file .o_thaihao_w2_file_meta {
    color: var(--th-ok-fg);
}

.o_thaihao_w2_file.has-file .o_thaihao_w2_file_meta {
    font-weight: 600;
}

@media (min-width: 640px) {
    .o_thaihao_w2_files {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .o_thaihao_w2_file {
        grid-template-columns: minmax(0, 1fr);
    }

    .o_thaihao_w2_file_icon {
        grid-row: auto;
        margin-bottom: 4px;
    }
}

.o_thaihao_w2_submit {
    display: grid;
    gap: 10px;
    margin-top: 4px;
    padding-top: 20px;
    border-top: 1px solid var(--th-border-subtle);
}

.o_thaihao_w2_submit .o_thaihao_btn {
    justify-self: start;
    min-width: 200px;
}

.o_thaihao_w2_submit_note {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--o-thaihao-muted);
}

/* Phones: the submit button follows the thumb down the form. */
@media (max-width: 767px) {
    .o_thaihao_w2_submit {
        position: sticky;
        bottom: 0;
        z-index: 30;
        margin: 4px -20px -20px;
        padding: 12px 20px calc(12px + var(--o-thaihao-safe-bottom));
        border-radius: 0 0 15px 15px;
        background-color: rgba(255, 255, 255, 0.97);
    }

    .o_thaihao_w2_submit .o_thaihao_btn {
        justify-self: stretch;
        min-height: 52px;
    }
}

/* Receipt after a successful submission */
.o_thaihao_w2_receipt {
    display: grid;
    gap: 16px;
}

.o_thaihao_w2_receipt_head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.o_thaihao_w2_receipt_head .o_thaihao_pwa_heading {
    margin: 0;
}

.o_thaihao_w2_receipt_head p {
    margin: 0;
}

.o_thaihao_w2_receipt_icon {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--th-ok-bg);
    color: var(--th-ok-fg);
}

.o_thaihao_w2_receipt_icon path {
    stroke-dasharray: 22;
    stroke-dashoffset: 22;
    animation: th-check-draw 500ms var(--th-ease-out) 80ms forwards;
}

@keyframes th-check-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.o_thaihao_w2_receipt_ref {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 14px 16px;
    border-radius: var(--th-r-md);
    background-color: var(--th-surface-sunken);
}

.o_thaihao_w2_receipt_ref .o_thaihao_code_chip {
    font-size: 16px;
    background-color: var(--th-surface-card);
}

.o_thaihao_w2_receipt_ref .o_thaihao_btn {
    margin-left: auto;
    min-height: 40px;
}

.o_thaihao_w2_steps {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: th-step;
}

.o_thaihao_w2_steps li {
    position: relative;
    padding-left: 36px;
    line-height: 1.55;
    counter-increment: th-step;
}

.o_thaihao_w2_steps li::before {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--th-surface-sunken);
    color: var(--o-thaihao-ink);
    font-size: 12px;
    font-weight: 700;
    content: counter(th-step);
}

.o_thaihao_w2_steps li.is-done::before {
    background-color: var(--th-ok-bg);
    color: var(--th-ok-fg);
}

.o_thaihao_w2_corridor_block {
    margin-top: 28px;
}

.o_thaihao_w2_hero {
    padding: 8px 0 4px;
}

.o_thaihao_w2_footer {
    margin: 24px 0 0;
    font-size: 12px;
    color: var(--o-thaihao-muted);
    text-align: center;
}

.o_thaihao_w2_hidden_csrf {
    display: none;
}

/* --------------------------------------------------------------------------
   /thaihao/ops/dashboard
   -------------------------------------------------------------------------- */
.o_thaihao_ops_body {
    padding-bottom: 32px;
}

.o_thaihao_ops_body .o_thaihao_pwa_container {
    max-width: 1320px;
}

.o_thaihao_ops_status {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--o-thaihao-muted);
}

.o_thaihao_ops_status p {
    margin: 0;
}

.o_thaihao_ops_links {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.o_thaihao_ops_drill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: var(--o-thaihao-crimson);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

@media (hover: hover) {
    .o_thaihao_ops_drill:hover {
        text-decoration: underline;
    }
}

.o_thaihao_ops_attention {
    margin-bottom: 8px;
}

.o_thaihao_ops_attention_list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.o_thaihao_ops_attention_item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px 16px;
    border: 1px solid var(--th-border-subtle);
    border-radius: var(--th-r-md);
    background-color: var(--th-surface-card);
    color: var(--o-thaihao-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: border-color var(--th-dur-quick) var(--th-ease-out);
}

.o_thaihao_ops_attention_item.is-warn {
    border-color: var(--th-warn-bd);
    background-color: var(--th-warn-bg);
    color: var(--th-warn-fg);
}

.o_thaihao_ops_attention_item.is-risk {
    border-color: var(--th-risk-bd);
    background-color: var(--th-risk-bg);
    color: var(--th-risk-fg);
}

@media (hover: hover) {
    a.o_thaihao_ops_attention_item:hover {
        border-color: currentColor;
    }
}

.o_thaihao_ops_attention_count {
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.o_thaihao_ops_all_clear {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 16px;
    border: 1px solid var(--th-ok-bd);
    border-radius: var(--th-r-md);
    background-color: var(--th-ok-bg);
    color: var(--th-ok-fg);
    font-weight: 600;
}

.o_thaihao_sc_corridor--telemetry {
    margin-bottom: 4px;
}

.o_thaihao_sc_corridor--telemetry .o_thaihao_sc_corridor_readout {
    min-height: 60px;
}

.o_thaihao_ops_tile.is-warn {
    border-color: var(--th-warn-bd);
    background-color: var(--th-warn-bg);
}

.o_thaihao_ops_tile.is-warn .o_thaihao_step_value {
    color: var(--th-warn-fg);
}

.o_thaihao_ops_tile.is-risk {
    border-color: var(--th-risk-bd);
    background-color: var(--th-risk-bg);
}

.o_thaihao_ops_tile.is-risk .o_thaihao_step_value {
    color: var(--th-risk-fg);
}

@media (min-width: 1280px) {
    .o_thaihao_ops_grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 0 32px;
    }

    .o_thaihao_ops_col:only-child {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .o_thaihao_w2_receipt_icon path {
        stroke-dashoffset: 0;
        animation: none;
    }

    .o_thaihao_w2_file,
    .o_thaihao_ops_attention_item {
        transition: none;
    }
}
