﻿:root {
    --bg: #f2f3f5;
    --surface: #ffffff;
    --ink: #1a1d21;
    --muted: #5f6770;
    --line: #dde1e6;
    --line-strong: #c8ced6;
    --panel: #ffffff;
    --primary: #7c3424;
    --primary-dark: #5a2418;
    --primary-soft: #f6ebe7;
    --accent: #8f6b24;
    --navy: #18212b;
    --gold: #8f6b24;
    --danger: #b42318;
    --success: #0f7a45;
    --success-soft: #e8f6ee;
    --warn-bg: #fff8e8;
    --warn-line: #efd48a;
    --shadow: 0 12px 32px rgba(24, 33, 43, 0.08);
    --soft-shadow: 0 4px 14px rgba(24, 33, 43, 0.05);
    --radius: 12px;
    --radius-lg: 16px;
    --focus: 0 0 0 3px rgba(124, 52, 36, 0.22);
    --font-display: "Be Vietnam Pro", "Segoe UI", sans-serif;
    --font-body: "Be Vietnam Pro", "Segoe UI", sans-serif;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, #ebe4de 0, var(--bg) 220px);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
}

body.user-page {
    min-height: 100svh;
    background:
        radial-gradient(ellipse 80% 40% at 50% -10%, rgba(124, 52, 36, 0.08), transparent 60%),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 10px clamp(14px, 3vw, 40px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.user-topbar {
    position: relative;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--navy);
    font-weight: 700;
    text-transform: none;
    min-width: 0;
    font-size: 15px;
}

.brand img {
    width: 96px;
    height: 52px;
    object-fit: contain;
}

.topbar nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    color: var(--primary-dark);
    font-weight: 600;
    justify-content: flex-end;
}

.topbar nav a {
    padding: 8px 12px;
    border-radius: 8px;
}

.topbar nav a:hover {
    background: var(--primary-soft);
}

.header-admin-nav {
    flex: 0 0 auto;
    max-width: none;
    overflow: visible;
    gap: 8px;
}

.header-admin-nav a {
    white-space: nowrap;
    border: 1px solid transparent;
    font-size: 14px;
    padding: 8px 12px;
}

.header-admin-nav a.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.mobile-admin-menu {
    display: none;
}

.mobile-admin-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    list-style: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fffaf2;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.mobile-admin-menu summary:hover,
.mobile-admin-menu[open] summary {
    border-color: rgba(143, 63, 43, 0.42);
    background: #fff7ec;
    box-shadow: 0 10px 22px rgba(75, 45, 28, 0.12);
}

.mobile-admin-menu summary:hover {
    transform: translateY(-1px);
}

.mobile-admin-menu summary::-webkit-details-marker {
    display: none;
}

.mobile-admin-menu summary span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--primary-dark);
}

.mobile-admin-menu nav {
    display: none;
    gap: 7px;
}

.mobile-admin-menu[open] nav {
    display: grid;
    animation: menu-pop 180ms ease-out both;
}

.mobile-admin-menu a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(230, 222, 210, 0.95);
    border-radius: 10px;
    background: rgba(255, 250, 242, 0.86);
    color: var(--primary-dark);
    font-weight: 900;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 5px 12px rgba(75, 45, 28, 0.05);
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mobile-admin-menu[open] a {
    animation: menu-item-in 180ms ease-out both;
}

.mobile-admin-menu[open] a:nth-child(2) {
    animation-delay: 35ms;
}

.mobile-admin-menu[open] a:nth-child(3) {
    animation-delay: 70ms;
}

.mobile-admin-menu a:hover,
.mobile-admin-menu a:focus-visible {
    color: #fff;
    background: #7f3523;
    border-color: #7f3523;
    box-shadow: 0 8px 18px rgba(127, 53, 35, 0.22);
    transform: translateY(-1px);
    outline: 0;
}

.mobile-admin-menu a.active {
    color: #fff;
    background: #7f3523;
    border-color: #7f3523;
    box-shadow: 0 8px 18px rgba(127, 53, 35, 0.22);
}

.lookup-shell {
    width: min(560px, 100%);
    margin: 0 auto;
    padding: 20px 14px 40px;
}

.lookup-panel,
.lookup-hero {
    display: grid;
    gap: var(--space-5);
    padding: clamp(20px, 4vw, 32px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.lookup-panel::before,
.lookup-hero::before,
.lookup-hero::after {
    display: none;
}

.lookup-intro,
.hero-copy {
    text-align: left;
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    text-transform: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    color: var(--navy);
    font-family: var(--font-display);
    font-size: clamp(26px, 5vw, 34px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.lede,
.hero-copy p:last-child,
.lookup-intro .lede {
    color: var(--muted);
    width: 100%;
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 500;
}

.lookup-form {
    background: transparent;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    animation: none;
    position: relative;
    z-index: 1;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
    color: var(--navy);
    min-width: 0;
    font-size: 14px;
}

input,
select,
button,
input[type="submit"],
input[type="button"] {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line-strong);
    padding: 0 14px;
    font: inherit;
    border-radius: 10px;
    max-width: 100%;
    min-width: 0;
}

input,
select {
    background: #fff;
    color: var(--ink);
}

input:focus,
select:focus,
input:focus-visible,
select:focus-visible {
    border-color: var(--primary);
    box-shadow: var(--focus);
    outline: 0;
}

button,
input[type="submit"],
input[type="button"] {
    background: var(--primary);
    color: #fff;
    border: 0;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, box-shadow 140ms ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: var(--primary-dark);
    box-shadow: none;
    transform: none;
}

button:disabled,
input[type="submit"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lookup-control {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 0;
}

.lookup-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 14px;
    align-items: center;
    margin-top: 4px;
}

.lookup-actions button,
.lookup-actions input[type="submit"] {
    width: auto;
    flex: 1 1 auto;
    min-height: 48px;
    box-shadow: none;
    animation: none;
}

.lookup-actions > button:first-child:last-child,
.lookup-actions > input[type="submit"]:first-child:last-child {
    flex: 1 1 100%;
}

.turnstile-wrap {
    margin-top: 0;
    min-height: 0;
    overflow: visible;
}

.lookup-message {
    display: block;
    margin-top: 14px;
    margin-bottom: 0;
}

.bot-note {
    margin: 12px 0 0;
    font-size: 13px;
}

.lookup-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: clamp(8px, 2vw, 20px);
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 20, 24, 0.72);
    backdrop-filter: blur(2px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(920px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    overflow: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    font-size: 24px;
    line-height: 1;
}

.modal-close:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.result-card {
    margin: 0 auto;
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: clamp(14px, 2vw, 20px);
    border-radius: var(--radius-lg);
    animation: rise-in 280ms ease-out both;
}

.result-card.result-layout.is-ok {
    border-color: #9fd0b3;
}

.result-head {
    text-align: left;
    background: transparent;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.result-head img {
    width: 72px;
    height: 38px;
    object-fit: contain;
}

.result-head h2 {
    margin: 6px 0 0;
    color: var(--navy);
    font-size: clamp(18px, 2.2vw, 22px);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: #f8f9fb;
    margin: 10px 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    text-align: left;
}

.info-grid div,
.transfer-info {
    display: grid;
    gap: 4px;
}

.info-grid div {
    padding: 7px 9px;
    background: #fff;
    border-bottom: 1px solid #eef0f5;
}

.info-grid div:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.info-grid div:nth-child(odd) {
    border-right: 1px solid #eef0f5;
}

.info-grid div:nth-child(even) {
    min-width: 148px;
}

.info-grid span,
.transfer-info span,
.muted {
    color: var(--muted);
}

.info-grid span {
    font-size: 14px;
}

.info-grid strong {
    color: var(--navy);
    font-size: clamp(15px, 1.8vw, 18px);
    line-height: 1.1;
    overflow-wrap: normal;
    word-break: normal;
    text-wrap: balance;
}

.student-name {
    font-size: inherit;
    letter-spacing: 0;
}

.amount-due {
    display: grid;
    gap: 5px;
    width: min(280px, 100%);
    margin: 9px auto 0;
    padding: 7px 10px;
    border: 1px solid #bfe6c9;
    border-radius: 14px;
    background: #f1fff5;
    text-align: center;
}

.amount-due span {
    color: #44805a;
    font-weight: 800;
}

.amount-due strong {
    color: #16733a;
    font-size: 20px;
}

.qr-block {
    text-align: center;
    padding-top: 8px;
}

.qr-block h3 {
    color: var(--navy);
    font-size: 18px;
    margin-bottom: 4px;
}

.qr-block p {
    color: var(--muted);
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.25;
}

.qr-image {
    width: min(240px, 70vw);
    aspect-ratio: 1;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    background: #fff;
    box-shadow: none;
    animation: none;
    -webkit-touch-callout: none;
    user-select: none;
    pointer-events: none;
}

.transfer-info {
    width: min(520px, 100%);
    margin: 12px auto 0;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.bank-warning,
.notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    line-height: 1.45;
}

.bank-warning {
    display: block;
    background: #fffbea;
    border: 1px solid #f1dd69;
    border-radius: 16px;
    font-size: 12.5px;
    line-height: 1.34;
}

.warning-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    margin-right: 7px;
    vertical-align: -5px;
    color: #b78100;
}

.warning-icon svg {
    width: 100%;
    height: 100%;
}

.warning-icon svg path:first-child {
    fill: #f6c343;
    stroke: #b78100;
    stroke-width: 1.6;
}

.warning-icon svg path:not(:first-child) {
    fill: none;
    stroke: #4c3500;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.notice.error,
.flash-error {
    background: #fff1f0;
    color: var(--danger);
    border: 1px solid #ffccc7;
}

.notice.warn {
    background: var(--warn-bg);
    border: 1px solid #f3dd7b;
}

.flash,
.shell,
.admin-shell {
    width: min(1320px, calc(100% - 28px));
    margin: 18px auto;
}

.flash {
    padding: 12px 14px;
    border-radius: 10px;
}

.flash-success {
    background: #fff4e5;
    color: var(--primary-dark);
    border: 1px solid #edcf9d;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--soft-shadow);
}

.narrow {
    max-width: 460px;
}

.login-shell {
    width: min(520px, calc(100% - 32px));
    min-height: calc(100vh - 96px);
    margin: 0 auto;
    display: grid;
    align-items: center;
    padding: 34px 0 64px;
}

.login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: clamp(24px, 4vw, 36px);
    animation: rise-in 280ms ease-out both;
}

.login-brand {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-bottom: 22px;
    text-align: center;
}

.login-brand img {
    width: 180px;
    height: 96px;
    object-fit: contain;
}

.login-brand h1 {
    margin: 0;
    font-size: clamp(24px, 4vw, 30px);
    line-height: 1.2;
}

.login-form {
    gap: 16px;
}

.remember-login {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: var(--primary-dark);
    font-weight: 800;
    cursor: pointer;
}

.remember-login input {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    accent-color: var(--primary);
}

.login-form button,
.login-form input[type="submit"] {
    min-height: 54px;
    font-size: 18px;
}

.stack-form {
    display: grid;
    gap: 14px;
}

.admin-shell {
    padding-bottom: 48px;
}

.admin-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    padding: 20px 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--soft-shadow);
}

.admin-hero h1 {
    margin-bottom: 6px;
    font-size: clamp(24px, 3.5vw, 32px);
}

.admin-subnav {
    position: sticky;
    top: 90px;
    z-index: 8;
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    padding: 8px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--soft-shadow);
    backdrop-filter: blur(8px);
}

.admin-subnav a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--primary-dark);
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 700;
}

.admin-subnav a:hover {
    background: var(--primary-soft);
}

.admin-status,
.metric-card {
    display: grid;
    gap: 8px;
}

.admin-status {
    min-width: 170px;
    justify-items: end;
}

.admin-status span,
.metric-card span {
    color: var(--muted);
    font-weight: 700;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: none;
}

.metric-card strong {
    color: var(--navy);
    font-size: 24px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.admin-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--soft-shadow);
    overflow-x: auto;
}

.compact-batch-card {
    padding: 18px;
    overflow: visible;
    scroll-margin-top: 160px;
}

.span-4 {
    grid-column: span 4;
}

.span-5 {
    grid-column: span 5;
}

.span-6 {
    grid-column: span 6;
}

.span-7 {
    grid-column: span 7;
}

.span-8 {
    grid-column: span 8;
}

.span-12 {
    grid-column: span 12;
}

.card-head {
    margin-bottom: 16px;
}

.card-head h2 {
    color: var(--navy);
    margin-bottom: 6px;
}

.card-head p {
    color: var(--muted);
    margin-bottom: 0;
    line-height: 1.45;
}

.batch-form {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.batch-form label {
    min-width: 0;
    overflow: hidden;
}

.batch-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 4px;
}

.batch-form-head h2 {
    margin-bottom: 4px;
    color: var(--navy);
}

.batch-form-head p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.45;
}

.status-toggle {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    max-width: 100%;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.status-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.status-toggle span {
    position: relative;
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: #e6ded2;
    transition: background 160ms ease;
}

.status-toggle span::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(31, 36, 48, 0.22);
    transition: transform 160ms ease;
}

.status-toggle input[type="checkbox"]:checked + span {
    background: #20a34a;
}

.status-toggle input[type="checkbox"]:checked + span::after {
    transform: translateX(24px);
}

.status-toggle strong {
    color: var(--navy);
    font-size: 14px;
    white-space: nowrap;
}

.status-toggle b {
    font-weight: 900;
}

.status-toggle .toggle-on {
    display: none;
    color: #22623c;
}

.status-toggle .toggle-off {
    display: inline;
    color: var(--danger);
}

.status-toggle input[type="checkbox"]:checked ~ strong .toggle-on {
    display: inline;
}

.status-toggle input[type="checkbox"]:checked ~ strong .toggle-off {
    display: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    min-width: 0;
}

.batch-form input[name="exam_date"],
.batch-form input[name="payment_deadline"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-size: 15px;
    line-height: 1.2;
    display: block;
}

.date-field {
    position: relative;
    display: block;
    width: 100%;
}

.date-field .date-mask {
    padding-right: 54px;
}

.date-picker-control {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
}

.date-picker-button {
    display: grid;
    place-items: center;
    width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 0;
    color: var(--primary-dark);
    background: #fffaf2;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    pointer-events: none;
}

.date-picker-button svg {
    width: 20px;
    height: 20px;
}

.date-picker-button rect,
.date-picker-button path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.date-native {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.date-picker-control:hover .date-picker-button,
.date-picker-control:focus-within .date-picker-button {
    border-color: rgba(143, 63, 43, 0.42);
    background: #fff7ec;
    box-shadow: 0 0 0 3px rgba(143, 63, 43, 0.1);
}

.upload-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.upload-card button,
.upload-card input[type="submit"] {
    min-height: 52px;
}

.form-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.form-actions.action-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    grid-template-columns: none;
}

.form-actions.action-bar > button[type="submit"] {
    width: 100%;
    min-height: 48px;
}

.action-bar-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.action-bar-secondary .ghost-button {
    width: 100%;
    min-height: 44px;
    white-space: nowrap;
    padding: 0 12px;
}

.ghost-button,
.button-like {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.ghost-button {
    padding: 0 18px;
    border: 1px solid var(--line);
    color: var(--primary-dark);
    background: #fffaf2;
}

.button-like {
    min-width: 96px;
    padding: 0 14px;
    background: var(--primary);
    color: #fff;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button-like:hover {
    background: var(--primary-dark);
    box-shadow: 0 10px 20px rgba(100, 41, 24, 0.18);
    transform: translateY(-1px);
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.inline-import {
    display: inline-grid;
    position: relative;
}

.import-guide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.import-guide div {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfd;
}

.import-guide strong {
    color: var(--navy);
    font-size: 18px;
}

.import-guide span {
    color: var(--muted);
    line-height: 1.45;
}

.status-list {
    display: grid;
    gap: 12px;
}

.status-list p {
    margin-bottom: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f3eee7;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.status-published,
.status-imported {
    background: #eaf6ee;
    color: #22623c;
}

.status-draft {
    background: #fff4e3;
    color: #8b5b14;
}

.status-closed,
.status-failed {
    background: #fff1f0;
    color: var(--danger);
}

.jobs-table td:last-child {
    max-width: 300px;
    color: var(--danger);
}

.batch-table td:first-child {
    min-width: 260px;
}

.batch-list-card {
    overflow: visible;
    padding: 24px;
    scroll-margin-top: 160px;
}

.batch-list-card .wide-table {
    min-width: 1040px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.row-actions.table-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
}

.row-actions.table-actions .action-button,
.row-actions.table-actions .ghost-button {
    width: auto;
    min-width: 0;
    justify-content: center;
    text-align: center;
}

.row-actions.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.row-actions form {
    margin: 0;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffaf2;
    color: var(--primary-dark);
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: none;
}

.action-button:hover {
    background: #f7eadc;
    transform: none;
    box-shadow: none;
}

.action-danger {
    color: var(--danger);
    border-color: #ffd4cf;
    background: #fff8f7;
}

.action-danger:hover {
    background: #fff1f0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td,
th {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    font-size: 13px;
    background: #f6f8f8;
}

.wide-table {
    min-width: 900px;
}

@media (max-width: 1100px) {
    .batch-list-card {
        overflow: visible;
        padding: 14px;
    }

    .batch-list-card .wide-table,
    .batch-table,
    .batch-table tbody,
    .batch-table tr,
    .batch-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .batch-table thead {
        display: none;
    }

    .batch-table tr {
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
        box-shadow: var(--soft-shadow);
    }

    .batch-table tr:last-child {
        margin-bottom: 0;
    }

    .batch-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 0;
        border-bottom: 1px solid #efe8dc;
        text-align: right;
    }

    .batch-table td:first-child {
        min-width: 0;
    }

    .batch-table td:last-child {
        border-bottom: 0;
    }

    .batch-table td::before {
        content: attr(data-label);
        flex: 0 0 124px;
        color: var(--muted);
        font-weight: 800;
        text-align: left;
    }

    .batch-table td[data-label="KhÃ³a thi"] {
        align-items: flex-start;
    }

    .batch-table td[data-label="KhÃ³a thi"] strong {
        max-width: calc(100% - 136px);
        overflow-wrap: anywhere;
    }

    .batch-table td[data-label="Chá»©c nÄƒng"],
    .batch-table td[data-label="Thao tÃ¡c"] {
        display: grid;
        grid-template-columns: 124px 1fr;
        align-items: center;
        text-align: left;
    }

    .batch-table td[data-label="Chá»©c nÄƒng"]::before,
    .batch-table td[data-label="Thao tÃ¡c"]::before {
        align-self: center;
    }

    .inline-import,
    .button-like,
    .row-actions:not(.table-actions),
    .row-actions:not(.table-actions) form,
    .action-button {
        width: 100%;
    }

    .row-actions:not(.table-actions) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .row-actions.table-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1180px) {
    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding: 10px 14px;
    }

    .brand span {
        max-width: calc(100vw - 170px);
        font-size: 13px;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .brand img {
        width: 98px;
        height: 54px;
    }

    .topbar .header-admin-nav {
        display: none;
    }

    .topbar .mobile-admin-menu {
        position: relative;
        display: block;
        justify-self: end;
    }

    .topbar .mobile-admin-menu nav {
        position: absolute;
        display: none;
        top: calc(100% + 8px);
        right: 0;
        width: min(210px, calc(100vw - 24px));
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        z-index: 30;
        transform-origin: top right;
    }

    .topbar .mobile-admin-menu a {
        font-size: 14px;
    }

    .topbar .mobile-admin-menu[open] nav {
        display: grid;
    }
}

@media (max-width: 760px) {
    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding: 10px 12px;
    }

    .brand span {
        display: none;
    }

    .brand img {
        width: 92px;
        height: 50px;
    }

    .user-topbar {
        display: flex;
        justify-content: center;
        padding: 6px 12px;
    }

    .user-topbar .brand {
        margin: 0 auto;
        justify-content: center;
    }

    .user-page {
        min-height: 100svh;
        overflow-y: hidden;
    }

    .user-page .brand img {
        width: 86px;
        height: 46px;
    }

    .topbar .header-admin-nav {
        display: none;
    }

    .topbar .mobile-admin-menu {
        position: relative;
        display: block;
        justify-self: end;
    }

    .topbar .mobile-admin-menu nav {
        position: absolute;
        display: none;
        top: calc(100% + 8px);
        right: 0;
        width: min(210px, calc(100vw - 24px));
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        z-index: 30;
        transform-origin: top right;
    }

    .topbar .mobile-admin-menu a {
        font-size: 14px;
    }

    .topbar .mobile-admin-menu[open] nav {
        display: grid;
    }

    .lookup-hero,
    .grid-two,
    .admin-header,
    .upload-form,
    .admin-hero,
    .metric-grid,
    .batch-form-head,
    .form-row,
    .form-actions,
    .import-guide {
        grid-template-columns: 1fr;
    }

    .lookup-shell {
        padding: 8px 10px 10px;
    }

    .user-page .lookup-shell {
        display: grid;
        align-items: start;
        height: calc(100svh - 58px);
        overflow: hidden;
    }

    @supports (height: 100dvh) {
        .user-page .lookup-shell {
            height: calc(100dvh - 58px);
        }
    }

    .lookup-hero {
        gap: 12px;
        padding: 18px 12px;
        border-radius: 18px;
    }

    .lookup-hero::before {
        right: -120px;
        top: -120px;
    }

    .lookup-hero::after {
        left: -120px;
        bottom: -120px;
    }

    .hero-copy p:last-child {
        font-size: 15px;
        line-height: 1.35;
    }

    .lookup-form {
        padding: 15px;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8,
    .span-12 {
        grid-column: auto;
    }

    .admin-status {
        justify-items: start;
    }

    .lookup-control {
        grid-template-columns: 1fr;
    }

    .lookup-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-top: 10px;
    }

    .lookup-actions button,
    .lookup-actions input[type="submit"] {
        order: 0;
        width: 100%;
    }

    .turnstile-wrap {
        order: 0;
        justify-self: start;
        max-width: none;
        overflow: visible;
    }

    h1 {
        font-size: 33px;
        margin-bottom: 10px;
    }

    .info-grid {
        grid-template-columns: minmax(0, 1fr) minmax(122px, max-content);
    }

    .info-grid div {
        padding: 7px 7px;
    }

    .info-grid strong {
        font-size: clamp(14px, 3.9vw, 17px);
    }

    .student-name {
        font-size: inherit;
    }

    .result-head {
        padding: 8px 7px;
    }

    .result-head h2 {
        font-size: clamp(20px, 5.8vw, 23px);
    }

    .modal-panel {
        width: min(430px, calc(100vw - 14px));
        max-height: calc(100vh - 12px);
        max-height: calc(100dvh - 12px);
    }

    .modal-close {
        top: 6px;
        right: 6px;
        width: 34px;
        height: 34px;
    }

    .amount-due {
        margin-top: 9px;
        padding: 7px 10px;
    }

    .amount-due strong {
        font-size: 19px;
    }

    .qr-block {
        padding-top: 10px;
    }

    .qr-block h3 {
        font-size: 19px;
    }

    .qr-block p {
        font-size: 12px;
    }

    .qr-image {
        width: min(178px, 58vw);
    }

    .compact-batch-card,
    .admin-card {
        overflow-x: hidden;
    }

    .batch-form-head {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .status-toggle {
        justify-self: start;
        width: max-content;
        min-width: 0;
    }

    .status-toggle span {
        flex: 0 0 54px;
    }

    .batch-form input[name="exam_date"],
    .batch-form input[name="payment_deadline"] {
        font-size: 14px;
        padding-left: 10px;
        padding-right: 50px;
    }

    .bank-warning {
        font-size: 12px;
        padding: 8px 9px;
    }

    .metric-grid {
        display: none;
    }

    .login-shell {
        min-height: auto;
        padding-top: 28px;
    }

    .panel {
        overflow-x: auto;
    }
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-soft {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.012);
    }
}

@keyframes cta-breathe {
    0%,
    100% {
        box-shadow: 0 12px 24px rgba(143, 63, 43, 0.18);
    }
    50% {
        box-shadow: 0 16px 30px rgba(143, 63, 43, 0.26);
    }
}

@keyframes menu-pop {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes menu-item-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}

/* Lookup multi-step + admin fee stages */
.user-page h1,
.user-page .brand span,
.result-card h2,
.amount-due strong {
    font-family: var(--font-display);
}

.lookup-form-steps {
    display: grid;
    gap: 16px;
    width: min(560px, 100%);
}

.lookup-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0;
    padding: 0;
}

.lookup-steps li {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    padding: 10px 8px;
    border-radius: 10px;
    background: #f5f6f8;
    border: 1px solid transparent;
}

.lookup-steps .step-num {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #e7eaee;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.lookup-steps li.is-active {
    color: var(--primary-dark);
    background: var(--primary-soft);
    border-color: #e8cfc6;
}

.lookup-steps li.is-active .step-num {
    background: var(--primary);
    color: #fff;
}

.lookup-steps li.is-done {
    color: var(--success);
    background: var(--success-soft);
    border-color: #b7e4c7;
}

.lookup-steps li.is-done .step-num {
    background: var(--success);
    color: #fff;
}

.field-stack {
    display: grid;
    gap: 6px;
}

.field-stack > label {
    display: block;
    margin: 0;
    font-weight: 700;
    color: var(--navy);
}

.field-hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
}

.batch-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f5f6f8;
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.lookup-select,
.lookup-control input {
    min-height: 52px;
    font-size: 16px;
}

.lookup-submit {
    background: var(--primary);
    color: #fff;
    border: 0;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 22px rgba(139, 58, 40, 0.28);
}

.lookup-submit:hover {
    filter: brightness(1.04);
}

.lookup-submit:disabled {
    opacity: 0.55;
    box-shadow: none;
}

.result-stage {
    margin: -4px 0 14px;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 14px;
}

.stage-manager {
    margin-bottom: 18px;
}

.stage-manager-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.stage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.stage-manager-note {
    margin: 0 0 4px;
    font-size: 13px;
}

.stage-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    padding: 16px;
    display: grid;
    gap: 14px;
    box-shadow: var(--soft-shadow);
}

.stage-card.is-open {
    border-color: #cfe6d8;
    box-shadow: 0 0 0 1px rgba(15, 122, 69, 0.08), var(--soft-shadow);
}

.stage-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.stage-card-head h3 {
    margin: 0 0 4px;
    font-size: 16px;
    line-height: 1.35;
    color: var(--navy);
}

.stage-hint {
    margin: 0 0 4px;
    font-size: 12px;
}

.stage-visibility {
    margin: 0;
    font-size: 12px;
}

.stage-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stage-metrics div {
    background: #f5f6f8;
    border-radius: 12px;
    padding: 10px 12px;
}

.stage-metrics span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.stage-metrics strong {
    font-size: 22px;
    color: var(--navy);
}

.stage-form {
    display: grid;
    gap: 12px;
}

.stage-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
}

.stage-actions .action-danger {
    grid-column: 1 / -1;
}

.stage-actions button,
.stage-actions .button-like {
    width: 100%;
    min-width: 0;
    min-height: 42px;
}

.import-report-notice {
    margin-top: 10px;
}

.import-report-notice a {
    font-weight: 800;
}

.field-stack.is-hidden,
.lookup-actions.is-hidden {
    display: none !important;
}

.lookup-steps li.is-done {
    color: #166534;
    background: #e8f7ee;
    border-color: #b7e4c7;
}

.batch-code-line {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.import-preview-card {
    border: 2px solid #d97706;
    margin-bottom: 18px;
}

.import-preview-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.import-preview-metrics div {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fffaf2;
}

.import-preview-metrics span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.import-preview-metrics strong {
    font-size: 18px;
    color: var(--navy);
}

.status-ok {
    color: #166534 !important;
}

.status-warn {
    color: #b45309 !important;
}

body.modal-open {
    overflow: hidden;
}

.result-card.result-layout {
    padding: clamp(12px, 1.6vw, 18px);
}

.result-status {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.result-layout.is-ok .result-status {
    color: #166534;
    background: #e8f7ee;
    border: 1px solid #b7e4c7;
}

.result-layout.is-expired {
    border-color: #d97706;
}

.result-layout.is-expired .result-status {
    color: #92400e;
    background: #fff7ed;
    border: 1px solid #fdba74;
}

.result-split {
    display: grid;
    gap: 16px;
}

.qr-pane {
    text-align: center;
}

.qr-pane h2 {
    margin: 0 0 10px;
    color: var(--navy);
    font-size: clamp(18px, 2vw, 22px);
}

.qr-pane .qr-image {
    width: min(260px, 72vw);
}

.qr-pane .amount-due {
    margin-top: 12px;
}

.info-pane .result-head {
    text-align: left;
    margin-bottom: 10px;
}

.info-pane .result-stage {
    margin: 4px 0 0;
    font-weight: 700;
    color: var(--primary-dark);
}

.info-grid-stack {
    grid-template-columns: 1fr;
}

.info-grid-stack div {
    border-right: 0 !important;
    border-bottom: 1px solid #eef0f5;
}

.info-grid-stack div:last-child {
    border-bottom: 0;
}

@media (min-width: 900px) {
    .modal-panel {
        width: min(920px, calc(100vw - 32px));
    }

    .result-split {
        grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.05fr);
        align-items: start;
        gap: 20px;
    }

    .qr-pane .qr-image {
        width: min(320px, 100%);
    }

    .info-pane .bank-warning {
        margin-top: 12px;
    }
}

@media (max-width: 1100px) {
    .stage-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .lookup-steps {
        grid-template-columns: 1fr;
    }

    .lookup-steps li {
        text-align: left;
        padding-left: 12px;
    }

    .stage-manager-head {
        flex-direction: column;
    }

    .action-bar-secondary {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== UI 2026 refresh overrides ===== */
.user-page .lookup-shell {
    height: auto !important;
    min-height: calc(100svh - 64px);
    overflow: visible !important;
    align-content: start;
    padding: 16px 14px 28px;
}

.lookup-live {
    margin-top: 8px;
}

.lookup-live .notice {
    margin-top: 0;
}

.amount-due {
    width: 100%;
    margin: 12px 0 0;
    padding: 12px 14px;
    border: 1px solid #c9e8d4;
    border-radius: 12px;
    background: var(--success-soft);
    text-align: left;
}

.amount-due span {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.amount-due strong {
    color: var(--success);
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.bank-warning {
    background: var(--warn-bg);
    border: 1px solid var(--warn-line);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    padding: 12px 14px;
}

.stage-card {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: none;
}

.stage-metrics div {
    background: #f5f6f8;
    border-radius: 10px;
}

.ghost-button {
    background: #fff;
    border-color: var(--line-strong);
    color: var(--navy);
    font-weight: 700;
}

.ghost-button:hover {
    background: #f5f6f8;
}

.action-button {
    background: #fff;
    border-color: var(--line-strong);
    color: var(--navy);
    font-weight: 700;
    border-radius: 8px;
    min-height: 40px;
}

.action-button:hover {
    background: #f5f6f8;
}

.action-danger {
    color: var(--danger);
    border-color: #f0c9c5;
    background: #fff8f7;
}

.status-pill {
    border-radius: 8px;
    text-transform: none;
    font-weight: 700;
    background: #f0f2f5;
    color: var(--muted);
}

.import-preview-metrics div {
    background: #f8f9fb;
}

.compact-batch-card .batch-form {
    display: grid;
    gap: 14px;
}

.admin-card .card-head h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.admin-card .card-head p {
    color: var(--muted);
    margin: 0;
}

.wide-table th {
    font-size: 12px;
    font-weight: 700;
    text-transform: none;
    color: var(--muted);
    background: #f5f6f8;
}

.notice.success {
    background: var(--success-soft);
    color: #166534;
    border: 1px solid #b7e4c7;
}

@media (max-width: 760px) {
    .lookup-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .info-grid:not(.info-grid-stack) {
        grid-template-columns: 1fr;
    }

    .info-grid:not(.info-grid-stack) div:nth-child(odd) {
        border-right: 0;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brand span {
        font-size: 13px;
    }
}

@media (min-width: 900px) {
    .user-page .lookup-shell {
        padding-top: 36px;
    }

    .qr-pane .qr-image {
        width: min(300px, 100%);
    }
}

/* final UI fixes */
.lookup-shell {
    width: min(520px, 100%);
    padding: 10px 12px 20px;
}

.lookup-panel,
.lookup-hero {
    gap: 16px;
    padding: 18px 18px 16px;
}

.lookup-intro,
.hero-copy {
    text-align: center;
}

.lookup-intro .eyebrow,
.hero-copy .eyebrow {
    margin-bottom: 4px;
    font-size: 12px;
}

.lookup-intro .lede,
.hero-copy .lede,
.hero-copy p:last-child {
    display: none;
}

.lookup-form-steps {
    gap: 12px;
}

.lookup-steps {
    gap: 6px;
}

.lookup-steps li {
    min-height: 48px;
    border-radius: 12px;
}

.lookup-steps li.is-active {
    color: var(--primary-dark);
    background: var(--primary-soft);
    border-color: #e3c8bf;
}

.lookup-steps li.is-done {
    color: var(--success);
    background: #edf7f1;
    border-color: #cfe6d8;
}

.lookup-steps li:not(.is-active):not(.is-done) {
    color: #7a828c;
    background: #f4f6f8;
    border-color: #edf0f3;
}

.lookup-select,
.lookup-control input {
    min-height: 46px;
    font-size: 15px;
}

.field-stack {
    gap: 6px;
}

.field-stack > label {
    font-size: 13px;
    font-weight: 700;
}

.lookup-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.lookup-actions .turnstile-wrap {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 0;
    overflow: visible;
    line-height: 0;
}

.lookup-actions .cf-turnstile,
.lookup-actions iframe {
    max-width: none;
}

.lookup-submit {
    flex: 1 1 auto;
    width: auto;
    min-width: 160px;
    min-height: 48px;
    height: 48px;
    font-size: 15px;
    margin: 0;
}

.lookup-live {
    margin-top: 0;
}

.lookup-select:disabled,
.lookup-control input:disabled,
.lookup-submit:disabled {
    opacity: 1;
    color: #929aa3;
    background: #f5f6f8;
    border-color: #e4e8ec;
    box-shadow: none;
    cursor: not-allowed;
}

.lookup-submit:disabled {
    background: #d7cbc7;
    color: #fff;
}

.action-bar-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-bar-secondary .ghost-button {
    min-height: 40px;
    white-space: nowrap;
}

.status-toggle {
    gap: 10px;
}

.compact-batch-card .batch-form {
    gap: 10px;
}

@media (max-width: 760px) {
    .lookup-shell {
        padding: 8px 10px 12px;
    }

    .lookup-panel,
    .lookup-hero {
        padding: 14px;
        gap: 14px;
    }

    .lookup-steps {
        grid-template-columns: repeat(3, 1fr);
    }

    .lookup-steps li {
        text-align: center;
        padding-left: 8px;
        min-height: 44px;
    }

    .lookup-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

/* neutralize legacy mobile cream chrome */
@media (max-width: 760px) {
    .lookup-panel,
    .lookup-hero {
        gap: 18px;
        padding: 16px;
        border-radius: var(--radius-lg);
    }

    .lookup-form {
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .hero-copy,
    .lookup-intro {
        text-align: left;
    }
}

/* import preview + result modal clarity */
.import-preview-card {
    border-color: #d6a24a;
}

.import-preview-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.import-preview-samples {
    margin: 8px 0 12px;
    line-height: 1.45;
}

.import-preview-link {
    margin: 0 0 14px;
}

.preview-actions {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 10px;
    align-items: stretch;
}

.preview-actions .preview-confirm,
.preview-actions .preview-cancel {
    width: 100%;
    min-height: 46px;
    margin: 0;
}

.preview-actions .preview-cancel {
    font-weight: 700;
}

.result-card.result-layout {
    display: grid;
    gap: 12px;
}

.result-status {
    justify-self: start;
}

.info-grid-stack {
    margin-top: 8px;
}

.info-grid-stack div {
    padding: 8px 10px;
}

.info-pane .result-stage {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
}

.amount-due span {
    display: block;
    line-height: 1.35;
    max-width: 28ch;
}

.bank-warning {
    margin-top: 12px;
}

.modal-close {
    width: 40px;
    height: 40px;
}

@media (max-width: 900px) {
    .import-preview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-actions {
        grid-template-columns: 1fr;
    }
}

/* result modal header centered + aligned columns */
.result-banner {
    text-align: center;
    padding: 4px 36px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}

.result-company {
    margin: 0 0 4px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.result-banner h2 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 800;
    line-height: 1.3;
}

.result-status {
    display: none !important;
}

.result-split {
    align-items: start;
}

.qr-pane,
.info-pane {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 0;
}

.qr-pane-title {
    margin: 0;
    text-align: center;
    color: var(--navy);
    font-size: 16px;
    font-weight: 700;
}

.qr-pane .qr-image {
    margin: 0 auto;
}

.qr-pane .amount-due {
    margin-top: 0;
}

.info-pane .result-head {
    display: none;
}

.info-grid-stack {
    margin-top: 0;
}

@media (min-width: 900px) {
    .result-split {
        align-items: stretch;
    }

    .qr-pane,
    .info-pane {
        height: 100%;
    }

    .info-pane {
        display: flex;
        flex-direction: column;
    }

    .info-pane .info-grid {
        flex: 1;
    }

    .info-pane .bank-warning {
        margin-top: auto;
    }
}

/* ===== Public lookup form: stable final layout ===== */
.user-page .lookup-panel {
    overflow: visible;
}

.user-page .lookup-form-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.user-page .field-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.user-page .field-stack > label {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.3;
}

.user-page .lookup-select,
.user-page .lookup-control,
.user-page .lookup-control input {
    width: 100%;
    margin: 0;
}

.user-page select.lookup-select,
.user-page .lookup-control input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    min-height: 48px;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background-color: #fff;
    background-image: none;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.3;
    box-shadow: none;
}

.user-page select.lookup-select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235f6770' d='M1.1 1.2l4.9 4.8 4.9-4.8 1.1 1.1-6 5.9L0 2.3z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
}

.user-page select.lookup-select:disabled,
.user-page .lookup-control input:disabled,
.user-page select.aspNetDisabled,
.user-page .lookup-control input.aspNetDisabled {
    background-color: #f5f6f8;
    color: #8a929b;
    border-color: #e4e8ec;
    cursor: not-allowed;
}

.user-page .lookup-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center !important;
    justify-content: flex-start;
    gap: 12px !important;
    margin-top: 4px;
    width: 100%;
}

.user-page .lookup-actions .turnstile-wrap {
    display: block;
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible !important;
    min-height: 0 !important;
    line-height: 0;
}

.user-page .lookup-actions .cf-turnstile,
.user-page .lookup-actions iframe {
    max-width: none !important;
    transform: none !important;
}

.user-page .lookup-actions .lookup-submit,
.user-page .lookup-actions input[type="submit"].lookup-submit {
    flex: 1 1 auto;
    width: auto !important;
    max-width: none !important;
    min-width: 140px !important;
    min-height: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    align-self: center;
    border: 0 !important;
    border-radius: 10px;
    background: var(--primary) !important;
    color: #fff !important;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(124, 52, 36, 0.18);
}

.user-page .lookup-actions .lookup-submit:hover:not(:disabled),
.user-page .lookup-actions input[type="submit"].lookup-submit:hover:not(:disabled) {
    background: var(--primary-dark) !important;
}

.user-page .lookup-actions .lookup-submit:disabled,
.user-page .lookup-actions input[type="submit"].lookup-submit:disabled {
    background: #9a7a72 !important;
    color: #fff !important;
    opacity: 1 !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .user-page .lookup-actions {
        flex-wrap: wrap;
    }

    .user-page .lookup-actions .lookup-submit,
    .user-page .lookup-actions input[type="submit"].lookup-submit {
        flex: 1 1 100%;
        width: 100% !important;
        min-width: 0 !important;
    }
}
