/**
 * styles.css
 * Mr. Fox design system — design tokens, global reset, typography, utilities.
 * Imported by every sub-app. No framework. No runtime compilation.
 * Sharp corners are enforced with !important and must never be relaxed.
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&display=swap');

/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
  /* Colours */
  --parchment:  #F4EEE6;
  --surface:    #EBE5DD;
  --near-black: #1C1C1C;
  --fox-red:    #7F1C24;
  --line:       rgba(28,28,28,0.5);
  --line-soft:  rgba(28,28,28,0.15);
  --muted:      rgba(28,28,28,0.55);
  --error:      #8B1A1A;
  --success:    #2B5D3F;
  --amber:      #8A6914;

  /* Typography */
  --font-stack:       'Montserrat', -apple-system, system-ui, sans-serif;
  --weight-regular:   400;
  --weight-medium:    500;
  --tracking-display: 0.20em;
  --tracking-button:  0.18em;
  --tracking-label:   0.15em;

  /* Sizing */
  --tap-min:    44px;
  --gutter-sm:  8px;
  --gutter:     16px;
  --gutter-lg:  24px;
  --gutter-xl:  40px;

  /* Border / shape — SHARP CORNERS ALWAYS */
  --radius:        0;
  --border:        0.5px solid var(--line);
  --border-strong: 1px solid var(--near-black);
}

/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: var(--radius) !important; /* Sharp corners. Non-negotiable. */
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--parchment);
  color: var(--near-black);
  font-family: var(--font-stack);
  font-weight: var(--weight-regular);
  font-size: 15px;
  line-height: 1.45;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--weight-medium);
}

p { margin: 0 0 var(--gutter); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--near-black);
  text-decoration: underline;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-stack);
  font-size: inherit;
}

input, textarea, select {
  font-family: var(--font-stack);
  font-size: inherit;
}

img { max-width: 100%; display: block; }

/* ==========================================================================
   Typography utilities
   ========================================================================== */

.screen-title {
  font-size: 13px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  margin: 0 0 var(--gutter-lg);
}

/* Title row with an action button on the right */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gutter-lg);
}

.screen-header .screen-title {
  margin: 0;
}

.section-label {
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--gutter-sm);
  display: block;
}

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

/* ==========================================================================
   Layout
   ========================================================================== */

.page-root {
  /* Below top nav (56px). Sidebar offset applied at ≥1024px. */
  padding-top: 56px;
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .page-root {
    padding-left: 220px;
  }
}

.content-area {
  padding: var(--gutter-xl) var(--gutter-lg);
  max-width: 720px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .content-area {
    padding: var(--gutter-xl) var(--gutter-xl);
  }
}

/* ==========================================================================
   Field grid (measurement form, 2-column number input layout)
   ========================================================================== */

.field-grid {
  display: grid;
  gap: var(--gutter);
}

/* Field groups inside a grid don't need extra bottom margin — gap handles spacing */
.field-grid .field-group {
  margin-bottom: 0;
}

/* Labels in tight grid columns should wrap, not overflow */
.field-grid .field-label {
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

.field-grid--2 {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 600px) {
  .field-grid--2 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .field-grid--2 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Posture flags grid */
.posture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--gutter-sm);
}

/* Checkbox label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--fox-red);
  cursor: pointer;
  flex-shrink: 0;
}

/* ==========================================================================
   Measurement composite card (client profile — measurements tab)
   ========================================================================== */

.meas-composite-card {
  background: var(--surface);
  border: var(--border-strong);
  padding: var(--gutter-lg);
  margin-bottom: var(--gutter-lg);
}

.meas-composite-card__header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--gutter);
}

.meas-composite-card__title {
  font-size: 13px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.meas-composite-card__sub {
  font-size: 11px;
  color: var(--muted);
}

.meas-composite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--gutter-sm);
}

.meas-composite-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--parchment);
  border: var(--border);
  padding: 10px 8px 8px;
  text-align: center;
}

.meas-composite-item__val {
  font-size: 18px;
  font-weight: var(--weight-medium);
  color: var(--near-black);
  line-height: 1;
  margin-bottom: 4px;
}

.meas-composite-item__label {
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
}

.meas-composite-item__date {
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--fox-red);
  margin-top: 3px;
  opacity: 0.8;
}

/* Date badge used inside measurement detail modal info rows */
.meas-date-badge {
  display: inline-block;
  font-size: 9px;
  color: var(--fox-red);
  letter-spacing: 0.05em;
  margin-left: 6px;
  opacity: 0.85;
  vertical-align: middle;
}

/* field-error styling */
.field-error .field-input,
.field-error .field-number-wrap {
  border-color: var(--fox-red) !important;
}

.field-error-msg {
  color: var(--fox-red);
  font-size: 11px;
  margin: 4px 0 0;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Home screen
   ========================================================================== */

.home-screen {
  max-width: 680px;
}

.home-header {
  padding: var(--gutter-xl) 0 var(--gutter-xl);
  border-bottom: var(--border);
  margin-bottom: var(--gutter-xl);
}

.home-header .screen-title {
  font-size: 16px;
  letter-spacing: 0.22em;
  margin-bottom: 6px;
}

.home-header .muted {
  font-size: 13px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gutter);
  margin-bottom: var(--gutter-xl);
}

.quick-actions .btn {
  flex: 1 1 auto;
  min-width: 120px;
  justify-content: center;
}

.home-section {
  margin-bottom: var(--gutter-xl);
}

.home-section .section-label {
  margin-bottom: var(--gutter);
  padding-bottom: var(--gutter-sm);
  border-bottom: var(--border);
}

/* Two-column form row (e.g. city + pincode) */
.form-row-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
}

/* Taller textarea for notes */
.field-textarea--tall {
  min-height: 120px;
  resize: vertical;
}

/* ==========================================================================
   Top nav bar
   ========================================================================== */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--near-black);
  color: var(--parchment);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  z-index: 100;
  gap: var(--gutter);
}

.top-nav .nav-back {
  width: var(--tap-min);
  height: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--parchment);
  flex-shrink: 0;
}

.top-nav .nav-title {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
}

.top-nav .nav-actions {
  display: flex;
  align-items: center;
  gap: var(--gutter-sm);
  flex-shrink: 0;
}

/* ==========================================================================
   Bottom tab bar (mobile / tablet < 1024px)
   ========================================================================== */

.bottom-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--parchment);
  border-top: var(--border-strong);
  display: flex;
  z-index: 100;
}

@media (min-width: 1024px) {
  .bottom-tabs { display: none; }
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  min-height: var(--tap-min);
}

.tab-item.active {
  color: var(--fox-red);
}

.tab-item svg {
  width: 22px;
  height: 22px;
}

/* ==========================================================================
   Left sidebar (laptop ≥ 1024px)
   ========================================================================== */

.left-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .left-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 220px;
    background: var(--parchment);
    border-right: var(--border);
    padding: var(--gutter-lg) 0;
    z-index: 90;
    overflow-y: auto;
  }
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--gutter-sm);
  padding: 12px var(--gutter-lg);
  font-size: 12px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--near-black);
  text-decoration: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  min-height: var(--tap-min);
}

.sidebar-item.active,
.sidebar-item:hover {
  border-left-color: var(--fox-red);
  color: var(--fox-red);
  background: var(--surface);
}

.sidebar-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ==========================================================================
   Context strip (sticky below nav during wizard)
   ========================================================================== */

.context-strip {
  position: sticky;
  top: 56px;
  background: var(--surface);
  border-bottom: var(--border);
  padding: 8px var(--gutter);
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 80;
}

/* ==========================================================================
   Pills / pill selectors
   ========================================================================== */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gutter-sm);
  margin-bottom: var(--gutter);
}

.pill-btn {
  min-height: var(--tap-min);
  padding: 10px 20px;
  font-family: var(--font-stack);
  font-size: 12px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  background: transparent;
  color: var(--near-black);
  border: var(--border-strong);
  cursor: pointer;
  transition: background-color 80ms ease, color 80ms ease, border-color 80ms ease;
  white-space: nowrap;
}

.pill-btn:hover {
  background: var(--surface);
}

.pill-btn.selected,
.pill-btn[aria-pressed="true"] {
  background: var(--fox-red);
  color: var(--parchment);
  border-color: var(--fox-red);
}

.pill-btn:focus-visible {
  outline: 2px solid var(--fox-red);
  outline-offset: 2px;
}

.pill-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Larger pills in presentation mode */
.presentation-mode .pill-btn {
  min-height: 56px;
  font-size: 13px;
}

/* ==========================================================================
   Inputs
   ========================================================================== */

.field-group {
  margin-bottom: var(--gutter-lg);
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  background: var(--surface);
  border: var(--border);
  padding: 14px var(--gutter);
  font-family: var(--font-stack);
  font-size: 15px;
  color: var(--near-black);
  outline: none;
  transition: border-color 80ms ease;
}

.field-input::placeholder {
  color: var(--muted);
}

.field-input:focus {
  border: var(--border-strong);
}

.field-input--error {
  border-color: var(--error);
}

.field-textarea {
  min-height: 80px;
  resize: vertical;
}

.field-number-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-number-wrap .field-input {
  padding-right: 48px;
  /* Hide browser spinners */
  -moz-appearance: textfield;
}

.field-number-wrap .field-input::-webkit-outer-spin-button,
.field-number-wrap .field-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.field-unit {
  position: absolute;
  right: 14px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: var(--tracking-label);
  pointer-events: none;
}

/* ==========================================================================
   Buttons (CTAs)
   ========================================================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 12px 28px;
  background: var(--fox-red);
  color: var(--parchment);
  font-family: var(--font-stack);
  font-size: 12px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  border: 1px solid var(--fox-red);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 80ms ease;
  width: 100%;
}

@media (min-width: 768px) {
  .btn-primary {
    width: auto;
    min-width: 200px;
  }
}

.btn-primary:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 12px 28px;
  background: transparent;
  color: var(--near-black);
  font-family: var(--font-stack);
  font-size: 12px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  border: var(--border-strong);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 80ms ease;
  width: 100%;
}

@media (min-width: 768px) {
  .btn-secondary {
    width: auto;
    min-width: 200px;
  }
}

.btn-secondary:hover {
  background: var(--surface);
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: var(--gutter-sm);
  margin-top: var(--gutter-lg);
}

@media (min-width: 768px) {
  .btn-row {
    flex-direction: row;
  }
}

/* ==========================================================================
   Wizard layout
   ========================================================================== */

/* Full-height column: progress bar fixed at top, form scrolls, footer sticks to bottom */
.wizard-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px); /* subtract nav bar */
  max-width: 620px;
  margin: 0 auto;
  overflow: hidden;
}

.wizard-progress-wrap {
  flex-shrink: 0;
  border-bottom: var(--border);
  background: var(--parchment);
}

/* Scrollable form area */
.wizard-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.wizard-form {
  padding: 18px 20px 32px;
}

/* Sticky footer with back / section title / continue */
.wizard-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: var(--border);
  background: var(--parchment);
}

.wizard-footer__center {
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  flex: 1;
}

/* Progress bar */
.progress-bar {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  overflow-x: auto;
  gap: 0;
  scrollbar-width: none;
}
.progress-bar::-webkit-scrollbar { display: none; }

.progress-step {
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.progress-step-label {
  font-size: 9px;
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0;
}

.progress-step.active .progress-step-label {
  color: var(--near-black);
  font-weight: var(--weight-medium);
}

.progress-step.completed .progress-step-label {
  color: var(--fox-red);
}

.progress-step-line {
  width: 20px;
  height: 0.5px;
  background: var(--line-soft);
  margin: 0 6px;
  flex-shrink: 0;
}

/* ── Wizard field spacing and sizing ─────────────────────────────────────── */

/* Tighter field spacing inside wizard */
.wizard-form .field-group {
  margin-bottom: 14px;
}

/* Boolean checkboxes: 2 per row */
.wizard-form {
  display: flex;
  flex-flow: row wrap;
  align-items: flex-start;
  gap: 0;
}
.wizard-field {
  width: 100%;
}
.wizard-field--bool {
  width: 50%;
  padding-right: 8px;
}
.wizard-field--bool .field-group {
  margin-bottom: 10px;
}

/* Tighter labels in wizard */
.wizard-form .field-label {
  font-size: 10px;
  margin-bottom: 5px;
}

/* Number inputs — never full width in wizard */
.wizard-form .field-number-wrap {
  max-width: 180px;
}

/* Pill rows wrap but don't stretch to full width */
.wizard-form .pill-row {
  gap: 6px;
  margin-bottom: 0;
}

/* Slightly smaller pills in wizard to fit more per row */
.wizard-form .pill-btn {
  padding: 8px 14px;
  font-size: 11px;
}

/* Textarea full width is fine */
.wizard-form textarea.field-input {
  max-width: 100%;
}

/* ==========================================================================
   Conditional sections
   ========================================================================== */

.conditional-section {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 200ms ease-out, opacity 200ms ease-out;
}

.conditional-section.visible {
  max-height: 2000px; /* Large enough. Transition driven by opacity. */
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .conditional-section {
    transition: none;
  }
}

/* ==========================================================================
   Draft badge
   ========================================================================== */

.draft-badge {
  display: inline-block;
  background: var(--fox-red);
  color: var(--parchment);
  font-size: 9px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding: 3px 8px;
  animation: badge-fade 120ms ease;
}

@keyframes badge-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ==========================================================================
   Toast notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--gutter-sm);
  pointer-events: none;
  width: min(480px, calc(100vw - 32px));
}

.toast {
  background: var(--parchment);
  border: var(--border-strong);
  padding: var(--gutter) var(--gutter-lg);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: var(--gutter-sm);
  pointer-events: auto;
  animation: toast-in 180ms ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast--error .toast-icon { color: var(--fox-red); }
.toast--success .toast-icon { color: var(--success); }
.toast--warning .toast-icon { color: var(--amber); }

/* ==========================================================================
   Confirm dialog
   ========================================================================== */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28,28,28,0.4);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: backdrop-in 160ms ease;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.dialog-box {
  background: var(--parchment);
  border: var(--border-strong);
  padding: var(--gutter-xl);
  width: min(480px, calc(100vw - 32px));
  animation: dialog-in 160ms ease;
}

@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}

.dialog-title {
  font-size: 13px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  margin: 0 0 var(--gutter);
}

.dialog-body {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 var(--gutter-lg);
}

/* ==========================================================================
   Filter chips
   ========================================================================== */

.filter-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: var(--gutter-sm);
  margin-bottom: var(--gutter-lg);
  padding-bottom: 2px; /* stop clipping focus ring */
}

.filter-chips::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  background: transparent;
  border: var(--border);
  cursor: pointer;
  color: var(--muted);
  min-height: 36px;
  display: flex;
  align-items: center;
  transition: background-color 80ms ease, color 80ms ease, border-color 80ms ease;
  white-space: nowrap;
}

.filter-chip:hover:not(.active) {
  background: var(--surface);
  color: var(--near-black);
}

.filter-chip.active {
  background: var(--fox-red);
  color: var(--parchment);
  border-color: var(--fox-red);
}

/* ==========================================================================
   Search bar
   ========================================================================== */

.search-bar-wrap {
  position: relative;
  margin-bottom: var(--gutter);
}

.search-bar {
  width: 100%;
  background: var(--surface);
  border: var(--border);
  padding: 14px var(--gutter) 14px 44px;
  font-family: var(--font-stack);
  font-size: 15px;
  color: var(--near-black);
  outline: none;
}

.search-bar:focus {
  border: var(--border-strong);
}

.search-bar-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* Search autocomplete dropdown */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--parchment);
  border: var(--border-strong);
  border-top: none;
  z-index: 150;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(28,28,28,0.12);
}

.search-suggestion-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px var(--gutter);
  cursor: pointer;
  border-bottom: var(--border);
  transition: background-color 80ms ease;
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
  background: var(--surface);
}

.suggestion-label {
  font-size: 14px;
  font-weight: var(--weight-medium);
}

.suggestion-sublabel {
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   Admin dashboard
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--near-black);
  border: var(--border-strong);
  margin-bottom: var(--gutter-xl);
}

@media (min-width: 600px) {
  .kpi-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.kpi-card {
  background: var(--parchment);
  padding: var(--gutter-lg) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-value {
  font-size: 28px;
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
  line-height: 1;
}

.kpi-label {
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
}

.admin-section {
  margin-bottom: var(--gutter-xl);
}

.admin-section .section-label {
  margin-bottom: var(--gutter);
  padding-bottom: var(--gutter-sm);
  border-bottom: var(--border);
}

.admin-links-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-top: var(--border-strong);
}

.admin-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  padding: var(--gutter) 0;
  border-bottom: var(--border);
  cursor: pointer;
  transition: background-color 80ms ease;
}

.admin-link-card:hover {
  background: var(--surface);
  padding-left: var(--gutter-sm);
}

.admin-link-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-link-card__text strong {
  font-size: 14px;
  font-weight: var(--weight-medium);
}

.admin-link-card__text .muted {
  font-size: 12px;
}

.admin-link-card svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.back-to-tool {
  color: var(--muted);
}

.back-to-tool:hover {
  color: var(--near-black);
}

/* ==========================================================================
   Offline indicator
   ========================================================================== */

.offline-indicator {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--amber);
}

.offline-indicator.visible {
  display: flex;
}

/* ==========================================================================
   Garment tab strip
   ========================================================================== */

.garment-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: var(--border);
  background: var(--parchment);
  scrollbar-width: none;
}

.garment-tabs::-webkit-scrollbar { display: none; }

.garment-tab {
  flex-shrink: 0;
  padding: var(--gutter-sm) var(--gutter);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color 80ms ease;
}

.garment-tab.active {
  color: var(--near-black);
  border-bottom-color: var(--near-black);
}

.garment-tab .tab-status {
  color: var(--fox-red);
  font-size: 14px;
}

/* ==========================================================================
   Status pills (order status)
   ========================================================================== */

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  border: var(--border);
}

.status-pill--quoted     { border-color: var(--amber);   color: var(--amber); }
.status-pill--confirmed  { border-color: var(--success); color: var(--success); }
.status-pill--production { border-color: var(--near-black); color: var(--near-black); }
.status-pill--delivered  { border-color: var(--muted);   color: var(--muted); }
.status-pill--paid       { border-color: var(--success); color: var(--success); }
.status-pill--pending    { border-color: var(--amber);   color: var(--amber); }

/* ==========================================================================
   Presentation mode
   ========================================================================== */

.presentation-mode .internal-only {
  display: none !important;
}

.presentation-mode .cost-column {
  display: none !important;
}

/* ==========================================================================
   Screen transitions
   ========================================================================== */

.screen-enter {
  animation: screen-in 180ms ease;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .screen-enter { animation: none; }
}

/* ==========================================================================
   Measurement quickview drawer
   ========================================================================== */

.measurement-quickview {
  position: fixed;
  bottom: 64px; /* above bottom tabs */
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: var(--border-strong);
  z-index: 70;
  transition: transform 200ms ease;
  transform: translateY(calc(100% - 44px));
}

.measurement-quickview.expanded {
  transform: translateY(0);
}

@media (min-width: 1024px) {
  .measurement-quickview {
    bottom: 0;
    left: 220px; /* sidebar width */
  }
}

.quickview-handle {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  cursor: pointer;
}

.quickview-handle-label {
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
}

.quickview-body {
  padding: var(--gutter);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--gutter-sm);
}

.quickview-field {
  padding: var(--gutter-sm);
  background: var(--parchment);
  border: var(--border);
}

.quickview-field-label {
  font-size: 9px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
}

.quickview-field-value {
  font-size: 14px;
  font-weight: var(--weight-medium);
}

/* ==========================================================================
   Button system — .btn modifier API
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap-min);
  padding: 10px 24px;
  font-family: var(--font-stack);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  border: var(--border-strong);
  background: transparent;
  color: var(--near-black);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 80ms ease, opacity 80ms ease;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--fox-red);
  color: var(--parchment);
  border-color: var(--fox-red);
}

.btn--primary:hover { opacity: 0.88; }

.btn--ghost {
  background: transparent;
  color: var(--near-black);
  border-color: var(--near-black);
}

.btn--ghost:hover { background: var(--surface); }

.btn--danger {
  background: transparent;
  color: var(--fox-red);
  border-color: var(--fox-red);
}

.btn--secondary {
  background: transparent;
  color: var(--near-black);
  border-color: var(--near-black);
}

.btn--secondary:hover { background: var(--surface); }

.btn--sm {
  min-height: 36px;
  padding: 6px 16px;
  font-size: 10px;
}

.btn--large {
  min-height: 52px;
  padding: 14px 32px;
  font-size: 12px;
  width: 100%;
}

@media (min-width: 480px) {
  .btn--large { width: auto; min-width: 200px; }
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ==========================================================================
   Form system — .form-stack, .form-section, .form-actions
   ========================================================================== */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gutter-lg);
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  padding-bottom: var(--gutter-lg);
  border-bottom: var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section-label {
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  font-weight: var(--weight-medium);
}

.form-actions {
  display: flex;
  gap: var(--gutter);
  flex-wrap: wrap;
  padding-top: var(--gutter);
}

/* field-wrap (used in client-new.js inline dropdowns/textarea) */
.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231C1C1C' stroke-width='1.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ==========================================================================
   Warning / info banners
   ========================================================================== */

.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
  padding: var(--gutter);
  background: #FFF8E7;
  border: 1px solid var(--amber);
  margin-bottom: var(--gutter-lg);
}

.warning-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--amber);
  margin-top: 2px;
}

.duplicate-item {
  margin-top: 4px;
  font-size: 14px;
}

/* ==========================================================================
   Skeleton / loading
   ========================================================================== */

.loading-state {
  padding: var(--gutter-lg) 0;
}

.skeleton-card {
  background: var(--surface);
  border: var(--border);
  height: 80px;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}

.skeleton-card--tall { height: 200px; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.error-text {
  color: var(--fox-red);
  font-size: 14px;
  padding: var(--gutter) 0;
}

/* ==========================================================================
   List cards
   ========================================================================== */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-top: var(--border-strong);
}

.list-card {
  display: flex;
  align-items: center;
  gap: var(--gutter);
  padding: var(--gutter) 0;
  border-bottom: var(--border);
  cursor: pointer;
  transition: background-color 80ms ease;
}

.list-card:hover { background: var(--surface); }
.list-card.garment-card--dirty { background: #fdf6ec; border-left: 2px solid var(--fox-red); padding-left: calc(var(--gutter) - 2px); }

.list-card__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.list-card__title {
  font-size: 14px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-card__sub {
  font-size: 12px;
  color: var(--muted);
}

.list-card__meta {
  display: flex;
  align-items: center;
  color: var(--muted);
  flex-shrink: 0;
}

.list-card__meta svg {
  width: 16px;
  height: 16px;
}

.list-card--draft {
  border-left: 3px solid var(--amber);
  padding-left: calc(var(--gutter) - 3px);
}

/* Selectable list card (measurements picker in new-order) */
.list-card--selectable {
  cursor: pointer;
}

.list-card--selectable .list-card__meta svg {
  opacity: 0.2;
  transition: opacity 80ms ease;
}

.list-card--selectable.selected {
  background: var(--surface);
  border-left: 3px solid var(--fox-red);
  padding-left: calc(var(--gutter) - 3px);
}

.list-card--selectable.selected .list-card__meta svg {
  opacity: 1;
  color: var(--fox-red);
}

/* New order — client selected card */
.selected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  padding: var(--gutter);
  background: var(--surface);
  border: var(--border-strong);
}

.selected-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.selected-card__info strong {
  font-size: 14px;
  font-weight: var(--weight-medium);
}

/* New order — garment type grid */
.garment-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gutter-sm);
}

.garment-type-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Quantity adjuster rows */
.qty-adjuster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: var(--border);
}

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

.qty-label {
  font-size: 13px;
  font-weight: var(--weight-medium);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: var(--gutter-sm);
}

.qty-value {
  font-size: 14px;
  font-weight: var(--weight-medium);
  min-width: 24px;
  text-align: center;
}

/* Extra-small button */
.btn--xs {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

/* ==========================================================================
   Status badges / tier badges
   ========================================================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--weight-medium);
  border: 1px solid currentColor;
}

.status-badge--draft        { color: var(--muted); }
.status-badge--confirmed    { color: var(--success); }
.status-badge--in_progress  { color: var(--near-black); }
.status-badge--ready        { color: var(--amber); }
.status-badge--delivered    { color: var(--muted); }
.status-badge--cancelled    { color: var(--fox-red); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--weight-medium);
  background: var(--surface);
  border: 1px solid var(--line-soft);
}

.badge--green  { background: #E8F5EE; color: var(--success); border-color: var(--success); }
.badge--red    { background: #FAE8E8; color: var(--fox-red);  border-color: var(--fox-red); }
.badge--amber  { background: #FFF8E7; color: var(--amber);    border-color: var(--amber); }

/* Tier badge */
.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--weight-medium);
  border: 1px solid var(--near-black);
  background: var(--near-black);
  color: var(--parchment);
}

/* ==========================================================================
   Section header (above list)
   ========================================================================== */

.section-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--gutter);
}

/* ==========================================================================
   Tab strip (profile, order tabs)
   ========================================================================== */

.tab-strip {
  display: flex;
  border-bottom: var(--border-strong);
  margin-bottom: var(--gutter-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-strip::-webkit-scrollbar { display: none; }

.tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px var(--gutter);
  font-family: var(--font-stack);
  font-size: 11px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--weight-medium);
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 80ms ease;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--fox-red);
  transform: scaleX(0);
  transition: transform 120ms ease;
}

.tab-btn.active {
  color: var(--near-black);
}

.tab-btn.active::after {
  transform: scaleX(1);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 10px;
  background: var(--surface);
  border: var(--border);
}

/* ==========================================================================
   Client profile layout
   ========================================================================== */

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
  margin-bottom: var(--gutter-xl);
  padding-bottom: var(--gutter-xl);
  border-bottom: var(--border);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--near-black);
  color: var(--parchment);
  font-size: 18px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.05em;
}

.profile-header__info {
  flex: 1;
  min-width: 0;
}

.profile-header__info .screen-title {
  word-break: break-word;
}

.profile-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.profile-header__actions {
  flex-shrink: 0;
}

/* Info sections inside overview tab */

/* Account summary 4-up stat grid on client profile overview */
.account-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}

@media (min-width: 480px) {
  .account-summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.account-summary-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.account-summary-stat__val {
  font-size: 14px;
  font-weight: var(--weight-medium);
  color: var(--near-black);
}

.account-summary-stat__label {
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
}

.account-summary-stat--outstanding .account-summary-stat__val {
  color: var(--fox-red);
}

/* Wardrobe pill tags */
.wardrobe-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wardrobe-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--near-black);
  letter-spacing: 0.03em;
}

.wardrobe-pill__type {
  color: var(--muted);
  font-weight: 400;
}

.info-section {
  margin-bottom: var(--gutter-lg);
  padding-bottom: var(--gutter-lg);
  border-bottom: var(--border);
}

.info-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.info-section__heading {
  font-size: 9px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  font-weight: var(--weight-medium);
  margin-bottom: var(--gutter);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter-sm) var(--gutter-lg);
}

@media (min-width: 480px) {
  .info-grid--wide {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-row--full {
  grid-column: 1 / -1;
}

.info-key {
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  font-weight: var(--weight-regular);
}

.info-val {
  font-size: 14px;
  font-weight: var(--weight-medium);
  word-break: break-word;
}

.info-val--muted {
  color: var(--muted);
  font-weight: var(--weight-regular);
}

.notes-block {
  background: var(--surface);
  border: var(--border);
  padding: var(--gutter);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.profile-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gutter);
  margin-top: var(--gutter-xl);
  padding-top: var(--gutter-lg);
  border-top: var(--border);
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 28, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 0;
}

@media (min-width: 600px) {
  .modal-overlay {
    align-items: center;
    padding: var(--gutter-lg);
  }
}

.modal {
  background: var(--parchment);
  border: var(--border-strong);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal--wide {
  max-width: 800px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gutter) var(--gutter-lg);
  border-bottom: var(--border-strong);
  flex-shrink: 0;
}

.modal__title {
  font-size: 13px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--weight-medium);
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--near-black);
  padding: 0;
}

.modal__close svg {
  width: 18px;
  height: 18px;
}

.modal__close:hover { background: var(--surface); }

.modal__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--gutter-lg);
  -webkit-overflow-scrolling: touch;
}

.modal__footer {
  display: flex;
  gap: var(--gutter);
  justify-content: flex-end;
  padding: var(--gutter) var(--gutter-lg);
  border-top: var(--border);
  flex-shrink: 0;
  background: var(--parchment);
}

/* modal-specific form-section — tighter spacing */
.modal__body .form-section {
  gap: 12px;
  padding-bottom: var(--gutter);
  margin-bottom: 4px;
}

.modal__body .form-section-label {
  font-size: 9px;
}

/* ==========================================================================
   Link style
   ========================================================================== */

.link {
  color: var(--fox-red);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
}

.link:hover { opacity: 0.75; }

/* ==========================================================================
   Order Detail Screen
   ========================================================================== */

/* Header row: order code + action buttons */
.order-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gutter);
  margin-bottom: var(--gutter-lg);
}
.order-detail-header h1 {
  margin: 0 0 4px;
}
.order-detail-header .muted {
  font-size: 13px;
  margin: 0;
}
.order-detail-header__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* Status stepper */
.status-stepper {
  display: flex;
  gap: 0;
  margin-bottom: var(--gutter-lg);
  overflow-x: auto;
  padding-bottom: 4px;
}
.status-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  cursor: pointer;
  position: relative;
  min-width: 80px;
}
/* connecting line between dots */
.status-step::before {
  content: '';
  position: absolute;
  top: 7px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: var(--line-soft);
}
.status-step:first-child::before { display: none; }
.status-step.done::before,
.status-step.active::before { background: var(--fox-red); }

.status-step__dot {
  width: 16px;
  height: 16px;
  border-radius: 0;
  border: 2px solid var(--border-strong-color, #C8BFB4);
  background: var(--parchment);
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
  transition: background 0.15s, border-color 0.15s;
}
.status-step.done .status-step__dot {
  background: var(--fox-red);
  border-color: var(--fox-red);
}
.status-step.active .status-step__dot {
  background: var(--fox-red);
  border-color: var(--fox-red);
  box-shadow: 0 0 0 3px rgba(127,28,36,0.18);
}
.status-step__label {
  font-size: 9px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.status-step.active .status-step__label { color: var(--fox-red); }
.status-step.done  .status-step__label  { color: var(--near-black); }

/* Detail meta grid */
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: var(--border);
}
.detail-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: var(--border);
}
.detail-label {
  font-size: 9px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  min-width: 110px;
  flex-shrink: 0;
}
.detail-value {
  font-size: 13px;
  color: var(--near-black);
}

/* Order sections */
.order-section {
  margin: var(--gutter-lg) 0 0;
}
.order-section .section-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--gutter);
}
.order-section .section-header .section-label { margin: 0; }

/* Pricing summary */
.pricing-summary-block {
  border-top: var(--border);
}
.pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: var(--border);
  font-size: 13px;
}
.pricing-row--total {
  font-size: 15px;
  border-bottom: none;
  padding-top: 12px;
}
.pricing-row--total strong {
  color: var(--fox-red);
}

/* Danger zone */
.danger-zone {
  padding-top: var(--gutter-lg);
  border-top: var(--border);
  margin-top: var(--gutter-xl, 40px);
}

/* ── Garment fabric card (new-order.js) ──────────────────────────────────── */
.garment-fabric-card {
  border: 1px solid var(--line);
  padding: 16px;
  margin-bottom: 16px;
  background: var(--surface);
}
.garment-fabric-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.garment-fabric-card__title {
  font-weight: var(--weight-medium);
  font-size: 13px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.discount-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.discount-type-btn.selected {
  background: var(--near-black);
  color: var(--parchment);
}

/* ── Autocomplete dropdown ────────────────────────────────────────────────── */
.autocomplete-dropdown {
  border: 1px solid var(--line);
  background: var(--parchment);
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
  position: absolute;
  width: 100%;
}
.autocomplete-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.autocomplete-item:hover { background: var(--surface); }

/* ── Pricing preview (in garment card) ───────────────────────────────────── */
.f-price-preview {
  font-size: 13px;
  padding: 8px 0;
  color: var(--muted);
}
.pricing-preview {
  font-size: 13px;
}

/* ── House designs piece selector ───────────────────────────────────────────  */
.hd-piece-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.hd-piece-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
}
.hd-piece-name { font-size: 14px; }
.hd-piece-price { white-space: nowrap; font-size: 13px; }

/* ── Quotation rows (new-order committed items) ───────────────────────────── */
.quotation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--surface);
}
.quotation-row__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quotation-row__price {
  font-weight: var(--weight-medium);
  font-size: 15px;
  white-space: nowrap;
}

/* ── Price display inside garment form ───────────────────────────────────── */
.garment-price-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}
.garment-price-value {
  font-size: 15px;
  font-weight: var(--weight-medium);
  color: var(--text);
}

/* ── Pricing tool result card ─────────────────────────────────────────────── */
.pricing-result-card {
  border: 1px solid var(--line);
  padding: 20px;
  background: var(--surface);
}
.pricing-result-mrp {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.pricing-result-label {
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
}
.pricing-result-amount {
  font-size: 28px;
  font-weight: var(--weight-medium);
  color: var(--fox-red);
}
.pricing-result-breakdown { margin-top: 8px; }

/* ── Pricing matrix (admin pricing editor) ───────────────────────────────── */
.pricing-matrix { margin-top: 8px; }
.pricing-matrix-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}
.pricing-matrix-header { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pricing-matrix-label { min-width: 90px; font-size: 12px; }
.pricing-matrix-cell { flex: 1; }

/* ── Admin supplier accordion ─────────────────────────────────────────────── */
.admin-supplier-section { border: 1px solid var(--line); padding: 0; margin-bottom: 8px; }
.supplier-header { padding: 12px 16px; }
.supplier-qualities { padding: 0 16px 16px; border-top: 1px solid var(--line-soft); }
.pricing-edit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.pricing-edit-label { flex: 1; font-size: 13px; }
.pricing-edit-input-wrap { display: flex; align-items: center; gap: 4px; }
.field-unit { font-size: 12px; color: var(--muted); }
.qualities-table .pricing-edit-row { align-items: center; padding: 4px 0; gap: 6px; }
.danger-zone .section-label { margin-bottom: var(--gutter); }

/* ── Presentation Mode ────────────────────────────────────────────────────── */

/* Hide the app shell when in presentation mode */
body.presentation-active #app-shell { display: none; }
body.presentation-active #screen-root { margin: 0; padding: 0; max-width: 100%; }

/* Slide base */
.presentation-slide {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 48px 40px;
  box-sizing: border-box;
  z-index: 1000;
}

/* Cover & close slides — dark luxury */
.presentation-slide--cover,
.presentation-slide--close {
  background: var(--near-black);
  color: var(--parchment);
}

/* Garment slides — clean parchment */
.presentation-slide--garment {
  background: var(--parchment);
  color: var(--near-black);
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
  overflow: hidden;
  padding: 24px 48px 0;
}

/* Cover content */
.presentation-brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.40em;
  text-transform: uppercase;
  color: var(--parchment);
  margin-bottom: 12px;
}
.presentation-subtitle {
  font-size: 10px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: #9a8f85;
  margin-bottom: 48px;
}
.presentation-client {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--parchment);
  margin-bottom: 8px;
}
.presentation-commission {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9a8f85;
  margin-bottom: 56px;
}
.presentation-tagline {
  font-size: 13px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: #9a8f85;
  margin-bottom: 24px;
}
.presentation-thanks {
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--parchment);
  margin-bottom: 56px;
}

/* Nav buttons */
.presentation-nav-btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--fox-red);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 8px;
}
.presentation-nav-btn--ghost {
  background: transparent;
  color: var(--near-black);
  border: 1px solid var(--line);
}
.presentation-nav-btn--ghost:hover { background: var(--surface); }
.presentation-nav-btn:hover { opacity: 0.88; }

/* Exit button — top right corner */
.presentation-exit-btn {
  position: fixed;
  top: 20px;
  right: 24px;
  background: transparent;
  border: none;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
  z-index: 1010;
}
.presentation-exit-btn:hover { opacity: 1; }
.presentation-slide--cover .presentation-exit-btn,
.presentation-slide--close .presentation-exit-btn { color: var(--parchment); }
.presentation-slide--garment .presentation-exit-btn { color: var(--near-black); }

/* Garment slide layout */
.pres-garment-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  flex-shrink: 0;
}
.pres-garment-number {
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--muted);
}
.pres-garment-type {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: 1;
}
.pres-garment-qty {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--fox-red);
}

/* Fabric block */
.pres-fabric-block {
  background: var(--surface);
  padding: 16px 20px;
  margin-bottom: 28px;
}
.pres-section-label {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.pres-fabric-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.pres-fabric-detail {
  font-size: 12px;
  margin-top: 3px;
  letter-spacing: 0.05em;
}

/* Body — 3-column CSS columns, no scroll, fills space between header and nav */
.pres-body {
  flex: 1;
  overflow: hidden;
  columns: 3;
  column-gap: 40px;
  padding-bottom: 72px; /* clear the fixed nav bar */
  width: 100%;
}

/* Spec sections — keep each section together, don't split across columns */
.pres-spec-section {
  break-inside: avoid;
  margin-bottom: 20px;
}

.pres-spec-section-label {
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}

.pres-spec-rows { display: flex; flex-direction: column; }

.pres-spec-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-soft);
}
.pres-spec-row:last-child { border-bottom: none; }

.pres-spec-key {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 90px;
  flex-shrink: 0;
}
.pres-spec-val {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--near-black);
}

.pres-empty {
  font-size: 12px;
  letter-spacing: 0.10em;
  font-style: italic;
  color: var(--muted);
  margin-top: 16px;
}

/* Bottom nav bar on garment slides */
.presentation-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--parchment);
  border-top: 1px solid var(--line);
  z-index: 1005;
}
.presentation-nav .presentation-nav-btn { margin-top: 0; }

/* ── Language picker overlay ─────────────────────────────────────────────── */
.lang-picker-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.lang-picker-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  min-width: 260px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.lang-picker-title { font-size: 14px; font-weight: 600; margin: 0; }
.lang-picker-btns { display: flex; gap: 12px; }
.lang-picker-cancel { font-size: 12px; color: var(--muted); }
