/*
 * Liana's Boutique — Partners portal
 *
 * Built for a phone held in one hand: one column, large targets, the
 * sections in a bar at the bottom under the thumb. On a wider screen the
 * column stays readable and the sections move up into the top bar. Same
 * palette and type as the store and the POS.
 *
 *  1. Tokens and base     5. Lists and rows        9. Sign in
 *  2. Top and bottom bar  6. Pieces and detail    10. Wider screens
 *  3. Buttons and forms   7. The sale form
 *  4. Cards and figures   8. Confirmation window
 */

@font-face {
    font-family: "Playfair Display";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/playfair-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Jost";
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url("../fonts/jost-latin.woff2") format("woff2");
}

/* ---------- 1. Tokens and base ---------- */
:root {
    --cream: #fbf4ec;
    --cream-deep: #f5eadf;
    --sand: #eadfd3;
    --sand-deep: #d9cabb;
    --paper: #ffffff;
    --ink: #1c1714;
    --ink-2: #3a302a;
    --ink-soft: #5c524a;
    --ink-faint: #8c8178;
    --accent: #a16c4b;
    --accent-bg: #f4e7dc;
    --gold: #b98a3a;
    --success: #2f6a47;
    --success-bg: #e2f0e6;
    --error: #a33a2c;
    --error-bg: #f8e1dc;
    --warn: #8a5a0b;
    --warn-bg: #f8ecd0;

    --font-display: "Playfair Display", Georgia, serif;
    --font-body: "Jost", "Segoe UI", system-ui, sans-serif;
    --radius: 18px;
    --radius-sm: 12px;
    --line: 1px solid var(--sand);
    --shadow-1: 0 1px 2px rgba(60, 40, 25, 0.05), 0 8px 22px -14px rgba(60, 40, 25, 0.3);
    --shadow-2: 0 2px 6px rgba(60, 40, 25, 0.08), 0 26px 50px -26px rgba(60, 40, 25, 0.5);
    --ring: 0 0 0 3px rgba(28, 23, 20, 0.12);
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --bar-h: 60px;
    --tab-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100vh; background: var(--cream); color: var(--ink); font-family: var(--font-body); font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.has-modal { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(1.625rem, 1.35rem + 1.2vw, 2.125rem); letter-spacing: -0.005em; }
h2 { font-size: 1.1875rem; }
p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
img, svg { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: lining-nums tabular-nums; }
.ico { flex: none; }

.pt-eyebrow { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.pt-muted { color: var(--ink-faint); font-size: 0.875rem; }

/* ---------- 2. Top and bottom bar ---------- */
/* No backdrop-filter on the bar while the sections sit at the bottom: a
   filter makes the bar the containing block of its fixed children, and the
   tab bar would be pinned to the header instead of the screen. */
.pt-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: var(--bar-h); padding: 0 16px; background: rgba(251, 244, 236, 0.97); border-bottom: var(--line); }
.pt-bar__back { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 50%; text-decoration: none; }
.pt-bar__back:active { background: var(--cream-deep); }
.pt-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.pt-brand__logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.pt-brand__logo--full { width: auto; height: 38px; max-width: 90px; border-radius: 0; object-fit: contain; }
.pt-brand__text { display: grid; line-height: 1.05; }
.pt-brand__name { font-family: var(--font-display); font-size: 1.0625rem; letter-spacing: 0.08em; }
.pt-brand__tag { font-size: 0.5625rem; font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent); }
.pt-bar__side { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pt-user { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--font-display); font-size: 0.9375rem; }
.pt-icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); }
.pt-icon-btn:active { background: var(--cream-deep); color: var(--ink); }

/* The sections: a tab bar at the bottom on a phone. */
.pt-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255, 255, 255, 0.96); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-top: var(--line); box-shadow: 0 -10px 30px -24px rgba(60, 40, 25, 0.5); }
.pt-nav a { display: grid; justify-items: center; align-content: center; gap: 3px; text-decoration: none; font-size: 0.6875rem; letter-spacing: 0.04em; color: var(--ink-faint); }
.pt-nav a[aria-current="page"] { color: var(--ink); }
.pt-nav__icon { position: relative; display: grid; place-items: center; width: 52px; height: 30px; border-radius: 99px; transition: background-color 0.18s var(--ease); }
.pt-nav a[aria-current="page"] .pt-nav__icon { background: var(--cream-deep); }
.pt-nav__dot { position: absolute; top: -2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--paper); font-size: 0.6875rem; font-weight: 600; line-height: 18px; text-align: center; }

.pt-main { width: 100%; max-width: 640px; margin: 0 auto; padding: 20px 16px calc(var(--tab-h) + var(--safe-b) + 28px); display: grid; gap: 18px; }

.pt-flash { display: flex; align-items: flex-start; gap: 10px; max-width: 608px; margin: 14px auto 0; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.9375rem; line-height: 1.4; }
.pt-bar + .pt-flash { margin-left: 16px; margin-right: 16px; }
.pt-flash--success { background: var(--success-bg); color: var(--success); }
.pt-flash--error { background: var(--error-bg); color: var(--error); }
.pt-flash--warning, .pt-flash--info { background: var(--warn-bg); color: var(--warn); }
.pt-flash--inline { margin: 0; }

/* ---------- 3. Buttons and forms ---------- */
.pt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 22px; border: 1px solid var(--ink); border-radius: var(--radius-sm); background: transparent; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; white-space: nowrap; transition: background-color 0.18s var(--ease), transform 0.12s var(--ease), box-shadow 0.18s var(--ease); }
.pt-btn:active:not(:disabled) { transform: translateY(1px); }
.pt-btn--dark { background: var(--ink); color: var(--paper); box-shadow: 0 12px 22px -14px rgba(28, 23, 20, 0.85); }
.pt-btn--dark:hover:not(:disabled) { background: var(--ink-2); }
.pt-btn--light { background: var(--paper); border-color: var(--sand-deep); }
.pt-btn--danger { background: var(--error); border-color: var(--error); color: var(--paper); }
.pt-btn--block { width: 100%; }
.pt-btn--lg { min-height: 56px; font-size: 0.875rem; }
.pt-btn:disabled { opacity: 0.5; }
.pt-link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--sand-deep); border-radius: 99px; background: var(--paper); font-size: 0.8125rem; color: var(--ink-soft); }

.pt-form { display: grid; gap: 14px; }
.pt-form label, .pt-field { display: grid; gap: 6px; font-size: 0.8125rem; font-weight: 500; color: var(--ink-soft); }
.pt-form input, .pt-field input[type="number"]:not([data-qty]) { width: 100%; min-height: 52px; padding: 0 14px; background: var(--paper); border: 1px solid var(--sand-deep); border-radius: var(--radius-sm); font-size: 1.0625rem; font-weight: 400; color: var(--ink); }
.pt-form input:focus, .pt-field input:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.pt-field__label { font-size: 0.8125rem; font-weight: 500; color: var(--ink-soft); }

.pt-note { display: flex; gap: 8px; align-items: flex-start; font-size: 0.8125rem; line-height: 1.45; color: var(--ink-faint); }
.pt-note .ico { margin-top: 2px; }

.pt-search { position: relative; display: flex; align-items: center; }
.pt-search > .ico { position: absolute; left: 14px; color: var(--ink-faint); pointer-events: none; }
.pt-search input { width: 100%; min-height: 50px; padding: 0 44px; background: var(--paper); border: 1px solid var(--sand); border-radius: 99px; font-size: 1rem; box-shadow: var(--shadow-1); -webkit-appearance: none; appearance: none; }
.pt-search input:focus { outline: none; border-color: var(--ink); }
.pt-search__clear { position: absolute; right: 8px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--ink-faint); }

/* ---------- 4. Cards and figures ---------- */
.pt-hello { display: grid; gap: 6px; padding-top: 4px; }
.pt-card { display: grid; gap: 16px; padding: 20px; background: var(--paper); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }

.pt-balance { position: relative; display: grid; gap: 4px; padding: 22px 22px 20px; border-radius: var(--radius); background: radial-gradient(120% 140% at 100% 0%, #3d3129 0%, var(--ink) 55%); color: var(--paper); text-decoration: none; box-shadow: var(--shadow-2); overflow: hidden; }
.pt-balance::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 1px solid rgba(214, 178, 112, 0.35); }
.pt-balance small { font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.pt-balance strong { font-family: var(--font-display); font-weight: 400; font-size: 2.5rem; line-height: 1.1; }
.pt-balance span { display: inline-flex; align-items: center; gap: 4px; font-size: 0.875rem; color: #e3c88e; }

.pt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pt-stats--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pt-stats > div { display: grid; gap: 2px; padding: 14px 12px; background: var(--paper); border: var(--line); border-radius: var(--radius-sm); }
.pt-stats small { font-size: 0.625rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); line-height: 1.3; }
.pt-stats strong { font-family: var(--font-display); font-weight: 400; font-size: 1.375rem; line-height: 1.2; overflow-wrap: anywhere; }

.pt-callout { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); text-decoration: none; }
.pt-callout--ok { background: var(--success-bg); color: var(--success); }
.pt-callout__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.65); flex: none; }
.pt-callout__text { display: grid; flex: 1; line-height: 1.3; }
.pt-callout__text strong { font-weight: 500; color: var(--ink); }
.pt-callout__text small { font-size: 0.8125rem; }

.pt-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--cream-deep); font-size: 0.75rem; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.pt-chip--ok { background: var(--success-bg); color: var(--success); }
.pt-chip--warn { background: var(--warn-bg); color: var(--warn); }

.pt-facts { display: grid; background: var(--paper); border: var(--line); border-radius: var(--radius-sm); }
.pt-facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 16px; }
.pt-facts > div + div { border-top: var(--line); }
.pt-facts dt { color: var(--ink-soft); font-size: 0.9375rem; }
.pt-facts dd { font-weight: 500; text-align: right; }

.pt-empty { color: var(--ink-faint); font-size: 0.9375rem; }
.pt-empty--card { display: grid; justify-items: center; gap: 12px; padding: 36px 20px; text-align: center; background: var(--paper); border: 1px dashed var(--sand-deep); border-radius: var(--radius); }

/* ---------- 5. Lists and rows ---------- */
.pt-section { display: grid; gap: 10px; }
.pt-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pt-section__head a { font-size: 0.8125rem; color: var(--accent); text-decoration: none; }
.pt-list { display: grid; background: var(--paper); border: var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.pt-list > li + li { border-top: var(--line); }
.pt-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.pt-row--link { text-decoration: none; }
.pt-row--link:active { background: var(--cream); }
.pt-row--link > .ico { color: var(--ink-faint); }
.pt-row__main { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.pt-row__main strong { font-weight: 500; overflow-wrap: anywhere; }
.pt-row__main small { font-size: 0.8125rem; color: var(--ink-faint); }
.pt-row__side { font-weight: 500; white-space: nowrap; }
.is-void .pt-row__main strong, .is-void .pt-row__side { text-decoration: line-through; color: var(--ink-faint); }
.pt-list__day { padding: 10px 16px 8px; background: var(--cream); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.pt-sale { display: grid; gap: 8px; padding: 14px 16px; }
.pt-sale__top { display: flex; gap: 12px; }
.pt-sale__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 0.8125rem; }
.pt-sale__foot form { margin-left: auto; }
.pt-notes { padding: 0 2px; }

/* ---------- 6. Pieces and detail ---------- */
.pt-pieces { display: grid; gap: 10px; }
.pt-piece { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; background: var(--paper); border: var(--line); border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow-1); transition: transform 0.12s var(--ease); }
.pt-piece:active { transform: scale(0.99); }
.pt-piece__img { width: 72px; height: 96px; border-radius: 10px; object-fit: cover; background: var(--cream-deep); flex: none; }
.pt-piece__info { display: grid; gap: 3px; flex: 1; min-width: 0; line-height: 1.3; }
.pt-piece__info strong { font-weight: 500; overflow-wrap: anywhere; }
.pt-piece__variant { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--ink-soft); }
.pt-piece__price { font-family: var(--font-display); font-size: 1.0625rem; }
.pt-piece__qty { display: grid; justify-items: center; min-width: 56px; padding: 8px 6px; border-radius: var(--radius-sm); background: var(--cream); line-height: 1.1; }
.pt-piece__qty b { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; }
.pt-piece__qty small { font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.pt-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.12); flex: none; }

.pt-detail { display: grid; gap: 16px; }
.pt-detail__media { margin: -20px -16px 0; aspect-ratio: 4 / 5; max-height: 60vh; background: var(--cream-deep); overflow: hidden; }
.pt-detail__media img { width: 100%; height: 100%; object-fit: cover; }
.pt-detail__body { display: grid; gap: 6px; }
.pt-detail__variant { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.pt-detail__price { font-family: var(--font-display); font-size: 1.5rem; }
.pt-detail__price small { font-family: var(--font-body); font-size: 0.8125rem; color: var(--ink-faint); }

/* ---------- 7. The sale form ---------- */
.pt-stepper { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; height: 60px; border: 1px solid var(--sand-deep); border-radius: var(--radius-sm); background: var(--paper); overflow: hidden; }
.pt-stepper button { display: grid; place-items: center; height: 100%; border: 0; background: var(--cream); color: var(--ink); }
.pt-stepper button:active { background: var(--sand); }
.pt-stepper input { width: 100%; height: 100%; border: 0; text-align: center; font-family: var(--font-display); font-size: 1.75rem; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.pt-stepper input::-webkit-outer-spin-button, .pt-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pt-stepper input:focus { outline: none; box-shadow: none; }

.pt-sum { display: grid; gap: 0; border-radius: var(--radius-sm); background: var(--cream); padding: 6px 14px; }
.pt-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 0.9375rem; color: var(--ink-soft); }
.pt-sum > div + div { border-top: 1px dashed var(--sand-deep); }
.pt-sum dd { font-variant-numeric: tabular-nums; color: var(--ink); }
.pt-sum .is-strong dt, .pt-sum .is-strong dd { font-weight: 500; color: var(--ink); }
.pt-sum .is-accent dd { font-family: var(--font-display); font-size: 1.25rem; }

/* ---------- 8. Confirmation window ---------- */
.pt-modal { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; padding: 12px; background: rgba(28, 23, 20, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: pt-fade 0.18s var(--ease); }
.pt-modal__box { display: grid; gap: 12px; justify-items: center; width: 100%; max-width: 440px; margin: 0 auto; padding: 26px 22px calc(18px + var(--safe-b)); background: var(--paper); border-radius: 22px; text-align: center; box-shadow: var(--shadow-2); animation: pt-rise 0.24s var(--ease); }
.pt-modal__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); }
.pt-modal.is-danger .pt-modal__icon { background: var(--error-bg); color: var(--error); }
.pt-modal__box p { color: var(--ink-soft); font-size: 0.9375rem; }
.pt-modal__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 6px; }
@keyframes pt-fade { from { opacity: 0; } }
@keyframes pt-rise { from { transform: translateY(24px); opacity: 0; } }

/* ---------- 9. Sign in ---------- */
.pt-gate { display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(90% 60% at 50% 0%, #fff 0%, var(--cream) 70%); }
.pt-gate__card { display: grid; gap: 22px; width: 100%; max-width: 420px; padding: 32px 24px; background: var(--paper); border: var(--line); border-radius: 24px; box-shadow: var(--shadow-2); }
.pt-gate__brand { display: grid; justify-items: center; gap: 10px; text-align: center; }
.pt-gate__logo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-1); }
.pt-gate__logo--full { width: auto; height: 84px; max-width: 200px; border-radius: 0; object-fit: contain; box-shadow: none; }
.pt-gate__brand h1 { font-size: 1.625rem; }

/* ---------- 10. Wider screens ---------- */
@media (min-width: 900px) {
    :root { --bar-h: 68px; }
    .pt-bar { padding: 0 28px; gap: 20px; background: rgba(251, 244, 236, 0.9); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
    .pt-nav { position: static; display: flex; gap: 2px; height: auto; padding: 4px; margin: 0 auto; background: var(--cream-deep); border: 0; border-radius: 99px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .pt-nav a { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px 0 8px; border-radius: 99px; font-size: 0.875rem; color: var(--ink-soft); }
    .pt-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
    .pt-nav__icon { width: 30px; height: 30px; background: none !important; }
    .pt-nav__dot { top: -4px; right: -6px; }
    .pt-bar__side { margin-left: 0; }
    .pt-main { padding-bottom: 48px; }
    .pt-detail { grid-template-columns: 240px 1fr; align-items: end; }
    .pt-detail__media { margin: 0; border-radius: var(--radius); aspect-ratio: 3 / 4; }
    .pt-modal { align-items: center; }
}
