/* =====================================================================
   ITs Print — "School Paper" redesign
   Customer side: student-friendly sticker/notebook look — cream paper,
   chunky ink borders, hard offset shadows, highlighter accents.
   Staff side (body.is-staff): "nanay mode" — bigger text, bigger buttons,
   calm background, presyo at gagawin kitang-kita agad.
   ===================================================================== */

:root {
    /* Palette derived from the ITs Print badge logo:
       deep teal ring, bright teal highlights, violet inner band,
       gold "ITS" lettering. */
    --paper: #F4FAFA;          /* soft paper with a cool teal tint */
    --card: #FFFFFF;
    --ink: #0E2A38;            /* deep teal-navy (logo ring) — text & borders */
    --muted: #5B7079;
    --line: #0E2A38;

    /* primary actions = logo teal (kept under the --blue name so all
       existing markup recolors with no template changes) */
    --blue: #11A8A4;           /* bright logo teal — primary actions */
    --blue-d: #0C8580;
    --blue-soft: #D2EFEC;
    --yellow: #FFC42E;         /* gold — the "ITS" lettering */
    --yellow-soft: #FFEDBE;
    --coral: #FF5D5D;          /* pricing / important */
    --coral-soft: #FFD9D9;
    --green: #1FAE76;          /* success / paid */
    --green-soft: #C7F1DC;
    --teal: #11A8A4;
    --purple: #6A23A8;         /* violet inner band — secondary accent */
    --purple-d: #551A88;
    --purple-soft: #ECDDFB;

    --radius: 16px;
    --radius-sm: 12px;
    --bs: 4px 4px 0 var(--ink);            /* sticker shadow */
    --bs-sm: 3px 3px 0 var(--ink);
    --font-display: 'Baloo 2', 'Nunito', sans-serif;
    --font-body: 'Nunito', system-ui, sans-serif;
    --font-mono: 'Courier New', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Keep the [hidden] attribute working even for elements whose class sets
   display (.editor/.btn/.badge/.uploading) — author display rules would
   otherwise override the UA's [hidden]{display:none} and force them visible. */
[hidden] { display: none !important; }
body {
    margin: 0;
    font: 400 16px/1.55 var(--font-body);
    color: var(--ink);
    background-color: var(--paper);
    background-image: radial-gradient(rgba(38, 36, 59, .07) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.no-scroll { overflow: hidden; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 8px; }
h1 { font-size: 34px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 10px; }
a { color: var(--blue-d); }
code { font-family: var(--font-mono); background: var(--yellow-soft); padding: 1px 6px; border-radius: 6px; }

.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.r { text-align: right; }
.inline { display: inline; }
.eyebrow { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.lead { font-size: 18px; }
/* highlighter swipe behind key words */
.hl { background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); padding: 0 4px; border-radius: 4px; }

.icon { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.2;
        stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px;
        display: inline-block; }
.gicon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
h1 .icon { width: 28px; height: 28px; vertical-align: -4px; }
h2 .icon { width: 19px; height: 19px; }
.steps__grid h3 .icon { width: 18px; height: 18px; }
.spec .icon { width: 15px; height: 15px; }
.tabs a .icon { width: 15px; height: 15px; }
.foot .icon { width: 14px; height: 14px; stroke: var(--coral); fill: var(--coral); }

/* ---- layout ------------------------------------------------------- */
.wrap { width: min(1080px, 100% - 32px); margin: 26px auto 60px; }
.wrap--wide { width: min(1180px, 100% - 32px); }
.wrap--narrow { width: min(520px, 100% - 32px); }

/* ---- topbar -------------------------------------------------------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px clamp(16px, 4vw, 36px);
    background: var(--card);
    border-bottom: 3px solid var(--ink);
    position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand__mark {
    width: 72px; height: 72px; flex: none;
    display: grid; place-items: center; overflow: hidden;
}
.brand__mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand__mark .icon { width: 20px; height: 20px; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 27px; }
.brand__name b { color: var(--purple); }
.topnav { display: flex; align-items: center; gap: 16px; font-weight: 700; font-size: 14.5px; }
.topnav a { color: var(--ink); text-decoration: none; }
.topnav a:hover { color: var(--blue-d); }
.staff-link {
    border: 2px solid var(--ink); border-radius: 999px; padding: 5px 14px;
    background: var(--card); box-shadow: var(--bs-sm);
}
.link { background: none; border: 0; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.link:hover { color: var(--coral); }

/* ---- flash --------------------------------------------------------- */
.flash {
    width: min(1080px, 100% - 32px); margin: 14px auto -6px;
    border: 2.5px solid var(--ink); border-radius: var(--radius-sm);
    padding: 11px 16px; font-weight: 700; box-shadow: var(--bs-sm);
}
.flash--ok { background: var(--green-soft); }
.flash--err { background: var(--coral-soft); }
.flash .icon { width: 19px; height: 19px; margin-right: 4px; }

/* ---- buttons -------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-display); font-weight: 700; font-size: 15.5px;
    color: var(--ink); background: var(--card);
    border: 2.5px solid var(--ink); border-radius: 14px;
    padding: 10px 20px; cursor: pointer; text-decoration: none;
    box-shadow: 0 4px 0 var(--ink);
    transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
.btn:hover { background: var(--yellow-soft); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-d); }
.btn--primary:disabled { background: #B9C6DC; border-color: #8A93A8; box-shadow: 0 4px 0 #8A93A8; cursor: not-allowed; }
.btn--ghost { background: var(--card); }
.btn--google { background: var(--card); }
.btn--sm { padding: 6px 13px; font-size: 14px; border-radius: 11px; box-shadow: 0 3px 0 var(--ink); }
.btn--sm:active { transform: translateY(3px); }
.btn--lg { padding: 14px 26px; font-size: 18px; }
.btn--block { width: 100%; }

/* ---- landing: hero -------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; padding: 30px 0 10px; }
.hero h1 { font-size: clamp(36px, 5.5vw, 54px); margin: 10px 0 14px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }

.qrcard { justify-self: center; transform: rotate(2.5deg); position: relative; }
.qrcard::before {            /* piraso ng tape sa taas */
    content: ""; position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-3deg);
    width: 110px; height: 26px; background: rgba(255, 197, 61, .75);
    border: 1px solid rgba(38, 36, 59, .15); z-index: 2;
}
.qrcard__inner {
    background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
    box-shadow: var(--bs); padding: 22px; text-align: center;
}
.qrcode { display: grid; place-items: center; padding: 6px; }
.qrcode img, .qrcode canvas { border-radius: 8px; }
.qrcard__hint { font-weight: 700; margin: 10px 0 6px; }
.qrcard__url { display: block; font-size: 12px; word-break: break-all; }

/* ---- landing: price board ------------------------------------------ */
.priceboard { margin-top: 54px; }
.priceboard > h2 { font-size: 28px; text-align: center; }
.priceboard__sub { text-align: center; color: var(--muted); margin-bottom: 22px; }
.priceboard__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.pricecard {
    background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
    box-shadow: var(--bs); padding: 18px; text-align: center;
}
.pricecard:nth-child(odd) { transform: rotate(-.8deg); }
.pricecard:nth-child(even) { transform: rotate(.8deg); }
.pricecard__icon {
    display: inline-grid; place-items: center; width: 54px; height: 54px; margin-bottom: 8px;
    border-radius: 50%; background: var(--yellow-soft); border: 2px solid var(--ink);
}
.pricecard__icon .icon { width: 26px; height: 26px; }
.pricecard--deal .pricecard__icon { background: #fff; }
.pricecard__amt { font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--coral); display: block; }
.pricecard__amt small { font-size: 14px; color: var(--muted); font-weight: 700; }
.pricecard__name { font-weight: 800; }
.pricecard__note { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.pricecard--deal { background: var(--green-soft); }

/* ---- landing: steps ------------------------------------------------- */
.steps { margin-top: 54px; text-align: center; }
.steps > h2 { font-size: 28px; }
.steps__grid { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 0; margin: 24px 0 0; }
.steps__grid li {
    background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
    box-shadow: var(--bs); padding: 20px 16px;
}
.steps__grid li:nth-child(odd) { transform: rotate(-.7deg); }
.steps__grid li:nth-child(even) { transform: rotate(.7deg); }
.steps__n {
    display: inline-grid; place-items: center; width: 42px; height: 42px;
    border-radius: 50%; border: 2.5px solid var(--ink);
    font-family: var(--font-display); font-weight: 800; font-size: 19px;
    margin-bottom: 8px; box-shadow: var(--bs-sm);
}
.steps__grid li:nth-child(1) .steps__n { background: var(--yellow); }
.steps__grid li:nth-child(2) .steps__n { background: var(--blue-soft); }
.steps__grid li:nth-child(3) .steps__n { background: var(--coral-soft); }
.steps__grid li:nth-child(4) .steps__n { background: var(--green-soft); }

/* ---- cards ----------------------------------------------------------- */
.card {
    background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
    box-shadow: var(--bs); padding: 20px; margin-bottom: 18px;
}
.card--head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.card--muted { background: var(--yellow-soft); }
.empty { text-align: center; color: var(--muted); font-weight: 700; padding: 26px 0; }

/* ---- uploader --------------------------------------------------------- */
.uploader { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.uploader__main { min-width: 0; }

.dropzone {
    display: block; cursor: pointer; text-align: center;
    background: var(--card); border: 3px dashed var(--ink); border-radius: var(--radius);
    padding: 34px 18px; margin-bottom: 16px;
    transition: background .15s ease, transform .15s ease;
}
.dropzone:hover, .dropzone.is-over { background: var(--yellow-soft); transform: scale(1.005); }
.dropzone__icon {
    width: 62px; height: 62px; margin: 0 auto 10px; border-radius: 50%;
    background: var(--yellow); border: 2.5px solid var(--ink); box-shadow: var(--bs-sm);
    display: grid; place-items: center;
}
.dropzone__icon .icon { width: 28px; height: 28px; }
.dropzone__title { font-family: var(--font-display); font-weight: 700; font-size: 19px; margin: 0; }
.dropzone__title span { color: var(--blue-d); text-decoration: underline; }
.dropzone__hint { margin: 4px 0 0; }

.uploading { margin: 0 0 14px; }
.uploading__head { font-weight: 700; margin: 0 0 10px; }
.spinner {
    display: inline-block; width: 16px; height: 16px; vertical-align: -3px;
    border: 3px solid var(--blue-soft); border-top-color: var(--blue);
    border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* per-file upload progress */
.up-list { display: flex; flex-direction: column; gap: 8px; }
.up-row {
    background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-sm);
    box-shadow: var(--bs-sm); padding: 9px 12px;
}
.up-row__top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.up-name {
    font-weight: 700; font-size: 14px; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.up-pct { font-family: var(--font-mono); font-size: 13px; color: var(--muted); flex: none; }
.up-bar {
    margin-top: 7px; height: 8px; border-radius: 99px;
    background: var(--blue-soft); border: 1.5px solid var(--ink); overflow: hidden;
}
.up-bar i {
    display: block; height: 100%; width: 0;
    background: var(--blue); transition: width .15s ease;
}
.up-row--err { border-color: #A52A2A; background: var(--coral-soft); }
.up-err { font-size: 13px; color: #8a1f1f; margin-top: 5px; }
.up-retry {
    flex: none; cursor: pointer; font: 700 13px var(--font-body);
    background: var(--card); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 99px; padding: 3px 12px;
}
.up-retry:hover { background: var(--yellow-soft); }

/* file cards */
.files { display: flex; flex-direction: column; gap: 14px; }
.filecard {
    background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
    box-shadow: var(--bs-sm); padding: 14px;
}
.filecard__top { display: flex; gap: 12px; align-items: center; }
.filecard__thumb {
    width: 52px; height: 52px; flex: none; border-radius: 10px;
    border: 2px solid var(--ink); background: var(--blue-soft) center/cover no-repeat;
    display: grid; place-items: center; overflow: hidden;
}
.filecard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.filecard__thumb--icon {
    background: var(--yellow-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2326243B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E") center/26px no-repeat;
}
.filecard__meta { min-width: 0; flex: 1; }
.filecard__name { font-weight: 800; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard__sub { margin: 0; }
.filecard__del {
    flex: none; background: var(--card); border: 2px solid var(--ink); border-radius: 10px;
    width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
    box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.filecard__del:hover { background: var(--coral-soft); color: var(--coral); }
.filecard__del:active { transform: translateY(3px); box-shadow: none; }

.filecard__opts { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 12px 0 0; padding-top: 12px; border-top: 2px dashed rgba(38, 36, 59, .25); }
.opt { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 800; }
.opt input[type="number"], .opt select {
    font: 700 14.5px var(--font-body); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 10px; padding: 7px 9px; background: #fff;
}
.opt input[type="number"] { width: 76px; }
.opt--check { flex-direction: row; align-items: center; gap: 7px; align-self: flex-end; padding-bottom: 8px; font-size: 13.5px; }
.opt--check input { width: 19px; height: 19px; accent-color: var(--blue); }

.filecard__foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.filecard__price { margin-left: auto; font-family: var(--font-display); font-weight: 800; font-size: 21px; color: var(--coral); }
.filecard__foot .btn { white-space: nowrap; }
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--yellow); border: 2px solid var(--ink); color: var(--ink);
    font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px;
    transform: rotate(-1.5deg);
}
.badge .icon { width: 12px; height: 12px; }
.badge--admin { background: var(--coral); color: #fff; transform: none; }

/* ---- summary = resibo ------------------------------------------------- */
.summary {
    background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius);
    box-shadow: var(--bs); padding: 18px; position: sticky; top: 86px;
}
.summary h2 { text-align: center; letter-spacing: .06em; text-transform: uppercase; font-size: 17px; }
.summary h2 .icon { width: 19px; height: 19px; }
.summary__rows { margin: 12px 0; padding: 12px 0; border-top: 2px dashed rgba(38,36,59,.3); border-bottom: 2px dashed rgba(38,36,59,.3); }
.summary__rows div { display: flex; justify-content: space-between; margin: 4px 0; }
.summary__rows dt { color: var(--muted); font-weight: 700; }
.summary__rows dd { margin: 0; font-family: var(--font-mono); font-weight: 700; }
.summary__total { font-size: 21px; padding-top: 8px; }
.summary__total dt { color: var(--ink); font-family: var(--font-display); font-weight: 800; }
.summary__total dd { color: var(--coral); font-family: var(--font-display) !important; font-weight: 800; }

.submitform { display: flex; flex-direction: column; gap: 11px; }
.submitform label { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: 13.5px; }
.submitform input, .submitform textarea {
    font: 600 15px var(--font-body); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 10px; padding: 9px 11px; background: #fff;
}
.submitform input:focus, .submitform textarea:focus, .opt select:focus, .opt input:focus,
.authform input:focus, .addstaff input:focus { outline: 3px solid var(--yellow); outline-offset: 1px; }
.signed { font-weight: 800; color: var(--green); }

/* ---- toasts ---------------------------------------------------------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
    background: var(--ink); color: #fff; font-weight: 700; font-size: 14.5px;
    border-radius: 12px; padding: 10px 18px; border: 2px solid var(--ink);
    border-left: 7px solid var(--green);
    opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
    box-shadow: 0 6px 18px rgba(38,36,59,.35);
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast--error { background: var(--coral); border-left-color: #A52A2A; }

/* ---- editor modal ----------------------------------------------------- */
.editor { position: fixed; inset: 0; height: var(--vvh, 100dvh); z-index: 80; background: rgba(38, 36, 59, .55); display: grid; place-items: safe center; overflow-y: auto; padding: 16px; }
.editor__panel {
    background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius);
    box-shadow: 8px 8px 0 rgba(38,36,59,.45); width: min(860px, 100%);
    display: flex; flex-direction: column; max-height: 94vh;
}
.editor__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 2.5px solid var(--ink); }
.editor__head h3 { margin: 0; font-size: 19px; }
.editor__close { background: var(--coral-soft); border: 2px solid var(--ink); border-radius: 10px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.editor__stage { padding: 16px; display: grid; place-items: center; overflow: auto; min-height: 0; background:
    repeating-conic-gradient(rgba(38,36,59,.05) 0% 25%, transparent 0% 50%) 0 0 / 22px 22px; }
.editor__stage { position: relative; }
.editor__stage .canvas-container { border: 2px solid var(--ink); border-radius: 6px; background: #fff; }
.editor__stage canvas { background: transparent; border-radius: 6px; }
.editor__status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 18px; font-weight: 800; font-size: 14px; color: var(--ink); background: rgba(255,255,255,.86); }
.editor__status[hidden] { display: none; }
.editor__status--err { color: #9a1c1c; }
.editor__ver { opacity: .45; font-weight: 600; font-size: 11px; }
.editor__tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-top: 2.5px solid var(--ink); }
.editor__field { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13.5px; }
.editor__field select { font: 700 14px var(--font-body); border: 2px solid var(--ink); border-radius: 10px; padding: 7px 9px; }
.editor__feenote { font-size: 13px; font-weight: 800; color: var(--coral); background: var(--coral-soft); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 11px; }
.editor__actions { margin-left: auto; display: flex; gap: 10px; }

/* ---- doc preview modal (tingnan ang laman) ------------------------------ */
.preview { position: fixed; inset: 0; height: var(--vvh, 100dvh); z-index: 85; background: rgba(38, 36, 59, .55); display: grid; place-items: safe center; overflow-y: auto; padding: 16px; }
.preview__panel {
    background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius);
    box-shadow: 8px 8px 0 rgba(38,36,59,.45); width: min(720px, 100%);
    max-height: 94vh; display: flex; flex-direction: column;
}
.preview__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 2.5px solid var(--ink); }
.preview__head h3 { margin: 0; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview__close { background: var(--coral-soft); border: 2px solid var(--ink); border-radius: 10px; width: 34px; height: 34px; flex: none; display: grid; place-items: center; cursor: pointer; }
.preview__body {
    overflow: auto; padding: 14px; flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    background: repeating-conic-gradient(rgba(38,36,59,.05) 0% 25%, transparent 0% 50%) 0 0 / 22px 22px;
}
.preview__img { max-width: 100%; max-height: 80vh; max-height: 80dvh; border: 2px solid var(--ink); border-radius: 8px; background: #fff; }
.preview__page { border: 2px solid var(--ink); border-radius: 6px; background: #fff; max-width: 100%; height: auto; }
.preview__page--slot { display: grid; place-items: center; border-style: dashed; }
.preview__pageinfo { font-weight: 800; font-size: 13px; color: var(--muted); margin: 0; }
.preview__loading { font-weight: 700; margin: 30px 0; }
.preview__msg { text-align: center; font-weight: 700; padding: 30px 10px; }
.preview__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 2.5px solid var(--ink); }

/* ---- public receipt / tracker ----------------------------------------- */
.receipt { width: min(640px, 100%); margin: 0 auto; }
.receipt__head { text-align: center; margin-bottom: 18px; }
.ref {
    font-family: var(--font-mono); font-weight: 700; font-size: clamp(30px, 6vw, 44px);
    letter-spacing: .04em; margin: 2px 0;
    background: var(--card); display: inline-block; padding: 4px 18px;
    border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: var(--bs-sm);
    transform: rotate(-1deg);
}
.tracker { list-style: none; display: flex; justify-content: space-between; padding: 0; margin: 22px 0; position: relative; }
.tracker::before { content: ""; position: absolute; top: 13px; left: 8%; right: 8%; height: 4px; background: var(--card); border: 2px solid var(--ink); border-radius: 4px; }
.tracker__step { position: relative; z-index: 1; text-align: center; flex: 1; }
.tracker__dot {
    display: block; width: 28px; height: 28px; margin: 0 auto 6px; border-radius: 50%;
    background: var(--card); border: 2.5px solid var(--ink);
}
.tracker__step.is-done .tracker__dot { background: var(--green); }
.tracker__step.is-current .tracker__dot { background: var(--yellow); box-shadow: 0 0 0 5px var(--yellow-soft); }
.tracker__label { font-weight: 800; font-size: 13.5px; }
.totals { margin: 14px 0 0; padding-top: 12px; border-top: 2px dashed rgba(38,36,59,.3); }
.totals div { display: flex; justify-content: space-between; margin: 4px 0; }
.totals dt { color: var(--muted); font-weight: 700; }
.totals dd { margin: 0; font-family: var(--font-mono); font-weight: 700; }
.totals__grand { font-size: 22px; }
.totals__grand dt { color: var(--ink); font-family: var(--font-display); font-weight: 800; }
.totals__grand dd { color: var(--coral); font-family: var(--font-display); font-weight: 800; }

/* ---- tables ------------------------------------------------------------ */
.ftable { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius); box-shadow: var(--bs); overflow: hidden; }
.ftable th, .ftable td { text-align: left; padding: 12px 12px; border-bottom: 2px solid rgba(38,36,59,.12); }
.ftable thead th { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; background: var(--yellow-soft); border-bottom: 2.5px solid var(--ink); }
.ftable tbody tr:last-child td { border-bottom: 0; }
.ftable .r { text-align: right; }

/* ---- status chips (kulay na tuldok bawat status) ------------------------ */
.status {
    display: inline-flex; align-items: center; gap: 7px;
    font-weight: 800; font-size: 13px; white-space: nowrap;
    border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; background: var(--card);
}
.status::before { content: ""; width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--muted); border: 1.5px solid rgba(38,36,59,.45); }
.status--pending { background: var(--yellow); }
.status--pending::before { background: #B7791F; }
.status--printing { background: var(--blue-soft); }
.status--printing::before { background: var(--blue-d); }
.status--ready { background: var(--green-soft); }
.status--ready::before { background: #15803D; }
.status--completed { background: var(--green); color: #fff; border-color: var(--ink); }
.status--completed::before { background: #fff; }
.status--cancelled { background: var(--coral-soft); }
.status--cancelled::before { background: var(--coral); }

/* =====================================================================
   STAFF — "nanay mode": mas malaki, mas malinaw, mas kalmado
   ===================================================================== */
body.is-staff {
    background-color: #EFF5FC;
    background-image: radial-gradient(rgba(45, 127, 249, .08) 1.5px, transparent 1.5px);
    font-size: 17.5px;
}
body.is-staff .topbar { border-bottom-color: var(--blue-d); }
body.is-staff .brand__mark { background: transparent; }
body.is-staff h1 { font-size: 32px; }
body.is-staff .btn { font-size: 17px; }
body.is-staff .btn--sm { font-size: 15px; }
body.is-staff .ftable { font-size: 16.5px; }
body.is-staff .status { font-size: 15px; padding: 6px 14px; }
body.is-staff .pricecard, body.is-staff .steps__grid li, body.is-staff .qrcard,
body.is-staff .badge { transform: none; }

.staffhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.staffhead__act { display: flex; align-items: center; gap: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; text-decoration: none; color: var(--ink); margin-bottom: 14px; }
.back:hover { color: var(--blue-d); }

/* queue tabs */
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a {
    text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700;
    background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px;
    padding: 8px 18px; box-shadow: 0 3px 0 var(--ink);
}
.tabs a.is-active { background: var(--ink); color: #fff; }
.pill { background: var(--yellow); color: var(--ink); border: 1.5px solid var(--ink); padding: 1px 9px; border-radius: 999px; font-size: 13px; margin-left: 6px; font-family: var(--font-body); font-weight: 800; }
.tabs a.is-active .pill { background: var(--yellow); }

.ftable--queue td { vertical-align: middle; }
.qcode { font-family: var(--font-mono); font-weight: 700; font-size: 19px; }
.qtotal { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--coral); white-space: nowrap; }

/* ---- staff order page -------------------------------------------------- */
.staffshow { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.staffshow__main, .staffshow__side { min-width: 0; display: flex; flex-direction: column; }

/* SINGILIN banner — unang makikita ni nanay */
.paybar {
    background: var(--coral); color: #fff; text-align: center;
    border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--bs);
    padding: 16px; margin-bottom: 18px;
}
.paybar__label { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .08em; text-transform: uppercase; display: block; }
.paybar__amt { font-family: var(--font-display); font-weight: 800; font-size: clamp(40px, 7vw, 54px); line-height: 1.1; display: block; }
.paybar--paid { background: var(--green); }
.paybar--off { background: var(--muted); }

/* per-file specs — malalaking chips na mabilis basahin */
.stafffile { padding: 16px 0; border-bottom: 2px dashed rgba(38,36,59,.25); }
.stafffile:last-of-type { border-bottom: 0; }
.stafffile__name { font-weight: 800; font-size: 18px; margin: 0 0 8px; word-break: break-word; }
.specs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.spec {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--card); border: 2px solid var(--ink); border-radius: 999px;
    font-weight: 800; font-size: 15px; padding: 5px 13px;
}
.spec--color { background: linear-gradient(100deg, #FFD9D9, #FFEDC2, #C9F2DD, #DCEAFF); }
.spec--bw { background: #E8E8EE; }
.spec--alert { background: var(--yellow); }
.stafffile__act { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stafffile__price { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--coral); margin-left: auto; }

/* staff: edit a file's setup / layout on a submitted order */
.sfedit { margin-top: 12px; }
.sfedit > summary { cursor: pointer; font-weight: 800; font-size: 14px; color: var(--blue); display: inline-flex; align-items: center; gap: 6px; list-style: none; user-select: none; }
.sfedit > summary::-webkit-details-marker { display: none; }
.sfedit > summary:hover { text-decoration: underline; }
.sfedit__grid { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; align-items: flex-end; }
.sfedit__act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dangerzone { margin-top: 14px; padding-top: 12px; border-top: 2px dashed rgba(38,36,59,.18); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* gabay para kay nanay */
.guide { background: var(--yellow-soft); }
.guide ol { margin: 6px 0 0; padding-left: 22px; font-weight: 700; }
.guide li { margin: 7px 0; }

/* direct print + back-to-back guide per file */
.printbox {
    background: var(--blue-soft); border: 2px solid var(--ink); border-radius: var(--radius-sm);
    padding: 14px; margin-top: 12px;
}
.printbox__title { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; margin: 0 0 6px; }
.printbox__guide { margin: 0 0 12px; padding-left: 22px; font-weight: 700; font-size: 15.5px; }
.printbox__guide li { margin: 6px 0; }
.printbox__btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* malalaking status buttons */
.bigbtns { display: flex; flex-direction: column; gap: 12px; }
.bigbtns .btn { padding: 15px 18px; font-size: 18.5px; justify-content: flex-start; }
.bigbtns .btn small { font-family: var(--font-body); font-weight: 700; font-size: 13px; margin-left: auto; color: inherit; opacity: .8; }
.btn--print { background: var(--blue-soft); }
.btn--readybtn { background: var(--green-soft); }
.btn--paid { background: var(--green); color: #fff; }
.btn--cancel { background: var(--card); color: var(--coral); }
.bigbtns .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--ink); }
.bigbtns .btn.is-current { outline: 4px solid var(--yellow); }
.note { font-style: italic; color: var(--muted); }

/* ---- auth -------------------------------------------------------------- */
.card--auth { max-width: 460px; margin: 34px auto; }
.card--auth h1 { margin: 0 0 4px; }
.authform { display: flex; flex-direction: column; gap: 15px; margin-top: 18px; }
.authform label { display: flex; flex-direction: column; gap: 5px; font-weight: 800; font-size: 15px; }
.authform input { padding: 13px 13px; border: 2px solid var(--ink); border-radius: 10px; font: 600 16px var(--font-body); }
.divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 14px; color: var(--muted); font-weight: 800; font-size: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 2px; background: rgba(38,36,59,.2); border-radius: 2px; }
.card--auth .btn--google { justify-content: center; }
.card--auth .tiny { margin-top: 10px; text-align: center; }

/* ---- staff management ---------------------------------------------------- */
.addstaff { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.addstaff input { flex: 1; min-width: 190px; padding: 12px 12px; border: 2px solid var(--ink); border-radius: 10px; font: 600 15.5px var(--font-body); }

/* ---- footer ---------------------------------------------------------------- */
.foot {
    margin-top: auto; text-align: center; padding: 26px 16px;
    color: var(--muted); font-weight: 700; font-size: 13.5px;
    border-top: 3px solid var(--ink); background: var(--card);
}

/* ---- responsive -------------------------------------------------------------- */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .hero__cta { justify-content: center; }
    .qrcard { transform: rotate(0); }
    .steps__grid { grid-template-columns: repeat(2, 1fr); }
    .uploader { grid-template-columns: 1fr; }
    .summary { position: static; }
    .staffshow { grid-template-columns: 1fr; }
    .staffshow__side { order: -1; }   /* presyo + buttons una sa phone */
}
@media (max-width: 600px) {
    h1 { font-size: 28px; }
    .wrap { margin-top: 18px; }
    .steps__grid { grid-template-columns: 1fr; }
    .ftable { font-size: 13.5px; display: block; overflow-x: auto; }
    /* Header: on phones the brand + nav don't fit one row. Let the bar wrap so
       the nav drops onto its own full-width line and wraps within itself —
       nothing (esp. "Sign out") gets pushed off-screen / scrolls sideways. */
    .topbar { flex-wrap: wrap; gap: 6px 12px; }
    .topnav { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 8px 12px; font-size: 13.5px; }
    /* Staff page action rows (Scan/Printers/Staff/Payments/Sign out) wrap too. */
    .staffhead__act { flex-wrap: wrap; gap: 8px 10px; }
    .brand__mark { width: 54px; height: 54px; }
    .brand__name { font-size: 22px; }
    .filecard__opts { gap: 8px 10px; }
    .editor { padding: 8px; }
    .editor__panel { max-height: 94dvh; }
    .editor__head { padding: 10px 12px; }
    .editor__head h3 { font-size: 17px; }
    .editor__stage { padding: 8px; }
    .editor__tools { gap: 8px; padding: 10px 12px; }
    .editor__field { width: 100%; }
    .editor__feenote { width: 100%; text-align: center; }
    .editor__actions { margin-left: 0; width: 100%; }
    .editor__actions .btn { flex: 1; }
    .preview { padding: 8px; }
    .preview__panel { max-height: 94dvh; }
    .preview__head { padding: 10px 12px; }
    .preview__head h3 { font-size: 16px; }
    .preview__body { padding: 8px; }
    .preview__foot { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
    .preview__foot .btn { width: 100%; justify-content: center; }
    .preview__foot .muted { text-align: center; }
    body.is-staff { font-size: 16.5px; }
}

@media (max-width: 360px) {
    .preview, .editor { padding: 5px; }
    .preview__panel, .editor__panel { width: 100%; max-height: 96dvh; }
    .preview__head, .preview__foot, .editor__head, .editor__tools { padding: 9px 10px; }
    .preview__head h3, .editor__head h3 { font-size: 15px; }
    .preview__body, .editor__stage { padding: 6px; }
    .preview__foot .muted.tiny { font-size: 11px; }
}

/* =====================================================================
   Printers — status panel + per-order "Print to" picker
   ===================================================================== */
.printerbar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    margin: 0 0 16px; padding: 10px 12px;
    background: var(--blue-soft); border: 2px solid var(--ink);
    border-radius: var(--radius-sm); box-shadow: var(--bs-sm);
}
.printerbar--warn { background: var(--coral-soft); }
.printerbar__lbl { font-family: var(--font-display); font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.printerbar__sel {
    font: 700 15px var(--font-body); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 10px; padding: 7px 10px; background: #fff;
    max-width: 100%;
}
.printerbar__link { margin-left: auto; font-weight: 800; text-decoration: none; color: var(--blue-d); display: inline-flex; align-items: center; gap: 5px; }
.printerbar__link:hover { color: var(--ink); }

.printers { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 14px; }
.pcard { display: flex; flex-direction: column; gap: 10px; }
.pcard--active { border-color: var(--blue); box-shadow: 4px 4px 0 var(--blue); }
.pcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pcard__name { font-family: var(--font-display); font-weight: 800; font-size: 19px; margin: 0; display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pcard__reason { margin: -4px 0 0; }
.pcard__queue { border-top: 2px dashed var(--line); padding-top: 10px; }
.pcard__set { margin-top: auto; }
.badge--soft { background: var(--blue-soft); color: var(--ink); transform: none; }

/* status pill: ready / busy / offline / unknown */
.pstat {
    display: inline-flex; align-items: center; gap: 7px; flex: none;
    font: 800 13px var(--font-display); text-transform: uppercase; letter-spacing: .04em;
    padding: 5px 11px; border: 2px solid var(--ink); border-radius: 999px; background: #fff;
}
.pstat__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.pstat--ready { background: var(--green-soft); }
.pstat--ready .pstat__dot { background: var(--green); }
.pstat--busy { background: var(--yellow-soft); }
.pstat--busy .pstat__dot { background: var(--yellow); }
.pstat--offline { background: var(--coral-soft); }
.pstat--offline .pstat__dot { background: var(--coral); }

.qlist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qlist__row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.qlist__id { font-family: var(--font-mono); font-weight: 700; }
.qlist__when { margin-left: auto; }

.pstat--sm { font-size: 11px; padding: 3px 8px; }
.pstat--sm .pstat__dot { width: 8px; height: 8px; }

/* partner-station admin page */
.sechead { font-family: var(--font-display); margin: 26px 0 6px; display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
.setup { margin: 6px 0 0; padding-left: 20px; line-height: 1.7; }
.setup li { margin-bottom: 4px; }
.tokencard { border-color: var(--coral); box-shadow: 4px 4px 0 var(--coral); }
.tokencard__title { font-family: var(--font-display); font-weight: 800; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.tokencard__code {
    display: block; font-family: var(--font-mono); font-size: 15px; word-break: break-all;
    background: var(--ink); color: #fff; padding: 10px 12px; border-radius: 10px; margin-bottom: 6px;
}
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* guide jump menu */
.toc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.toc a {
    font-weight: 700; text-decoration: none; color: var(--blue-d);
    background: var(--blue-soft); border: 2px solid var(--ink); border-radius: 999px;
    padding: 4px 12px; font-size: 14px;
}
.toc a:hover { background: var(--yellow-soft); color: var(--ink); }
.sechead { scroll-margin-top: 16px; }

/* ---- per-page price breakdown (PDF) -------------------------------------- */
.pagebreak { margin-top: 10px; border-top: 1px dashed var(--line, #e5e2dc); padding-top: 8px; }
.pagebreak > summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink-soft, #6b6760); list-style: none; display: inline-flex; align-items: center; gap: 6px; user-select: none; }
.pagebreak > summary::-webkit-details-marker { display: none; }
.pagebreak > summary::before { content: '\25B8'; display: inline-block; transition: transform .15s ease; }
.pagebreak[open] > summary::before { transform: rotate(90deg); }
.pagebreak > summary .icon { width: 14px; height: 14px; }
.pagebreak[open] > summary { margin-bottom: 6px; }
.pagebreak__list { display: flex; flex-direction: column; gap: 0; max-height: 280px; overflow-y: auto; }
.pagebreak__row { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 10px; align-items: center; font-size: .82rem; padding: 4px 2px; border-bottom: 1px solid var(--line-soft, #f0eee9); }
.pagebreak__row .pb-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.pagebreak__note { margin-top: 6px; font-size: .8rem; text-align: right; }

/* Modal panels must never exceed the MEASURED visible height (--vvh, set in the
   layout from window.visualViewport) so the footer / OK button is always on
   screen above the mobile browser bars. Overrides the vh/dvh caps above. */
.preview__panel, .editor__panel { max-height: calc(var(--vvh, 94dvh) - 16px); }
