/* ============================================
   Stilo Measurement App - Measurement Styles
   ============================================ */

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0a0a 0%, #141414 50%, #1e1e1e 100%);
  padding: 2rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--color-dark-secondary, #141414);
  border: 1px solid rgba(201, 169, 110, 0.15);
  padding: 3rem 2.5rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-brand {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--color-cream, #faf8f5);
  letter-spacing: 4px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
}

.login-brand span {
  color: var(--color-gold, #c9a96e);
}

.login-subtitle {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-gold, #c9a96e);
}

.login-form .form-group {
  margin-bottom: 1.5rem;
}

.login-form label {
  display: block;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-muted, #9a9590);
  margin-bottom: 0.5rem;
}

.login-form input {
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.95rem;
  border: 1px solid rgba(201, 169, 110, 0.2);
  background: rgba(10, 10, 10, 0.5);
  color: var(--color-cream, #faf8f5);
  outline: none;
  transition: border-color 0.3s ease;
}

.login-form input:focus {
  border-color: var(--color-gold, #c9a96e);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1);
}

.login-form input::placeholder {
  color: rgba(154, 149, 144, 0.5);
}

.login-btn {
  width: 100%;
  padding: 1rem;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-message {
  text-align: center;
  font-size: 0.85rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  display: none;
}

.login-message.error {
  display: block;
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.login-message.success {
  display: block;
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.login-loading {
  display: none;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted, #9a9590);
  margin-top: 1rem;
}

.login-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(201, 169, 110, 0.1);
}

.login-footer p {
  font-size: 0.75rem;
  color: var(--color-text-muted, #9a9590);
  letter-spacing: 1px;
}

/* --- Measurement App Layout --- */
.measurement-app {
  min-height: 100vh;
  background: var(--color-cream, #faf8f5);
}

/* Top Bar */
.app-topbar {
  background: var(--color-dark, #0a0a0a);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(201, 169, 110, 0.2);
}

.app-topbar-brand {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-cream, #faf8f5);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-decoration: none;
}

.app-topbar-brand span {
  color: var(--color-gold, #c9a96e);
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.app-topbar-user {
  font-size: 0.8rem;
  color: var(--color-text-muted, #9a9590);
  letter-spacing: 1px;
}

.app-topbar-user strong {
  color: var(--color-gold, #c9a96e);
  font-weight: 500;
}

.app-topbar-link {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-muted, #9a9590);
  text-decoration: none;
  transition: color 0.3s;
}

.app-topbar-link:hover {
  color: var(--color-gold, #c9a96e);
}

.app-topbar-logout {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-muted, #9a9590);
  background: none;
  border: 1px solid rgba(201, 169, 110, 0.3);
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.app-topbar-logout:hover {
  color: var(--color-cream, #faf8f5);
  border-color: var(--color-gold, #c9a96e);
}

.profile-menu-wrap {
  position: relative;
}

.profile-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border: 0;
  background: transparent;
  color: var(--color-gold, #c9a96e);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.profile-menu-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.profile-menu-button:hover,
.profile-menu-button[aria-expanded="true"] {
  color: var(--color-cream, #faf8f5);
}

.profile-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 0.55rem);
  right: 0;
  width: 190px;
  padding: 0.4rem 0;
  border: 1px solid rgba(201, 169, 110, 0.35);
  background: #111;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.profile-menu[hidden] {
  display: none !important;
}

.profile-menu a,
.profile-menu button {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 0;
  background: transparent;
  color: #d9d4cb;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.profile-menu a:hover,
.profile-menu button:hover {
  color: var(--color-gold, #c9a96e);
  background: rgba(201, 169, 110, 0.08);
}

/* Tab Bar */
.tab-bar {
  display: flex;
  background: var(--color-dark-secondary, #141414);
  padding: 0;
  border-bottom: 2px solid rgba(201, 169, 110, 0.2);
}

.tab-btn {
  flex: 1;
  padding: 1.5rem 0.75rem 0.8rem;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-muted, #9a9590);
  background: #1d1c1a;
  border: none;
  border-top: 3px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  text-align: center;
}

.tab-code {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(154, 149, 144, 0.6);
  letter-spacing: 0.5px;
}

.tab-btn.selected .tab-code {
  color: #91d9a0;
}

.tab-btn::before {
  content: 'NOT SELECTED';
  position: absolute;
  top: 5px;
  right: 8px;
  padding: 2px 5px;
  border: 1px solid #66615a;
  border-radius: 3px;
  color: #bcb5aa;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold, #c9a96e);
  transition: width 0.3s;
}

.tab-btn:hover {
  color: var(--color-cream, #faf8f5);
  background: rgba(201, 169, 110, 0.05);
}

.tab-btn.active {
  color: var(--color-gold, #c9a96e);
  background: rgba(201, 169, 110, 0.08);
  font-weight: 600;
}

.tab-btn.active::before {
  content: 'ACTIVE · NOT SELECTED';
  border-color: #b9995e;
  background: #30291d;
  color: #e3c17d;
}

.tab-btn.active::after {
  width: 100%;
}

.tab-btn.active .tab-code {
  color: #ae9160;
}

.tab-btn.selected {
  background: #193526;
  border-top-color: #72ca8a;
  color: #e7f5eb;
  font-weight: 600;
}

.tab-btn.selected::before {
  content: '✓ SELECTED';
  border-color: #72ca8a;
  background: #28543a;
  color: #e7f5eb;
}

.tab-btn.selected.active {
  background: rgba(201, 169, 110, 0.08);
  border-top-color: #388c55;
  color: var(--color-gold, #c9a96e);
}

.tab-btn.selected.active::before {
  content: 'ACTIVE · ✓ SELECTED';
  border-color: #72ca8a;
  background: #23412d;
  color: #e7f5eb;
}

.tab-btn.selected.active::after {
  background: var(--color-gold, #c9a96e);
}

/* Form Content */
.form-content {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Section Groups */
.form-section {
  margin-bottom: 2.5rem;
}

.form-section-title {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text-dark, #2a2a2a);
  margin-bottom: 0.5rem;
}

.form-section-line {
  width: 50px;
  height: 2px;
  background: var(--color-gold, #c9a96e);
  margin-bottom: 1.5rem;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.form-grid-2col {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid-3col {
  grid-template-columns: repeat(3, 1fr);
}

.form-grid-4col {
  grid-template-columns: repeat(4, 1fr);
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field[hidden] {
  display: none !important;
}

.form-field label {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-dark, #2a2a2a);
  margin-bottom: 0.4rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 0.7rem 0.85rem;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.9rem;
  border: 1px solid rgba(201, 169, 110, 0.2);
  background: white;
  color: var(--color-text-dark, #2a2a2a);
  outline: none;
  transition: border-color 0.3s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--color-gold, #c9a96e);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.08);
}

.form-field textarea {
  resize: vertical;
  min-height: 80px;
}

.form-field-full {
  grid-column: 1 / -1;
}

/* --- Measurement Fields with Handwriting --- */
.measurement-field {
  background: white;
  border: 1px solid rgba(201, 169, 110, 0.15);
  padding: 1rem;
  transition: border-color 0.3s;
}

.measurement-field:hover {
  border-color: rgba(201, 169, 110, 0.4);
}

.measurement-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.measurement-field-label {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-dark, #2a2a2a);
}

.measurement-field-code {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--color-gold, #c9a96e);
  background: rgba(201, 169, 110, 0.1);
  padding: 0.2rem 0.6rem;
}

.ap-measurement-type {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: -0.1rem 0 0.65rem;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  color: var(--color-text-dark, #2a2a2a);
}

.ap-measurement-type label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.ap-measurement-type input {
  accent-color: var(--color-gold, #c9a96e);
}

.measurement-field-value {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid rgba(201, 169, 110, 0.2);
  background: var(--color-cream, #faf8f5);
  color: var(--color-text-dark, #2a2a2a);
  margin-bottom: 0.5rem;
  outline: none;
}

.measurement-field-value:focus {
  border-color: var(--color-gold, #c9a96e);
}

/* --- Handwriting Canvas Indicator --- */
.hw-canvas-indicator {
  width: 100%;
  height: 60px;
  border: 2px dashed rgba(201, 169, 110, 0.3);
  background: white;
  cursor: pointer;
  touch-action: none;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.hw-canvas-indicator:hover {
  border-color: var(--color-gold, #c9a96e);
  background: rgba(201, 169, 110, 0.03);
}

.hw-canvas-indicator.has-value {
  border-color: #2ecc71;
  border-style: solid;
  background: rgba(46, 204, 113, 0.03);
}

.hw-canvas-indicator-icon {
  font-size: 1.5rem;
  color: var(--color-gold, #c9a96e);
  pointer-events: none;
}

.hw-canvas-indicator.has-value .hw-canvas-indicator-icon {
  color: #2ecc71;
}

.hw-canvas-indicator-label {
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-muted, #9a9590);
  margin-top: 0.25rem;
  text-align: center;
  pointer-events: none;
}

/* --- Handwriting Modal --- */
.hw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.hw-modal-overlay.visible {
  display: flex;
}

.hw-modal {
  background: white;
  border-radius: 4px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: auto;
  border: 1px solid rgba(201, 169, 110, 0.3);
}

.hw-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.15);
  background: var(--color-dark, #0a0a0a);
}

.hw-modal-title {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-cream, #faf8f5);
  letter-spacing: 1px;
}

.hw-modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted, #9a9590);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.hw-modal-close:hover {
  color: var(--color-cream, #faf8f5);
}

.hw-modal-body {
  padding: 1.5rem;
}

#hw-draw-canvas {
  width: 100%;
  height: 250px;
  border: 2px solid rgba(201, 169, 110, 0.2);
  background: white;
  cursor: crosshair;
  touch-action: none;
  transition: border-color 0.3s;
}

#hw-draw-canvas.drawing {
  border-color: var(--color-gold, #c9a96e);
  box-shadow: 0 0 12px rgba(201, 169, 110, 0.15);
}

.hw-modal-preview {
  text-align: center;
  padding: 1rem 0 0.5rem;
  border-top: 1px solid rgba(201, 169, 110, 0.1);
  margin-top: 1rem;
}

.hw-preview-text {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  color: var(--color-text-dark, #2a2a2a);
  margin-bottom: 0.25rem;
  transition: color 0.3s;
}

.hw-preview-text.hw-conf-high {
  color: #2ecc71;
}

.hw-preview-text.hw-conf-medium {
  color: #f1c40f;
}

.hw-preview-text.hw-conf-low {
  color: #e74c3c;
}

.hw-preview-confidence {
  font-size: 0.8rem;
  color: var(--color-text-muted, #9a9590);
}

.hw-modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(201, 169, 110, 0.15);
  background: var(--color-cream, #faf8f5);
}

.hw-btn {
  flex: 1;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.hw-btn-clear {
  background: white;
  color: var(--color-text-dark, #2a2a2a);
  border: 1px solid rgba(201, 169, 110, 0.3);
}

.hw-btn-clear:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

.hw-btn-confirm {
  background: var(--color-gold, #c9a96e);
  color: var(--color-dark, #0a0a0a);
}

.hw-btn-confirm:hover {
  background: var(--color-gold-light, #dfc088);
}

/* --- Options / Checkboxes --- */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.option-group {
  background: white;
  border: 1px solid rgba(201, 169, 110, 0.15);
  padding: 1rem;
}

.option-group-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-dark, #2a2a2a);
  margin-bottom: 0.75rem;
}

.option-radios {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.option-radio {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.option-radio input[type="radio"],
.option-radio input[type="checkbox"] {
  accent-color: var(--color-gold, #c9a96e);
}

.option-radio span {
  font-size: 0.8rem;
  color: var(--color-text-dark, #2a2a2a);
}

.additional-options-content {
  margin-top: 1.25rem;
  padding: 0 1.25rem 1.25rem;
}

.pant-special-instructions {
  margin-top: 1.5rem;
}

.pant-special-instructions textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
}

.additional-options-group .options-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.additional-options-group .option-group:not(.option-group-pocket-style) {
  min-height: 300px;
  padding: 1.25rem;
  border-color: rgba(201, 169, 110, 0.42);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.88);
}

.additional-options-group .option-group:not(.option-group-pocket-style) .option-group-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 40px;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.48);
}

.option-group-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: #a6813d;
}

.option-group-icon svg {
  width: 100%;
  height: 100%;
}

.option-group-icon path,
.option-group-icon circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.additional-options-group .option-group-title-text {
  line-height: 1.2;
}

.additional-options-group .option-group-stitching_type .option-radios {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 0.45rem;
}

@media (max-width: 1100px) {
  .additional-options-group .options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .additional-options-group .options-grid {
    grid-template-columns: 1fr;
  }
  .additional-options-group .option-group:not(.option-group-pocket-style) {
    min-height: auto;
  }
}

.pleats-option-rows {
  display: grid;
  gap: 0.45rem;
}

.hand-stitch-option-rows {
  display: grid;
  gap: 0.45rem;
}

.checkbox-option-subgroup-title {
  margin: 0;
  padding: 0 0.4rem;
  color: #a6813d;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
}

.option-rows-additional_options {
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.checkbox-option-subgroup {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.55rem;
  min-width: 0;
  margin: 0;
  padding: 0.4rem 0.55rem 0.55rem;
  border: 1px solid rgba(201, 169, 110, 0.48);
  border-radius: 3px;
  background: transparent;
}

.option-rows-additional_options .checkbox-option-grouped-row {
  min-height: 34px;
  padding: 0.35rem 0.25rem;
  border-bottom: 0;
}

.option-rows-additional_options .checkbox-option-grouped-row .checkbox-option-copy {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem;
}

.option-rows-additional_options .checkbox-option-grouped-row .checkbox-option-description {
  white-space: nowrap;
}

.hand-stitch-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(201, 169, 110, 0.16);
  cursor: pointer;
}

.hand-stitch-option-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.hand-stitch-option-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-gold, #c9a96e);
}

.hand-stitch-row-label {
  font-size: 0.78rem;
  font-weight: 600;
}

.checkbox-option-copy {
  display: grid;
  grid-template-columns: minmax(3.5rem, auto) minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.checkbox-option-code {
  color: var(--color-text-dark, #2a2a2a);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.checkbox-option-description {
  color: var(--color-text-muted, #77716a);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.35;
}

.pleats-option-row {
  display: grid;
  grid-template-columns: 2.75rem 1rem 1fr;
  align-items: center;
  min-height: 2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.16);
}

.pleats-option-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.pleats-option-row.is-disabled {
  color: #b8b4ae;
  background: rgba(120, 116, 110, 0.06);
  cursor: not-allowed;
}

.pleats-option-row.is-disabled .pleats-row-arrow,
.pleats-option-row.is-disabled .option-radio {
  color: #c8c4be;
}

.pleats-option-row.is-disabled input {
  cursor: not-allowed;
  opacity: 0.45;
}

.pleats-row-label {
  font-size: 0.78rem;
  font-weight: 600;
}

.pleats-row-arrow {
  color: var(--color-gold, #c9a96e);
}

.pleats-row-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #d9c8a8;
  background: #fff;
  color: transparent;
  cursor: pointer;
}

.pleats-row-checkbox input {
  position: absolute;
  opacity: 0;
}

.pleats-row-checkbox:has(input:checked) {
  border-color: #b38b43;
  background: #f7eedb;
  color: #8b682d;
}

.pleats-row-checkbox:has(input:focus-visible) {
  outline: 2px solid #8b682d;
  outline-offset: 2px;
}

.pleats-option-row.is-disabled .pleats-row-checkbox {
  cursor: not-allowed;
  border-color: #dedbd6;
  background: #f1f0ee;
  color: transparent;
}

.pleats-option-row.is-disabled .pleats-row-checkbox input {
  opacity: 0;
}

/* --- Visual Selection (Fabric Direction) --- */
.visual-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.visual-option {
  cursor: pointer;
  position: relative;
}

.visual-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.visual-option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(201, 169, 110, 0.2);
  background: white;
  transition: all 0.3s;
  width: 130px;
  min-width: 130px;
}

.visual-option-card:hover {
  border-color: rgba(201, 169, 110, 0.5);
  background: rgba(201, 169, 110, 0.03);
}

.visual-option input[type="radio"]:checked + .visual-option-card {
  border-color: var(--color-gold, #c9a96e);
  background: rgba(201, 169, 110, 0.08);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1);
}

.visual-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
}

.visual-option-icon svg {
  width: 64px;
  height: 80px;
}

.visual-option-label {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-dark, #2a2a2a);
}

/* --- Stilo Checkboxes --- */
.checkbox-group-field {
  background: white;
  border: 1px solid rgba(201, 169, 110, 0.15);
  border-radius: 4px;
  padding: 0.75rem 1rem;
}

#shirt-dart-style-field[hidden] { display: none; }

.shirt-dart-style-note {
  margin: 0 0 0.55rem;
  color: var(--color-text-muted, #77716a);
  font-size: 0.7rem;
  line-height: 1.45;
}

.checkbox-group-title {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-gold, #c9a96e);
  margin-bottom: 0.5rem;
}

.stilo-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0;
  position: relative;
}

.stilo-checkbox input[type="checkbox"],
.stilo-checkbox input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.stilo-checkbox-mark {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(201, 169, 110, 0.4);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  background: white;
}

.stilo-checkbox-mark::after {
  content: '';
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s;
  margin-top: -2px;
}

.stilo-checkbox input[type="checkbox"]:checked + .stilo-checkbox-mark,
.stilo-checkbox input[type="radio"]:checked + .stilo-checkbox-mark {
  border-color: var(--color-gold, #c9a96e);
  background: var(--color-gold, #c9a96e);
}

.stilo-checkbox input[type="checkbox"]:checked + .stilo-checkbox-mark::after,
.stilo-checkbox input[type="radio"]:checked + .stilo-checkbox-mark::after {
  transform: rotate(45deg) scale(1);
}

.stilo-checkbox-label {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--color-text-dark, #2a2a2a);
}

/* --- Collar Select --- */
#txt-collar_design,
#txt-shirt_pleats,
#item-pocket_style-r,
#item-pocket_style-l,
.pocket-style-select {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 4px;
  background: white;
  color: var(--color-text-dark, #2a2a2a);
  appearance: auto;
  cursor: pointer;
}

#txt-collar_design:focus,
#txt-shirt_pleats:focus,
#item-pocket_style-r:focus,
#item-pocket_style-l:focus,
.pocket-style-select:focus {
  outline: none;
  border-color: var(--color-gold, #c9a96e);
  box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.15);
}

/* --- Action Bar --- */
.action-bar {
  background: white;
  border-top: 1px solid rgba(201, 169, 110, 0.2);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  position: sticky;
  bottom: 0;
  z-index: 50;
}

.action-bar .btn {
  padding: 0.8rem 2rem;
  font-size: 0.8rem;
}

.btn-dark {
  background: var(--color-dark, #0a0a0a);
  color: var(--color-cream, #faf8f5);
}

.btn-dark:hover {
  background: var(--color-dark-secondary, #141414);
}

.btn-outline-dark {
  background: transparent;
  color: var(--color-text-dark, #2a2a2a);
  border: 1px solid rgba(201, 169, 110, 0.3);
}

.btn-outline-dark:hover {
  border-color: var(--color-gold, #c9a96e);
  background: rgba(201, 169, 110, 0.05);
}

/* --- Orders List Page --- */
.orders-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.orders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.orders-header h2 {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text-dark, #2a2a2a);
}

.orders-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.orders-filters input,
.orders-filters select {
  padding: 0.6rem 1rem;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.85rem;
  border: 1px solid rgba(201, 169, 110, 0.2);
  background: white;
  outline: none;
}

.orders-filters input:focus,
.orders-filters select:focus {
  border-color: var(--color-gold, #c9a96e);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid rgba(201, 169, 110, 0.15);
}

.orders-table th {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-dark, #2a2a2a);
  padding: 1rem;
  text-align: left;
  background: var(--color-cream, #faf8f5);
  border-bottom: 2px solid rgba(201, 169, 110, 0.2);
}

.orders-table td {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.1);
  color: var(--color-text-dark, #2a2a2a);
}

.orders-table tr:hover td {
  background: rgba(201, 169, 110, 0.03);
}

.orders-table .status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.status-badge.draft {
  background: rgba(154, 149, 144, 0.15);
  color: var(--color-text-muted, #9a9590);
}

.status-badge.completed {
  background: rgba(46, 204, 113, 0.15);
  color: #27ae60;
}

.order-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: none;
  box-sizing: border-box;
  white-space: nowrap;
}
.order-status-icon.draft {
  color: #d12c2c;
  border: 2px solid currentColor;
  border-radius: 2px;
  padding: 0.16rem 0.28rem;
  transform: rotate(-8deg);
}
.order-status-icon.draft .order-status-stamp-text {
  font: 900 0.63rem/1 Georgia, serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.order-status-icon.completed {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  color: #087d36;
  border: 0.2rem solid currentColor;
  border-radius: 50%;
  transform: rotate(-12deg);
}
.order-status-icon.completed::before {
  content: '';
  position: absolute;
  inset: 0.14rem;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.order-status-icon.completed .order-status-stamp-text {
  position: relative;
  z-index: 1;
  padding: 0.12rem 0.08rem;
  border: 1px solid currentColor;
  background: #fff;
  font: 900 0.39rem/1 Arial, sans-serif;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.status-badge.submitted {
  background: rgba(201, 169, 110, 0.15);
  color: var(--color-gold-dark, #a8894e);
}

.orders-table .action-links a {
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-gold, #c9a96e);
  margin-right: 1rem;
  text-decoration: none;
}

.orders-table .action-links a:hover {
  color: var(--color-gold-dark, #a8894e);
}

.orders-table .action-links a.delete-link {
  color: #e74c3c;
}

.orders-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-muted, #9a9590);
}

/* --- Preview Page --- */
.preview-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.preview-form-card {
  background: white;
  border: 2px solid var(--color-dark, #0a0a0a);
  padding: 2rem;
}

.preview-form-header {
  text-align: center;
  border-bottom: 2px solid var(--color-dark, #0a0a0a);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.preview-form-header h1 {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.preview-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.preview-two-col {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.preview-two-col-left,
.preview-two-col-right {
  flex: 1;
  min-width: 0;
}

/* Inside the 2-col panels, stack items vertically (1 column) so each label+value has full column width */
.preview-two-col .preview-info-grid {
  grid-template-columns: 1fr;
}

.preview-section-label {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-muted, #9a9590);
  display: block;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(201,169,110,0.15);
}

.preview-info-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.preview-info-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-muted, #9a9590);
  width: 130px;
  flex-shrink: 0;
}

.preview-info-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-dark, #2a2a2a);
  word-break: break-word;
}

.preview-measurements {
  border: 1px solid var(--color-dark, #0a0a0a);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.preview-measurements table {
  min-width: 100%;
  border-collapse: collapse;
}

.preview-measurements th,
.preview-measurements td {
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  text-align: center;
  white-space: nowrap;
}

.preview-measurements th {
  background: var(--color-dark, #0a0a0a);
  color: var(--color-cream, #faf8f5);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.preview-measurements td {
  font-weight: 600;
  font-size: 1rem;
}

.preview-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* --- Workslip Page (Static Blank Form - baju_pendek.pdf table layout) --- */
.workslip-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Main form table */
.ws-table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid #000;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: #000;
  background: #fff;
  table-layout: fixed;
}

.ws-table td {
  border: 1px solid #000;
  padding: 5px 8px;
  vertical-align: middle;
  height: 26px;
}

/* Cell types */
.ws-center { text-align: center; }
.ws-bold { font-weight: 700; }
.ws-big { font-size: 18px; letter-spacing: 6px; }
.ws-small { font-size: 10px; letter-spacing: 1px; }
.ws-blank { height: 10px; border: none !important; padding: 0; }

.ws-label-cell {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  width: 140px;
  background: #fafafa;
}

.ws-blank-cell {
  background: #fff;
}

.ws-dots-cell {
  background: #fff;
}

.ws-cb-cell {
  text-align: center;
  font-size: 14px;
}

.ws-cb-row-cell {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
}

.ws-cb {
  font-size: 14px;
  vertical-align: middle;
  margin: 0 2px;
}

/* Collar/Design section inner table */
.ws-section-header {
  padding: 0 !important;
  border: 1px solid #000;
}

.ws-inner-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ws-inner-table td {
  border: 1px solid #000;
  padding: 4px 6px;
  height: 26px;
  vertical-align: middle;
}

.ws-inner-label {
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  width: 35%;
  background: #fafafa;
  white-space: nowrap;
}

.ws-inner-blank {
  background: #fff;
}

.ws-inner-center {
  text-align: center;
}

.ws-inner-cb {
  text-align: center;
  font-size: 10px;
  white-space: nowrap;
}

/* Measurement section */
.ws-meas-header {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  background: #e0e0e0;
  height: 24px;
}

.ws-meas-code {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  text-align: center;
  background: #f5f5f5;
  width: 80px;
}

.ws-meas-val {
  background: #fff;
  min-width: 100px;
}

.ws-meas-cb {
  background: #fff;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Actions bar */
.workslip-actions-bar {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Print styles */
@media print {
  .workslip-container {
    padding: 0;
    max-width: 100%;
  }
  .ws-table {
    border: 2px solid #000;
    font-size: 10px;
  }
}

/* --- Order & Pax Bar --- */
.order-pax-bar {
  background: var(--color-dark, #0a0a0a);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(201, 169, 110, 0.2);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.order-pax-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.order-pax-order {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--color-gold, #c9a96e);
}

.order-pax-invoice {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--color-gold, #c9a96e);
}

.order-pax-invoice.draft {
  color: rgba(201, 169, 110, 0.6);
  font-style: italic;
}

.order-pax-remark {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  color: rgba(250, 248, 245, 0.5);
  font-style: italic;
  padding: 0.2rem 0.5rem;
  background: rgba(201, 169, 110, 0.1);
  border-radius: 3px;
  border-left: 2px solid rgba(201, 169, 110, 0.3);
}

.order-pax-sep {
  color: rgba(201, 169, 110, 0.3);
}

.order-pax-workslip {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.8rem;
  color: var(--color-cream, #faf8f5);
  letter-spacing: 1px;
}

.order-pax-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-pax-nav {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-cream, #faf8f5);
  background: rgba(201, 169, 110, 0.15);
  border: 1px solid rgba(201, 169, 110, 0.3);
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-pax-nav:hover:not(:disabled) {
  background: rgba(201, 169, 110, 0.3);
  border-color: var(--color-gold, #c9a96e);
}

.btn-pax-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pax-progress {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  color: var(--color-text-muted, #9a9590);
  letter-spacing: 1px;
}

/* --- Order Info Display (Read-Only) --- */
.order-info-display {
  background: rgba(201, 169, 110, 0.06);
  border-bottom: 1px solid rgba(201, 169, 110, 0.15);
  padding: 1rem 2rem;
}

.order-info-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.order-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.oi-label {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-muted, #9a9590);
}

.oi-value {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-dark, #2a2a2a);
}

.oi-pax-input {
  width: 4.5rem;
  min-height: 1.6rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid rgba(201, 169, 110, 0.55);
  border-radius: 3px;
  background: #fff;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.85rem;
  color: var(--color-text-dark, #2a2a2a);
}

/* --- New Order Page --- */
.order-number-type { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.order-number-type legend { color: #80662f; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .6rem; }
.order-number-type-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.order-number-type-option { display: flex; align-items: center; gap: .7rem; padding: .75rem .85rem; background: #fff; border: 1px solid rgba(201,169,110,.4); border-radius: 5px; cursor: pointer; }
.order-number-type-option:has(input:checked) { border-color: #ad853e; background: #fbf6eb; box-shadow: inset 0 0 0 1px #ad853e; }
.order-number-type-option input { accent-color: #a77d35; margin: 0; }
.order-number-type-option span { display: flex; flex-direction: column; gap: .2rem; }
.order-number-type-option strong { color: #302c25; font-size: .85rem; }
.order-number-type-option small { color: #847b70; font-size: .73rem; }
.order-number-type:disabled .order-number-type-option { opacity: .5; cursor: not-allowed; }
@media (max-width: 600px) { .order-number-type-options { grid-template-columns: 1fr; } }
.new-order-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.new-order-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted, #9a9590);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.form-subsection-title {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-dark, #2a2a2a);
  margin-bottom: 0.4rem;
}

.new-order-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted, #9a9590);
  margin-bottom: 1rem;
  font-style: italic;
}

/* --- Main category vs Sub-category differentiation --- */
.main-category {
  background: #faf9f7;
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: 8px;
  padding: 1.5rem 1.75rem 1.75rem;
  margin-bottom: 0;
}

.main-category > .form-section-title {
  font-size: 1.4rem;
  color: var(--color-text-dark, #2a2a2a);
}

.main-category > .form-section-line {
  width: 60px;
  height: 3px;
}

.sub-categories {
  margin-top: 1.5rem;
  margin-left: 0.75rem;
  padding-left: 1.25rem;
  border-left: 3px solid rgba(201, 169, 110, 0.25);
}

.sub-category {
  margin-bottom: 1.75rem;
  padding-bottom: 0;
}

.sub-category:last-child {
  margin-bottom: 0;
}

.sub-category > .form-subsection-title {
  font-size: 1rem;
  color: #4a4540;
  letter-spacing: 0.3px;
}

.sub-line {
  width: 35px;
  height: 2px;
  background: var(--color-gold, #c9a96e);
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.fabric-reference-group {
  border: 1px solid rgba(201, 169, 110, 0.3);
  background: #fff;
  margin-top: 0.75rem;
}

.fabric-reference-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: #f5f1e9;
  color: #4a4030;
  cursor: pointer;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  list-style: none;
}

.fabric-reference-group > summary::-webkit-details-marker { display: none; }
.fabric-reference-group > summary:focus-visible { outline: 2px solid var(--color-gold, #c9a96e); outline-offset: -2px; }
.fabric-reference-toggle::after { content: 'Expand +'; font-size: 0.67rem; letter-spacing: 0.5px; }
.fabric-reference-group[open] .fabric-reference-toggle::after { content: 'Collapse −'; }
.fabric-reference-group > .fabric-reference-grid { padding: 1rem; }

.fabric-reference-grid .form-field input + input { margin-top: 0.75rem; }
.fabric-reference-grid .form-field input { box-sizing: border-box; width: 100%; min-width: 0; }

.completion-modal:has(.completion-fabric-reference),
.fabric-editor-modal { max-width: 960px; }

.completion-fabric-reference { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(201, 169, 110, 0.25); }
.completion-fabric-reference h3 { margin: 0 0 0.4rem; font-family: var(--font-heading, 'Playfair Display', Georgia, serif); font-size: 1.1rem; }
.completion-fabric-reference p { margin-bottom: 0.75rem; }
.fabric-editor-message { min-height: 1.2rem; margin: 0.75rem 0 0 !important; color: #8b3434 !important; }

@media (max-width: 700px) {
  .completion-modal-overlay { padding: 0.65rem; }
  .completion-fabric-reference .fabric-reference-grid,
  .fabric-editor-modal .fabric-reference-grid { grid-template-columns: 1fr; }
}

.new-order-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(201, 169, 110, 0.15);
}

/* ---- Staff management ---- */
.staff-page-container {
  width: min(760px, calc(100% - 2rem));
  margin: 3rem auto;
}

.staff-page-header {
  margin-bottom: 1.5rem;
}

.staff-page-header h2 {
  margin: 0 0 0.35rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.8rem;
}

.staff-page-header p {
  margin: 0;
  color: #b18a3e;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.staff-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 1.75rem;
  border: 1px solid #e7dcc5;
  background: #fff;
}

.staff-form-message,
.staff-id-display,
.staff-form-actions {
  grid-column: 1 / -1;
}

.password-form {
  grid-template-columns: 1fr;
}

.password-form .form-field {
  grid-column: 1 / -1;
}

/* ---- Quantity statistics ---- */
.statistics-container {
  width: min(1120px, calc(100% - 2rem));
  margin: 2.75rem auto;
}

.statistics-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.statistics-heading h2 {
  margin: 0 0 0.35rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.8rem;
}

.statistics-heading p {
  margin: 0;
  color: #8f8981;
  font-size: 0.78rem;
}

.statistics-view-switch {
  display: inline-flex;
  border: 1px solid #d9c9a8;
}

.statistics-view-switch button {
  padding: 0.65rem 1rem;
  border: 0;
  border-right: 1px solid #d9c9a8;
  background: #fff;
  color: #665f56;
  cursor: pointer;
}

.statistics-view-switch button:last-child { border-right: 0; }
.statistics-view-switch button.active { background: #c9a96e; color: #111; }

.statistics-period-nav {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  margin-bottom: 1.5rem;
  border: 1px solid #eadfc9;
  background: #fff;
  text-align: center;
}

.statistics-period-nav button {
  height: 42px;
  border: 0;
  background: #faf6ed;
  color: #9b7226;
  cursor: pointer;
}

.statistics-period-nav strong { font-size: 0.9rem; font-weight: 500; }
.statistics-message { padding: 3rem; color: #8f8981; text-align: center; }

.statistics-branch-switch {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: -0.5rem 0 1.5rem;
}

.statistics-branch-switch[hidden] { display: none; }

.statistics-branch-switch button {
  padding: 0.55rem 0.9rem;
  border: 1px solid #d9c9a8;
  background: #fff;
  color: #665f56;
  font: 600 0.68rem var(--font-body, 'Montserrat', sans-serif);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.statistics-branch-switch button.active {
  background: #c9a96e;
  color: #111;
}

.statistics-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.statistics-card {
  display: grid;
  gap: 0.3rem;
  padding: 1.25rem;
  border: 1px solid #e7dcc5;
  border-top: 4px solid currentColor;
  background: #fff;
}

.statistics-card span,
.statistics-card small {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.statistics-card strong { color: #221f1b; font-size: 2rem; }
.statistics-card small { color: #9a9590; }
.statistics-sh1 { color: #6277b5; }
.statistics-sh2 { color: #7856a8; }
.statistics-sh3 { color: #b46b83; }
.statistics-tr { color: #b27b31; }

.statistics-chart {
  margin-top: 1.25rem;
  padding: 1.25rem 1.5rem 1.5rem;
  border: 1px solid #e7dcc5;
  background: #fff;
}

.statistics-graph-legend {
  display: flex;
  justify-content: flex-end;
  gap: 1.1rem;
  margin-bottom: 0.75rem;
  color: #625d56;
  font-size: 0.68rem;
}

.statistics-graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.statistics-graph-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.statistics-line-graph,
.statistics-bar-graph {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
  overflow: hidden;
}

.statistics-graph-frame {
  overflow-x: auto;
  border: 1px solid #eee6d8;
  background: linear-gradient(180deg, #fff 0%, #fffdf9 100%);
}

.graph-grid {
  stroke: #eee8dd;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.graph-axis,
.graph-tick {
  stroke: #b9afa1;
  stroke-width: 1;
}

.graph-axis-label {
  fill: #8f8981;
  font-family: Arial, sans-serif;
  font-size: 11px;
}

.graph-axis-title {
  fill: #6f685f;
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.graph-line {
  fill: none;
  stroke-width: 3.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.graph-point {
  stroke: #fff;
  stroke-width: 2;
}

.graph-point-zero {
  opacity: 0.35;
}

.graph-bar {
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.graph-bar:hover {
  opacity: 1;
}

.statistics-bar-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.statistics-bar-track { height: 14px; overflow: hidden; background: #f0ece5; }
.statistics-bar { min-width: 0; height: 100%; background: currentColor; transition: width 0.25s ease; }
.statistics-bar-row strong { text-align: right; }

.statistics-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: #151515;
  color: #eee8de;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.statistics-total strong { color: #c9a96e; font-size: 1.35rem; }

@media (max-width: 700px) {
  .statistics-heading { align-items: stretch; flex-direction: column; }
  .statistics-view-switch { width: 100%; }
  .statistics-view-switch button { flex: 1; }
  .statistics-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.staff-form-message {
  display: none;
  padding: 0.75rem 0.9rem;
  font-size: 0.8rem;
}

.staff-form-message.error,
.staff-form-message.success {
  display: block;
}

.staff-form-message.error {
  color: #9f2424;
  background: #fff0f0;
  border: 1px solid #e6b3b3;
}

.staff-form-message.success {
  color: #176b3a;
  background: #effaf3;
  border: 1px solid #afd8bd;
}

.staff-id-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border: 1px solid #d6c49d;
  background: #faf6eb;
}

.staff-id-display span {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.staff-id-display strong {
  color: #9b7226;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
}

.staff-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ---- Settings ---- */
.settings-page-container {
  width: min(920px, calc(100% - 2rem));
  margin: 3rem auto;
}

.settings-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.settings-eyebrow {
  display: block;
  margin-bottom: 0.35rem;
  color: #a6813d;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.settings-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  border: 1px solid #e7dcc5;
  background: #f3eee5;
}

.settings-tab {
  min-width: 170px;
  padding: 0.75rem 1.1rem;
  border: 0;
  background: transparent;
  color: #746d63;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.settings-tab.is-active {
  background: #171714;
  color: #d6b46f;
}

.settings-panel[hidden] {
  display: none;
}

.settings-save-row [hidden] { display: none; }

.settings-target-row {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid #b38b43;
  border-left: 4px solid #b38b43;
  background: #f8f3e9;
}

.settings-target-row label {
  color: #28231d;
  font-size: 0.9rem;
  font-weight: 700;
}

.settings-target-row select {
  width: min(100%, 520px);
  min-height: 46px;
  padding: 0.65rem 0.8rem;
  border: 1px solid #a6813d;
  border-radius: 3px;
  background: #fff;
  color: #28231d;
  font: 600 0.78rem var(--font-body, 'Montserrat', sans-serif);
  cursor: pointer;
}
.settings-target-row span,
.settings-target-row small { color: #8a837a; font-size: 0.7rem; }

.settings-tab[hidden],
.settings-division[hidden],
#staff-panel-create[hidden],
#staff-panel-options[hidden] {
  display: none;
}

.settings-subtabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #dfd2ba;
}

.settings-subtab {
  padding: 0.7rem 1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #777067;
  font: 600 0.7rem var(--font-body, 'Montserrat', sans-serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.settings-subtab.is-active {
  border-bottom-color: #b38b43;
  color: #29251f;
}

.settings-staff-options {
  padding: 1.2rem;
}

.staff-selection-panel {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.4rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid #b38b43;
  border-left: 4px solid #b38b43;
  background: #f8f3e9;
}

.staff-selection-step {
  color: #96723a;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.staff-selection-panel > label {
  color: #28231d;
  font-size: 0.9rem;
  font-weight: 700;
}

.staff-selection-panel > select {
  width: min(100%, 520px);
  min-height: 46px;
  padding: 0.65rem 0.8rem;
  border: 1px solid #a6813d;
  border-radius: 3px;
  background: #fff;
  color: #28231d;
  font: 600 0.78rem var(--font-body, 'Montserrat', sans-serif);
  cursor: pointer;
}

.staff-selection-panel > select:focus-visible {
  outline: 2px solid #a6813d;
  outline-offset: 2px;
}

.staff-selection-hint {
  color: #83786a;
  font-size: 0.7rem;
}

.staff-selection-panel.is-selected {
  border-color: #8e713f;
  background: #f5efe3;
}

.settings-staff-options .form-field {
  max-width: 320px;
}

.settings-staff-options p {
  margin: 0.75rem 0 0;
  color: #8a837a;
  font-size: 0.7rem;
}

.settings-password-form {
  max-width: 650px;
}

.settings-division-list {
  display: grid;
  gap: 1rem;
}

.settings-division {
  border: 1px solid #e7dcc5;
  background: #fff;
}

.settings-division-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #eee5d5;
  background: #faf8f5;
}

.settings-division-heading > div {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.settings-division-index {
  color: #b38b43;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.settings-division h3 {
  margin: 0;
  color: #2a2824;
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.05rem;
}

.settings-division-heading p {
  margin: 0;
  color: #8a837a;
  font-size: 0.7rem;
}

.settings-empty-state {
  padding: 1rem 1.2rem;
  color: #a29b92;
  font-size: 0.74rem;
  font-style: italic;
}

.settings-option-list {
  padding: 0 1.2rem;
}

.settings-content-group {
  padding-top: 1rem;
}

.settings-content-group h4 {
  margin: 0 1.2rem 0.35rem;
  color: #2a2824;
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1rem;
}

.settings-content-subheading {
  margin: 0 1.2rem;
  color: #9a753c;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
  border-bottom: 1px solid #eee8de;
}

.settings-option-row:last-child {
  border-bottom: 0;
}

.settings-option-copy {
  display: grid;
  gap: 0.28rem;
}

.settings-option-copy strong {
  color: #2f2c27;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.settings-option-copy span {
  color: #8a837a;
  font-size: 0.7rem;
}

.settings-switch {
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
}

.settings-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.settings-switch-track {
  position: relative;
  display: block;
  width: 42px;
  height: 22px;
  border: 1px solid #c9bfae;
  border-radius: 999px;
  background: #e6e0d7;
  transition: 0.2s ease;
}

.settings-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: 0.2s ease;
}

.settings-switch input:checked + .settings-switch-track {
  border-color: #a6813d;
  background: #c9a96e;
}

.settings-switch input:checked + .settings-switch-track::after {
  transform: translateX(20px);
}

.settings-switch input:focus-visible + .settings-switch-track {
  outline: 2px solid #a6813d;
  outline-offset: 2px;
}

.settings-save-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-top: 1px solid #eee5d5;
  background: #faf8f5;
}

.settings-save-message {
  color: #176b3a;
  font-size: 0.72rem;
}

.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;
}

@media (max-width: 650px) {
  .settings-page-container { margin: 1.5rem auto; }
  .settings-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .settings-tab { min-width: 0; padding-inline: 0.5rem; }
  .settings-division-heading { align-items: flex-start; flex-direction: column; }
  .settings-option-row { min-height: 86px; }
}

@media (max-width: 600px) {
  .staff-page-container { margin: 1.5rem auto; }
  .staff-form { grid-template-columns: 1fr; padding: 1.2rem; }
}

.custom-style-group {
  overflow: hidden;
  border: 1px solid var(--color-gold, #c9a96e);
  border-radius: 6px;
  background: rgba(201, 169, 110, 0.04);
  box-shadow: 0 2px 8px rgba(80, 58, 20, 0.08);
}

#common-options .custom-style-group[open] {
  overflow: visible;
}

#shirt-pleats-field[hidden] { display: none; }

.shirt-pleats-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
}

.shirt-pleats-label label { margin-bottom: 0; }

#shirt-pleats-preview {
  width: 330px;
  min-height: 0;
  left: auto;
  right: calc(100% + 12px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.8rem;
}

#shirt-pleats-preview::before {
  left: auto;
  right: -10px;
  transform: rotate(225deg);
}

.shirt-pleats-preview-item {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  color: #242424;
  font-size: 0.68rem;
  font-weight: 700;
}

.shirt-pleats-preview-item svg {
  width: 82px;
  height: 82px;
}

.shirt-pleats-preview-item path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.shirt-pleats-preview-item .shirt-pleat-mark {
  stroke: #e45b66;
}

@media (max-width: 700px) {
  #shirt-pleats-preview {
    top: 28px;
    left: -112px;
    right: auto;
    width: min(300px, calc(100vw - 3rem));
  }
}

.custom-style-summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  padding: 1rem 3.25rem 1rem 1.25rem;
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text-dark, #2a2a2a);
  background: linear-gradient(90deg, rgba(201, 169, 110, 0.22), rgba(201, 169, 110, 0.07));
  transition: background 0.2s ease, color 0.2s ease;
  user-select: none;
}

.custom-style-summary::-webkit-details-marker {
  display: none;
}

.custom-style-summary::after {
  content: '<';
  position: absolute;
  right: 1.1rem;
  top: 50%;
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  border: 1px solid var(--color-gold, #c9a96e);
  border-radius: 50%;
  color: #725a2d;
  background: #fff;
  font-family: Arial, sans-serif;
  font-size: 1.15rem;
  line-height: 1;
  transform: translateY(-50%);
}

.custom-style-summary:hover {
  background: linear-gradient(90deg, rgba(201, 169, 110, 0.32), rgba(201, 169, 110, 0.12));
}

.custom-style-summary:focus-visible {
  outline: 2px solid var(--color-gold, #c9a96e);
  outline-offset: -3px;
}

.custom-style-hint {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #806b43;
}

.custom-style-group[open] > .custom-style-summary::after {
  content: 'v';
}

.custom-style-group[open] > .custom-style-summary {
  color: #6c5427;
  border-bottom: 1px solid rgba(201, 169, 110, 0.55);
}

.custom-style-group[open] .custom-style-hint {
  font-size: 0;
}

.custom-style-group[open] .custom-style-hint::after {
  content: 'Click to collapse';
  font-size: 0.68rem;
}

.custom-style-group > #custom-style-fields {
  padding: 0 1.25rem 1.25rem;
}

.uniform-set-warning {
  margin-top: 0.35rem;
  color: #c62828;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
}

.new-order-actions .btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  line-height: 1;
}

/* --- Order Group Cards (Orders List) --- */
.order-group-card {
  background: white;
  border: 1px solid rgba(201, 169, 110, 0.15);
  margin-bottom: 1.25rem;
  transition: border-color 0.3s;
}

.order-group-card:hover {
  border-color: rgba(201, 169, 110, 0.35);
}

.order-group-card[open] {
  box-shadow: 0 5px 18px rgba(35, 28, 18, 0.08);
}

.order-group-header {
  position: relative;
  display: grid;
  grid-template-columns: 1.45rem minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.1);
  flex-wrap: wrap;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  background: #fff;
}

.order-group-header::-webkit-details-marker {
  display: none;
}

.order-group-header::before {
  content: '>';
  display: grid;
  flex: 0 0 1.45rem;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border: 1px solid var(--color-gold, #c9a96e);
  border-radius: 50%;
  color: #725a2d;
  font: 700 1rem/1 Arial, sans-serif;
}

.order-group-card[open] > .order-group-header::before {
  content: 'v';
}

.order-group-card[open] > .order-group-header {
  background: rgba(201, 169, 110, 0.06);
}

.order-group-main {
  display: flex;
  min-width: 0;
  text-align: left;
  align-items: flex-start;
  overflow-wrap: anywhere;
  flex-direction: column;
  gap: 0.25rem;
}
.order-group-invoice-line { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.order-group-branch {
  display: inline-flex;
  align-items: center;
  padding: .16rem .45rem;
  border: 1px solid #ddc897;
  border-radius: 3px;
  background: #f7edd7;
  color: #715220;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.order-group-no {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-dark, #2a2a2a);
  letter-spacing: 0.5px;
}

.order-group-company {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  color: var(--color-text-muted, #9a9590);
  letter-spacing: 0.5px;
}

.order-group-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.order-group-hold-icon {
  color: #7b6a4b;
  font-size: 0.9rem;
  line-height: 1;
}

.order-group-item,
.order-group-pax,
.order-group-qty,
.order-group-date {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  color: var(--color-text-dark, #2a2a2a);
  letter-spacing: 0.5px;
}

.order-group-workslips {
  padding: 0;
}

.order-group-workslips.workslips-scrollable {
  max-height: 270px;
  overflow-y: auto;
  scrollbar-color: var(--color-gold, #c9a96e) #eee9df;
  scrollbar-width: thin;
}

.workslip-row {
  display: grid;
  grid-template-columns: 55px 120px 270px max-content minmax(0, 1fr);
  align-items: center;
  padding: 0.65rem 1.25rem;
  gap: 1rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.06);
  transition: background 0.2s;
}

.workslip-row[hidden] {
  display: none !important;
}

.workslip-row:last-child {
  border-bottom: none;
}

.workslip-row:hover {
  background: rgba(201, 169, 110, 0.03);
}

.workslip-row.workslip-on-hold {
  background: #e8e5df;
  color: #77716a;
}

.workslip-row.workslip-on-hold:hover {
  background: #e1ddd5;
}

.workslip-row.workslip-on-hold > .workslip-no,
.workslip-row.workslip-on-hold > .workslip-name,
.workslip-row.workslip-on-hold > .workslip-items,
.workslip-row.workslip-on-hold > .workslip-detail,
.workslip-row.workslip-on-hold > .status-badge,
.workslip-row.workslip-on-hold > .order-status-icon,
.workslip-row.workslip-on-hold > .workslip-actions > a,
.workslip-row.workslip-on-hold > .workslip-actions > .workslip-hold-icon {
  filter: grayscale(0.45);
  opacity: 0.68;
}

.workslip-no {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-gold, #c9a96e);
  min-width: 55px;
}

.workslip-name {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-dark, #2a2a2a);
  min-width: 120px;
}

.workslip-detail {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  color: var(--color-text-muted, #9a9590);
  min-width: 0;
}

.workslip-items {
  display: grid;
  grid-template-columns: repeat(4, 62px);
  gap: 0.4rem;
  min-width: 0;
}

.workslip-status {
  width: 82px;
  box-sizing: border-box;
  text-align: center;
  justify-self: start;
}

.item-badge {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: var(--color-gold, #c9a96e);
  color: #fff;
  white-space: nowrap;
}

.item-badge-sh1 { grid-column: 1; background: #5271a8; }
.item-badge-sh2 { grid-column: 2; background: #7a5ba7; }
.item-badge-sh3 { grid-column: 3; background: #bf6b86; }
.item-badge-tr { grid-column: 4; background: #b77a32; }

.order-date-chip {
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.order-date-chip.submitted-date {
  color: #17613a;
  background: #dff4e7;
  border: 1px solid #9bd5b1;
}

.order-date-chip.delivery-date {
  color: #8b2424;
  background: #fde3e3;
  border: 1px solid #efaaaa;
}

.orders-filters {
  flex-wrap: wrap;
}

.orders-color-legend,
.orders-colour-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 0.64rem;
  color: #625e58;
}

.orders-colour-info > span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.colour-info-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legend-dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
}

.legend-dot.submitted-date { background: #70be8d; }
.legend-dot.delivery-date { background: #e98282; }
.legend-dot.sh1 { background: #5271a8; }
.legend-dot.sh2 { background: #7a5ba7; }
.legend-dot.sh3 { background: #bf6b86; }
.legend-dot.tr { background: #b77a32; }

.today-orders-title {
  margin: 1.5rem 0 0.8rem;
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.25rem;
  color: #2a2a2a;
}

.orders-list-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.orders-date-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.orders-date-filter {
  height: 34px;
  padding: 0 0.65rem;
  border: 1px solid rgba(201, 169, 110, 0.55);
  border-radius: 3px;
  background: #fffdf9;
  color: #403a33;
  font: 600 0.7rem var(--font-body, 'Montserrat', sans-serif);
  cursor: pointer;
}

.today-orders-link {
  margin-top: 0.7rem;
  border: 0;
  border-bottom: 1px solid #a98545;
  background: transparent;
  color: #765b2b;
  padding: 0.25rem 0;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.today-orders-link:hover {
  color: #2a2a2a;
  border-bottom-color: #2a2a2a;
}

.order-folder-tree {
  margin-bottom: 1.5rem;
  max-height: 310px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(201, 169, 110, 0.38);
  border-radius: 5px;
  background: #fffdf9;
  scrollbar-color: #c9a96e #f3eee5;
  scrollbar-width: thin;
}

.order-year-folder {
  border-top: 1px solid rgba(201, 169, 110, 0.22);
}

.folder-current-path {
  position: sticky;
  top: -0.65rem;
  z-index: 2;
  margin: -0.65rem -0.9rem 0.3rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.32);
  background: #f8f0df;
  color: #66502a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.order-year-folder > summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  list-style: none;
  color: #59451f;
}

.order-year-folder > summary::-webkit-details-marker { display: none; }
.order-year-folder > summary span:last-child { color: #918878; font-size: 0.68rem; }
.folder-icon::before { content: '>'; }
.order-year-folder[open] .folder-icon::before { content: 'v'; }
.year-folder-icon { font-size: 1rem; }

.order-company-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
  padding: 0.2rem 0 0.9rem 1.35rem;
}

.company-folder {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid rgba(201, 169, 110, 0.38);
  border-radius: 5px;
  background: #fff;
  color: #36322d;
  padding: 0.7rem 0.8rem;
  text-align: left;
  cursor: pointer;
}

.company-folder:hover {
  border-color: #c9a96e;
  background: rgba(201, 169, 110, 0.08);
}

.company-folder.selected {
  border-color: #a98545;
  background: rgba(201, 169, 110, 0.18);
  box-shadow: inset 3px 0 0 #c9a96e;
}

.company-folder-icon { color: #c9a96e; }
.company-folder small { color: #918878; font-size: 0.62rem; }

/* File Explorer-style folder navigation */
.folder-current-path {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.folder-path-link {
  border: 0;
  background: transparent;
  color: #66501f;
  font: inherit;
  padding: 0.15rem 0.25rem;
  cursor: pointer;
}

.folder-back-button {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #59451f;
  font: 700 1rem/1 Arial, sans-serif;
  cursor: pointer;
}

.folder-back-button:hover:not(:disabled) {
  border-color: rgba(201, 169, 110, 0.45);
  background: rgba(201, 169, 110, 0.14);
}

.folder-back-button:disabled {
  color: #b8b2a8;
  cursor: default;
}

.folder-path-link:hover {
  background: rgba(201, 169, 110, 0.16);
}

.explorer-folder-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  align-items: start;
  gap: 0.45rem;
  padding: 0.35rem 0;
}

.explorer-folder-row,
.company-folder.explorer-folder-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.2rem;
  width: 100%;
  min-height: 88px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #36322d;
  padding: 0.55rem 0.35rem 0.45rem;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  box-shadow: none;
}

.explorer-folder-row:hover,
.company-folder.explorer-folder-row:hover {
  border: 0;
  background: #eef5fc;
  outline: 1px solid #c7dcef;
}

.explorer-folder-row.selected,
.company-folder.explorer-folder-row.selected {
  border: 0;
  background: #dcecf9;
  outline: 1px solid #99c2e4;
  box-shadow: none;
}

.explorer-folder-icon {
  display: block;
  font-size: 2.15rem;
  line-height: 1;
}

.explorer-folder-row > span:nth-child(2) {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-folder-row small {
  color: #827d75;
  font-size: 0.58rem;
  white-space: nowrap;
}

.workslip-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-self: end;
}

.workslip-hold-icon {
  color: #7b6a4b;
  font-size: 0.9rem;
  line-height: 1;
}

.workslip-more {
  position: relative;
  margin-left: 0.1rem;
  z-index: 40;
}

.workslip-more-button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(201, 169, 110, 0.35);
  border-radius: 3px;
  background: transparent;
  color: #665f56;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.workslip-more-button:hover,
.workslip-more-button[aria-expanded="true"] {
  color: #0a0a0a;
  background: var(--color-gold, #c9a96e);
}

.workslip-row.workslip-on-hold .workslip-more-button {
  background: #fffdf9;
  color: #4d4438;
  border-color: #a68b59;
  opacity: 1;
}

.workslip-row.workslip-on-hold .workslip-more-button:hover,
.workslip-row.workslip-on-hold .workslip-more-button[aria-expanded="true"] {
  background: var(--color-gold, #c9a96e);
  color: #0a0a0a;
}

.workslip-more-menu {
  position: absolute;
  z-index: 100;
  top: calc(100% + 5px);
  right: 0;
  width: 170px;
  padding: 0.4rem;
  border: 1px solid rgba(201, 169, 110, 0.45);
  border-radius: 4px;
  background: #fffdf9;
  opacity: 1;
  filter: none;
  box-shadow: 0 10px 24px rgba(20, 17, 13, 0.16);
}

.workslip-more-menu[hidden] { display: none; }

.workslip-more-menu button,
.workslip-menu-label {
  display: block;
  width: 100%;
  padding: 0.48rem 0.6rem;
  border: 0;
  background: transparent;
  text-align: left;
  font: 600 0.67rem var(--font-body, 'Montserrat', sans-serif);
  letter-spacing: 0.5px;
  color: #36312c;
}

.workslip-menu-label {
  color: var(--color-gold-dark, #9d7c40);
  text-transform: uppercase;
}

.workslip-more-menu button:not(:disabled) { cursor: pointer; }
.workslip-more-menu button:not(:disabled):hover { background: rgba(201, 169, 110, 0.18); }
.workslip-more-menu button:disabled { color: #bbb5ad; }
.workslip-more-menu .workslip-delete-action { color: #b34f4f; }

.workslip-menu-separator {
  display: block;
  margin: 0.3rem 0;
  border-top: 1px solid rgba(201, 169, 110, 0.25);
}

.workslip-actions a {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-gold, #c9a96e);
  text-decoration: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  transition: all 0.2s;
}

.workslip-actions a:hover {
  color: var(--color-dark, #0a0a0a);
  background: var(--color-gold, #c9a96e);
  text-decoration: none;
}

.order-group-actions {
  padding: 0.65rem 1.25rem;
  border-top: 1px solid rgba(201, 169, 110, 0.1);
  display: flex;
  justify-content: flex-end;
}

.delete-group-link {
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #e74c3c;
  text-decoration: none;
}

.delete-group-link:hover {
  color: #c0392b;
}

/* --- Completion Modal --- */
.completion-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.completion-modal-overlay.visible {
  display: flex;
}

.completion-modal {
  background: white;
  border-radius: 4px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow: auto;
  border: 1px solid rgba(201, 169, 110, 0.3);
}

.completion-modal-header {
  background: var(--color-dark, #0a0a0a);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.2);
}

.completion-modal-header h2 {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-gold, #c9a96e);
  margin: 0;
  letter-spacing: 1px;
}

.completion-modal-body {
  padding: 1.5rem;
}

.completion-modal-body p {
  font-size: 0.9rem;
  color: var(--color-text-dark, #2a2a2a);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.completion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.completion-table th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-muted, #9a9590);
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid rgba(201, 169, 110, 0.2);
  background: var(--color-cream, #faf8f5);
}

.completion-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.1);
  color: var(--color-text-dark, #2a2a2a);
}

.completion-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(201, 169, 110, 0.15);
}

/* --- Item Tabs (Stilo Dark/Gold Theme) --- */
.item-tabs-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  background: var(--color-dark, #0a0a0a);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  border: 1px solid rgba(201, 169, 110, 0.2);
}

.item-tab-btn {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
  border: 1px solid rgba(201, 169, 110, 0.3);
  background: var(--color-dark-secondary, #141414);
  color: var(--color-text-muted, #9a9590);
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 3px;
}

.item-tab-btn:hover {
  border-color: var(--color-gold, #c9a96e);
  color: var(--color-gold, #c9a96e);
  background: rgba(201, 169, 110, 0.05);
}

.item-tab-btn.active {
  background: var(--color-gold, #c9a96e);
  color: var(--color-dark, #0a0a0a);
  border-color: var(--color-gold, #c9a96e);
  box-shadow: 0 2px 8px rgba(201, 169, 110, 0.3);
}

/* --- Multi-Value Measurement Fields (Add/Remove) --- */
.measurement-field-multi {
  background: white;
  border: 1px solid rgba(201, 169, 110, 0.15);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.measurement-field-multi .measurement-field-label {
  margin-bottom: 0.5rem;
}

.multi-subfields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.multi-subfield-wrapper {
  position: relative;
}

.multi-subfield-remark {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-gold, #c9a96e);
  pointer-events: none;
  z-index: 1;
}

.multi-subfield-wrapper .measurement-field-value {
  width: 100%;
  margin-bottom: 0;
  padding-left: 4rem;
  padding-right: 2rem;
}

.multi-subfield-wrapper .btn-remove-subfield {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--color-text-muted, #9a9590);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.3s;
  padding: 0;
  z-index: 1;
}

.multi-subfield-wrapper .btn-remove-subfield:hover {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}

.multi-shared-canvas {
  margin-top: 0.75rem;
}

.btn-remove-subfield {
  background: transparent;
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s;
  flex-shrink: 0;
}

.btn-remove-subfield:hover {
  background: rgba(231, 76, 60, 0.1);
  border-color: #e74c3c;
}

.btn-add-subfield {
  background: transparent;
  border: 1px dashed rgba(201, 169, 110, 0.4);
  color: var(--color-gold, #c9a96e);
  padding: 0.4rem 1rem;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-add-subfield:hover {
  background: rgba(201, 169, 110, 0.08);
  border-color: var(--color-gold, #c9a96e);
  border-style: solid;
}

.btn-add-subfield::before {
  content: '+';
  font-size: 1rem;
  font-weight: 700;
}

/* --- Print Styles --- */
@media print {
  .app-topbar,
  .tab-bar,
  .action-bar,
  .preview-actions,
  .workslip-actions-bar,
  .order-pax-bar,
  .completion-modal-overlay,
  .btn-add-subfield,
  .btn-remove-subfield,
  .no-print {
    display: none !important;
  }

  .preview-container,
  .workslip-container {
    padding: 0;
    max-width: none;
  }

  .preview-form-card,
  .ws-table {
    border: 1px solid #000;
    padding: 1rem;
  }

  body {
    background: white;
    color: black;
    font-size: 10pt;
  }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .form-grid-4col {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid-3col {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Full-width Design & Options stays 2 cols; panels already 1 col from default */
  .preview-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .preview-two-col .preview-info-grid {
    grid-template-columns: 1fr;
  }

  /* Tablet topbar — slightly tighter */
  .app-topbar {
    padding: 0.75rem 1.5rem;
  }

  .app-topbar-right {
    gap: 1rem;
  }

  .app-topbar-brand {
    font-size: 1.2rem;
  }

  /* Tablet action bar — slightly smaller buttons */
  .action-bar {
    padding: 0.75rem 1.5rem;
  }

  .action-bar .btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.75rem;
  }

  .preview-actions {
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .tab-bar {
    flex-wrap: wrap;
  }

  .tab-btn {
    flex: 1 0 50%;
    padding: 1.5rem 0.5rem 0.7rem;
    font-size: 0.7rem;
  }

  .tab-btn::before {
    font-size: 0.48rem;
    letter-spacing: 0;
    padding: 2px 3px;
  }

  .form-content {
    padding: 1rem;
  }

  .form-grid,
  .form-grid-2col,
  .form-grid-3col,
  .form-grid-4col {
    grid-template-columns: 1fr;
  }

  /* Mobile topbar — compact single row, no wrap */
  .app-topbar {
    flex-wrap: nowrap;
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }

  .app-topbar-brand {
    font-size: 1rem;
    letter-spacing: 2px;
    white-space: nowrap;
  }

  .app-topbar-right {
    gap: 0.5rem;
  }

  .app-topbar-user {
    display: none;
  }

  .app-topbar-link {
    font-size: 0.65rem;
    letter-spacing: 1px;
  }

  .app-topbar-logout {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
    letter-spacing: 1px;
  }

  .orders-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Mobile action bar — full-width stacked buttons */
  .action-bar {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    justify-content: stretch;
  }

  .action-bar .btn {
    flex: 1 1 100%;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    text-align: center;
  }

  /* Mobile preview actions — full-width stacked buttons */
  .preview-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .preview-actions .btn {
    width: 100%;
    text-align: center;
  }

  .preview-info-grid {
    grid-template-columns: 1fr;
  }

  .preview-two-col {
    flex-direction: column;
    gap: 1.5rem;
  }

  .hw-canvas-indicator {
    height: 50px;
  }

  .hw-modal {
    max-width: 100%;
    margin: 0 0.5rem;
  }

  .hw-modal-body {
    padding: 1rem;
  }

  #hw-draw-canvas {
    height: 200px;
  }

  .order-pax-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
  }

  .order-pax-info {
    justify-content: center;
  }

  .order-pax-nav {
    justify-content: center;
  }

  .order-info-display {
    padding: 1rem;
  }

  .order-info-grid {
    gap: 1rem;
  }

  .new-order-actions {
    flex-direction: column;
  }

  .completion-modal-actions {
    flex-direction: column;
  }

  .order-group-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .workslip-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .workslip-actions {
    margin-left: 0;
    justify-self: auto;
  }

  .visual-options {
    justify-content: center;
  }

  .visual-option-card {
    min-width: 100px;
    width: 100px;
    padding: 0.5rem 0.75rem;
  }

  .visual-option-icon svg {
    width: 52px;
    height: 66px;
  }
}

/* --- Item Count Overlay (non-interactive) --- */
.item-count-overlay {
  position: fixed;
  top: 120px;
  right: 20px;
  background: rgba(250, 248, 245, 0.15);
  border: 1px solid rgba(201, 169, 110, 0.25);
  border-radius: 8px;
  padding: 1rem;
  min-width: 160px;
  z-index: 9999;
  pointer-events: none;
}

.item-count-title {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-gold, #c9a96e);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 169, 110, 0.2);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 8px rgba(255, 255, 255, 0.8);
}

.item-count-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-count-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.item-code {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #2a2a2a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9), 0 0 6px rgba(255, 255, 255, 0.6);
}

.item-status {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-gold, #c9a96e);
  min-width: 20px;
  text-align: right;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 8px rgba(255, 255, 255, 0.9);
  background: rgba(201, 169, 110, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Inline Pant pocket-style selector and SVG preview. */
.pocket-style-field {
  position: relative;
  width: calc((100% - 1rem) / 2);
}

.option-group-pocket-style {
  grid-column: 1 / -1;
  order: -1;
  display: grid;
  grid-template-columns: minmax(210px, 0.75fr) minmax(420px, 2fr);
  align-items: center;
  gap: 1.5rem;
  padding: 1.2rem 1.5rem;
  border: 1px solid rgba(201, 169, 110, 0.5);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.66);
}

.pocket-style-field {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
}

.pocket-style-side-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.pocket-style-side-row > label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pocket-style-side-row > label span {
  color: var(--color-text-muted, #9a9590);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0;
}

.pocket-style-side-row > select {
  width: 100%;
}

.pocket-style-single-field {
  display: block;
}

.pocket-style-single-field > select {
  width: 100%;
}

.option-group-pocket-style .option-group-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.pocket-style-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.field-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 0.3rem;
  border: 1px solid var(--color-gold, #c9a96e);
  border-radius: 50%;
  color: #8c6d32;
  font-family: Georgia, serif;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.unit-code-label { display: flex; align-items: center; gap: .3rem; }
.unit-code-info { position: relative; }
.unit-code-info summary { list-style: none; margin: 0 0 .45rem; }
.unit-code-info summary::-webkit-details-marker { display: none; }
.unit-code-info-note {
  position: absolute;
  z-index: 40;
  top: 1.5rem;
  left: 0;
  display: block;
  width: min(280px, calc(100vw - 3rem));
  padding: .7rem .85rem;
  border: 1px solid rgba(201,169,110,.7);
  border-radius: 5px;
  background: #fffdf8;
  box-shadow: 0 5px 18px rgba(0,0,0,.14);
  color: #302c25;
  font-size: .78rem;
  line-height: 1.45;
}

/* Report-only overlay; does not change table dimensions or diagram flow. */
.inDesign .report-hold-stamp,
.tr-sample-cell .report-hold-stamp {
  position: absolute;
  z-index: 10;
  left: 0;
  bottom: 0;
  width: 30%;
  aspect-ratio: 1295 / 1215;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  pointer-events: none;
}
.inDesign .report-hold-stamp .report-hold-stamp-image,
.tr-sample-cell .report-hold-stamp .report-hold-stamp-image {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
  border: 0 !important;
}
.workslip-table .report-hold-stamp-reason,
.tr-table .report-hold-stamp-reason {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 68%;
  color: #111 !important;
  font: 800 clamp(7px, .65vw, 9px)/1 Arial, sans-serif !important;
  text-align: center;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.tr-sample-cell { position: relative; }

.pocket-style-control-row {
  display: block;
}

.pocket-style-preview {
  position: absolute;
  z-index: 40;
  top: -30px;
  left: calc(100% + 12px);
  width: 270px;
  min-height: 220px;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.9rem;
  border: 1px solid #292929;
  border-radius: 26px;
  background: #fffdf9;
  box-shadow: 0 12px 28px rgba(20, 17, 13, 0.16);
  color: #151515;
  pointer-events: auto;
}

.pocket-style-preview[hidden] { display: none !important; }
.pocket-style-preview.is-viewport-positioned { position: fixed; z-index: 1000; max-height: calc(100dvh - 24px); overflow-y: auto; }
.pocket-style-preview.is-viewport-positioned::before { display: none; }

.side-pocket-style-preview {
  min-height: 145px;
}

.pleats-style-preview {
  width: 205px;
  min-height: 280px;
  padding: 0.7rem 0.8rem;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.pleats-preview-item {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
}

.pleats-preview-item svg {
  width: 118px;
  height: 100px;
}

.pleats-preview-item path {
  fill: none;
  stroke: #242424;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.pleats-preview-item > span {
  color: #242424;
  font-size: 0.68rem;
  font-weight: 700;
}

.pleats-preview-item strong {
  color: #a6813d;
  font-size: 0.9rem;
}

.side-pocket-style-preview .pocket-style-preview-item {
  min-height: 92px;
}

.side-pocket-reference svg {
  height: 76px;
}

.side-pocket-reference .side-pocket-opening,
.side-pocket-reference .side-pocket-stitch {
  stroke-width: 2;
}

.pocket-style-preview::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 29px;
  width: 18px;
  height: 18px;
  border-left: 1px solid #292929;
  border-bottom: 1px solid #292929;
  background: #fffdf9;
  transform: rotate(45deg);
}

.pocket-style-preview-item {
  position: relative;
  min-height: 78px;
  padding-top: 1rem;
}

.pocket-style-preview-item > span {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
}

.pocket-style-preview-item svg {
  display: block;
  width: 100%;
  height: 58px;
  overflow: visible;
}

.pocket-style-preview-item path,
.pocket-style-preview-item rect,
.pocket-style-preview-item circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

@media (max-width: 600px) {
  .pocket-style-field { grid-column: 1 / -1; width: 100%; }
  .pocket-style-control-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .pocket-style-preview {
    top: 28px;
    left: -112px;
    width: min(270px, calc(100vw - 3rem));
    min-height: 210px;
  }
  .pocket-style-preview::before { top: -10px; left: 116px; transform: rotate(135deg); }
}

@media (max-width: 800px) {
  .option-group-pocket-style {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    padding: 1rem;
  }
}

.add-pax-link {
  color: #4d4438;
}

.workslip-group-filter {
  max-width: 150px;
  height: 28px;
  padding: 0 1.6rem 0 0.45rem;
  border: 1px solid rgba(201, 169, 110, 0.45);
  border-radius: 3px;
  background: #fffdf9;
  color: #4d4438;
  font: 600 0.62rem var(--font-body, 'Montserrat', sans-serif);
  cursor: pointer;
}

.order-group-more {
  position: relative;
  z-index: 50;
}

.order-group-more-button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(201, 169, 110, 0.5);
  border-radius: 3px;
  background: #fffdf9;
  color: #4d4438;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.order-group-more-button:hover,
.order-group-more-button[aria-expanded="true"] {
  background: var(--color-gold, #c9a96e);
  color: #0a0a0a;
}

.order-group-more-menu {
  position: absolute;
  z-index: 110;
  top: calc(100% + 5px);
  right: 0;
  width: 190px;
  padding: 0.4rem;
  border: 1px solid rgba(201, 169, 110, 0.45);
  border-radius: 4px;
  background: #fffdf9;
  box-shadow: 0 10px 24px rgba(20, 17, 13, 0.16);
}

.order-group-more-menu[hidden] { display: none; }

.order-group-more-menu button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  background: transparent;
  text-align: left;
  font: 600 0.67rem var(--font-body, 'Montserrat', sans-serif);
  letter-spacing: 0.5px;
  cursor: pointer;
}

.order-group-more-menu button:hover:not(:disabled) { background: rgba(201, 169, 110, 0.18); }
.order-group-more-menu .delete-group-link { color: #b34f4f; }
.order-group-more-menu button:disabled { color: #bbb5ad; cursor: default; }

/* Use separate rows before status/actions run out of room, including tablets. */
@media (max-width: 1100px) {
  .orders-container {
    padding-inline: 0.75rem;
  }

  .workslip-row {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas: "number name" "items items" "status actions";
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
  }

  .workslip-no,
  .workslip-name,
  .workslip-detail,
  .workslip-items,
  .workslip-status,
  .workslip-actions {
    min-width: 0;
  }

  .workslip-items {
    grid-area: items;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .workslip-status {
    grid-area: status;
    width: auto;
    max-width: 100%;
  }

  .workslip-actions {
    grid-area: actions;
    margin-left: 0;
    justify-self: end;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
  }

  .workslip-actions a {
    padding-inline: 0.3rem;
  }
  .workslip-no { grid-area: number; }
  .workslip-name { grid-area: name; overflow-wrap: anywhere; }
  .workslip-detail { grid-area: items; overflow-wrap: anywhere; }
  .order-group-header {
    grid-template-columns: 1.45rem minmax(0, 1fr);
    align-items: start;
  }
  .order-group-header::before { grid-column: 1; grid-row: 1; }
  .order-group-main { grid-column: 2; grid-row: 1; justify-self: stretch; }
  .order-group-meta {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-start;
    min-width: 0;
    gap: 0.65rem;
  }
}

@media (max-width: 1100px) {
  .order-group-meta {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .workslip-row {
    grid-template-areas: "number name" "items items" "status status" "actions actions";
  }
  .workslip-actions {
    justify-self: start;
    justify-content: flex-start;
    gap: 0.65rem;
  }
}

/* Number-conflict dialogs shown by sync on every app page. */
.base-number-status {
  margin: 0.45rem 0 0;
  color: #82652e;
  font-size: 0.78rem;
  line-height: 1.5;
}
.base-number-status:empty { display: none; }
.base-number-status.is-conflict { color: #a73737; }
.stilo-sync-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 10, 10, 0.68);
  backdrop-filter: blur(3px);
}
.stilo-sync-dialog {
  width: min(100%, 470px);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: clamp(1.5rem, 5vw, 2rem);
  background: #faf8f5;
  border: 1px solid #c9a96e;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.32);
  color: #26211b;
  font-family: var(--font-body, 'Montserrat', sans-serif);
}
.stilo-sync-dialog--completion {
  border-top: 4px solid #c9a96e;
}
.stilo-sync-dialog--completion .stilo-sync-dialog-input {
  font-variant-numeric: tabular-nums;
}
.stilo-sync-dialog-title {
  margin: 0 0 0.9rem;
  color: #161616;
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  line-height: 1.25;
}
.stilo-sync-dialog-message {
  margin: 0 0 1.3rem;
  color: #5d554b;
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre-line;
}
.stilo-sync-dialog-label {
  display: block;
  color: #4b4135;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.stilo-sync-dialog-input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 0.55rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #c9a96e;
  border-radius: 2px;
  background: #fff;
  color: #161616;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}
.stilo-sync-dialog-input:focus-visible,
.stilo-sync-dialog button:focus-visible {
  outline: 2px solid #9b792f;
  outline-offset: 2px;
}
.stilo-sync-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.6rem;
}
.stilo-sync-dialog-actions button {
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stilo-sync-dialog-cancel {
  border: 1px solid #d8cdbb;
  background: transparent;
  color: #4b4135;
}
.stilo-sync-dialog-confirm {
  border: 1px solid #b99858;
  background: #c9a96e;
  color: #151515;
}
.stilo-sync-dialog-confirm:hover { background: #b99858; }
@media (max-width: 480px) {
  .stilo-sync-dialog-actions button { flex: 1 1 120px; }
}
