/* ==============================================
   SELFPRINTZ CUSTOMER APP — FULL CSS DESIGN SYSTEM
   Warm ivory/olive theme — Desktop + Mobile
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

/* ---- VARIABLES ---- */
:root {
    --bg: #faf7f2;
    --bg2: #f4f0ea;
    --card: #ffffff;
    --primary: #3d5a3e;
    --primary-lt: #e8f0e8;
    --accent: #8b7355;
    --text: #1c1c1e;
    --muted: #6b6b6b;
    --border: #e5ddd2;
    --success: #2d7d46;
    --error: #c0392b;
    --warning: #e67e22;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 2px 12px rgba(61, 90, 62, 0.08);
    --shadow-md: 0 4px 24px rgba(61, 90, 62, 0.12);
    --shadow-lg: 0 8px 48px rgba(61, 90, 62, 0.16);
    --sidebar-w: 200px;
    --topbar-h: 56px;
    --font: 'Inter', sans-serif;
    --font2: 'Manrope', sans-serif;
}

/* ---- RESET ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    background: linear-gradient(135deg, #faf7f2 0%, #e5ddd2 100%);
    font-family: var(--font);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

a {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

input {
    font-family: inherit;
}

/* ========== APP SHELL ========== */
.app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    height: 100vh;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

/* ========== GLOBAL TOP BAR (branding bar) ========== */
.global-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: var(--topbar-h);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    position: sticky;
    top: 0;
    z-index: 200;
}

.global-topbar-logo {
    font-family: var(--font2);
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.global-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.topbar-icon-btn:hover {
    background: var(--primary-lt);
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== DESKTOP LAYOUT WRAPPER ========== */
.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* ========== SIDEBAR NAV ========== */
.sidebar {
    display: none;
    flex-direction: column;
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    padding: 24px 0;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 4px;
}

.sidebar-nav-item:hover {
    background: rgba(61, 90, 62, 0.04);
    color: var(--primary);
}

.sidebar-nav-item.active {
    color: var(--primary);
    background: var(--primary-lt);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav-icon {
    font-size: 18px;
}

.sidebar-nav-label {
    font-size: 14px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 24px;
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    background: linear-gradient(180deg, #faf7f2 0%, #f4efe6 100%);
}

/* ========== SCREEN ========== */
.screen {
    display: none;
    padding: 20px 16px 110px;
    min-height: 100%;
    animation: fadeIn 0.2s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== MOBILE BOTTOM NAV ========== */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(61, 90, 62, 0.08);
    height: 64px;
    z-index: 500;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.bottom-nav.hidden {
    display: none !important;
}

.app-site-footer {
    display: none;
    flex-shrink: 0;
    background: #13261b;
    color: #cbd5e1;
    text-align: center;
    padding: 10px 12px 8px;
    z-index: 40;
}

.app-site-footer-brand {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.app-site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    margin-bottom: 6px;
}

.app-site-footer-links a {
    color: #4ade80;
    font-size: 12px;
    font-weight: 600;
}

.app-site-footer-copy {
    font-size: 11px;
    color: #94a3b8;
}

.app-site-footer.hidden {
    display: none !important;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 6px 0;
    border-radius: 14px;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(45, 80, 52, 0.09);
}

.nav-item.active .nav-label {
    font-weight: 800;
    color: var(--primary);
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

.nav-icon {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.nav-label {
    font-size: 11px;
    transition: color 0.2s ease, font-weight 0.2s ease;
}

.nav-scan-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg2);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-top: -10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: var(--muted);
    transition: all 0.2s ease;
}

.nav-item:hover .nav-scan-btn {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-item.active .nav-scan-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #1e4620 100%);
    border-color: transparent;
    color: #fff;
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 22px rgba(45, 80, 52, 0.55);
}

/* ========== TOP BAR (screen-level) ========== */
.top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.top-bar-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.top-bar-title {
    font-family: var(--font2);
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-bar-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-bar-spacer {
    width: 36px;
}

/* ========== BUTTONS & UNIVERSAL CLICKABLE ELEMENTS ========== */
button,
a.btn,
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-admin,
.btn-icon-action,
.btn-login,
.btn-google,
.btn-guest,
.payment-method,
.option-pill,
.pill-btn,
.home-print-btn,
.scan-control-btn,
.scan-tool-btn,
.home-step,
.home-refer-btn,
.add-doc-btn,
.tab-btn,
[onclick],
[role="button"] {
    cursor: pointer !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    pointer-events: auto !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    min-height: 48px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    transition: opacity 0.15s, transform 0.1s;
    font-family: var(--font);
    z-index: 2;
}

/* Children of pure button/pill elements should not intercept pointer events
   so clicks always bubble to the interactive element itself.
   IMPORTANT: [onclick] divs are intentionally excluded — they may contain
   real nested interactive buttons that must remain clickable. */
button *,
a.btn *,
.btn *,
.btn-primary *,
.btn-secondary *,
.btn-ghost *,
.btn-admin *,
.btn-icon-action *,
.btn-login *,
.btn-google *,
.btn-guest *,
.payment-method *,
.option-pill *,
.pill-btn *,
.home-print-btn *,
.scan-control-btn *,
.scan-tool-btn *,
.home-step *,
.home-refer-btn *,
.add-doc-btn *,
.tab-btn * {
    pointer-events: none;
}

/* Ensure all interactive elements remain clickable regardless of parent */
button,
input,
select,
textarea,
label,
a[href] {
    pointer-events: auto !important;
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: #2e4530;
}

.btn-secondary {
    background: var(--bg2);
    color: var(--primary);
    border: 1.5px solid var(--border);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-amber {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-green {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

/* ========== NOTIFICATIONS ========== */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notification-badge.is-on {
    display: flex;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 999;
    overflow: hidden;
}

/* ========== APM BANNER VALS ========== */
.active-apm-name-val {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}

.active-apm-rate-val {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.active-apm-badge-val {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #fef3c7;
    color: #92400e;
}

/* ========== NEARBY KIOSKS CONTAINER ========== */
.mini-nearby-apms-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========== EXTRA UTILITIES ========== */
.mt-8 {
    margin-top: 8px;
}

.how-step-content {
    padding: 12px 0 4px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}


/* ========== CARD ========== */

.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px 0 rgba(61, 90, 62, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 40px 0 rgba(61, 90, 62, 0.06);
}

.card-title {
    font-family: var(--font2);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== HOME SCREEN — REDESIGNED ========== */

/* Greeting block */
.home-greeting-block {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-top: 4px;
}

.home-greeting-left {
    flex: 1;
}

.home-greeting-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 2px;
    letter-spacing: 0.01em;
}

.home-greeting-name {
    font-family: var(--font2);
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
    margin-bottom: 4px;
}

.home-greeting-sub {
    font-size: 13px;
    color: var(--muted);
}

.home-greeting-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #2e4530 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(61, 90, 62, 0.25);
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.15s;
}

.home-greeting-avatar:hover {
    transform: scale(1.06);
}

/* Print Now button */
.home-print-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 22px;
    min-height: 58px;
    background: linear-gradient(135deg, var(--primary) 0%, #1e4620 100%);
    color: #fff;
    border: none;
    border-radius: 18px;
    font-size: 17px;
    font-weight: 800;
    font-family: var(--font2);
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(61, 90, 62, 0.30);
    transition: transform 0.12s, box-shadow 0.12s;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    z-index: 10;
}

.home-print-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0%, transparent 60%);
    pointer-events: none !important;
}

.home-print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(61, 90, 62, 0.38);
}

.home-print-btn:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.home-print-icon {
    font-size: 22px;
}

.home-print-label {
    flex: 1;
    text-align: center;
    letter-spacing: 0.01em;
}

.home-print-arrow {
    font-size: 20px;
    opacity: 0.75;
    transition: transform 0.15s;
}

.home-print-btn:hover .home-print-arrow {
    transform: translateX(4px);
    opacity: 1;
}

/* Stats strip */
.home-stats-strip {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 0;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.home-stat-chip {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.home-stat-val {
    font-family: var(--font2);
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.home-stat-key {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.home-stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

/* How it works steps */
.home-steps-row {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

/* Printer Selection Side-by-Side Cards (No Cropping) */
#printer-options-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

#printer-options-row.hidden {
    display: none !important;
}

.printer-option-card {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.home-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.home-step-icon {
    font-size: 20px;
    line-height: 1;
}

.home-step-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
    letter-spacing: 0.02em;
}

.home-step-line {
    width: 20px;
    height: 1.5px;
    background: linear-gradient(90deg, var(--border) 0%, var(--primary) 50%, var(--border) 100%);
    opacity: 0.5;
    flex-shrink: 0;
}

.home-step-arrow {
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    opacity: 0.6;
    flex-shrink: 0;
    user-select: none;
    line-height: 1;
}

/* Refer & Earn card — compact, page background color */
.home-refer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow);
}

.home-refer-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(61, 90, 62, 0.14);
}

.home-refer-left {
    flex: 1;
}

.home-refer-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 2px;
}

.home-refer-desc {
    font-size: 11px;
    color: var(--muted);
}

.home-refer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.home-refer-balance-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.home-refer-balance {
    font-family: var(--font2);
    font-size: 17px;
    font-weight: 800;
    color: var(--primary);
}

.home-refer-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.15s;
}

.home-refer-btn:hover {
    background: #2e4530;
}

/* Keep old referral-card for other screens using it */
.referral-card {
    background: linear-gradient(135deg, var(--primary) 0%, #2e4530 100%);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    margin-bottom: 20px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s;
}

.referral-card:hover {
    transform: translateY(-2px);
}

.referral-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.referral-card-title {
    font-family: var(--font2);
    font-size: 15px;
    font-weight: 700;
}

.referral-card-arrow {
    font-size: 18px;
    opacity: 0.8;
}

.referral-card-desc {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 14px;
}

.referral-balance-label {
    font-size: 11px;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.referral-balance-amount {
    font-family: var(--font2);
    font-size: 26px;
    font-weight: 800;
}

.refer-now-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}



/* ==== ORDERS ==== */
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.section-title-sm {
    font-family: var(--font2);
    font-size: 15px;
    font-weight: 700;
}

.section-link {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}

.order-item {
    background: var(--card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    cursor: pointer;
    transition: box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.order-item:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.order-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.order-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.order-id {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
}

.order-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.order-status-printing {
    background: rgba(45, 80, 52, 0.12);
    color: var(--primary);
    border: 1px solid rgba(45, 80, 52, 0.25);
}

.order-status-completed {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.order-status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.order-status-held {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.order-status-failed {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.order-status-cancelled {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.25);
}

.order-status-refunded {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.order-status-refund-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ==== TRUST BAR ==== */
.trust-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.trust-icon {
    font-size: 14px;
}

/* ========== UPLOAD SCREEN ========== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg2);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 20px;
}

.upload-zone:hover,
.upload-zone.dragging {
    border-color: var(--primary);
    background: var(--primary-lt);
}

.upload-zone-icon {
    font-size: 44px;
    margin-bottom: 10px;
}

.upload-zone h3 {
    font-family: var(--font2);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.upload-zone p {
    font-size: 13px;
    color: var(--muted);
}

.file-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-zone.is-uploading {
    pointer-events: none;
    border-color: var(--primary);
    background: rgba(22, 163, 74, 0.05);
    cursor: wait;
}

.upload-spinner-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 4px auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(22, 163, 74, 0.09) 0%, rgba(22, 163, 74, 0.02) 70%, transparent 100%);
}

.upload-spinner-ring-outer {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px dashed rgba(22, 163, 74, 0.25);
    animation: uploadSpinAnim 6s linear infinite reverse;
}

.upload-spinner-ring {
    position: absolute;
    inset: 0;
    border: 3.5px solid rgba(22, 163, 74, 0.15);
    border-top: 3.5px solid var(--primary, #16a34a);
    border-right: 3.5px solid #10b981;
    border-radius: 50%;
    animation: uploadSpinAnim 0.9s cubic-bezier(0.4, 0.1, 0.4, 1) infinite;
    box-shadow: 0 0 16px rgba(22, 163, 74, 0.25);
}

.upload-scan-line {
    position: absolute;
    left: 20%;
    right: 20%;
    height: 2.5px;
    background: linear-gradient(90deg, transparent, #22c55e, #86efac, #22c55e, transparent);
    box-shadow: 0 0 8px #22c55e, 0 0 14px rgba(34, 197, 94, 0.6);
    border-radius: 2px;
    top: 20%;
    z-index: 3;
    pointer-events: none;
    animation: laserScanAnim 1.6s ease-in-out infinite alternate;
}

.upload-spinner-icon {
    font-size: 32px;
    z-index: 2;
    animation: docFloatAnim 1.8s ease-in-out infinite alternate;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
}

.upload-pct-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(22, 163, 74, 0.12);
    color: var(--primary, #16a34a);
    font-size: 13px;
    font-weight: 800;
    font-family: monospace;
    letter-spacing: 0.5px;
    animation: pulseBadge 1.2s ease-in-out infinite alternate;
}

@keyframes uploadSpinAnim {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes docFloatAnim {
    0% { transform: translateY(2px) scale(0.96); opacity: 0.92; }
    100% { transform: translateY(-4px) scale(1.05); opacity: 1; }
}

@keyframes laserScanAnim {
    0% { top: 22%; opacity: 0.3; }
    50% { opacity: 1; }
    100% { top: 76%; opacity: 0.3; }
}

@keyframes pulseBadge {
    0% { transform: scale(0.97); }
    100% { transform: scale(1.05); box-shadow: 0 0 10px rgba(22, 163, 74, 0.2); }
}

.upload-progress-container {
    width: 88%;
    max-width: 320px;
    height: 10px;
    background: var(--border, #e2e8f0);
    border-radius: 12px;
    margin: 12px auto;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #16a34a 0%, #10b981 50%, #34d399 100%);
    border-radius: 12px;
    position: relative;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}

.upload-progress-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    animation: shimmerBarAnim 1.4s linear infinite;
    border-radius: 12px;
}

@keyframes shimmerBarAnim {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.recent-files-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.file-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.file-item:hover {
    box-shadow: var(--shadow-md);
}

.file-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
}

.file-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.file-more {
    font-size: 18px;
    color: var(--muted);
    padding: 0 4px;
}

/* ========== PREVIEW SCREEN ========== */
.preview-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.preview-header {
    background: var(--primary);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-logo {
    font-family: var(--font2);
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.preview-tagline {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

.preview-doc {
    padding: 32px 16px;
    background: #fff;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-doc-placeholder {
    text-align: center;
    color: var(--muted);
}

.doc-icon {
    font-size: 52px;
    margin-bottom: 10px;
}

.preview-meta-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    margin-top: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    box-sizing: border-box;
    gap: 10px;
}

.preview-info {
    display: none;
}

/* ========== PRINT SETTINGS ========== */
.setting-group {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.setting-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.num {
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.copies-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    user-select: none;
    -webkit-user-select: none;
}

.copies-btn:hover {
    background: var(--primary-lt);
    border-color: var(--primary);
}

.copies-btn:active {
    transform: scale(0.92);
}

.copies-count {
    font-size: 19px;
    font-weight: 700;
    min-width: 44px;
    max-width: 64px;
    text-align: center;
    color: var(--text);
}

.copies-input {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 4px 6px;
    font-family: inherit;
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    outline: none;
    transition: all 0.15s ease;
    -moz-appearance: textfield;
}

.copies-input::-webkit-outer-spin-button,
.copies-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.copies-input:hover {
    border-color: var(--primary);
    background: #fff;
}

.copies-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.option-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.option-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 12px;
    gap: 6px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: pointer;
    transition: all 0.15s;
    min-width: 70px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.option-pill:hover {
    border-color: var(--primary);
    background: var(--primary-lt);
}

.option-pill.selected {
    border-color: var(--primary);
    background: var(--primary-lt);
}

.option-pill-icon {
    font-size: 20px;
}

.option-pill-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.option-pill.selected .option-pill-text {
    color: var(--primary);
}

/* NUP Layout pills (pages per sheet SVG icons) */
.nup-pills-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
}

.nup-pill {
    min-width: 0 !important;
    padding: 8px 4px !important;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nup-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: color 0.15s;
}

.nup-pill.selected .nup-icon,
.nup-pill:hover .nup-icon {
    color: var(--primary);
}

.nup-pill .option-pill-text {
    font-size: 11px;
    font-weight: 700;
}

/* Paper Size pills (SVG icons) */
.paper-size-pill {
    min-width: 0 !important;
    align-items: center;
    justify-content: center;
    flex-direction: column !important;
    gap: 4px;
}

.paper-size-icon-wrapper {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 0;
    flex-shrink: 0;
    margin-bottom: 6px;
}

.option-pill svg {
    color: var(--muted);
    transition: color 0.15s;
}

.option-pill.selected svg,
.option-pill:hover svg {
    color: var(--primary);
}

.option-pill.selected svg .front-page,
.option-pill:hover svg .front-page {
    fill: var(--primary-lt);
}

.option-pill-subtext {
    font-size: 9px;
    color: var(--muted);
    margin-top: 1px;
    text-align: center;
    line-height: 1.1;
    transition: color 0.15s;
}

.option-pill.selected .option-pill-subtext {
    color: var(--primary);
    opacity: 0.8;
}

/* Printer option cards (side by side) */
.printer-option-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

.printer-option-card:hover {
    border-color: var(--primary) !important;
}

/* Pending files section */
#pending-files-list .file-item,
#pending-files-list .pending-file-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

#pending-files-list .file-item:hover,
#pending-files-list .pending-file-card:hover {
    border-color: var(--primary);
}


.cart-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.cart-item-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    padding-right: 4px;
}

.cart-item-meta {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cart-item-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    text-align: right;
    padding-left: 6px;
}

.cart-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.cart-item-action-btn {
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    background: var(--bg);
    cursor: pointer;
}

.cart-item-action-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.add-doc-btn {
    width: 100%;
    padding: 14px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
    transition: all 0.15s;
}

.add-doc-btn:hover {
    border-color: var(--primary);
    background: var(--primary-lt);
}

/* ========== ORDER SUMMARY ========== */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    gap: 12px;
    min-width: 0;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}

.summary-label {
    color: var(--muted);
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.summary-value {
    font-weight: 600;
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}

/* ========== PAYMENT SCREEN ========== */
.payment-amount {
    background: var(--primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
}

.payment-amount-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.payment-amount-value {
    font-family: var(--font2);
    font-size: 36px;
    font-weight: 800;
}

.payment-method {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.payment-method:hover {
    border-color: var(--primary);
    background: var(--primary-lt);
}

.payment-method.selected {
    border-color: var(--primary);
    background: var(--primary-lt);
}

.payment-method-icons {
    font-size: 24px;
}

.payment-method-name {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
}

.payment-method-check {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    opacity: 0;
}

.payment-method.selected .payment-method-check {
    opacity: 1;
}

.payment-upi-fields {
    display: none;
    margin: 4px 0 14px;
    padding: 14px 16px;
    background: var(--card);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius);
}

.payment-upi-fields.visible {
    display: block;
}

.payment-upi-fields .form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
}

.payment-upi-fields input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
}

.payment-upi-fields input:focus {
    outline: none;
    border-color: var(--primary);
}

.payment-upi-hint {
    font-size: 11px;
    color: var(--muted);
    margin: 10px 0 0;
    line-height: 1.45;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--primary-lt);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 16px 0;
}

.secure-badge-icon {
    font-size: 20px;
}

.secure-badge-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.secure-badge-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}


/* ========== SCAN SCREEN — PRODUCTION REDESIGN ========== */
.scan-laser-line {
    position: absolute;
    left: 4px;
    right: 4px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #22c55e, #86efac, #22c55e, transparent);
    box-shadow: 0 0 14px #22c55e, 0 0 4px #86efac;
    border-radius: 2px;
    animation: laserScan 2.2s ease-in-out infinite;
}

@keyframes laserScan {
    0% {
        top: 4px;
        opacity: 0.8;
    }

    50% {
        top: 190px;
        opacity: 1;
    }

    100% {
        top: 4px;
        opacity: 0.8;
    }
}

.scan-toolbar {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.scan-tool-btn {
    flex: 1;
    max-width: 105px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow);
}

.scan-tool-btn:hover {
    background: var(--bg2);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.scan-tool-btn:active {
    transform: scale(0.96);
}

.scan-tool-btn.active-tool {
    background: rgba(34, 197, 94, 0.12);
    border-color: #22c55e;
    color: #16a34a;
}

.scan-tool-icon {
    font-size: 18px;
    line-height: 1;
}


/* ========== UTILITY CLASSES ========== */
.text-center {
    text-align: center;
}

.text-sm {
    font-size: 13px;
}

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

.mb-16 {
    margin-bottom: 16px;
}

.mt-16 {
    margin-top: 16px;
}

.btn-full {
    width: 100%;
}

/* ========== SUCCESS SCREEN ========== */

.success-screen {
    padding: 20px 0;
    text-align: center;
}

.success-icon {
    width: 72px;
    height: 72px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    font-size: 36px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 20px rgba(45, 125, 70, 0.3);
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-family: var(--font2);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.success-sub {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
}

.success-details {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 16px 0;
    text-align: left;
    box-shadow: var(--shadow);
}

.success-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.success-detail-row:last-child {
    border-bottom: none;
}

.success-detail-label {
    color: var(--muted);
}

.success-detail-value {
    font-weight: 600;
}

/* ========== SCAN QR ========== */


.scan-frame::before,
.scan-frame::after,
.scan-frame>.corner-tl,
.scan-frame>.corner-tr,
.scan-frame>.corner-bl,
.scan-frame>.corner-br {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border: 3px solid var(--primary);
}

.scan-frame::before {
    top: 8px;
    left: 8px;
    border-right: none;
    border-bottom: none;
}

.scan-frame::after {
    top: 8px;
    right: 8px;
    border-left: none;
    border-bottom: none;
}

.scan-line-inner {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% {
        top: 10%;
    }

    50% {
        top: 85%;
    }

    100% {
        top: 10%;
    }
}


.scan-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.scan-control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
}

.scan-control-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.scan-ctrl-icon {
    font-size: 22px;
}

.manual-entry {
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

.manual-entry a {
    color: var(--primary);
    font-weight: 600;
}

/* ========== APM CARD ========== */
.apm-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    margin: 16px 0;
    box-shadow: var(--shadow);
}

.apm-card-icon {
    font-size: 44px;
    margin-bottom: 8px;
}

.apm-card-title {
    font-family: var(--font2);
    font-size: 18px;
    font-weight: 800;
}

.apm-card-id {
    font-size: 13px;
    color: var(--muted);
}

.apm-card-location {
    font-size: 15px;
    font-weight: 600;
}

.apm-card-address {
    font-size: 13px;
    color: var(--muted);
}

.sent-banner {
    background: #e8f5e9;
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== PRINTING PROGRESS ========== */
.printing-animation {
    text-align: center;
    padding: 20px 0;
}

.printing-icon {
    font-size: 64px;
    margin-bottom: 12px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.progress-text {
    font-family: var(--font2);
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin: 12px 0 8px;
}

.progress-bar-container {
    background: var(--border);
    border-radius: 50px;
    height: 10px;
    overflow: hidden;
    margin: 8px 0 6px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 50px;
    transition: width 0.3s ease;
}

.progress-pages {
    font-size: 13px;
    color: var(--muted);
}

/* --- LIVE PAPER EJECT TELEMETRY CARD --- */
.printing-eject-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.04) 0%, rgba(99, 102, 241, 0.06) 100%);
    border: 1.5px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius, 12px);
    padding: 16px 18px;
    margin: 14px 0 16px;
    text-align: left;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.eject-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.eject-card-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.eject-icon-pulse {
    font-size: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: ejectPulse 2s infinite ease-in-out;
}
@keyframes ejectPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.4)); }
}
.eject-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text, #1e293b);
    line-height: 1.2;
}
.eject-subtitle {
    font-size: 12px;
    color: var(--muted, #64748b);
    margin-top: 2px;
}
.eject-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: #e0e7ff;
    color: #4338ca;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}
.eject-badge.completed {
    background: #dcfce7;
    color: #15803d;
}
.eject-counter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #1e293b);
    margin-bottom: 6px;
}
.eject-pct-label {
    font-variant-numeric: tabular-nums;
    color: #4f46e5;
}
.eject-progress-track {
    height: 8px;
    background: rgba(226, 232, 240, 0.8);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.eject-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #3b82f6 50%, #10b981 100%);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

/* --- STAGED PRINT PROGRESS STEPPER --- */
.print-stepper {
    text-align: left;
    background: var(--card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 12px);
    padding: 20px 18px;
    margin: 16px 0 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.print-step {
    display: flex;
    gap: 14px;
    position: relative;
    padding-bottom: 18px;
    transition: all 0.3s ease;
}

.print-step:last-child {
    padding-bottom: 0;
}

.step-indicator-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 34px;
    flex-shrink: 0;
}

.step-indicator {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    color: #94a3b8;
    position: relative;
    z-index: 2;
}

.step-check {
    display: none;
}

.step-connector {
    width: 2px;
    flex-grow: 1;
    min-height: 20px;
    background: #e2e8f0;
    margin-top: 4px;
    margin-bottom: 4px;
    transition: background 0.35s ease;
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: color 0.3s ease;
}

.step-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.step-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 3px;
    line-height: 1.35;
    transition: color 0.3s ease;
}

/* Step States */
.print-step.pending .step-indicator {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

.print-step.active .step-indicator {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
    animation: step-pulse 1.8s ease-in-out infinite;
}

.print-step.active .step-label {
    color: #0f172a;
    font-weight: 700;
}

.print-step.active .step-badge {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.print-step.active .step-sub {
    color: #166534;
    font-weight: 500;
}

.print-step.completed .step-indicator {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
}

.print-step.completed .step-icon {
    display: none;
}

.print-step.completed .step-check {
    display: inline-block;
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    animation: check-pop 0.3s ease-out;
}

.print-step.completed .step-connector {
    background: #16a34a;
}

.print-step.completed .step-label {
    color: #334155;
}

.print-step.completed .step-badge {
    background: #f0fdf4;
    color: #16a34a;
}

.print-step.completed .step-sub {
    color: #64748b;
}

/* Stage-tied Icon Animations */
.printing-icon.stage-anim-preparing {
    animation: pulse 1.8s ease-in-out infinite;
}

.printing-icon.stage-anim-downloading {
    animation: icon-float-down 1.2s ease-in-out infinite;
}

.printing-icon.stage-anim-processing {
    animation: icon-spin-tilt 1.8s ease-in-out infinite;
}

.printing-icon.stage-anim-spooling {
    animation: icon-spool-slide 1.4s ease-in-out infinite;
}

.printing-icon.stage-anim-printing {
    animation: icon-print-vibe 0.75s ease-in-out infinite;
}

.printing-icon.stage-anim-completed {
    animation: check-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes step-pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
    }
    50% {
        box-shadow: 0 0 0 7px rgba(22, 163, 74, 0.28);
    }
}

@keyframes check-pop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    70% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes icon-float-down {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(6px);
    }
}

@keyframes icon-spin-tilt {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-6deg) scale(1.04);
    }
    75% {
        transform: rotate(6deg) scale(1.04);
    }
}

@keyframes icon-spool-slide {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(4px);
    }
}

@keyframes icon-print-vibe {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-2px) scale(1.02);
    }
    50% {
        transform: translateY(1px) scale(0.99);
    }
    75% {
        transform: translateY(-1px) scale(1.01);
    }
}

.print-failed-panel {
    text-align: center;
    padding: 24px 16px;
    margin-top: 12px;
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    border-radius: var(--radius);
}

.print-failed-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.print-refund-status {
    font-size: 13px;
    font-weight: 700;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 14px;
    line-height: 1.45;
}

/* ========== REFERRAL SCREENS ========== */
.referral-dashboard {
    background: linear-gradient(135deg, var(--primary) 0%, #2e4530 100%);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    color: #fff;
    text-align: center;
    margin-bottom: 16px;
}

.referral-big-balance {
    font-family: var(--font2);
    font-size: 40px;
    font-weight: 800;
    margin: 6px 0;
}

.referral-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.referral-stat {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow);
}

.referral-stat-num {
    font-family: var(--font2);
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.referral-stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.referral-code-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.referral-code-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.referral-code {
    font-family: var(--font2);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.referral-link {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
    word-break: break-all;
}

.referral-history-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
}

.referral-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.referral-person-info {
    flex: 1;
}

.referral-person-name {
    font-size: 14px;
    font-weight: 600;
}

.referral-person-status {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.referral-reward {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.referral-reward.earned {
    color: var(--success);
}

.referral-reward.pending {
    color: var(--warning);
}

.share-options {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 10px 0;
}

.share-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--bg2);
    border: 1px solid var(--border);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}

.share-btn:hover {
    background: var(--primary-lt);
}

/* ========== HOW IT WORKS STEPS ========== */
.how-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.how-step-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.how-step-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.how-step-desc {
    font-size: 13px;
    color: var(--muted);
}

/* ========== PROFILE ========== */
.profile-header {
    background: linear-gradient(135deg, var(--primary) 0%, #1e2f20 100%);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    color: #fff;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid var(--accent);
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-name {
    font-family: var(--font2);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.profile-email {
    font-size: 13px;
    opacity: 0.85;
}

.profile-menu-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
}

.profile-menu-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.profile-menu-icon {
    font-size: 20px;
}

.profile-menu-text {
    flex: 1;
}

.profile-menu-title {
    font-size: 14px;
    font-weight: 600;
}

.profile-menu-badge {
    background: var(--primary-lt);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
}

.profile-menu-arrow {
    color: var(--muted);
    font-size: 16px;
}

/* ========== TRACKING ========== */
.tracking-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.tracking-step:last-child {
    border-bottom: none;
}

.tracking-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    flex-shrink: 0;
}

.tracking-step.done .tracking-dot {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.tracking-step.active .tracking-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tracking-label {
    font-size: 14px;
    font-weight: 500;
}

.tracking-step.done .tracking-label {
    color: var(--success);
}

.tracking-step.active .tracking-label {
    color: var(--primary);
    font-weight: 700;
}

/* ========== UTILITY CLASSES ========== */
.mt-16 {
    margin-top: 16px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-24 {
    margin-top: 24px;
}

.mt-12 {
    margin-top: 12px;
}

.mb-12 {
    margin-bottom: 12px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-20 {
    margin-bottom: 20px;
}

.text-center {
    text-align: center;
}

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

.text-sm {
    font-size: 14px;
}

.text-xs {
    font-size: 12px;
}

.fw-700 {
    font-weight: 700;
}

/* ========== DESKTOP RESPONSIVE ========== */
@media (min-width: 768px) {
    body {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-height: 100vh;
    }

    .app {
        width: 100%;
        max-width: 1200px;
        box-shadow: var(--shadow-lg);
        flex-direction: column;
    }

    .global-topbar {
        position: sticky;
        top: 0;
        z-index: 300;
    }

    .app-body {
        display: flex;
        flex: 1;
        overflow: visible;
    }

    .sidebar {
        display: flex;
        position: sticky;
        top: var(--topbar-h);
    }

    .main-content {
        overflow-y: auto;
    }

    .screen {
        padding: 28px 32px 60px;
        max-width: 700px;
    }

    .bottom-nav {
        display: none;
    }

    /* Home: two-column grid for orders */
    #screen-home .order-item {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    /* Wider preview */
    .scan-frame {
        width: 260px;
        height: 260px;
    }
}

@media (min-width: 1200px) {
    .screen {
        max-width: 800px;
    }
}

@media (max-width: 767px) {
    .sidebar {
        display: none;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        margin: 0;
    }

    .app-site-footer {
        display: block;
        margin: 8px 0 0;
        padding: 18px 14px 28px;
        border-radius: 16px 16px 0 0;
    }

    .app-body {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .main-content {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .screen {
        padding: 16px 14px 24px;
    }

    .screen.active {
        min-height: 100%;
    }

    .global-topbar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .home-print-btn,
    .btn-full {
        width: 100%;
    }

    .app-site-footer {
        margin-bottom: 88px;
    }

    .home-greeting-avatar {
        display: none;
    }
}

/* ========================================================
   UNIVERSAL TEXT OVERFLOW & RESPONSIVE CARD CONTAINMENT
   ======================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.card,
.order-item,
.cart-item,
.order-card,
.summary-row,
.apm-item,
.home-step,
.home-refer-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.cart-item-name,
.order-id,
.order-meta,
.card-title,
.summary-label,
.top-bar-title,
#payment-filename,
#success-receipt-filename,
#settings-file-info {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cart-item-price,
.order-status,
.summary-value,
.badge {
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   SMOOTH TACTILE BUTTONS, LOADERS & MICRO-ANIMATIONS
   ══════════════════════════════════════════════════════════════════════════ */
button,
.btn,
.btn-admin,
.btn-icon-action,
a.btn,
[onclick] {
    -webkit-tap-highlight-color: transparent !important;
    transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease !important;
}

button:active,
.btn:active,
.btn-admin:active,
.btn-icon-action:active,
a.btn:active,
[onclick]:active {
    transform: scale(0.965) !important;
}

button:disabled,
.btn:disabled,
.btn-admin:disabled,
.is-disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    pointer-events: none !important;
}

/* Spinner Loader for Buttons */
.btn-loading,
.is-loading {
    position: relative !important;
    pointer-events: none !important;
    cursor: wait !important;
    opacity: 0.88 !important;
}

.btn-loading>* {
    visibility: hidden !important;
    opacity: 0 !important;
}

.btn-loading::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 18px !important;
    height: 18px !important;
    margin-top: -9px !important;
    margin-left: -9px !important;
    border: 2.5px solid rgba(255, 255, 255, 0.35) !important;
    border-top-color: #ffffff !important;
    border-radius: 50% !important;
    animation: btn-spin-anim 0.65s linear infinite !important;
    box-sizing: border-box !important;
    z-index: 10 !important;
}

.btn-secondary.btn-loading::after,
.btn-ghost.btn-loading::after {
    border-color: rgba(99, 102, 241, 0.25) !important;
    border-top-color: var(--primary, #4f46e5) !important;
}

@keyframes btn-spin-anim {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shake-anim {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

.shake-error {
    animation: shake-anim 0.35s ease-in-out !important;
}

/* Floating Toast Notification */
.selfprintz-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 400px;
    width: calc(100vw - 32px);
    padding: 13px 18px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 4px 10px rgba(0, 0, 0, 0.08);
    z-index: 999999;
    color: #fff;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.selfprintz-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.selfprintz-toast-success {
    background: linear-gradient(135deg, #15803d, #16a34a);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.selfprintz-toast-error {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.selfprintz-toast-warning {
    background: linear-gradient(135deg, #b45309, #d97706);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.selfprintz-toast-info {
    background: linear-gradient(135deg, #4338ca, #6366f1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 767px) {
    .selfprintz-toast {
        bottom: 84px;
        left: 50%;
        right: auto;
        width: calc(100vw - 32px);
        max-width: 380px;
        transform: translateX(-50%) translateY(20px) scale(0.95);
    }

    .selfprintz-toast.show {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* ══════════════════════════════════════════════════════════════════
   TABLE HORIZONTAL SCROLL — Prevent overflow on orders/invoice tables
   ══════════════════════════════════════════════════════════════════ */
.orders-list,
.invoice-list,
.order-table-wrap,
table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ══════════════════════════════════════════════════════════════════
   EXTRA SMALL MOBILE (≤ 360px) — Compact 320px-360px phone support
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {

    /* OTP boxes scale down for 320px–360px screens */
    .login-otp-input {
        gap: 5px;
    }

    /* Quick action cards stacked 2-col */
    .home-actions-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Checkout CTA full width */
    .cart-footer .btn,
    .summary-actions .btn {
        width: 100%;
        font-size: 14px;
        padding: 14px;
    }

    /* Scan screen controls */
    .scan-controls {
        gap: 12px;
    }

    /* Profile menu items readable on tiny screens */
    .profile-menu-item {
        padding: 13px 16px;
        font-size: 13px;
    }

    /* Copies counter larger tap area */
    .copies-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 18px;
    }

    /* Payment method cards */
    .payment-option {
        padding: 12px;
        font-size: 13px;
    }
}

/* ══════════════════════════════════════════════════════════════════
   TOUCH TARGET MINIMUMS — Customer App buttons
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* Bottom nav touch targets */
    .bottom-nav-btn,
    .nav-btn {
        min-width: 44px;
        min-height: 44px;
    }

    /* Form submit buttons */
    .btn-primary {
        min-height: 48px;
    }

    /* Back button in topbar */
    .back-btn,
    .header-btn {
        min-width: 40px;
        min-height: 40px;
    }
}


/* ═══════════════════════════════════════════════════════════════
   MEDIUM MOBILE (481–600px) — Large Android Phones
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 481px) and (max-width: 600px) {
    .screen-card {
        max-width: 520px;
        margin: 0 auto;
    }

    .home-actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cart-item-row {
        padding: 14px 16px;
    }

    .otp-box {
        width: 44px;
        height: 52px;
    }
}

/* User Portal: Permanently hide pending files section per user preference */
#pending-files-section {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   COUPON CELEBRATION SUCCESS POPUP & PROCESSING SPINNER STYLES
   ═══════════════════════════════════════════════════════════════ */
.coupon-btn-spinner {
    width: 13px;
    height: 13px;
    display: inline-block;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin-anim 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
    box-sizing: border-box;
}

.coupon-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.coupon-success-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.coupon-success-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: linear-gradient(145deg, #ffffff, #f0fdf4);
    border: 1.5px solid rgba(34, 197, 94, 0.35);
    border-radius: 26px;
    padding: 30px 24px 22px;
    text-align: center;
    box-shadow: 0 25px 60px -10px rgba(22, 163, 74, 0.35), 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: scale(0.82) translateY(24px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    box-sizing: border-box;
}

.coupon-success-overlay.active .coupon-success-card {
    transform: scale(1) translateY(0);
}

/* Floating celebratory confetti particles */
.coupon-confetti-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    font-size: 20px;
    opacity: 0;
    user-select: none;
}

.coupon-success-overlay.active .cp-1 { top: 12%; left: 10%; animation: particleBurst 0.8s 0.1s cubic-bezier(0.17, 0.89, 0.32, 1.28) forwards; }
.coupon-success-overlay.active .cp-2 { top: 18%; right: 12%; animation: particleBurst 0.8s 0.15s cubic-bezier(0.17, 0.89, 0.32, 1.28) forwards; }
.coupon-success-overlay.active .cp-3 { bottom: 25%; left: 8%; animation: particleBurst 0.8s 0.2s cubic-bezier(0.17, 0.89, 0.32, 1.28) forwards; }
.coupon-success-overlay.active .cp-4 { bottom: 30%; right: 10%; animation: particleBurst 0.8s 0.25s cubic-bezier(0.17, 0.89, 0.32, 1.28) forwards; }
.coupon-success-overlay.active .cp-5 { top: 4%; left: 45%; animation: particleBurst 0.8s 0.05s cubic-bezier(0.17, 0.89, 0.32, 1.28) forwards; }
.coupon-success-overlay.active .cp-6 { bottom: 15%; left: 48%; animation: particleBurst 0.8s 0.3s cubic-bezier(0.17, 0.89, 0.32, 1.28) forwards; }

@keyframes particleBurst {
    0% { opacity: 0; transform: scale(0.2) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.3) rotate(15deg); }
    100% { opacity: 0.85; transform: scale(1) rotate(0deg); }
}

.coupon-success-icon-badge {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(22, 163, 74, 0.3));
    border: 2px solid #22c55e;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.4);
    animation: iconPop 0.5s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes iconPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.coupon-success-tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.14);
    border: 1px dashed #16a34a;
    color: #15803d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.coupon-success-title {
    font-size: 19px;
    font-weight: 850;
    color: #0f172a;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.coupon-success-amount-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 14px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.savings-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.savings-amount {
    font-size: 26px;
    font-weight: 900;
    color: #16a34a;
    line-height: 1.15;
}

.coupon-success-desc {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 20px;
}

.coupon-success-btn {
    width: 100%;
    padding: 13px 20px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #ffffff;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.coupon-success-btn:active {
    transform: scale(0.97);
}

.coupon-auto-dismiss-bar-wrap {
    width: 100%;
    height: 4px;
    background: rgba(22, 163, 74, 0.15);
    border-radius: 999px;
    margin-top: 14px;
    overflow: hidden;
}

.coupon-auto-dismiss-bar {
    height: 100%;
    width: 100%;
    background: #16a34a;
    border-radius: 999px;
    transform-origin: left;
}

.coupon-success-overlay.active .coupon-auto-dismiss-bar {
    animation: dismissProgress 3.2s linear forwards;
}

@keyframes dismissProgress {
    0% { transform: scaleX(1); }
    100% { transform: scaleX(0); }
}

@keyframes sheet-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ===========================  TOGGLE SWITCH  =========================== */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
    display: inline-block;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 22px;
    transition: background 0.2s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary, #2563eb);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* ═══════ PULSE START PRINT BUTTON ═══════ */
.pulse-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    font-family: var(--font2, 'Manrope', sans-serif);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45), 0 0 0 0 rgba(99, 102, 241, 0.5);
    animation: pulseAura 2.2s ease-in-out infinite;
    transition: transform 0.18s, box-shadow 0.18s;
    -webkit-tap-highlight-color: transparent;
}

.pulse-start-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 60%);
    pointer-events: none;
}

.pulse-start-btn:active {
    transform: scale(0.96);
}

@keyframes pulseAura {
    0%   { box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45), 0 0 0 0 rgba(99, 102, 241, 0.45); }
    50%  { box-shadow: 0 8px 32px rgba(99, 102, 241, 0.55), 0 0 0 16px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45), 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* ═══════ SKELETON LOADERS ═══════ */
.skeleton-box {
    background: linear-gradient(90deg, var(--bg2) 25%, rgba(255,255,255,0.55) 50%, var(--bg2) 75%);
    background-size: 200% 100%;
    animation: shimmerSkeleton 1.4s linear infinite;
    border-radius: 10px;
}

@keyframes shimmerSkeleton {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 12px;
    border-radius: 8px;
}

/* ═══════ SCREEN TRANSITIONS ═══════ */
.screen {
    animation: screenSlideIn 0.22s ease-out both;
}

@keyframes screenSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════ SHAKE ANIMATION (phone prompt error) ═══════ */
@keyframes shakePop {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-7px); }
    40%  { transform: translateX(7px); }
    60%  { transform: translateX(-5px); }
    80%  { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

/* ═══════ IN-APP NOTIFICATION TOAST ═══════ */
.inapp-toast {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    pointer-events: all;
    animation: toastSlideDown 0.35s cubic-bezier(0.34, 1.2, 0.64, 1) both;
    transition: opacity 0.3s, transform 0.3s;
}

.inapp-toast.toast-held   { border-left: 4px solid #6366f1; }
.inapp-toast.toast-done   { border-left: 4px solid #16a34a; }
.inapp-toast.toast-failed { border-left: 4px solid #dc2626; }

@keyframes toastSlideDown {
    from { opacity: 0; transform: translateY(-18px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Payment Confirming Modal Animations ── */
@keyframes payConfirmSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes payConfirmPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.12); opacity: 0.8; }
}

#modal-payment-confirming {
    animation: fadeIn 0.25s ease both;
}

#pay-confirm-waiting,
#pay-confirm-failed {
    animation: fadeIn 0.3s ease both;
}

/* ── Sticky Pay Success Action Bar (Floats directly above mobile bottom nav) ── */
#pay-success-action-bar {
    display: none;
    position: fixed;
    bottom: calc(64px + max(12px, env(safe-area-inset-bottom)) + 8px);
    left: 12px;
    right: 12px;
    max-width: 440px;
    margin: 0 auto;
    z-index: 550;
    padding: 10px 14px 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(61, 90, 62, 0.08);
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
}

@media (min-width: 1025px) {
    #pay-success-action-bar {
        max-width: 460px;
        left: 50%;
        transform: translateX(-50%);
        bottom: 24px;
        border-radius: 20px;
        border: 1px solid var(--border);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(61, 90, 62, 0.08);
    }
}

/* ===========================  COOKIE & STORAGE BANNER  =========================== */
#selfprintz-cookie-banner {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    left: auto !important;
    top: auto !important;
    width: calc(100vw - 32px) !important;
    max-width: 420px !important;
    background: #0f172a !important;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(19, 38, 27, 0.98) 100%) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 18px !important;
    padding: 20px 22px !important;
    box-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(74, 222, 128, 0.18) !important;
    z-index: 2147483647 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    color: #f1f5f9 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    transform: translateY(24px) scale(0.96) !important;
    opacity: 0 !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease !important;
}
#selfprintz-cookie-banner * {
    box-sizing: border-box !important;
}
#selfprintz-cookie-banner.sp-cookie-show {
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
}
#selfprintz-cookie-banner.sp-cookie-hide,
body:has(#login-screen:not(.hidden)) #selfprintz-cookie-banner {
    transform: translateY(24px) scale(0.96) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    display: none !important;
}
.sp-cookie-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
}
.sp-cookie-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}
.sp-cookie-badge-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    background: rgba(34, 197, 94, 0.16) !important;
    border: 1px solid rgba(74, 222, 128, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 17px !important;
    flex-shrink: 0 !important;
}
.sp-cookie-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: -0.2px !important;
    margin: 0 !important;
}
.sp-cookie-close-btn {
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    padding: 4px 6px !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    transition: color 0.15s, background 0.15s !important;
}
.sp-cookie-close-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}
.sp-cookie-text {
    margin: 0 !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
}
.sp-cookie-text a {
    color: #4ade80 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    font-weight: 600 !important;
    transition: color 0.15s !important;
}
.sp-cookie-text a:hover {
    color: #86efac !important;
}
.sp-cookie-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    margin-top: 4px !important;
}
.sp-cookie-btn {
    font-family: inherit !important;
    font-size: 13px !important;
    padding: 9px 18px !important;
    border-radius: 11px !important;
    cursor: pointer !important;
    text-align: center !important;
    line-height: 1.3 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.sp-cookie-btn:active {
    transform: scale(0.97) !important;
}
.sp-cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    font-weight: 600 !important;
}
.sp-cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
}
.sp-cookie-btn-primary {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35) !important;
}
.sp-cookie-btn-primary:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.5) !important;
}
@media (max-width: 480px) {
    #selfprintz-cookie-banner {
        bottom: 16px !important;
        right: 16px !important;
        left: 16px !important;
        width: auto !important;
        max-width: calc(100vw - 32px) !important;
        padding: 18px 18px !important;
        border-radius: 16px !important;
    }
    .sp-cookie-actions {
        flex-direction: column-reverse !important;
        width: 100% !important;
    }
    .sp-cookie-btn {
        width: 100% !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   GLOBAL TOP ACTION PROGRESS BAR (Non-Intrusive Shimmer)
   ══════════════════════════════════════════════════════════════ */
.global-action-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    z-index: 9999;
    background: transparent;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.global-action-progress.is-active {
    opacity: 1;
}
.global-action-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.global-action-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    animation: globalGlowPulse 1.2s infinite;
}
@keyframes globalGlowPulse {
    0% { transform: translateX(-40px); }
    100% { transform: translateX(40px); }
}

/* Tactile button feedback */
.btn-primary:active,
.btn-secondary:active,
.home-print-btn:active,
.topbar-icon-btn:active {
    transform: scale(0.97);
}

/* Inline button spinner */
.btn-inline-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* Subtle cloud sync status pill */
.cloud-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
}
.cloud-sync-badge.syncing {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}
.cloud-sync-badge.ready {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

/* ==========================================================================
   LIVE DOCUMENT CREATION PROGRESS MODAL & DRAFT ORDER BANNER
   ========================================================================== */
.doc-proc-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.25s ease-out both;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.doc-proc-card {
    background: var(--card, #ffffff);
    border: 1px solid var(--border, rgba(226, 232, 240, 0.8));
    border-radius: 24px;
    padding: 28px 24px 22px;
    width: 100%;
    max-width: 410px;
    text-align: center;
    box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: scaleInCard 0.3s cubic-bezier(0.34, 1.35, 0.64, 1) both;
    position: relative;
    box-sizing: border-box;
}

@keyframes scaleInCard {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Multi-Ring Radar / Sonar Pulse */
.doc-proc-icon-wrap {
    position: relative;
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-proc-pulse-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid #2563eb;
    opacity: 0;
    pointer-events: none;
}

.doc-proc-pulse-ring.ring-1 {
    animation: docProcSonar 2.2s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.doc-proc-pulse-ring.ring-2 {
    animation: docProcSonar 2.2s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
    animation-delay: 1.1s;
}

@keyframes docProcSonar {
    0% { transform: scale(0.85); opacity: 0.85; border-color: #3b82f6; }
    50% { opacity: 0.35; }
    100% { transform: scale(1.48); opacity: 0; border-color: #06b6d4; }
}

.doc-proc-icon {
    width: 66px;
    height: 66px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(56, 189, 248, 0.22));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.8);
    position: relative;
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    animation: docProcIconBob 3s ease-in-out infinite alternate;
}

@keyframes docProcIconBob {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

.doc-proc-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text, #0f172a);
    margin: 0 0 5px 0;
    letter-spacing: -0.2px;
}

.doc-proc-subtitle {
    font-size: 12.5px;
    color: var(--muted, #64748b);
    margin: 0 0 16px 0;
    line-height: 1.4;
    min-height: 34px;
}

/* 3-Stage Pipeline Indicator */
.doc-proc-pipeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 16px 0;
    padding: 0 6px;
    position: relative;
}

.doc-proc-pipe-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 2;
    transition: all 0.3s ease;
}

.pipe-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg2, #f1f5f9);
    border: 2px solid var(--border, #cbd5e1);
    color: var(--muted, #94a3b8);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.pipe-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted, #94a3b8);
    letter-spacing: -0.1px;
    transition: color 0.3s ease;
}

.doc-proc-pipe-step.active .pipe-dot {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
    transform: scale(1.1);
}

.doc-proc-pipe-step.active .pipe-label {
    color: var(--primary, #2563eb);
}

.doc-proc-pipe-step.done .pipe-dot {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    transform: scale(1);
}

.doc-proc-pipe-step.done .pipe-label {
    color: #10b981;
}

.pipe-line {
    flex: 1;
    height: 2px;
    background: var(--border, #e2e8f0);
    margin: -14px 6px 0 6px;
    transition: background 0.3s ease;
}

.pipe-line.done {
    background: #10b981;
}

/* Shimmer Progress Bar */
.doc-proc-bar-wrap {
    width: 100%;
    height: 12px;
    background: var(--bg2, #f1f5f9);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--border, rgba(226, 232, 240, 0.7));
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
}

.doc-proc-bar-fill {
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(90deg, #2563eb, #38bdf8, #10b981);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.45);
    position: relative;
    overflow: hidden;
}

.doc-proc-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: docProcShimmer 1.8s infinite;
}

@keyframes docProcShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.doc-proc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 700;
}

.doc-proc-step {
    color: var(--muted, #64748b);
}

.doc-proc-pct {
    color: var(--primary, #2563eb);
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* Real-Time Upload Stats Panel (Uploaded MB, Pending MB, Speed) */
.doc-proc-stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--bg2, #f8fafc);
    border: 1px solid var(--border, rgba(226, 232, 240, 0.9));
    border-radius: 14px;
    text-align: left;
    animation: fadeInModal 0.3s ease-out;
}

.doc-proc-stat-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.doc-proc-stat-label {
    font-size: 9.5px;
    font-weight: 800;
    color: var(--muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-proc-stat-val {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--text, #0f172a);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-proc-stat-val.pending {
    color: #eab308;
}

.doc-proc-stat-val.speed {
    color: #10b981;
}

@media (max-width: 380px) {
    .doc-proc-stats-panel {
        grid-template-columns: 1fr 1fr;
    }
    #doc-proc-stat-speed-card {
        grid-column: span 2;
    }
}

/* Unfinished Cart Draft Banner on Orders Screen */
.orders-draft-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(56, 189, 248, 0.08));
    border: 1.5px solid rgba(37, 99, 235, 0.25);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.06);
}

.orders-draft-timer {
    font-size: 11px;
    font-weight: 700;
    color: #d97706;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.orders-draft-timer.timer-urgent,
.order-held-live-timer.timer-urgent {
    color: #dc2626 !important;
    animation: draftTimerPulse 1.5s infinite;
}

.order-held-live-timer,
.home-held-live-timer {
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@keyframes draftTimerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}


/* ====== UPLOAD METHOD MODAL & WHATSAPP SYNC STYLES ====== */
@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-choice-card:hover {
    border-color: var(--primary, #025f45) !important;
    background: var(--bg2, #f1f5f9) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.upload-quick-btn:hover {
    border-color: var(--primary, #025f45) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pulse-dot {
    animation: pulseDotAnim 1.4s infinite ease-in-out both;
}

@keyframes pulseDotAnim {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* 1-Page Duplex Choice Cards */
.duplex-choice-card {
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.duplex-choice-card:hover {
    border-color: var(--primary, #3d5a3e) !important;
    background: var(--bg2, #f1f5f9) !important;
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.duplex-choice-card:active {
    transform: translateY(0);
}

/* Progressive Radius & Infinite Scroll Kiosk Cards */
@keyframes fadeInApmCard {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.apm-kiosk-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.apm-kiosk-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

/* APM Search Box */
#apm-search-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(45, 90, 64, 0.15) !important;
}

.apm-online-pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    animation: apmPulseAnim 2s infinite;
}

@keyframes apmPulseAnim {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(22, 163, 74, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   MODERN 2-PHASE PRINT MONITOR & COLLECTION UI (MOBILE-FIRST)
   ═══════════════════════════════════════════════════════════════════ */

/* Top bar refinements for Printing screen */
.print-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--surface, #ffffff);
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.print-kiosk-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary, #15803d);
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.25);
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.print-monitor-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 36px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Kiosk Live Radar Pill ── */
.print-kiosk-radar-pill {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 12px;
    color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.kiosk-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
    animation: radar-pulse 1.8s infinite;
}

@keyframes radar-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ── Hardware Animation Hero ── */
.print-hardware-hero {
    text-align: center;
    padding: 14px 12px 10px;
}

.hardware-printer-graphic {
    position: relative;
    width: 110px;
    height: 74px;
    margin: 0 auto 14px;
}

.printer-body {
    position: relative;
    width: 100%;
    height: 64px;
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 8px;
    border: 1px solid #475569;
}

.printer-light-indicator {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: blink-light 1.2s infinite;
}

@keyframes blink-light {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.printer-feed-slot {
    width: 72px;
    height: 7px;
    background: #0f172a;
    border-radius: 4px;
    position: relative;
    overflow: visible;
}

.paper-eject-sheet {
    position: absolute;
    top: -2px;
    left: 8px;
    width: 56px;
    height: 28px;
    background: #ffffff;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    border: 1px solid #cbd5e1;
    animation: paper-glide 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes paper-glide {
    0% { transform: translateY(0); opacity: 0.3; }
    40% { transform: translateY(14px); opacity: 1; }
    85% { transform: translateY(22px); opacity: 1; }
    100% { transform: translateY(26px); opacity: 0; }
}

.printer-tray-glow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 12px;
    background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.35) 0%, rgba(34, 197, 94, 0) 70%);
}

.print-stage-title {
    font-size: clamp(20px, 5vw, 24px);
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
    letter-spacing: -0.3px;
}

.print-stage-desc {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

/* ── Live Telemetry Card ── */
.print-telemetry-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.telemetry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.telemetry-sheets-counter {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.telemetry-pct-badge {
    font-size: 13px;
    font-weight: 800;
    color: #16a34a;
    font-variant-numeric: tabular-nums;
}

.eject-progress-track {
    height: 9px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    border: 1px solid #e2e8f0;
}

.eject-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #16a34a 100%);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(22, 163, 74, 0.4);
}

.telemetry-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2px;
}

.print-countdown-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #0284c7;
}

.countdown-clock-icon {
    font-size: 14px;
}

.eject-badge {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
}

.eject-badge.completed {
    background: #22c55e;
    color: #ffffff;
}

/* ── Streamlined 3-Milestone Stepper ── */
.print-milestones-track {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.milestone-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.milestone-node {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s ease;
    margin-bottom: 6px;
}

.step-check {
    display: none;
}

.milestone-text {
    width: 100%;
}

.milestone-name {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.milestone-sub {
    font-size: 10.5px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.milestone-line {
    height: 2px;
    background: #e2e8f0;
    flex: 0 0 24px;
    margin-top: -18px;
    transition: background 0.35s ease;
}

/* Milestone States */
.milestone-step.active .milestone-node {
    background: #dcfce7;
    border-color: #16a34a;
    color: #15803d;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.16);
}

.milestone-step.active .milestone-name {
    color: #166534;
}

.milestone-step.completed .milestone-node {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

.milestone-step.completed .node-icon {
    display: none;
}

.milestone-step.completed .step-check {
    display: inline;
    font-weight: 800;
    font-size: 14px;
}

.milestone-step.completed .milestone-name {
    color: #0f172a;
}

.milestone-step.completed + .milestone-line {
    background: #16a34a;
}

/* ── Quick Specs Chips ── */
.print-specs-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.spec-chip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.spec-label {
    display: block;
    font-size: 10.5px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 2px;
}

.spec-val {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Cancel Button ── */
.print-cancel-row {
    text-align: center;
    padding-top: 6px;
}

.btn-cancel-print {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-print:hover {
    background: rgba(239, 68, 68, 0.06);
    border-color: #dc2626;
}

/* ═══════════════════════════════════════════════════════════════════
   PHASE 2: CELEBRATION & COLLECTION VIEW (WHEN COMPLETED)
   ═══════════════════════════════════════════════════════════════════ */
.print-collection-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fade-in-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.collection-celebrate-badge {
    text-align: center;
    padding: 8px 12px;
}

.celebrate-check-ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    color: #ffffff;
    font-size: 34px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 0 28px rgba(34, 197, 94, 0.38);
    animation: check-spring 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes check-spring {
    0% { transform: scale(0.3); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.celebrate-title {
    font-size: clamp(22px, 5.5vw, 26px);
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
}

.celebrate-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
}

/* ── Illuminated Kiosk Tray Visual Card ── */
.collection-tray-card {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
    border: 1.5px solid #86efac;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.08);
    text-align: center;
}

.tray-glow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    text-align: left;
}

.tray-hardware-icon {
    font-size: 26px;
}

.tray-header-meta {
    flex: 1;
}

.eject-title {
    font-size: 13px;
    font-weight: 800;
    color: #166534;
    letter-spacing: 0.5px;
}

.eject-subtitle {
    font-size: 12px;
    color: #15803d;
}

.tray-ready-pill {
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
    background: #16a34a;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.5px;
}

.tray-hardware-visual {
    background: #0f172a;
    border-radius: 14px;
    padding: 22px 14px 18px;
    margin-bottom: 14px;
    position: relative;
    border: 1px solid #334155;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.5);
}

.tray-machine-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.tray-paper-stack {
    position: relative;
    width: 140px;
    height: 48px;
    margin-bottom: 12px;
}

.stack-sheet {
    position: absolute;
    width: 100%;
    height: 34px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    border: 1px solid #cbd5e1;
}

.stack-sheet.sheet-1 { top: 0; transform: rotate(-2deg); }
.stack-sheet.sheet-2 { top: 6px; transform: rotate(1deg); }
.stack-sheet.sheet-3 { top: 12px; transform: rotate(0deg); border-top: 2px solid #22c55e; }

.tray-arrow-down {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #4ade80;
    animation: tray-bounce 1.5s infinite;
}

@keyframes tray-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.tray-location-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: #334155;
    padding-top: 4px;
}

.tray-location-bar strong {
    color: #15803d;
}

/* ── Receipt Summary Chip ── */
.collection-receipt-chip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.receipt-chip-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.receipt-chip-icon {
    font-size: 24px;
}

.receipt-chip-details {
    flex: 1;
    text-align: left;
}

.receipt-chip-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
}

.receipt-chip-sub {
    font-size: 12px;
    color: #64748b;
}

.receipt-status-pill {
    font-size: 11px;
    font-weight: 700;
    color: #15803d;
    background: #dcfce7;
    padding: 4px 9px;
    border-radius: 999px;
}

/* ── Action Buttons Container ── */
.collection-actions-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 6px;
}

.collection-primary-btn {
    min-height: 52px;
    font-size: 15px !important;
    font-weight: 800 !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.3) !important;
}

.collection-secondary-btn {
    min-height: 48px;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #334155 !important;
}

/* ── Attention & Error Panels ── */
.print-hw-attention-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fde68a;
    border-radius: 18px;
    padding: 18px 20px;
    text-align: left;
    box-shadow: 0 8px 24px -4px rgba(217, 119, 6, 0.12);
    animation: fadeInSlideUp 0.3s ease-out;
    margin-bottom: 4px;
}

.hw-attention-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.hw-attention-icon {
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #fef08a;
    border-radius: 50%;
    flex-shrink: 0;
}

.hw-attention-title {
    font-size: 15px;
    font-weight: 800;
    color: #92400e;
    letter-spacing: -0.2px;
}

.hw-attention-desc {
    color: #78350f;
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 16px;
}

#btn-hw-refund {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 13.5px;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#btn-hw-refund:active {
    transform: scale(0.98);
}

/* Hardware printer paused state */
.hardware-printer-graphic.printer-paused .printer-light-indicator {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
    animation: indicator-pulse-amber 1.2s infinite;
}

.hardware-printer-graphic.printer-paused .printer-tray-glow {
    background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
}

.hardware-printer-graphic.printer-paused .paper-eject-sheet {
    animation-play-state: paused;
}

@keyframes indicator-pulse-amber {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.print-failed-card {
    text-align: center;
    padding: 28px 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fef2f2 100%);
    border: 1.5px solid #fecaca;
    border-radius: 20px;
    box-shadow: 0 12px 32px -8px rgba(220, 38, 38, 0.14);
    animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.failed-icon-shield {
    width: 60px;
    height: 60px;
    background: #fee2e2;
    border: 2px solid #fca5a5;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 12px;
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.18);
}

.print-failed-title {
    font-size: 19px;
    font-weight: 800;
    color: #b91c1c;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.print-failed-desc {
    font-size: 13.5px;
    color: #7f1d1d;
    margin: 0 0 16px;
    line-height: 1.5;
}

.print-refund-status {
    font-size: 13px;
    font-weight: 700;
    color: #15803d;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.08);
}

.failed-actions-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.failed-primary-btn {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 14.5px !important;
    padding: 13px 20px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 14px rgba(22, 101, 52, 0.25) !important;
}

.failed-secondary-btn {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #334155 !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 12px 18px !important;
    border-radius: 12px !important;
}