
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
    --red: #f04f21;
    --orange: #f58016;
    --yellow: #ffbe2e;
    --cream: #FDF9F3;
    --peach: #fff1e6;
    --paper: #ffffff;
    --ink: #1a1a1a;
    --muted: #6e6259;
    --line: #1a1a1a;
    --shadow: 5px 5px 0 var(--ink);
    --primary: #f04f21;
    --secondary: #f58016;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

.site-header {
    min-height: 78px;
    padding: 16px 5.5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    text-decoration: none;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.8px;
}

.brand img {
    display: block;
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.back-link {
    color: var(--ink);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

.back-link span {
    margin-right: 5px;
    font-size: 17px;
}

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

.page-container {
    width: min(1240px, 89%);
    margin: 0 auto;
}

.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    min-height: 330px;
    margin: 36px 0 62px;
    padding: clamp(28px, 5vw, 64px);
    overflow: hidden;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: 2px solid var(--ink);
    box-shadow: 9px 9px 0 var(--ink);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 690px;
}

.eyebrow {
    margin: 0 0 14px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: clamp(45px, 7.5vw, 88px);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -5px;
}

.hero h1 span {
    color: var(--yellow);
}

.hero-description {
    max-width: 490px;
    margin: 22px 0 0;
    font-size: 14px;
    line-height: 1.8;
}

.hero-sticker {
    flex: 0 0 150px;
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotate(9deg);
    color: var(--ink);
    background: var(--yellow);
    border: 3px solid var(--ink);
    border-radius: 50%;
    box-shadow: 5px 5px 0 var(--ink);
}

.hero-sticker span {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
}

.hero-sticker strong {
    font-size: 25px;
    line-height: 1;
}

.manager-section {
    margin-bottom: 70px;
}

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

.section-heading .eyebrow {
    color: var(--primary);
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(27px, 4vw, 40px);
    font-weight: 900;
    letter-spacing: -1.8px;
}

.total-badge {
    flex-shrink: 0;
    padding: 11px 14px;
    color: white;
    background: var(--secondary);
    border: 2px solid var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
    font-size: 11px;
    font-weight: 900;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 14px;
    margin-bottom: 18px;
}

.search-box,
.filter-box {
    min-height: 57px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: white;
    border: 2px solid var(--ink);
}

.search-box > span {
    font-size: 27px;
    font-weight: 700;
}

.search-box input {
    width: 100%;
    min-width: 0;
    padding: 14px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
}

.filter-box {
    gap: 10px;
}

.filter-box span {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.filter-box select {
    width: 100%;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.search-box:focus-within,
.filter-box:focus-within {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

.result-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 20px 0;
}

.result-line p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.reset-button {
    padding: 8px 12px;
    border: 1px solid var(--ink);
    background: transparent;
    color: var(--ink);
    font-size: 11px;
    font-weight: 800;
}

.reset-button:hover {
    color: white;
    background: var(--secondary);
}

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

.qr-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qr-capture {
    position: relative;
    min-width: 0;
    aspect-ratio: 620 / 877;
    padding: 18px 16px 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at 50% 24%, #fffdf8 0%, #fff4e0 55%, #ffe5bf 100%);
    border: 2px solid var(--ink);
    border-radius: 14px;
    box-shadow: 4px 4px 0 var(--ink);
}

.qr-poster-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.qr-wave {
    position: absolute;
    display: block;
}

.qr-wave-left {
    top: 12%;
    left: -13%;
    width: 24%;
    height: 44%;
    background: #f57c20;
    border-radius: 50%;
}

.qr-wave-right {
    top: 10%;
    right: -13%;
    width: 24%;
    height: 46%;
    background: #f04f21;
    border-radius: 50%;
}

.qr-wave-bottom {
    left: -12%;
    right: -12%;
    bottom: -6%;
    height: 15%;
    background: #f04f21;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.qr-cup {
    position: absolute;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(90, 32, 8, 0.2));
}

.qr-cup-ml {
    width: 34%;
    left: -10%;
    top: 34%;
    transform: rotate(18deg);
}

.qr-cup-mr {
    width: 34%;
    right: -10%;
    top: 38%;
    transform: rotate(-16deg);
}

.qr-cup-bl {
    width: 38%;
    left: -9%;
    bottom: 2%;
    transform: rotate(10deg);
}

.qr-cup-br {
    width: 38%;
    right: -9%;
    bottom: 2%;
    transform: rotate(-11deg);
}

.qr-poster-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card-topline {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.poster-brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

.outlet-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 24px;
    padding: 0 10px;
    color: white;
    background: var(--primary);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.city-tag {
    max-width: 34%;
    padding: 4px 10px;
    overflow: hidden;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.92);
    border: 1.5px solid #f59c6c;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.outlet-name {
    min-height: 0;
    margin: 8px 0 5px;
    color: #1f1712;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.4px;
    overflow-wrap: anywhere;
}

.outlet-address {
    min-height: 0;
    margin: 0 0 10px;
    max-width: 92%;
    display: block;
    text-align: center;
    color: #4b3d33;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.address-pin-icon {
    position: relative;
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 5px;
    vertical-align: 0;
    background: var(--primary);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

.address-pin-icon::after {
    content: "";
    position: absolute;
    inset: 2.5px;
    background: #fff8ec;
    border-radius: 50%;
}

.qr-stage {
    position: relative;
    margin: auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-burst {
    position: absolute;
    top: -12px;
    right: -14px;
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.qr-burst i {
    position: absolute;
    display: block;
    width: 12px;
    height: 3.5px;
    border-radius: 999px;
    background: var(--primary);
}

.qr-burst i:nth-child(1) { top: 0; left: 2px; transform: rotate(-60deg); }
.qr-burst i:nth-child(2) { top: 8px; left: 7px; transform: rotate(-32deg); }
.qr-burst i:nth-child(3) { top: 16px; left: 10px; transform: rotate(-6deg); }

.qr-preview {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 10px;
    background: #ffffff;
    border: 3px solid var(--primary);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(240, 79, 33, 0.16);
}

.qr-cta-wrap {
    position: relative;
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.qr-capture-banner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
    padding: 8px 16px;
    color: white;
    background: linear-gradient(135deg, #f04f21 0%, #f58016 100%);
    border: 2px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 5px 14px rgba(240, 79, 33, 0.3);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    text-align: left;
}

.banner-phone-icon {
    width: 14px;
    height: 20px;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(2, 3px);
    grid-template-rows: repeat(2, 3px);
    place-content: center;
    gap: 2px;
    border: 2px solid #ffffff;
    border-radius: 3px;
}

.banner-phone-icon i {
    display: block;
    width: 3px;
    height: 3px;
    background: #ffffff;
}

.banner-divider {
    width: 1.5px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
}

.cta-burst {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cta-burst i {
    display: block;
    width: 10px;
    height: 3px;
    border-radius: 999px;
    background: #ffd23f;
}

.cta-burst-left i:nth-child(1) { transform: rotate(22deg); }
.cta-burst-left i:nth-child(3) { transform: rotate(-22deg); }
.cta-burst-right i:nth-child(1) { transform: rotate(-22deg); }
.cta-burst-right i:nth-child(3) { transform: rotate(22deg); }

.qr-preview canvas,
.qr-preview img {
    display: block;
    width: 158px;
    height: 158px;
    max-width: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

/* Exact A4 proportions for html2canvas export (620x877 @4x = 2480x3508) */
.qr-capture.is-a4-export {
    padding: 36px 34px 32px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.qr-capture.is-a4-export .poster-brand-logo {
    width: 82px;
    height: 82px;
}

.qr-capture.is-a4-export .outlet-number {
    min-width: 82px;
    height: 40px;
    padding: 0 18px;
    font-size: 20px;
}

.qr-capture.is-a4-export .city-tag {
    padding: 8px 18px;
    border-width: 2px;
    font-size: 17px;
}

.qr-capture.is-a4-export .outlet-name {
    margin: 14px 0 8px;
    font-size: 32px;
}

.qr-capture.is-a4-export .outlet-address {
    margin-bottom: 18px;
    font-size: 17px;
    gap: 8px;
}

.qr-capture.is-a4-export .address-pin-icon {
    width: 14px;
    height: 14px;
    margin-right: 8px;
}

.qr-capture.is-a4-export .address-pin-icon::after {
    inset: 4px;
}

.qr-capture.is-a4-export .qr-preview {
    padding: 18px;
    border-width: 5px;
    border-radius: 26px;
}

.qr-capture.is-a4-export .qr-capture-banner {
    padding: 14px 28px;
    gap: 14px;
    border-width: 4px;
    font-size: 21px;
}

.qr-capture.is-a4-export .banner-phone-icon {
    width: 24px;
    height: 34px;
    grid-template-columns: repeat(2, 5px);
    grid-template-rows: repeat(2, 5px);
    gap: 3px;
    border-width: 3px;
    border-radius: 5px;
}

.qr-capture.is-a4-export .banner-phone-icon i {
    width: 5px;
    height: 5px;
}

.qr-capture.is-a4-export .banner-divider {
    width: 2px;
    height: 36px;
}

.qr-capture.is-a4-export .cta-burst i {
    width: 18px;
    height: 4.5px;
}

.download-button {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    color: #ffffff;
    background: #1a1a1a;
    border: 2px solid #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 4px 0 #f04f21;
    font-size: 11.5px;
    font-weight: 900;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
}

.download-button > span {
    color: #ffbe2e;
    font-size: 14px;
    font-weight: 900;
}

.download-button:hover {
    background: #2f2620;
    color: #ffbe2e;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #f04f21;
}

.download-button:active {
    transform: translateY(4px);
    box-shadow: none;
}

.download-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.download-status {
    min-height: 18px;
}

.loading-state,
.empty-state {
    grid-column: 1 / -1;
    padding: 50px 20px;
    text-align: center;
    background: var(--peach);
    border: 2px dashed #dfd1c3;
    color: var(--muted);
}

.empty-state[hidden] {
    display: none;
}

.empty-state > span {
    font-size: 38px;
}

.empty-state h3 {
    margin: 10px 0;
    color: var(--ink);
    font-size: 20px;
}

.empty-state p {
    font-size: 12px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 24px 0;
    border-top: 2px solid var(--ink);
    font-size: 11px;
}

.site-footer strong {
    font-weight: 900;
}

.site-footer span {
    color: var(--muted);
}

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

    .hero-sticker {
        flex-basis: 120px;
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 600px) {
    .site-header {
        min-height: 67px;
        padding: 12px 5%;
    }

    .brand {
        gap: 8px;
        font-size: 14px;
    }

    .brand img {
        width: 35px;
        height: 35px;
    }

    .back-link {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        min-height: 34px;
        padding: 6px 11px;
        border: 1.5px solid var(--ink);
        border-radius: 999px;
        background: var(--peach);
        font-size: 10px;
        font-weight: 800;
    }

    .page-container {
        width: calc(100% - 32px);
    }

    .hero {
        min-height: auto;
        margin: 16px 0 26px;
        padding: 20px 18px;
        border-radius: 16px;
        box-shadow: 4px 4px 0 var(--ink);
    }

    .hero h1 {
        padding-right: 68px;
        font-size: clamp(34px, 10.5vw, 48px);
        letter-spacing: -1.8px;
    }

    .hero-description {
        max-width: 100%;
        margin-top: 10px;
        font-size: 12px;
        line-height: 1.65;
    }

    .hero-sticker {
        position: absolute;
        top: 14px;
        right: 14px;
        bottom: auto;
        width: 62px;
        height: 62px;
        min-width: 62px;
        transform: rotate(10deg);
        border-width: 2px;
        box-shadow: 3px 3px 0 var(--ink);
    }

    .hero-sticker span {
        font-size: 9px;
    }

    .hero-sticker strong {
        font-size: 13px;
    }

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

    .section-heading h2 {
        font-size: 28px;
        letter-spacing: -1.2px;
    }

    .total-badge {
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 9.5px;
    }

    .toolbar {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .search-box,
    .filter-box {
        min-height: 48px;
        border-radius: 10px;
    }

    .qr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .qr-capture {
        padding: 10px;
        box-shadow: 3px 3px 0 var(--ink);
    }

    .card-topline {
        flex-wrap: wrap;
        gap: 6px;
    }

    .outlet-number {
        min-width: 30px;
        height: 25px;
        font-size: 10px;
    }

    .city-tag {
        max-width: 100%;
        font-size: 8px;
    }

    .outlet-name {
        min-height: 42px;
        margin-top: 12px;
        font-size: 13px;
    }

    .outlet-address {
        min-height: 48px;
        font-size: 10px;
    }

    .qr-preview {
        min-height: 0;
        margin: 12px 0;
        padding: 5px;
    }

    .qr-preview canvas,
    .qr-preview img {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .download-button {
        min-height: 40px;
        padding: 8px 5px;
        font-size: 9px;
        box-shadow: 2px 2px 0 var(--ink);
    }

    .site-footer {
        flex-direction: column;
        gap: 8px;
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}


.result-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.download-all-button {
    min-height: 38px;
    padding: 9px 13px;
    color: #fff;
    background: var(--primary);
    border: 2px solid var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
    font-size: 11px;
    font-weight: 900;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.download-all-button:hover:not(:disabled) {
    background: var(--secondary);
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--ink);
}

.download-all-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.download-status {
    min-height: 18px;
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .result-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1.35fr;
        gap: 10px;
    }

    .download-all-button,
    .reset-button {
        min-height: 42px;
        border-radius: 10px;
        font-size: 10.5px;
        justify-content: center;
        text-align: center;
    }

    .qr-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .qr-capture {
        padding: 18px 16px 16px;
    }

    .poster-brand-logo {
        width: 44px;
        height: 44px;
    }

    .outlet-name {
        font-size: 16px;
    }

    .outlet-address {
        font-size: 10px;
    }

    .qr-preview canvas,
    .qr-preview img {
        width: 168px;
        height: 168px;
    }
}

/* Exact A4 Print Layout — works identically from Mobile & Desktop */
@page {
    size: A4 portrait;
    margin: 0;
}

@media print {
    html,
    body {
        width: 210mm;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .site-header,
    .hero,
    .section-heading,
    .toolbar,
    .result-line,
    .download-status,
    .download-button,
    .site-footer,
    .empty-state,
    .loading-state {
        display: none !important;
    }

    .page-container,
    .manager-section,
    .qr-grid {
        display: block !important;
        width: 210mm !important;
        max-width: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }

    .qr-card {
        display: block !important;
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-after: always;
        break-after: page;
        break-inside: avoid;
    }

    .qr-capture {
        width: 210mm !important;
        height: 297mm !important;
        max-width: 210mm !important;
        padding: 14mm 14mm 12mm !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .qr-capture .poster-brand-logo {
        width: 28mm !important;
        height: 28mm !important;
    }

    .qr-capture .outlet-number {
        min-width: 26mm !important;
        height: 12mm !important;
        font-size: 16pt !important;
    }

    .qr-capture .city-tag {
        padding: 2.5mm 6mm !important;
        font-size: 12pt !important;
    }

    .qr-capture .outlet-name {
        margin: 5mm 0 3mm !important;
        font-size: 24pt !important;
    }

    .qr-capture .outlet-address {
        margin-bottom: 6mm !important;
        font-size: 12pt !important;
    }

    .qr-capture .qr-preview {
        padding: 6mm !important;
        border-width: 1.5mm !important;
        border-radius: 8mm !important;
    }

    .qr-capture .qr-preview canvas,
    .qr-capture .qr-preview img {
        width: 105mm !important;
        height: 105mm !important;
    }

    .qr-capture .qr-capture-banner {
        padding: 4.5mm 10mm !important;
        border-width: 1.2mm !important;
        font-size: 15pt !important;
    }
}
