/* ==============================================
   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: 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: 20px;
    left: 20px;
    right: 20px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.85);
    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: 68px;
    z-index: 500;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bottom-nav.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: 18px;
    font-weight: 700;
    flex: 1;
}

.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 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    transition: opacity 0.15s, transform 0.1s;
    font-family: var(--font);
}

.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: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.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;
    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;
}
.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;
}
.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 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

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

.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: 10px;
    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;
}

/* 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: 10px;
    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);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: box-shadow 0.15s;
    box-shadow: var(--shadow);
}

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

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

.order-info {
    flex: 1;
}

.order-id {
    font-size: 14px;
    font-weight: 600;
}

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

.order-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 50px;
    white-space: nowrap;
}

.order-status-printing {
    background: #fff3e0;
    color: var(--warning);
}

.order-status-completed {
    background: #e8f5e9;
    color: var(--success);
}

.order-status-pending {
    background: #f3e5f5;
    color: #8e24aa;
}

/* ==== 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;
}

.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-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.preview-info-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.preview-info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 4px;
}

.preview-info-value {
    font-size: 14px;
    font-weight: 600;
}

/* ========== 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: 16px;
}

.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;
    transition: background 0.15s;
}

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

.copies-count {
    font-size: 20px;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
}

.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;
}

.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-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: 10px;
    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-pill svg {
    color: var(--muted);
    transition: color 0.15s;
}
.paper-size-pill.selected svg,
.paper-size-pill:hover svg {
    color: var(--primary);
}

/* 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 {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
#pending-files-list .file-item:hover {
    border-color: var(--primary);
    background: var(--primary-lt);
}


.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);
}

.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;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-meta {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.cart-item-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

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

.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;
}

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

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

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

.summary-value {
    font-weight: 600;
}

/* ========== 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;
}

.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);
}

/* ========== 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;
        align-items: flex-start;
        justify-content: center;
        min-height: 100vh;
    }

    .app {
        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;
    }

    /* 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;
    }

    .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;
    }
}