/* ============================================================
   SEND WE PRINT — Mobile-first design system
   ============================================================ */
:root {
  --blue: #1a56db;
  --blue-dark: #1648b8;
  --blue-darker: #1440a5;
  --blue-50: #eef4ff;
  --blue-100: #dbe7fd;
  --blue-200: #bfd6fb;
  --navy: #0b2447;
  --ink: #0f172a;
  --muted: #5b6b83;
  --faint: #8a97ab;
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e3e8f2;
  --line-dark: #c6d0e2;
  --green: #16a34a;
  --green-dark: #15803d;
  --green-50: #eafaf0;
  --red: #dc2626;
  --red-50: #fef2f2;
  --amber: #d97706;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 12px 32px -14px rgba(15, 23, 42, .16);
  --shadow-lg: 0 24px 60px -20px rgba(11, 36, 71, .25);
  --header-h: 60px;
  --tabbar-h: 62px;
  --sidebar-w: 248px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--blue); text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid rgba(26, 86, 219, .35); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Type & layout helpers ---------- */
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.01em; }
.page-title { font-size: clamp(1.25rem, 1rem + 1.2vw, 1.6rem); font-weight: 800; }
.section-title { font-size: 1.05rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(14px, 3vw, 32px);
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: clamp(16px, 2.4vw, 26px); }
.card + .card { margin-top: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .95rem;
  border: 1.5px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { flex: none; }
.btn-primary {
  background: linear-gradient(180deg, #2060e8, var(--blue));
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(26, 86, 219, .55), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: linear-gradient(180deg, #1a56db, var(--blue-dark)); }
.btn-outline { background: #fff; border-color: var(--line-dark); color: var(--ink); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-50); }
.btn-ghost { color: var(--blue); font-weight: 700; min-height: 44px; }
.btn-ghost:hover { background: var(--blue-50); }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 1rem; border-radius: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn .spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

/* ---------- Forms ---------- */
.label {
  display: block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.input, select.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-dark);
  border-radius: 12px;
  background: #fff;
  font-size: 16px; /* prevents iOS zoom */
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
}
textarea.input { min-height: 96px; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26, 86, 219, .14); }
.input:disabled { background: #f1f4fa; color: var(--faint); cursor: not-allowed; }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6b83' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}
.input-icon { position: relative; }
.input-icon > svg {
  position: absolute; left: 14px; top: 50%; translate: 0 -50%;
  color: var(--faint); pointer-events: none;
}
.input-icon .input { padding-left: 44px; }
.input-icon .trailing {
  position: absolute; right: 8px; top: 50%; translate: 0 -50%;
  width: 40px; height: 40px; display: grid; place-items: center;
  color: var(--faint); border-radius: 10px;
}
.input-icon .trailing:hover { color: var(--blue); background: var(--blue-50); }

/* custom checkbox */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 32px; }
.check input { position: absolute; opacity: 0; }
.check .box {
  width: 22px; height: 22px; flex: none;
  border: 2px solid var(--line-dark); border-radius: 7px;
  display: grid; place-items: center; background: #fff;
  transition: all .15s ease;
}
.check .box svg { opacity: 0; transform: scale(.5); transition: all .15s ease; }
.check input:checked + .box { background: var(--blue); border-color: var(--blue); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { outline: 3px solid rgba(26, 86, 219, .35); outline-offset: 2px; }

/* ---------- App header ---------- */
.app-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding-inline: clamp(12px, 2.5vw, 28px);
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px; color: var(--muted);
  transition: background .15s ease, color .15s ease;
  position: relative;
}
.icon-btn:hover { background: var(--blue-50); color: var(--blue); }
.icon-btn .dot {
  position: absolute; top: 9px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid #fff;
}
.brand-mini { display: none; align-items: center; gap: 9px; color: var(--navy); font-weight: 900; line-height: 1; }
.app-header .brand-mini { display: inline-flex; }
.brand-mini .logo-badge { width: 34px; height: 34px; }
.brand-mini .t { font-size: .82rem; letter-spacing: .02em; }
.brand-mini .t b { color: var(--blue); display: block; font-size: .92rem; }

.header-search {
  flex: 1; max-width: 460px; margin-inline: auto;
  display: none; /* mobile: toggled open */
}
.header-search.open {
  display: block; position: absolute; left: 0; right: 0; top: var(--header-h);
  max-width: none; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line);
}
.header-search .input { min-height: 44px; border-radius: 12px; background-color: #f6f8fc; }
.header-spacer { flex: 1; }
.profile-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 8px 5px 5px; border-radius: 999px;
  transition: background .15s ease;
}
.profile-chip:hover { background: var(--blue-50); }
.profile-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.profile-chip .name { display: none; font-weight: 700; font-size: .9rem; }
.profile-chip > svg { display: none; color: var(--faint); }

/* ---------- Sidebar / drawer ---------- */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(11, 36, 71, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.sidebar {
  position: fixed; z-index: 80;
  top: 0; bottom: 0; left: 0;
  width: min(82vw, 300px);
  background: #fff;
  border-right: 1px solid var(--line);
  transform: translateX(-104%);
  transition: transform .28s cubic-bezier(.32, .72, .24, 1);
  display: flex; flex-direction: column;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
body.nav-open { overflow: hidden; }
body.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
body.nav-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
.sidebar .brand-mini { display: flex; padding: 6px 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.nav-list { display: grid; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: .94rem;
  transition: background .15s ease, color .15s ease;
}
.nav-link svg { flex: none; }
.nav-link:hover { background: #f1f5fd; color: var(--ink); }
.nav-link.active { background: var(--blue-50); color: var(--blue); font-weight: 700; }
.sidebar-foot { margin-top: auto; padding-top: 14px; }
.side-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px;
}
.side-profile img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.side-profile .n { font-weight: 700; font-size: .88rem; }
.side-profile .v { font-size: .75rem; color: var(--blue); font-weight: 600; }

/* ---------- Mobile bottom tab bar ---------- */
.tabbar {
  position: fixed; z-index: 55;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: .68rem; font-weight: 700;
}
.tabbar .active { color: var(--blue); }

/* ---------- App main ---------- */
.app-main {
  padding-top: calc(var(--header-h) + 18px);
  padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
}
.page-head { margin-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.page-head .sub { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-weight: 600; font-size: .9rem;
  padding: 8px 10px; margin-left: -10px; border-radius: 10px;
}
.back-link:hover { background: #fff; color: var(--ink); }

/* ---------- Grids (mobile first: stacked) ---------- */
.grid { display: grid; gap: 16px; }
@media (min-width: 1024px) {
  .grid-upload { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
  .grid-checkout { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
  .grid-payment { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
  .grid-track { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .grid-options { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .grid-options .col-summary { grid-column: 1 / -1; }
}
@media (min-width: 1280px) {
  .grid-options { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr) minmax(0, .9fr); align-items: start; }
}

/* ---------- Stepper ---------- */
.stepper { display: flex; align-items: flex-start; margin: 6px 0 20px; }
.stepper li {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center;
}
.stepper li::before, .stepper li::after {
  content: ""; position: absolute; top: 16px; height: 3px; border-radius: 3px;
  background: var(--line-dark); width: 50%;
}
.stepper li::before { left: 0; }
.stepper li::after { right: 0; }
.stepper li:first-child::before, .stepper li:last-child::after { display: none; }
.stepper .bubble {
  position: relative; z-index: 1;
  width: 33px; height: 33px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; border: 2.5px solid var(--line-dark);
  color: var(--faint); font-weight: 800; font-size: .82rem;
  transition: all .2s ease;
}
.stepper .lbl { font-size: .68rem; font-weight: 700; color: var(--faint); line-height: 1.15; }
.stepper li.is-done .bubble, .stepper li.is-current .bubble {
  background: var(--blue); border-color: var(--blue); color: #fff;
  box-shadow: 0 0 0 4px rgba(26, 86, 219, .16);
}
.stepper li.is-done::before, .stepper li.is-done::after,
.stepper li.is-current::before { background: var(--blue); }
.stepper li.is-current .lbl { color: var(--navy); }
.stepper li.is-done .lbl { color: var(--muted); }
.stepper li.is-final .bubble { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 4px rgba(22, 163, 74, .18); }
.stepper li.is-final::before { background: var(--green); }
.stepper li.is-final .lbl { color: var(--green-dark); }
@media (min-width: 640px) {
  .stepper .bubble { width: 36px; height: 36px; }
  .stepper li::before, .stepper li::after { top: 18px; }
  .stepper .lbl { font-size: .82rem; }
}

/* ============================================================
   AUTH (login / register)
   ============================================================ */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; }
.auth-brand {
  position: relative; overflow: hidden;
  padding: clamp(22px, 5vw, 60px) clamp(20px, 4vw, 56px);
  background:
    radial-gradient(60% 50% at 85% 108%, rgba(26, 86, 219, .16), transparent 70%),
    radial-gradient(45% 40% at -10% -8%, rgba(26, 86, 219, .12), transparent 70%),
    linear-gradient(160deg, #f6f9ff 0%, #eef3fd 55%, #e7eefe 100%);
  display: flex; flex-direction: column; justify-content: center; gap: clamp(18px, 3vh, 34px);
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(26, 86, 219, .16) 1.3px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(115deg, #000 0%, transparent 32%);
  mask-image: linear-gradient(115deg, #000 0%, transparent 32%);
}
.auth-logo { display: flex; align-items: center; gap: 14px; position: relative; }
.auth-logo .logo-badge { width: clamp(52px, 8vw, 74px); height: auto; }
.auth-logo .word { line-height: .95; font-style: italic; font-weight: 900; color: var(--navy); letter-spacing: -.02em; }
.auth-logo .word .l1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); display: block; }
.auth-logo .word .l2 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); display: block; }
.auth-logo .word .l2 em { font-style: italic; color: var(--blue); }
.auth-logo .tag {
  margin-top: 8px; font-style: normal; font-weight: 700;
  font-size: clamp(.58rem, 1.4vw, .78rem); letter-spacing: .34em; color: var(--muted);
}
.auth-headline { position: relative; font-size: clamp(1.5rem, 2.6vw + .8rem, 2.4rem); font-weight: 800; color: var(--navy); letter-spacing: -.02em; }
.auth-headline span { display: block; color: var(--blue); }
.auth-sub { position: relative; color: var(--muted); font-size: clamp(.92rem, 1.4vw, 1.05rem); max-width: 46ch; }
.auth-features { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 560px; }
.feature-chip {
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 16px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.feature-chip .ic {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--blue-50); color: var(--blue);
  display: grid; place-items: center;
}
.feature-chip b { font-size: .82rem; }
.feature-chip span { font-size: .68rem; color: var(--muted); line-height: 1.3; display: block; }
@media (min-width: 640px) { .feature-chip { flex-direction: row; align-items: center; gap: 12px; } .feature-chip b { font-size: .9rem; } .feature-chip span { font-size: .75rem; } }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: clamp(18px, 4vh, 44px) clamp(14px, 3vw, 40px); }
.auth-card {
  width: 100%; max-width: 470px;
  background: #fff; border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3.4vw, 36px);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; position: relative; margin-bottom: 24px; }
.tabs::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.tabs button {
  padding: 12px; font-weight: 800; font-size: 1rem; color: var(--faint);
  position: relative; transition: color .15s ease;
}
.tabs button::after {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -2px; height: 3px;
  background: var(--blue); border-radius: 3px;
  transform: scaleX(0); transition: transform .22s ease;
}
.tabs button.active { color: var(--blue); }
.tabs button.active::after { transform: scaleX(1); }
.auth-card h1 { font-size: 1.45rem; font-weight: 800; }
.auth-card .lead { color: var(--muted); font-size: .9rem; margin: 4px 0 22px; }
.auth-form { display: grid; gap: 16px; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.form-row a { font-size: .85rem; font-weight: 600; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: .82rem; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { background: #fff; border-color: var(--line-dark); color: var(--ink); font-weight: 700; }
.btn-google:hover { background: #f8faff; border-color: var(--blue-200); }
.auth-secure {
  margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: .8rem; text-align: center;
}
.auth-secure svg { color: var(--blue); flex: none; }
.swap-link { text-align: center; font-size: .88rem; color: var(--muted); margin-top: 16px; }
.swap-link button { color: var(--blue); font-weight: 700; }
@media (min-width: 1024px) { .auth-wrap { grid-template-columns: 1.08fr .92fr; } }

/* ============================================================
   UPLOAD
   ============================================================ */
.dropzone {
  border: 2px dashed var(--line-dark);
  border-radius: 20px;
  background: #fbfcff;
  min-height: min(56vh, 430px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  padding: 30px 18px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.dropzone:hover { border-color: var(--blue-200); background: #f7faff; }
.dropzone.dragover {
  border-color: var(--blue); background: var(--blue-50);
  transform: scale(1.008);
  box-shadow: inset 0 0 0 4px rgba(26, 86, 219, .12);
}
.dropzone .up-ic {
  width: 76px; height: 76px; border-radius: 22px;
  background: var(--blue-50); color: var(--blue);
  display: grid; place-items: center; margin-bottom: 8px;
  transition: transform .18s ease;
}
.dropzone.dragover .up-ic { transform: translateY(-4px) scale(1.06); }
.dropzone h2 { font-size: 1.15rem; font-weight: 800; }
.dropzone .or { color: var(--faint); font-size: .85rem; margin: 2px 0 10px; }
.dropzone .hint { color: var(--muted); font-size: .85rem; margin-top: 14px; line-height: 1.6; }

.files-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.files-head h3 { font-size: .95rem; font-weight: 800; }
.file-list { display: grid; gap: 10px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; background: #fff;
  animation: pop-in .25s ease both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } }
.file-item .fic {
  width: 42px; height: 42px; flex: none; border-radius: 11px;
  display: grid; place-items: center; font-size: .58rem; font-weight: 900; letter-spacing: .03em;
}
.fic.pdf { background: var(--red-50); color: var(--red); }
.fic.doc { background: var(--blue-50); color: var(--blue); }
.fic.xls { background: var(--green-50); color: var(--green-dark); }
.fic.ppt { background: #fff4e5; color: var(--amber); }
.fic.gen { background: #f1f4fa; color: var(--muted); }
.file-item .meta { min-width: 0; flex: 1; }
.file-item .meta b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .meta span { font-size: .76rem; color: var(--muted); }
.file-item .ok {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--green); color: #fff; display: grid; place-items: center;
}
.file-item .del { width: 34px; height: 34px; flex: none; border-radius: 10px; color: var(--faint); display: grid; place-items: center; }
.file-item .del:hover { background: var(--red-50); color: var(--red); }
.file-progress { height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; margin-top: 7px; }
.file-progress i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 5px; transition: width .2s ease; }
.files-empty {
  border: 1.5px dashed var(--line); border-radius: 14px; padding: 26px 16px;
  text-align: center; color: var(--faint); font-size: .87rem;
}
.upload-actions { margin-top: 16px; display: grid; gap: 10px; }

/* ============================================================
   PRINT OPTIONS
   ============================================================ */
.preview-doc {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow);
  width: min(74%, 230px); margin: 18px auto 12px;
  padding: 20px 18px 26px;
  aspect-ratio: 3 / 4;
}
.preview-doc .pt { height: 8px; width: 55%; margin: 0 auto 14px; border-radius: 4px; background: #c9d3e4; }
.preview-doc .pl { height: 5px; border-radius: 3px; background: #e4e9f3; margin-bottom: 7px; }
.preview-doc .pl:nth-child(odd) { width: 92%; }
.preview-doc .pl:nth-child(3n) { width: 78%; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; }
.pager .pg-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1.5px solid var(--line-dark);
  display: grid; place-items: center; color: var(--muted); background: #fff;
}
.pager .pg-btn:hover { border-color: var(--blue); color: var(--blue); }
.pager .pg-num { font-weight: 700; font-size: .88rem; min-width: 64px; text-align: center; }
.opt-file { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcff; }
.opt-file .meta b { font-size: .9rem; display: block; }
.opt-file .meta span { font-size: .78rem; color: var(--muted); }

.qty {
  display: inline-grid; grid-template-columns: 48px 64px 48px;
  border: 1.5px solid var(--line-dark); border-radius: 12px; overflow: hidden; background: #fff;
}
.qty button { height: 48px; font-size: 1.25rem; font-weight: 700; color: var(--muted); transition: all .12s ease; }
.qty button:hover { background: var(--blue-50); color: var(--blue); }
.qty input { border: 0; text-align: center; font-weight: 800; font-size: 1rem; border-inline: 1.5px solid var(--line); -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

.radio-row { display: grid; gap: 10px; }
.radio-line { display: flex; align-items: center; gap: 11px; cursor: pointer; min-height: 30px; font-weight: 600; }
.radio-line input { position: absolute; opacity: 0; }
.radio-line .rb {
  width: 21px; height: 21px; flex: none; border-radius: 50%;
  border: 2px solid var(--line-dark); background: #fff;
  display: grid; place-items: center; transition: border-color .15s ease;
}
.radio-line .rb::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--blue); transform: scale(0); transition: transform .15s ease; }
.radio-line input:checked + .rb { border-color: var(--blue); border-width: 2px; }
.radio-line input:checked + .rb::after { transform: scale(1); }
.radio-line input:focus-visible + .rb { outline: 3px solid rgba(26, 86, 219, .35); outline-offset: 2px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg label {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; border: 1.5px solid var(--line-dark); border-radius: 12px;
  font-weight: 700; font-size: .9rem; cursor: pointer; background: #fff; color: var(--muted);
  transition: all .15s ease;
}
.seg label .rb {
  width: 19px; height: 19px; border-radius: 50%; border: 2px solid var(--line-dark);
  display: grid; place-items: center;
}
.seg label .rb::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); transform: scale(0); transition: transform .15s ease; }
.seg input { position: absolute; opacity: 0; }
.seg input:checked + label { border-color: var(--blue); background: var(--blue-50); color: var(--navy); box-shadow: 0 0 0 3px rgba(26, 86, 219, .12); }
.seg input:checked + label .rb { border-color: var(--blue); }
.seg input:checked + label .rb::after { transform: scale(1); }
.seg input:focus-visible + label { outline: 3px solid rgba(26, 86, 219, .35); outline-offset: 2px; }

.opt-group { margin-bottom: 20px; }
.opt-group > .label { margin-bottom: 10px; }

/* order summary */
.summary-list { display: grid; gap: 11px; margin-top: 14px; }
.summary-list .row { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.summary-list .row dt { color: var(--muted); }
.summary-list .row dd { font-weight: 600; text-align: right; }
.summary-list .row.hr { border-top: 1px solid var(--line); padding-top: 12px; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 16px; border-top: 1.5px solid var(--line); }
.summary-total .t { font-weight: 800; font-size: 1.05rem; }
.summary-total .v { font-weight: 900; font-size: clamp(1.35rem, 2.4vw, 1.7rem); color: var(--blue); letter-spacing: -.02em; }
.summary-file { font-weight: 700; font-size: .92rem; }
.summary-file span { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.sticky-cta { position: sticky; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); z-index: 20; margin-top: 16px; }
@media (min-width: 1024px) { .sticky-cta { bottom: 16px; } }

/* ============================================================
   CHECKOUT / PAYMENT
   ============================================================ */
.order-review { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.order-review .meta { flex: 1; min-width: 140px; }
.review-specs { display: grid; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.review-specs .row { display: flex; justify-content: space-between; font-size: .9rem; }
.review-specs .row dt { color: var(--muted); }
.review-specs .row dd { font-weight: 600; }

.choice-list { display: grid; gap: 12px; }
.choice {
  display: flex; align-items: center; gap: 13px;
  border: 1.5px solid var(--line-dark); border-radius: 15px;
  padding: 15px; cursor: pointer; background: #fff;
  transition: all .15s ease; position: relative;
}
.choice:hover { border-color: var(--blue-200); }
.choice input { position: absolute; opacity: 0; }
.choice .rb {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  border: 2px solid var(--line-dark); display: grid; place-items: center; background: #fff;
  transition: border-color .15s ease;
}
.choice .rb::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--blue); transform: scale(0); transition: transform .15s ease; }
.choice input:checked + .rb { border-color: var(--blue); }
.choice input:checked + .rb::after { transform: scale(1); }
.choice input:focus-visible + .rb { outline: 3px solid rgba(26, 86, 219, .35); outline-offset: 2px; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(26, 86, 219, .1); }
.choice .c-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.choice .c-txt b { display: block; font-size: .93rem; }
.choice .c-txt span { font-size: .78rem; color: var(--muted); display: block; margin-top: 1px; }
.choice .c-price { font-weight: 800; font-size: .92rem; margin-left: auto; flex: none; }
.brand-badge {
  width: 38px; height: 30px; flex: none; border-radius: 7px;
  display: grid; place-items: center;
  font-size: .6rem; font-weight: 900; letter-spacing: .02em;
  border: 1px solid var(--line);
}
.addr-card { border: 1.5px solid var(--line); border-radius: 15px; padding: 15px; position: relative; }
.addr-card b { font-size: .93rem; }
.addr-card p { color: var(--muted); font-size: .84rem; margin-top: 4px; line-height: 1.55; }
.addr-card .change {
  position: absolute; right: 12px; bottom: 12px;
  font-size: .8rem; font-weight: 700; color: var(--blue);
  padding: 6px 10px; border-radius: 8px;
}
.addr-card .change:hover { background: var(--blue-50); }
.card-logos { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; flex: none; }
.card-logos .cl {
  height: 20px; min-width: 30px; padding-inline: 5px; border-radius: 4px;
  display: inline-grid; place-items: center;
  font-size: .5rem; font-weight: 900; font-style: italic;
  border: 1px solid var(--line); background: #fff; color: #1a1f71;
}
.card-logos .mc { display: inline-flex; }
.card-logos .mc i { width: 14px; height: 14px; border-radius: 50%; display: block; }
.card-logos .mc i:first-child { background: #eb001b; margin-right: -5px; opacity: .9; }
.card-logos .mc i:last-child { background: #f79e1b; }
.pay-alt {
  display: none; margin-top: 14px; padding: 14px;
  background: #f8faff; border: 1px dashed var(--line-dark); border-radius: 12px;
  color: var(--muted); font-size: .85rem; line-height: 1.6;
}
.pay-alt.show { display: block; animation: pop-in .2s ease both; }
.field-grid { display: grid; gap: 14px; }
@media (min-width: 560px) { .field-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--faint); font-size: .76rem; margin-top: 12px; }

/* ============================================================
   CONFIRMATION
   ============================================================ */
.confirm-card { max-width: 720px; margin-inline: auto; text-align: center; }
.confirm-hero { position: relative; width: 118px; height: 118px; margin: 8px auto 18px; }
.confirm-hero .shield { width: 100%; height: 100%; animation: hero-pop .5s cubic-bezier(.2, 1.4, .4, 1) both .1s; }
@keyframes hero-pop { from { transform: scale(.4); opacity: 0; } }
.confetti { position: absolute; inset: -16px; pointer-events: none; }
.confetti i {
  position: absolute; width: 8px; height: 8px; border-radius: 2px;
  left: 50%; top: 50%; opacity: 0;
  animation: confetti 1.15s ease-out forwards .25s;
}
.confetti i:nth-child(3n) { border-radius: 50%; }
.confetti i:nth-child(4n) { width: 6px; height: 12px; }
@keyframes confetti {
  0% { transform: translate(-50%, -50%) rotate(0) scale(.6); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(1); opacity: 0; }
}
.confirm-card h1 { font-size: clamp(1.4rem, 3.4vw, 1.8rem); font-weight: 800; }
.confirm-card .lead { color: var(--muted); margin-top: 6px; }
.confirm-boxes { display: grid; gap: 12px; margin: 24px 0 18px; }
@media (min-width: 560px) { .confirm-boxes { grid-template-columns: 1fr 1fr; } }
.confirm-box { background: #f6f8fc; border: 1px solid var(--line); border-radius: 15px; padding: 16px; }
.confirm-box span { font-size: .76rem; color: var(--muted); font-weight: 600; }
.confirm-box b { display: block; font-size: 1.2rem; font-weight: 900; margin-top: 3px; letter-spacing: -.01em; }
.confirm-mail { color: var(--muted); font-size: .9rem; }
.confirm-mail b { color: var(--ink); }
.confirm-actions { display: grid; gap: 8px; margin-top: 22px; }
@media (min-width: 560px) { .confirm-actions { grid-template-columns: 1fr 1fr; align-items: center; } }

/* ============================================================
   ORDER TRACKING
   ============================================================ */
.order-id-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.order-id-head h1 { font-size: clamp(1.25rem, 2.6vw, 1.55rem); font-weight: 800; }
.order-id-head .muted { font-size: .85rem; }
.track-line { margin: 22px 0 8px; display: grid; gap: 0; }
.track-line li { position: relative; padding: 0 0 26px 46px; }
.track-line li::before {
  content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px;
  width: 3px; border-radius: 3px; background: var(--line-dark);
}
.track-line li:last-child::before { display: none; }
.track-line .tb {
  position: absolute; left: 0; top: 0;
  width: 33px; height: 33px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--line-dark); color: transparent;
  display: grid; place-items: center;
}
.track-line li.is-done .tb { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 4px rgba(26, 86, 219, .14); }
.track-line li.is-done::before { background: var(--blue); }
.track-line li.is-now .tb { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 0 0 4px rgba(22, 163, 74, .16); animation: pulse 2s infinite; }
.track-line li.is-now::before { background: var(--line-dark); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(22, 163, 74, .18); } 50% { box-shadow: 0 0 0 8px rgba(22, 163, 74, .07); } }
.track-line .tt { font-weight: 700; font-size: .92rem; }
.track-line .ts { font-size: .76rem; color: var(--muted); }
.track-line li.is-now .ts { color: var(--green-dark); font-weight: 700; }
@media (min-width: 900px) {
  .track-line { grid-template-columns: repeat(6, 1fr); gap: 0; margin-top: 26px; }
  .track-line li { padding: 46px 6px 0; text-align: center; }
  .track-line .tb { left: 50%; translate: -50% 0; }
  .track-line li::before { left: -50%; right: 50%; top: 16px; bottom: auto; width: auto; height: 3px; margin-inline: 17px; }
  .track-line li:first-child::before { display: none; }
}
.eta-card {
  background: linear-gradient(160deg, #f0fdf5, #e3f9ec);
  border: 1px solid #bbe6cb; border-radius: var(--r-lg);
  padding: 18px; display: flex; gap: 13px; align-items: flex-start;
}
.eta-card .ic { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.eta-card b { color: var(--green-dark); font-size: .95rem; display: block; }
.eta-card .big { color: var(--green-dark); font-size: 1.15rem; font-weight: 900; margin-top: 2px; display: block; }
.detail-rows { display: grid; gap: 0; }
.detail-rows .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.detail-rows .row:last-child { border-bottom: 0; }
.detail-rows dt { color: var(--muted); flex: none; }
.detail-rows dd { font-weight: 600; text-align: right; }
.help-card { text-align: left; }
.help-card p { color: var(--muted); font-size: .86rem; margin: 6px 0 14px; }
.badge-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: .72rem; font-weight: 800;
}
.badge-status.production { background: var(--blue-50); color: var(--blue); }
.badge-status.done { background: var(--green-50); color: var(--green-dark); }
.badge-status.queue { background: #fff7e8; color: var(--amber); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-hero {
  background: linear-gradient(120deg, var(--navy), #14396e 60%, var(--blue-dark));
  border-radius: var(--r-lg); color: #fff;
  padding: clamp(20px, 3.4vw, 30px);
  position: relative; overflow: hidden;
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
}
.dash-hero::after {
  content: ""; position: absolute; right: -60px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 150, 255, .35), transparent 65%);
}
.dash-hero h1 { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 800; }
.dash-hero p { color: #bcd0f5; font-size: .9rem; margin-top: 5px; }
.dash-hero .btn { position: relative; z-index: 1; margin-left: auto; background: #fff; color: var(--blue); }
.dash-hero .btn:hover { background: var(--blue-50); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { padding: 16px; display: flex; gap: 13px; align-items: center; }
.stat-card .ic { width: 44px; height: 44px; flex: none; border-radius: 13px; display: grid; place-items: center; }
.stat-card .ic.b { background: var(--blue-50); color: var(--blue); }
.stat-card .ic.g { background: var(--green-50); color: var(--green-dark); }
.stat-card .ic.a { background: #fff4e5; color: var(--amber); }
.stat-card .ic.v { background: #f1eafe; color: #7c3aed; }
.stat-card b { font-size: 1.25rem; font-weight: 900; display: block; letter-spacing: -.02em; }
.stat-card span { font-size: .74rem; color: var(--muted); font-weight: 600; }
.order-row {
  display: flex; align-items: center; gap: 10px 13px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff;
  transition: border-color .15s ease, transform .15s ease;
}
.order-row .badge-status { margin-left: 55px; }
.order-row .amt { margin-left: auto; font-weight: 800; font-size: .92rem; }
.order-row .chev { display: none; color: var(--faint); }
.order-row:hover { border-color: var(--blue-200); transform: translateY(-1px); }
.order-row + .order-row { margin-top: 10px; }
.order-row .meta { flex: 1 0 calc(100% - 55px); min-width: 0; }
.order-row .meta b { display: block; font-size: .92rem; }
.order-row .meta span { font-size: .77rem; color: var(--muted); }
@media (min-width: 640px) {
  .order-row { flex-wrap: nowrap; }
  .order-row .meta { flex: 1 1 auto; }
  .order-row .badge-status, .order-row .amt { margin-left: 0; }
  .order-row .chev { display: block; }
}

/* ---------- Toast ---------- */
.toast-root { position: fixed; z-index: 200; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); display: grid; place-items: center; pointer-events: none; padding-inline: 16px; }
@media (min-width: 1024px) { .toast-root { bottom: 26px; } }
.toast {
  background: var(--navy); color: #fff;
  padding: 12px 20px; border-radius: 999px;
  font-size: .87rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px;
  animation: toast-in .28s cubic-bezier(.2, 1.2, .4, 1) both;
  max-width: 100%;
}
.toast.out { animation: toast-out .25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.96); } }

/* ============================================================
   DESKTOP SHELL  (≥1024px)
   ============================================================ */
@media (min-width: 640px) {
  .profile-chip .name, .profile-chip > svg { display: block; }
  .header-search { display: block; }
  .app-header .search-toggle { display: none; }
}
@media (min-width: 1024px) {
  .app-header { padding-left: calc(var(--sidebar-w) + 20px); }
  .app-header .brand-mini, .app-header .nav-toggle { display: none; }
  .sidebar { transform: none; width: var(--sidebar-w); top: 0; padding-top: 0; box-shadow: none; }
  .sidebar .brand-mini { padding: 18px 10px 16px; position: sticky; top: 0; background: #fff; z-index: 2; }
  body.nav-open { overflow: auto; }
  .sidebar-overlay, .tabbar { display: none; }
  .app-main { margin-left: var(--sidebar-w); padding-bottom: 48px; }
  .grid-2col { grid-template-columns: 1fr 1fr; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .confetti { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .app-header, .sidebar, .tabbar, .sticky-cta, .toast-root { display: none !important; }
  .app-main { margin: 0; padding: 0; }
}
