:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --success: #047857;
    --warning: #b45309;
    --radius: 18px;
    --shadow:
        0 18px 55px rgba(15, 23, 42, 0.09);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    background:
        radial-gradient(
            circle at 10% 0%,
            rgba(37, 99, 235, 0.10),
            transparent 32%
        ),
        var(--bg);
    font-family:
        "Be Vietnam Pro",
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

button,
.button {
    min-height: 46px;
    border: 0;
    border-radius: 13px;
    padding: 0 18px;
    font-weight: 750;
    cursor: pointer;
}

.button-primary,
button[type="submit"] {
    color: #fff;
    background: var(--primary);
}

.button-primary:hover,
button[type="submit"]:hover {
    background: var(--primary-hover);
}

.button-danger {
    color: #fff;
    background: var(--danger);
}

.button-secondary {
    color: var(--text);
    border: 1px solid var(--border);
    background: #fff;
}

.link-button {
    min-height: auto;
    padding: 0;
    color: inherit;
    background: transparent;
}

input,
select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    background: #fff;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.11);
}

label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 750;
}

.form-group {
    margin-bottom: 17px;
}

.app-header {
    position: sticky;
    z-index: 50;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding:
        10px
        max(16px, calc((100vw - 1280px) / 2));
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 900;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: white;
    background:
        linear-gradient(
            135deg,
            #2563eb,
            #7c3aed
        );
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-actions a {
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.header-actions form {
    margin: 0;
}

.page-shell {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding:
        28px
        max(16px, env(safe-area-inset-right))
        max(40px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card-body {
    padding: clamp(20px, 4vw, 32px);
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: calc(100dvh - 56px);
}

.auth-card {
    width: min(100%, 460px);
}

.auth-title {
    margin: 0 0 10px;
    font-size: clamp(28px, 7vw, 38px);
    letter-spacing: -0.04em;
}

.muted {
    color: var(--muted);
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 13px;
    line-height: 1.5;
}

.alert-error {
    color: #991b1b;
    border: 1px solid #fecaca;
    background: #fef2f2;
}

.alert-success {
    color: #065f46;
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-heading h1 {
    margin: 0 0 6px;
    font-size: clamp(26px, 5vw, 38px);
    letter-spacing: -0.04em;
}

.stat-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 22px;
}

.stat-value {
    margin-top: 8px;
    font-size: 29px;
    font-weight: 900;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 13px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-active {
    color: #047857;
    background: #d1fae5;
}

.status-locked {
    color: #b91c1c;
    background: #fee2e2;
}

.device-list {
    display: grid;
    gap: 14px;
}

.device-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
}

.device-card h3 {
    margin: 0 0 5px;
}

.device-meta {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-form input {
    min-width: 190px;
}

@media (max-width: 800px) {
    .stat-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .header-actions > a {
        display: none;
    }

    .page-heading {
        flex-direction: column;
    }

    .device-card {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-form input {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .page-shell {
        padding-top: 18px;
    }

    .card {
        border-radius: 16px;
    }

    th,
    td {
        padding: 12px 10px;
    }
}
.money-positive {
    color: #047857;
}

.money-negative {
    color: #b91c1c;
}

.wallet-layout {
    display: grid;
    grid-template-columns:
        minmax(320px, 420px)
        minmax(0, 1fr);
    gap: 24px;
    margin-top: 24px;
    align-items: start;
}

textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    background: #fff;
    resize: vertical;
    outline: none;
    font: inherit;
}

textarea:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.11);
}

.balance-preview {
    display: grid;
    gap: 10px;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.balance-preview > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.balance-preview span {
    color: var(--muted);
}

.balance-preview strong {
    font-size: 17px;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

@media (max-width: 980px) {
    .wallet-layout {
        grid-template-columns: 1fr;
    }
}
.pricing-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

@media (max-width: 680px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 21px;
}

.notification-bell:hover {
    background: var(--surface-soft);
}

.notification-count {
    position: absolute;
    top: -4px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.notification-list {
    display: grid;
    gap: 14px;
}

.notification-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fff;
}

.notification-unread {
    border-color: rgba(37, 99, 235, 0.38);
    box-shadow:
        0 7px 25px rgba(37, 99, 235, 0.08);
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--surface-soft);
    font-size: 20px;
    font-weight: 800;
}

.notification-success .notification-icon,
.notification-wallet .notification-icon {
    background: #ecfdf5;
    color: #047857;
}

.notification-warning .notification-icon {
    background: #fffbeb;
    color: #b45309;
}

.notification-error .notification-icon {
    background: #fef2f2;
    color: #b91c1c;
}

.notification-security .notification-icon {
    background: #f5f3ff;
    color: #6d28d9;
}

.notification-ocr .notification-icon,
.notification-info .notification-icon {
    background: #eff6ff;
    color: #1d4ed8;
}

.notification-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notification-heading h3 {
    margin: 0;
}

.notification-content p {
    white-space: pre-line;
    margin: 8px 0;
    line-height: 1.65;
}

.notification-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.notification-new,
.priority-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.notification-new {
    background: #dbeafe;
    color: #1d4ed8;
}

.priority-badge {
    background: #fef3c7;
    color: #92400e;
}

.notification-action {
    margin-top: 14px;
}

.notification-admin-card {
    max-width: 900px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 24px;
}

.empty-state {
    padding: 48px 20px;
    text-align: center;
}

select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    color: var(--text);
    background: #fff;
    outline: none;
    font: inherit;
}

select:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.11);
}

@media (max-width: 640px) {
    .notification-item {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 15px;
    }

    .notification-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        font-size: 17px;
    }
}
.ocr-fieldset {
    margin: 22px 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.ocr-fieldset legend {
    padding: 0 8px;
    font-weight: 700;
}

.ocr-field-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.ocr-field-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 13px;
    cursor: pointer;
}

.ocr-field-option:hover {
    background: var(--surface-soft);
}

.ocr-field-option input {
    width: 18px;
    height: 18px;
}

.batch-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-value-small {
    font-size: 20px;
}

.upload-panel {
    margin-top: 24px;
}

.upload-dropzone {
    display: flex;
    min-height: 180px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 25px;
    border: 2px dashed var(--border);
    border-radius: 18px;
    background: var(--surface-soft);
    cursor: pointer;
    text-align: center;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragging {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-selection {
    margin: 14px 0;
    font-weight: 600;
}

.upload-progress {
    height: 10px;
    margin: 14px 0;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 0.15s ease;
}

.upload-message {
    min-height: 24px;
    margin: 12px 0;
}

.upload-message.success {
    color: #047857;
}

.upload-message.error {
    color: #b91c1c;
}

.ocr-image-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.ocr-image-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.ocr-image-card > img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
    background: var(--surface-soft);
}

.ocr-image-info {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.ocr-image-info > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finalize-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-top: 28px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fff;
}

.button-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

@media (max-width: 1050px) {
    .ocr-image-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .batch-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .ocr-field-grid,
    .batch-summary-grid {
        grid-template-columns: 1fr;
    }

    .ocr-image-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .finalize-panel {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 460px) {
    .ocr-image-grid {
        grid-template-columns: 1fr;
    }
}
.ocr-processing-panel {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.ocr-processing-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.ocr-result {
    display: grid;
    gap: 9px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.ocr-result-row {
    display: grid;
    gap: 3px;
}

.ocr-result-row span {
    color: var(--muted);
    font-size: 12px;
}

.ocr-result-row strong {
    overflow-wrap: anywhere;
    font-size: 14px;
}

.ocr-confidence {
    padding-top: 7px;
    color: var(--muted);
    font-size: 13px;
}

.ocr-warnings {
    display: grid;
    gap: 5px;
    padding: 10px;
    border-radius: 10px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
}

.ocr-error-message {
    margin-top: 8px;
    padding: 9px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
}
.batch-export-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
}

.batch-export-actions form {
    margin: 0;
}

.ocr-review-form {
    display: grid;
    gap: 12px;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.ocr-review-field {
    margin: 0;
}

.ocr-review-field label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.ocr-review-field input,
.ocr-review-field textarea {
    width: 100%;
}

.ocr-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ocr-review-status {
    margin-top: 4px;
}

@media (max-width: 640px) {
    .batch-export-actions,
    .ocr-review-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .batch-export-actions a,
    .batch-export-actions button,
    .ocr-review-actions button {
        width: 100%;
        text-align: center;
    }
}

/* OCR batch detail improvements */
.ocr-image-preview {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--surface-soft);
}

.ocr-image-preview > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ocr-image-status-overlay,
.ocr-image-cost-overlay {
    position: absolute;
    z-index: 2;
    top: 10px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 7px 20px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(8px);
    font-size: 12px;
    font-weight: 800;
}

.ocr-image-status-overlay {
    left: 10px;
}

.ocr-image-cost-overlay {
    right: 10px;
    background: rgba(4, 120, 87, 0.92);
}

.ocr-image-status-ready {
    background: rgba(37, 99, 235, 0.90);
}

.ocr-image-status-processing,
.ocr-image-status-retry_wait {
    background: rgba(180, 83, 9, 0.92);
}

.ocr-image-status-completed {
    background: rgba(4, 120, 87, 0.92);
}

.ocr-image-status-failed,
.ocr-image-status-cancelled {
    background: rgba(185, 28, 28, 0.92);
}

.ocr-review-form button {
    min-width: 150px;
}

@media (max-width: 640px) {
    .ocr-image-status-overlay,
    .ocr-image-cost-overlay {
        top: 8px;
        min-height: 26px;
        padding: 0 8px;
        font-size: 11px;
    }

    .ocr-image-status-overlay {
        left: 8px;
    }

    .ocr-image-cost-overlay {
        right: 8px;
    }
}

/* OCR batch v4 */
.ocr-image-grid {
    grid-template-columns:
        repeat(auto-fit, minmax(320px, 1fr));
    align-items: start;
    gap: 22px;
}

.ocr-image-card {
    border-radius: 20px;
    box-shadow:
        0 16px 40px rgba(15, 23, 42, 0.08);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.ocr-image-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 22px 52px rgba(15, 23, 42, 0.12);
}

.ocr-image-info {
    gap: 12px;
    padding: 18px;
}

.ocr-image-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.ocr-review-form {
    gap: 14px;
}

.ocr-review-field input,
.ocr-review-field textarea {
    background: #fbfdff;
}

.ocr-review-actions {
    align-items: center;
}

.ocr-save-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.ocr-unsaved-indicator {
    color: var(--warning);
    font-size: 13px;
    font-weight: 700;
}

.batch-export-actions {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.06);
}

.batch-summary-grid .stat-card {
    min-height: 118px;
}

@media (max-width: 720px) {
    .ocr-image-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   TWI AI OCR UX v6
   Dashboard, header, batch list and batch creation.
   ========================================================================== */

:root {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --violet-600: #7c3aed;
    --success-50: #ecfdf5;
    --success-600: #059669;
    --warning-50: #fffbeb;
    --warning-600: #d97706;
    --danger-50: #fef2f2;
    --danger-600: #dc2626;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-600: #475569;
    --slate-900: #0f172a;
}

body {
    background:
        radial-gradient(
            circle at 8% 0%,
            rgba(37, 99, 235, 0.10),
            transparent 28%
        ),
        radial-gradient(
            circle at 94% 5%,
            rgba(124, 58, 237, 0.08),
            transparent 24%
        ),
        #f4f7fb;
}

svg {
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-bottom: 10px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--primary-700);
    background: var(--primary-50);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Header */
.app-header {
    min-height: 76px;
    padding: 0;
}

.app-header-inner {
    display: grid;
    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;
    align-items: center;
    gap: 26px;
    width: min(1360px, 100%);
    min-height: 76px;
    margin: 0 auto;
    padding:
        10px
        max(18px, env(safe-area-inset-right))
        10px
        max(18px, env(safe-area-inset-left));
}

.brand {
    flex: 0 0 auto;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    box-shadow:
        0 10px 24px rgba(37, 99, 235, 0.24);
}

.brand-copy {
    display: grid;
    gap: 1px;
}

.brand-copy strong {
    font-size: 15px;
    line-height: 1.2;
}

.brand-copy small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
}

.primary-navigation {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.primary-navigation > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 13px;
    border-radius: 12px;
    color: var(--slate-600);
    text-decoration: none;
    font-size: 13px;
    font-weight: 750;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

.primary-navigation > a:hover {
    color: var(--slate-900);
    background: var(--slate-100);
}

.primary-navigation .primary-ocr-link {
    gap: 9px;
    min-height: 46px;
    padding: 0 17px;
    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--primary-600),
            var(--violet-600)
        );
    box-shadow:
        0 10px 24px rgba(37, 99, 235, 0.20);
}

.primary-navigation .primary-ocr-link:hover {
    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--primary-700),
            #6d28d9
        );
    transform: translateY(-1px);
}

.primary-ocr-link svg,
.header-action-link svg,
.notification-bell svg,
.logout-button svg,
.button-with-icon svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.header-actions {
    gap: 6px;
}

.header-action-link,
.notification-bell,
.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 10px;
    border-radius: 12px;
    color: var(--slate-600);
    text-decoration: none;
    background: transparent;
    font-size: 13px;
    font-weight: 750;
}

.header-action-link:hover,
.notification-bell:hover,
.logout-button:hover {
    color: var(--slate-900);
    background: var(--slate-100);
}

.notification-bell {
    width: 42px;
    padding: 0;
}

.logout-form {
    margin: 0;
}

.logout-button {
    border: 0;
    cursor: pointer;
}

.page-shell {
    width: min(1320px, 100%);
    padding-top: clamp(24px, 4vw, 46px);
}

/* Shared button refinements */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.button-with-icon {
    gap: 9px;
}

.button-primary {
    box-shadow:
        0 10px 24px rgba(37, 99, 235, 0.20);
}

.button-secondary:hover {
    border-color: #cbd5e1;
    background: var(--slate-50);
}

/* Dashboard */
.dashboard-hero {
    position: relative;
    display: grid;
    grid-template-columns:
        minmax(0, 1.45fr)
        minmax(250px, 0.55fr);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
    overflow: hidden;
    min-height: 310px;
    padding: clamp(28px, 5vw, 58px);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 30px;
    color: var(--slate-900);
    background:
        radial-gradient(
            circle at 86% 20%,
            rgba(124, 58, 237, 0.15),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.98),
            rgba(239, 246, 255, 0.96)
        );
    box-shadow:
        0 28px 70px rgba(15, 23, 42, 0.10);
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(
            rgba(37, 99, 235, 0.04) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(37, 99, 235, 0.04) 1px,
            transparent 1px
        );
    background-size: 28px 28px;
    mask-image:
        linear-gradient(
            to right,
            transparent,
            #000 45%,
            #000
        );
}

.dashboard-hero-copy,
.dashboard-hero-visual {
    position: relative;
    z-index: 1;
}

.dashboard-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.dashboard-hero p {
    max-width: 660px;
    margin: 16px 0 0;
    color: var(--slate-600);
    font-size: clamp(15px, 1.8vw, 18px);
    line-height: 1.7;
}

.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.dashboard-hero-visual {
    display: grid;
    place-items: center;
}

.scan-frame {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 260px);
    aspect-ratio: 1;
    border-radius: 28px;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.92),
            rgba(219, 234, 254, 0.82)
        );
    box-shadow:
        0 24px 55px rgba(37, 99, 235, 0.18);
}

.scan-document {
    display: grid;
    align-content: center;
    gap: 12px;
    width: 62%;
    height: 72%;
    padding: 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow:
        0 16px 36px rgba(15, 23, 42, 0.13);
    transform: rotate(-4deg);
}

.scan-document span {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: #dbeafe;
}

.scan-document span:nth-child(2) {
    background: #c7d2fe;
}

.scan-document .short {
    width: 68%;
}

.scan-line {
    position: absolute;
    left: 18%;
    right: 18%;
    top: 28%;
    height: 3px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            transparent,
            #2563eb,
            transparent
        );
    box-shadow:
        0 0 18px rgba(37, 99, 235, 0.75);
    animation: twi-scan-line 2.8s ease-in-out infinite;
}

@keyframes twi-scan-line {
    0%,
    100% {
        top: 26%;
        opacity: 0.55;
    }

    50% {
        top: 72%;
        opacity: 1;
    }
}

.scan-corner {
    position: absolute;
    width: 34px;
    height: 34px;
    border-color: var(--primary-600);
    border-style: solid;
}

.scan-corner-tl {
    top: 18px;
    left: 18px;
    border-width: 3px 0 0 3px;
    border-radius: 10px 0 0 0;
}

.scan-corner-tr {
    top: 18px;
    right: 18px;
    border-width: 3px 3px 0 0;
    border-radius: 0 10px 0 0;
}

.scan-corner-bl {
    bottom: 18px;
    left: 18px;
    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 10px;
}

.scan-corner-br {
    right: 18px;
    bottom: 18px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 10px 0;
}

.dashboard-stat-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.dashboard-stat-card {
    position: relative;
    display: grid;
    grid-template-columns:
        48px minmax(0, 1fr);
    grid-template-areas:
        "icon label"
        "icon value"
        "icon hint";
    gap: 2px 14px;
    min-height: 145px;
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 22px;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 14px 35px rgba(15, 23, 42, 0.07);
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

a.dashboard-stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.30);
    box-shadow:
        0 20px 45px rgba(15, 23, 42, 0.11);
}

.dashboard-stat-icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    color: var(--primary-700);
    background: var(--primary-50);
}

.dashboard-stat-icon svg {
    width: 24px;
    height: 24px;
}

.dashboard-stat-icon-warning {
    color: var(--warning-600);
    background: var(--warning-50);
}

.dashboard-stat-icon-cost {
    color: #6d28d9;
    background: #f5f3ff;
}

.dashboard-stat-label {
    grid-area: label;
    color: var(--slate-600);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-stat-value {
    grid-area: value;
    overflow-wrap: anywhere;
    font-size: clamp(25px, 2.4vw, 34px);
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.dashboard-stat-card small {
    grid-area: hint;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.dashboard-section {
    margin-top: 34px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(23px, 3vw, 31px);
    letter-spacing: -0.035em;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--primary-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
}

.recent-batch-list {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.27);
    border-radius: 22px;
    background: #fff;
    box-shadow:
        0 18px 48px rgba(15, 23, 42, 0.07);
}

.recent-batch-item {
    display: grid;
    grid-template-columns:
        46px
        minmax(0, 1fr)
        auto
        auto
        22px;
    align-items: center;
    gap: 14px;
    min-height: 82px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
    transition: background 0.16s ease;
}

.recent-batch-item:last-child {
    border-bottom: 0;
}

.recent-batch-item:hover {
    background: #f8fbff;
}

.recent-batch-icon,
.batch-file-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: var(--primary-700);
    background: var(--primary-50);
}

.recent-batch-icon svg,
.batch-file-icon svg {
    width: 23px;
    height: 23px;
}

.recent-batch-content {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.recent-batch-content strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-batch-content small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-batch-progress {
    color: var(--slate-600);
    font-size: 13px;
    font-weight: 800;
}

.recent-batch-arrow {
    color: var(--muted);
    font-size: 18px;
}

.dashboard-empty-state {
    display: grid;
    place-items: center;
    padding: clamp(34px, 7vw, 70px) 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.78);
}

.dashboard-empty-icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 20px;
    color: var(--primary-700);
    background: var(--primary-50);
}

.dashboard-empty-icon svg {
    width: 34px;
    height: 34px;
}

.dashboard-empty-state h3,
.dashboard-empty-state h2 {
    margin: 18px 0 7px;
}

.dashboard-empty-state p {
    max-width: 520px;
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.6;
}

/* Batch status */
.batch-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    color: var(--slate-600);
    background: var(--slate-100);
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.batch-status-ready {
    color: #1d4ed8;
    background: #dbeafe;
}

.batch-status-processing,
.batch-status-retry_wait {
    color: #92400e;
    background: #fef3c7;
}

.batch-status-completed {
    color: #047857;
    background: #d1fae5;
}

.batch-status-partially_completed {
    color: #b45309;
    background: #ffedd5;
}

.batch-status-failed,
.batch-status-cancelled {
    color: #b91c1c;
    background: #fee2e2;
}

/* Batch list */
.batch-page-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.batch-page-hero h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.06;
    letter-spacing: -0.05em;
}

.batch-page-hero p {
    max-width: 720px;
    margin: 12px 0 0;
    color: var(--slate-600);
    line-height: 1.65;
}

.batch-list-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 24px;
    background: #fff;
    box-shadow:
        0 22px 58px rgba(15, 23, 42, 0.08);
}

.batch-list-table-wrap {
    overflow-x: auto;
}

.batch-list-table th {
    padding: 16px 18px;
    color: var(--slate-600);
    background: #f8fafc;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.batch-list-table td {
    padding: 16px 18px;
}

.batch-list-table tbody tr {
    transition: background 0.16s ease;
}

.batch-list-table tbody tr:hover {
    background: #f8fbff;
}

.batch-name-cell {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    min-width: 260px;
}

.batch-name-cell > span:last-child {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.batch-name-cell strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-name-cell small,
.batch-list-table time small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.batch-result-cell {
    display: grid;
    min-width: 110px;
    gap: 7px;
}

.batch-mini-progress {
    width: 88px;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.batch-mini-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            var(--primary-600),
            var(--violet-600)
        );
}

.batch-detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.batch-detail-button:hover {
    border-color: #bfdbfe;
    color: var(--primary-700);
    background: var(--primary-50);
}

.batch-empty-state {
    min-height: 410px;
}

/* Batch create */
.batch-create-hero {
    align-items: flex-start;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    color: var(--slate-600);
    text-decoration: none;
    font-size: 13px;
    font-weight: 750;
}

.back-link:hover {
    color: var(--primary-700);
}

.batch-create-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(280px, 350px);
    align-items: start;
    gap: 22px;
}

.batch-create-main,
.batch-create-aside {
    border-radius: 24px;
}

.batch-create-aside {
    position: sticky;
    top: 98px;
}

.form-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 20px;
}

.form-section-heading-fields {
    margin-top: 34px;
}

.form-section-heading h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.025em;
}

.form-section-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.form-step {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--primary-600),
            var(--violet-600)
        );
    font-size: 13px;
    font-weight: 900;
}

.batch-create-main input#title {
    min-height: 54px;
    font-size: 16px;
}

.batch-create-main .ocr-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.batch-create-main .ocr-field-grid {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.batch-create-main .ocr-field-option {
    position: relative;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: flex-start;
    gap: 12px;
    min-height: 94px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.batch-create-main .ocr-field-option:hover {
    transform: translateY(-1px);
    border-color: #bfdbfe;
    background: #f8fbff;
    box-shadow:
        0 10px 24px rgba(37, 99, 235, 0.08);
}

.batch-create-main .ocr-field-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ocr-field-check {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    color: transparent;
    background: #fff;
    transition:
        color 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.ocr-field-check svg {
    width: 16px;
    height: 16px;
}

.ocr-field-option input:checked
+ .ocr-field-check {
    border-color: var(--primary-600);
    color: #fff;
    background: var(--primary-600);
}

.ocr-field-option:has(input:checked) {
    border-color: rgba(37, 99, 235, 0.42);
    background: var(--primary-50);
    box-shadow:
        0 9px 24px rgba(37, 99, 235, 0.08);
}

.ocr-field-copy {
    display: grid;
    gap: 5px;
}

.ocr-field-copy strong {
    font-size: 14px;
}

.ocr-field-copy small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
}

.batch-create-summary-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    color: var(--primary-700);
    background: var(--primary-50);
}

.batch-create-summary-icon svg {
    width: 30px;
    height: 30px;
}

.batch-create-aside h2 {
    margin: 18px 0 8px;
}

.batch-create-aside p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.batch-create-checklist {
    display: grid;
    gap: 11px;
    margin: 22px 0;
    padding: 0;
    list-style: none;
}

.batch-create-checklist li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--slate-600);
    font-size: 13px;
    font-weight: 650;
}

.batch-create-checklist span {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    color: var(--success-600);
    background: var(--success-50);
    font-size: 12px;
    font-weight: 900;
}

.batch-create-submit {
    width: 100%;
    gap: 9px;
}

/* Tablet */
@media (max-width: 1050px) {
    .app-header-inner {
        gap: 14px;
    }

    .primary-navigation > a:not(
        .primary-ocr-link
    ) {
        display: none;
    }

    .dashboard-stat-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .batch-create-layout {
        grid-template-columns: 1fr;
    }

    .batch-create-aside {
        position: static;
    }
}

/* Mobile */
@media (max-width: 720px) {
    .app-header {
        min-height: 66px;
    }

    .app-header-inner {
        grid-template-columns:
            auto
            minmax(0, 1fr)
            auto;
        min-height: 66px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .brand-copy small {
        display: none;
    }

    .primary-navigation {
        justify-content: center;
    }

    .primary-navigation .primary-ocr-link {
        min-height: 42px;
        padding: 0 12px;
    }

    .primary-ocr-link span {
        display: inline;
    }

    .header-action-link {
        display: none;
    }

    .logout-button {
        width: 40px;
        min-height: 40px;
        padding: 0;
    }

    .logout-button span {
        display: none;
    }

    .notification-bell {
        width: 40px;
        height: 40px;
    }

    .page-shell {
        padding-top: 20px;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 24px;
        border-radius: 24px;
    }

    .dashboard-hero h1 {
        font-size: clamp(31px, 9vw, 43px);
    }

    .dashboard-hero-visual {
        display: none;
    }

    .dashboard-hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dashboard-hero-actions .button {
        width: 100%;
    }

    .dashboard-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-top: 16px;
    }

    .dashboard-stat-card {
        grid-template-columns: 38px minmax(0, 1fr);
        min-height: 126px;
        padding: 16px;
        border-radius: 18px;
    }

    .dashboard-stat-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .dashboard-stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .dashboard-stat-value {
        font-size: clamp(21px, 6vw, 28px);
    }

    .dashboard-stat-card small {
        display: none;
    }

    .recent-batch-item {
        grid-template-columns:
            42px
            minmax(0, 1fr)
            auto;
        gap: 11px;
        padding: 13px 14px;
    }

    .recent-batch-icon {
        width: 42px;
        height: 42px;
    }

    .recent-batch-progress,
    .recent-batch-arrow {
        display: none;
    }

    .recent-batch-item .batch-status-pill {
        grid-column: 3;
    }

    .batch-page-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .batch-page-hero > .button {
        width: 100%;
    }

    .batch-list-card {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .batch-list-table-wrap {
        overflow: visible;
    }

    .batch-list-table,
    .batch-list-table tbody,
    .batch-list-table tr,
    .batch-list-table td {
        display: block;
        width: 100%;
    }

    .batch-list-table thead {
        display: none;
    }

    .batch-list-table tbody {
        display: grid;
        gap: 14px;
    }

    .batch-list-table tbody tr {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 0;
        overflow: hidden;
        border: 1px solid rgba(148, 163, 184, 0.28);
        border-radius: 19px;
        background: #fff;
        box-shadow:
            0 13px 32px rgba(15, 23, 42, 0.07);
    }

    .batch-list-table td {
        padding: 12px 15px;
        border-bottom: 1px solid var(--border);
    }

    .batch-list-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 5px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .batch-list-table td:first-child {
        grid-column: 1 / -1;
        padding-top: 16px;
    }

    .batch-list-table td:nth-child(4) {
        border-right: 0;
    }

    .batch-name-cell {
        min-width: 0;
    }

    .batch-list-table td.batch-row-action {
        grid-column: 1 / -1;
        padding: 12px;
        border-bottom: 0;
    }

    .batch-row-action::before {
        display: none !important;
    }

    .batch-detail-button {
        width: 100%;
        min-height: 42px;
    }

    .batch-create-main .ocr-field-grid {
        grid-template-columns: 1fr;
    }

    .batch-create-main .ocr-field-option {
        min-height: 82px;
    }

    .batch-create-main .card-body,
    .batch-create-aside .card-body {
        padding: 20px;
    }
}

@media (max-width: 460px) {
    .app-header-inner {
        gap: 8px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .brand-copy {
        display: none;
    }

    .primary-navigation .primary-ocr-link {
        gap: 7px;
        padding: 0 10px;
        font-size: 12px;
    }

    .dashboard-stat-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stat-card {
        grid-template-columns: 44px minmax(0, 1fr);
        min-height: 112px;
    }

    .dashboard-stat-card small {
        display: block;
    }

    .section-heading {
        align-items: flex-start;
    }

    .section-link {
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scan-line {
        animation: none;
    }

    .dashboard-stat-card,
    .ocr-field-option,
    .primary-navigation > a {
        transition: none;
    }
}

/* UX v7: mobile navigation, batch filters and form helpers */
.mobile-navigation {
    display: none;
    position: relative;
}

.mobile-navigation summary {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    list-style: none;
}

.mobile-navigation summary::-webkit-details-marker { display: none; }
.mobile-navigation summary svg { width: 22px; height: 22px; }

.mobile-navigation-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: grid;
    width: min(310px, calc(100vw - 28px));
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .18);
}

.mobile-navigation-panel a,
.mobile-navigation-panel button {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 13px;
    border-radius: 11px;
    text-decoration: none;
    font-weight: 750;
}

.mobile-navigation-panel a:hover { background: var(--surface-soft); }
.mobile-navigation-panel .mobile-navigation-primary { color: #fff; background: var(--primary); }
.mobile-navigation-panel form { margin: 6px 0 0; padding-top: 8px; border-top: 1px solid var(--border); }
.mobile-navigation-panel form button { width: 100%; color: #b91c1c; background: #fef2f2; }

.batch-overview-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.batch-overview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 72px;
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,.82);
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(15,23,42,.05);
}

.batch-overview-card span { color: var(--muted); font-size: 13px; font-weight: 750; }
.batch-overview-card strong { font-size: 24px; }
.batch-overview-card:hover,
.batch-overview-card.is-active { border-color: rgba(37,99,235,.45); background: #eff6ff; }
.batch-overview-attention.is-active { border-color: #fdba74; background: #fff7ed; }

.batch-filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) auto auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15,23,42,.05);
}

.batch-search-field { position: relative; margin: 0; }
.batch-search-field svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); }
.batch-search-field input { padding-left: 43px; }
.batch-filter-reset { color: var(--muted); font-size: 14px; font-weight: 750; text-decoration: none; }
.batch-list-heading { display: flex; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.batch-list-heading strong { color: var(--text); }

.batch-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 20px;
}
.batch-pagination a,
.batch-pagination span {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
}
.batch-pagination .is-disabled { opacity: .45; }

.ocr-field-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
}
.ocr-field-toolbar > div { display: flex; flex-wrap: wrap; gap: 6px; }
.field-selection-button {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    background: #fff;
    font-size: 12px;
}
.ocr-field-option.is-selected { border-color: rgba(37,99,235,.5); background: #eff6ff; box-shadow: 0 0 0 3px rgba(37,99,235,.06); }

@media (max-width: 980px) {
    .primary-navigation,
    .header-actions { display: none; }
    .mobile-navigation { display: block; }
    .batch-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .batch-filter-bar { grid-template-columns: 1fr 200px auto; }
    .batch-filter-reset { grid-column: 1 / -1; padding: 4px 2px; }
}

@media (max-width: 680px) {
    .batch-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .batch-overview-card:first-child { grid-column: 1 / -1; }
    .batch-filter-bar { grid-template-columns: 1fr; }
    .batch-filter-bar button,
    .batch-filter-bar select { width: 100%; }
    .batch-pagination { gap: 8px; justify-content: space-between; }
    .batch-pagination a,
    .batch-pagination span { padding: 0 10px; font-size: 13px; }
    .ocr-field-toolbar { align-items: flex-start; flex-direction: column; }
}

/* ==========================================================================
   Login UX v8
   ========================================================================== */

.app-guest {
    overflow-x: hidden;
    background:
        radial-gradient(
            circle at 8% 0%,
            rgba(37, 99, 235, 0.14),
            transparent 30%
        ),
        radial-gradient(
            circle at 92% 100%,
            rgba(124, 58, 237, 0.13),
            transparent 34%
        ),
        #eef3f9;
}

.app-guest .page-shell {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
}

.login-page {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(18px, 3vw, 38px);
}

.login-shell {
    display: grid;
    grid-template-columns:
        minmax(0, 1.08fr)
        minmax(420px, 0.92fr);
    overflow: hidden;
    width: min(1160px, 100%);
    min-height: min(720px, calc(100dvh - 76px));
    margin: auto;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 34px 90px rgba(15, 23, 42, 0.16);
}

.login-visual {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    min-height: 100%;
    padding: clamp(34px, 5vw, 64px);
    color: #fff;
    background:
        linear-gradient(
            145deg,
            #0b1e45 0%,
            #173e8f 50%,
            #5b21b6 100%
        );
}

.login-visual::before {
    content: "";
    position: absolute;
    z-index: -2;
    inset: 0;
    opacity: 0.23;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.12) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.12) 1px,
            transparent 1px
        );
    background-size: 32px 32px;
    mask-image:
        linear-gradient(
            to bottom,
            #000,
            transparent 88%
        );
}

.login-visual-glow {
    position: absolute;
    z-index: -1;
    border-radius: 999px;
    filter: blur(1px);
}

.login-visual-glow-one {
    top: -110px;
    right: -80px;
    width: 320px;
    height: 320px;
    background: rgba(96, 165, 250, 0.35);
}

.login-visual-glow-two {
    bottom: -130px;
    left: -100px;
    width: 380px;
    height: 380px;
    background: rgba(196, 181, 253, 0.24);
}

.login-visual-content {
    display: flex;
    width: 100%;
    flex-direction: column;
    justify-content: space-between;
    gap: 42px;
}

.login-visual-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-visual-brand img {
    width: 58px;
    height: auto;
    object-fit: contain;
    filter:
        drop-shadow(
            0 12px 24px rgba(0, 0, 0, 0.22)
        );
}

.login-visual-brand div {
    display: grid;
    gap: 4px;
}

.login-visual-brand strong {
    font-size: 19px;
    letter-spacing: -0.02em;
}

.login-visual-brand span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 600;
}

.login-preview-card {
    position: relative;
    overflow: hidden;
    width: min(100%, 520px);
    margin: auto;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow:
        0 28px 65px rgba(4, 12, 30, 0.30);
    backdrop-filter: blur(18px);
}

.login-preview-topbar {
    display: flex;
    gap: 7px;
    padding: 15px 17px;
    border-bottom:
        1px solid rgba(255, 255, 255, 0.16);
}

.login-preview-topbar span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
}

.login-preview-body {
    display: grid;
    grid-template-columns:
        minmax(120px, 0.75fr)
        minmax(0, 1.25fr);
    gap: 18px;
    padding: clamp(22px, 4vw, 36px);
}

.login-preview-document {
    display: grid;
    align-content: center;
    gap: 13px;
    min-height: 230px;
    padding: 26px 22px;
    border-radius: 17px;
    background: #fff;
    box-shadow:
        0 18px 42px rgba(3, 12, 30, 0.22);
    transform: rotate(-3deg);
}

.login-preview-document span {
    height: 8px;
    border-radius: 999px;
    background: #dbeafe;
}

.login-preview-document span:nth-child(even) {
    background: #e9d5ff;
}

.login-preview-document .is-short {
    width: 63%;
}

.login-preview-result {
    display: grid;
    align-content: center;
    gap: 13px;
    min-width: 0;
}

.login-preview-result strong {
    max-width: 240px;
    font-size: clamp(18px, 2.3vw, 25px);
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.login-preview-badge {
    justify-self: start;
    padding: 5px 10px;
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.14);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.login-preview-line {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.login-preview-line.is-short {
    width: 67%;
}

.login-preview-scan {
    position: absolute;
    z-index: 3;
    left: 7%;
    right: 7%;
    top: 34%;
    height: 3px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            transparent,
            #7dd3fc,
            #fff,
            #7dd3fc,
            transparent
        );
    box-shadow:
        0 0 24px rgba(125, 211, 252, 0.95);
    animation:
        login-scan 3.2s ease-in-out infinite;
}

@keyframes login-scan {
    0%,
    100% {
        top: 28%;
        opacity: 0.55;
    }

    50% {
        top: 74%;
        opacity: 1;
    }
}

.login-form-panel {
    display: grid;
    place-items: center;
    padding: clamp(30px, 5vw, 72px);
    background:
        radial-gradient(
            circle at 100% 0%,
            rgba(219, 234, 254, 0.72),
            transparent 32%
        ),
        #fff;
}

.login-form-inner {
    width: min(100%, 420px);
}

.login-mobile-logo {
    display: none;
}

.login-heading {
    margin-bottom: 28px;
}

.login-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    margin-bottom: 13px;
    padding: 0 11px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.login-heading h1 {
    margin: 0;
    font-size: clamp(35px, 5vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

.login-heading p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.login-alert svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.login-form {
    display: grid;
    gap: 19px;
}

.login-form .form-group {
    margin: 0;
}

.login-field label {
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap > svg {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 16px;
    width: 21px;
    height: 21px;
    color: #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
}

.login-input-wrap input {
    min-height: 56px;
    padding-left: 49px;
    padding-right: 15px;
    border-color: #dbe3ee;
    border-radius: 15px;
    background: #f8fafc;
    font-size: 15px;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.login-input-wrap input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.login-input-wrap input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.10);
}

.login-input-wrap:focus-within > svg {
    color: #2563eb;
}

.login-password-wrap input {
    padding-right: 54px;
}

.login-password-toggle {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 9px;
    display: grid;
    place-items: center;
    width: 39px;
    min-height: 39px;
    padding: 0;
    border-radius: 11px;
    color: #64748b;
    background: transparent;
    transform: translateY(-50%);
}

.login-password-toggle:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.login-password-toggle svg {
    width: 20px;
    height: 20px;
}

.login-eye-hide {
    display: none;
}

.login-password-toggle[aria-pressed="true"]
.login-eye-show {
    display: none;
}

.login-password-toggle[aria-pressed="true"]
.login-eye-hide {
    display: block;
}

.login-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    margin-top: 3px;
    border-radius: 15px;
    color: #fff;
    background:
        linear-gradient(
            135deg,
            #2563eb,
            #6d28d9
        );
    box-shadow:
        0 14px 30px rgba(37, 99, 235, 0.24);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

.login-submit:hover {
    background:
        linear-gradient(
            135deg,
            #1d4ed8,
            #5b21b6
        );
    box-shadow:
        0 18px 38px rgba(37, 99, 235, 0.30);
    transform: translateY(-1px);
}

.login-submit:active {
    transform: translateY(0);
}

.login-submit > svg {
    width: 20px;
    height: 20px;
}

.login-submit-loading {
    display: none;
    align-items: center;
    gap: 9px;
}

.login-submit.is-loading
.login-submit-text,
.login-submit.is-loading > svg {
    display: none;
}

.login-submit.is-loading
.login-submit-loading {
    display: inline-flex;
}

.login-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #fff;
    border-radius: 999px;
    animation:
        login-spinner 0.75s linear infinite;
}

@keyframes login-spinner {
    to {
        transform: rotate(360deg);
    }
}

.login-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 24px 0 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 650;
}

.login-security-note svg {
    width: 18px;
    height: 18px;
    color: #059669;
}

@media (max-width: 960px) {
    .login-page {
        padding: 20px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        width: min(620px, 100%);
        min-height: auto;
    }

    .login-visual {
        display: none;
    }

    .login-form-panel {
        min-height: min(720px, calc(100dvh - 40px));
        padding: clamp(28px, 8vw, 60px);
    }

    .login-mobile-logo {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 42px;
    }

    .login-mobile-logo img {
        width: 47px;
        height: auto;
    }

    .login-mobile-logo span {
        font-size: 16px;
        font-weight: 900;
        letter-spacing: -0.02em;
    }
}

@media (max-width: 560px) {
    .login-page {
        display: block;
        min-height: 100dvh;
        padding: 0;
    }

    .login-shell {
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-form-panel {
        align-items: start;
        min-height: 100dvh;
        padding:
            max(28px, env(safe-area-inset-top))
            20px
            max(30px, env(safe-area-inset-bottom));
    }

    .login-form-inner {
        margin: auto 0;
    }

    .login-mobile-logo {
        margin-bottom: 34px;
    }

    .login-heading {
        margin-bottom: 24px;
    }

    .login-heading h1 {
        font-size: 38px;
    }

    .login-heading p {
        font-size: 14px;
    }

    .login-input-wrap input,
    .login-submit {
        min-height: 54px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-preview-scan,
    .login-spinner {
        animation: none;
    }

    .login-submit,
    .login-input-wrap input {
        transition: none;
    }
}

/* ==========================================================================
   Admin wallet OCR transaction detail v9
   ========================================================================== */

.wallet-history-section {
    min-width: 0;
}

.wallet-history-table time {
    white-space: nowrap;
}

.wallet-history-table time small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.wallet-ocr-tag {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    margin-top: 7px;
    padding: 0 9px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wallet-history-action {
    text-align: right;
}

.transaction-overview-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.transaction-generic-card {
    max-width: 920px;
}

.transaction-definition-list {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.transaction-definition-list > div,
.pricing-snapshot-grid > div {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.transaction-definition-list dt,
.pricing-snapshot-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.transaction-definition-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.ocr-transaction-batch-card,
.pricing-snapshot-card {
    margin-bottom: 22px;
}

.ocr-transaction-batch-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.ocr-transaction-batch-heading h2 {
    margin: 10px 0 6px;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.035em;
}

.ocr-transaction-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.ocr-transaction-summary-grid article {
    display: grid;
    gap: 6px;
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
}

.ocr-transaction-summary-grid article > span,
.ocr-image-metric-grid span,
.ocr-image-cost-breakdown span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.ocr-transaction-summary-grid article > strong {
    overflow-wrap: anywhere;
    font-size: 21px;
    line-height: 1.2;
}

.ocr-transaction-summary-grid article small,
.ocr-image-metric-grid small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

.ocr-transaction-charge-card {
    color: #047857;
    border-color: #a7f3d0 !important;
    background: #ecfdf5 !important;
}

.pricing-snapshot-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pricing-snapshot-grid strong {
    overflow-wrap: anywhere;
}

.ocr-transaction-images-section {
    margin-top: 30px;
}

.ocr-transaction-image-list {
    display: grid;
    gap: 20px;
}

.ocr-transaction-image-card {
    display: grid;
    grid-template-columns:
        minmax(240px, 330px)
        minmax(0, 1fr);
    overflow: hidden;
}

.ocr-transaction-thumbnail {
    position: relative;
    min-height: 100%;
    background: #eef2f7;
}

.ocr-transaction-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 310px;
    object-fit: cover;
}

.ocr-transaction-image-content {
    min-width: 0;
    padding: 20px;
}

.ocr-transaction-image-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.ocr-transaction-image-heading > div {
    min-width: 0;
}

.ocr-transaction-image-heading span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.ocr-transaction-image-heading h3 {
    margin: 5px 0 0;
    overflow: hidden;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ocr-image-metric-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.ocr-image-metric-grid > div,
.ocr-image-cost-breakdown > div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.ocr-image-metric-grid strong,
.ocr-image-cost-breakdown strong {
    overflow-wrap: anywhere;
    font-size: 14px;
}

.ocr-image-cost-breakdown {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ocr-image-final-charge {
    color: #047857;
    border-color: #a7f3d0 !important;
    background: #ecfdf5 !important;
}

.ocr-image-cost-unavailable {
    margin: 14px 0 0;
}

@media (max-width: 1120px) {
    .ocr-transaction-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .ocr-image-cost-breakdown {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .transaction-overview-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .pricing-snapshot-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .ocr-transaction-image-card {
        grid-template-columns: 1fr;
    }

    .ocr-transaction-thumbnail img {
        min-height: 260px;
        max-height: 420px;
    }
}

@media (max-width: 640px) {
    .wallet-history-table,
    .wallet-history-table tbody,
    .wallet-history-table tr,
    .wallet-history-table td {
        display: block;
        width: 100%;
    }

    .wallet-history-table thead {
        display: none;
    }

    .wallet-history-table tbody {
        display: grid;
        gap: 13px;
        padding: 12px;
    }

    .wallet-history-table tr {
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: #fff;
    }

    .wallet-history-table td {
        padding: 11px 14px;
        border-bottom: 1px solid var(--border);
    }

    .wallet-history-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .wallet-history-table .wallet-history-action {
        padding: 12px;
        border-bottom: 0;
    }

    .wallet-history-action::before {
        display: none !important;
    }

    .wallet-history-action a {
        width: 100%;
    }

    .transaction-overview-grid,
    .ocr-transaction-summary-grid,
    .pricing-snapshot-grid,
    .transaction-definition-list {
        grid-template-columns: 1fr;
    }

    .ocr-transaction-batch-heading,
    .ocr-transaction-image-heading {
        flex-direction: column;
    }

    .ocr-image-metric-grid,
    .ocr-image-cost-breakdown {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .ocr-transaction-image-content {
        padding: 16px;
    }
}

@media (max-width: 420px) {
    .ocr-image-metric-grid,
    .ocr-image-cost-breakdown {
        grid-template-columns: 1fr;
    }
}

/* OCR review workspace v10 */
.review-page-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:18px}.review-title-row{display:flex;align-items:flex-end;gap:18px}.review-title-row h1{margin:0;font-size:clamp(30px,4vw,48px);letter-spacing:-.045em}.review-title-row p{margin:8px 0 0;color:var(--muted)}.review-heading-actions{display:flex;gap:10px}.review-summary-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}.review-summary-strip article{display:grid;gap:5px;padding:16px 18px;border:1px solid var(--border);border-radius:16px;background:#fff;box-shadow:0 10px 28px rgba(15,23,42,.05)}.review-summary-strip span{color:var(--muted);font-size:12px;font-weight:700}.review-summary-strip strong{font-size:24px}.review-toolbar{position:sticky;z-index:35;top:76px;display:flex;align-items:center;justify-content:space-between;gap:14px;margin:18px 0 12px;padding:11px;border:1px solid var(--border);border-radius:17px;background:rgba(255,255,255,.94);box-shadow:0 12px 34px rgba(15,23,42,.08);backdrop-filter:blur(14px)}.review-filter-group{display:flex;gap:7px;overflow-x:auto}.review-filter{display:inline-flex;align-items:center;gap:7px;min-height:39px;padding:0 12px;border:1px solid var(--border);border-radius:11px;color:var(--slate-600);background:#fff;white-space:nowrap}.review-filter span{display:grid;place-items:center;min-width:21px;height:21px;border-radius:999px;background:var(--slate-100);font-size:10px}.review-filter.is-active{border-color:#93c5fd;color:#1d4ed8;background:#eff6ff}.review-toolbar-actions{display:flex;align-items:center;gap:10px;white-space:nowrap}.review-progress-card{display:grid;gap:10px;margin-bottom:14px;padding:13px 16px;border:1px solid var(--border);border-radius:15px;background:#fff}.review-progress-card>div:first-child{display:flex;justify-content:space-between;gap:12px;font-size:13px}.review-progress-track{height:7px;overflow:hidden;border-radius:999px;background:#e2e8f0}.review-progress-track span{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#2563eb,#7c3aed);transition:width .2s ease}.review-workspace{display:grid;grid-template-columns:230px minmax(0,1fr);gap:14px;min-height:680px}.review-thumbnail-panel{position:sticky;top:150px;height:calc(100dvh - 170px);overflow:hidden;border:1px solid var(--border);border-radius:18px;background:#fff}.review-thumbnail-list{display:grid;gap:7px;height:100%;overflow-y:auto;padding:9px}.review-thumbnail-item{position:relative;display:grid;grid-template-columns:58px minmax(0,1fr);align-items:center;gap:10px;width:100%;min-height:69px;padding:6px;border:1px solid transparent;border-radius:12px;color:inherit;background:transparent;text-align:left}.review-thumbnail-item:hover{background:#f8fafc}.review-thumbnail-item.is-active{border-color:#93c5fd;background:#eff6ff}.review-thumbnail-item img{width:58px;height:54px;border-radius:9px;object-fit:cover;background:#eef2f7}.review-thumbnail-item span{display:grid;min-width:0;gap:3px}.review-thumbnail-item small{overflow:hidden;color:var(--muted);font-size:10px;text-overflow:ellipsis;white-space:nowrap}.review-thumb-state{position:absolute;right:7px;top:7px;width:9px;height:9px;border-radius:999px;background:#94a3b8}.review-thumb-completed{background:#10b981}.review-thumb-failed{background:#ef4444}.review-thumb-processing,.review-thumb-retry_wait{background:#f59e0b}.review-main-panel{min-width:0}.review-image-slide{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(360px,.88fr);gap:14px;min-height:680px}.review-viewer-card,.review-form-card{min-width:0;overflow:hidden;border:1px solid var(--border);border-radius:20px;background:#fff;box-shadow:0 16px 42px rgba(15,23,42,.07)}.review-viewer-card{display:grid;grid-template-rows:auto minmax(0,1fr)}.review-viewer-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border-bottom:1px solid var(--border)}.review-viewer-header>div:first-child{display:grid;min-width:0;gap:3px}.review-viewer-header strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.review-viewer-header span{color:var(--muted);font-size:11px}.review-viewer-tools{display:flex;gap:6px}.review-viewer-tools button,.review-viewer-tools a{display:grid;place-items:center;min-width:38px;height:38px;padding:0 9px;border:1px solid var(--border);border-radius:10px;color:var(--text);background:#fff;text-decoration:none;font-size:12px;font-weight:800}.review-image-stage{display:grid;place-items:center;overflow:auto;min-height:560px;padding:22px;background:linear-gradient(45deg,#eef2f7 25%,transparent 25%),linear-gradient(-45deg,#eef2f7 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eef2f7 75%),linear-gradient(-45deg,transparent 75%,#eef2f7 75%);background-color:#f8fafc;background-size:22px 22px;background-position:0 0,0 11px,11px -11px,-11px 0}.review-large-image{display:block;max-width:100%;max-height:72vh;transform-origin:center;transition:transform .18s ease;box-shadow:0 18px 48px rgba(15,23,42,.18);user-select:none}.review-form-card{display:grid;grid-template-rows:auto minmax(0,1fr)}.review-form-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 15px;border-bottom:1px solid var(--border)}.review-form-header>div{display:flex;flex-wrap:wrap;gap:7px}.review-edit-badge{display:inline-flex;align-items:center;min-height:28px;padding:0 9px;border-radius:999px;color:#6d28d9;background:#f5f3ff;font-size:10px;font-weight:800}.review-editor-form{display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:0}.review-fields-scroll{overflow-y:auto;max-height:610px;padding:16px}.review-field{margin-bottom:13px}.review-field input,.review-field textarea{background:#fbfdff}.review-editor-actions{position:sticky;bottom:0;display:flex;flex-wrap:wrap;gap:8px;padding:12px 14px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--border);background:rgba(255,255,255,.96);backdrop-filter:blur(12px)}.review-editor-actions .button{min-height:42px;padding:0 12px;font-size:12px}.review-dirty-indicator{align-self:center;color:#b45309;font-size:11px;font-weight:800}.review-waiting-state{display:grid;place-items:center;padding:40px;color:var(--muted);text-align:center}.review-mobile-nav{display:none}.review-toast{position:relative;min-width:260px;max-width:420px;margin:8px;padding:13px 16px;border-radius:13px;color:#065f46;background:#ecfdf5;box-shadow:0 16px 40px rgba(15,23,42,.18);font-weight:700}.review-toast-error{color:#991b1b;background:#fef2f2}.toast-region{position:fixed;z-index:1000;right:14px;bottom:14px}.status-badge.status-{color:#475569;background:#f1f5f9}
@media(max-width:1180px){.review-workspace{grid-template-columns:180px minmax(0,1fr)}.review-image-slide{grid-template-columns:1fr}.review-thumbnail-panel{top:145px}.review-image-stage{min-height:480px}.review-fields-scroll{max-height:none}.review-form-card{min-height:520px}}
@media(max-width:820px){.review-page-heading{align-items:stretch;flex-direction:column}.review-heading-actions .button{flex:1}.review-summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.review-toolbar{top:66px;align-items:stretch;flex-direction:column}.review-toolbar-actions{justify-content:space-between}.review-workspace{display:block}.review-thumbnail-panel{position:static;height:auto;margin-bottom:10px}.review-thumbnail-list{display:flex;overflow-x:auto;overflow-y:hidden}.review-thumbnail-item{flex:0 0 145px}.review-main-panel{padding-bottom:72px}.review-image-slide{display:block;min-height:0}.review-viewer-card{margin-bottom:12px}.review-image-stage{min-height:380px;padding:14px}.review-large-image{max-height:58vh}.review-form-card{min-height:0}.review-mobile-nav{position:fixed;z-index:70;left:0;right:0;bottom:0;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;padding:8px max(10px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));border-top:1px solid var(--border);background:rgba(255,255,255,.96);backdrop-filter:blur(14px)}.review-mobile-nav button{min-height:44px}.review-mobile-nav button:last-child{justify-self:stretch}.review-mobile-nav span{min-width:54px;text-align:center;font-size:12px;font-weight:800}.review-editor-actions{bottom:61px}.review-title-row{align-items:flex-start;flex-direction:column}.review-title-row .batch-status-pill{align-self:flex-start}}
@media(max-width:520px){.review-summary-strip{gap:8px}.review-summary-strip article{padding:13px}.review-toolbar{margin-left:-8px;margin-right:-8px;border-radius:14px}.review-toolbar-actions{align-items:stretch;flex-direction:column}.review-toolbar-actions .button{width:100%}.review-viewer-header{align-items:flex-start;flex-direction:column}.review-viewer-tools{width:100%;overflow-x:auto}.review-image-stage{min-height:300px}.review-form-header{align-items:flex-start;flex-direction:column}.review-editor-actions{display:grid;grid-template-columns:1fr}.review-editor-actions .button{width:100%}.toast-region{left:8px;right:8px;bottom:72px}.review-toast{min-width:0;max-width:none;margin:6px 0}}

/* ==========================================================================
   Admin Pricing UX v11
   ========================================================================== */

.pricing-eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.pricing-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
}

.pricing-editor {
    overflow: hidden;
}

.pricing-form-section {
    padding: 26px 0;
    border-bottom: 1px solid var(--border);
}

.pricing-form-section:first-of-type {
    padding-top: 0;
}

.pricing-section-title {
    display: flex;
    gap: 13px;
    margin-bottom: 20px;
}

.pricing-section-title > span {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    font-weight: 900;
}

.pricing-section-title h2 {
    margin: 0;
    font-size: 18px;
}

.pricing-section-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.pricing-label-row,
.pricing-model-actions,
.pricing-form-footer,
.pricing-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-label-row {
    justify-content: space-between;
    margin-bottom: 8px;
}

.pricing-label-row label {
    margin: 0;
}

.pricing-model-actions {
    margin-top: 10px;
    flex-wrap: wrap;
}

.pricing-test-result {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.pricing-test-result.is-success {
    color: #047857;
}

.pricing-test-result.is-error {
    color: #b91c1c;
}

.pricing-test-result.is-warning {
    color: #b45309;
}

.pricing-test-result.is-loading {
    color: #1d4ed8;
}

.pricing-help-box {
    margin-top: 4px;
    padding: 13px 15px;
    border: 1px solid #bfdbfe;
    border-radius: 13px;
    color: #1e3a8a;
    background: #eff6ff;
    font-size: 13px;
    line-height: 1.55;
}

.pricing-form-footer {
    justify-content: flex-end;
    padding-top: 24px;
}

.pricing-guide-card {
    position: sticky;
    top: 82px;
}

.pricing-guide-card h2 {
    margin-top: 0;
    font-size: 18px;
}

.pricing-guide-card ol {
    display: grid;
    gap: 12px;
    padding-left: 20px;
    line-height: 1.5;
}

.pricing-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.pricing-summary-strip > div {
    padding: 17px 19px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.pricing-summary-strip strong,
.pricing-summary-strip span {
    display: block;
}

.pricing-summary-strip strong {
    font-size: 24px;
}

.pricing-summary-strip span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.pricing-cell-sub {
    margin-top: 4px;
    font-size: 12px;
}

.pricing-model-code {
    display: inline-block;
    max-width: 210px;
    overflow-wrap: anywhere;
    padding: 6px 8px;
    border-radius: 8px;
    color: #1e3a8a;
    background: #eff6ff;
    font-size: 12px;
}

.pricing-actions {
    flex-wrap: wrap;
}

.pricing-actions form {
    margin: 0;
}

.pricing-current-label {
    color: #047857;
    font-size: 12px;
    font-weight: 800;
}

.button-small {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 12px;
}

@media (max-width: 1040px) {
    .pricing-form-layout {
        grid-template-columns: 1fr;
    }

    .pricing-guide-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .pricing-page-heading {
        align-items: stretch;
    }

    .pricing-page-heading .button {
        width: 100%;
    }

    .pricing-summary-strip {
        grid-template-columns: repeat(3, 1fr);
    }

    .pricing-table-wrap {
        overflow: visible;
        background: transparent;
        box-shadow: none;
    }

    .pricing-table,
    .pricing-table tbody,
    .pricing-table tr,
    .pricing-table td {
        display: block;
        width: 100%;
    }

    .pricing-table thead {
        display: none;
    }

    .pricing-table tr {
        margin-bottom: 14px;
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: #fff;
        box-shadow: var(--shadow);
    }

    .pricing-table td {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 12px;
        padding: 10px 0;
        border: 0;
        border-bottom: 1px dashed var(--border);
    }

    .pricing-table td:last-child {
        border-bottom: 0;
    }

    .pricing-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
    }

    .pricing-actions {
        align-items: stretch;
    }

    .pricing-actions .button,
    .pricing-actions button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .pricing-summary-strip {
        grid-template-columns: 1fr;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .pricing-label-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .pricing-model-actions,
    .pricing-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .pricing-model-actions .button,
    .pricing-form-footer .button,
    .pricing-form-footer button {
        width: 100%;
    }

    .pricing-table td {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}
