/* TAILORS APP NX - Modern Luxury Tailoring & Pattern Studio Styles */

:root {
  --bg-primary: #0f1115;
  --bg-secondary: #171a21;
  --bg-card: #1e222d;
  --bg-card-hover: #262c3a;
  --border-color: #2d3444;
  --border-focus: #c5a059;
  
  --gold-primary: #c5a059;
  --gold-hover: #d8b26e;
  --gold-subtle: rgba(197, 160, 89, 0.15);
  --cyan-accent: #00d2c4;
  --cyan-subtle: rgba(0, 210, 196, 0.15);
  
  --text-primary: #f0f3f8;
  --text-secondary: #9aa5b8;
  --text-muted: #647087;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px rgba(197, 160, 89, 0.25);
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", monospace;
  
  --blueprint-bg: #0d1b2a;
  --blueprint-grid: rgba(65, 90, 119, 0.25);
}

[data-theme="light"] {
  --bg-primary: #f6f8fb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f4f9;
  --border-color: #e2e8f0;
  --border-focus: #b88a38;
  
  --gold-primary: #9d7224;
  --gold-hover: #b88a38;
  --gold-subtle: rgba(157, 114, 36, 0.12);
  --cyan-accent: #0284c7;
  --cyan-subtle: rgba(2, 132, 199, 0.12);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-gold: 0 0 15px rgba(157, 114, 36, 0.2);
  
  --blueprint-bg: #1e293b;
  --blueprint-grid: rgba(255, 255, 255, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header & Top Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(23, 26, 33, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
}

[data-theme="light"] .app-header {
  background-color: rgba(255, 255, 255, 0.9);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  object-fit: cover;
  border: 1px solid rgba(197, 160, 89, 0.4);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #f0f3f8 30%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-title {
  background: linear-gradient(135deg, #0f172a 40%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-item {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid transparent;
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-card);
}

.nav-item.active {
  color: var(--gold-primary);
  background-color: var(--gold-subtle);
  border-color: rgba(197, 160, 89, 0.3);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge-mode {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.badge-mode.active {
  background: var(--gold-subtle);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.badge-mode .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.badge-mode.active .dot {
  background-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
}

.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-download-app {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.btn-download-app:hover {
  background: var(--gold-primary);
  color: #0b0f17;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.35);
}

[data-theme="light"] .btn-download-app {
  background: #ffffff;
  border-color: var(--gold-primary);
  color: #855d14;
}

[data-theme="light"] .btn-download-app:hover {
  background: var(--gold-primary);
  color: #ffffff;
}

/* App Download Banner in How-to-Use */
.app-download-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .app-download-banner {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: rgba(197, 160, 89, 0.5);
}

.app-download-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(197, 160, 89, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.banner-content {
  max-width: 650px;
}

.banner-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-primary);
  background: var(--gold-subtle);
  border: 1px solid rgba(197, 160, 89, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.banner-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.banner-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.btn-download-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gold-primary);
  color: #0b0f17;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(197, 160, 89, 0.35);
}

.btn-download-banner:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.45);
}

.banner-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Global Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 0;
  margin-top: 2rem;
  background: var(--bg-primary);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-link {
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-sep {
  color: var(--border-color);
}

.footer-status {
  color: var(--text-muted);
}

/* Main Container */
.main-wrapper {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
}

/* Section Common Styling */
.view-section {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-hero {
  margin-bottom: 2rem;
  text-align: left;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 650px;
}

/* Categories & Garment Cards Grid */
.category-group {
  margin-bottom: 2.75rem;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-left: 4px solid var(--gold-primary);
  padding-left: 0.75rem;
}

.category-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.category-counter {
  font-size: 0.8rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xl);
  color: var(--text-muted);
}

.garments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.garment-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.garment-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-gold);
}

.garment-card-img-wrap {
  width: 100%;
  height: 210px;
  background-color: var(--bg-secondary);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.garment-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.garment-card:hover .garment-card-img {
  transform: scale(1.04);
}

.garment-card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(8px);
  color: var(--gold-primary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.garment-card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.garment-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}

.garment-card-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex: 1;
}

.garment-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.btn-open-studio {
  background-color: transparent;
  color: var(--gold-primary);
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap 0.2s ease;
}

.garment-card:hover .btn-open-studio {
  gap: 0.6rem;
}

/* Studio & Interactive Calculator Layout */
.studio-layout {
  display: grid;
  grid-template-columns: 410px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  width: 100%;
}

@media (max-width: 1024px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
}

.studio-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.studio-panel-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.studio-panel-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

/* Forms & Input Controls */
.form-group-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.input-field.full-width {
  grid-column: span 2;
}

.input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.input-label .unit {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.input-control {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: var(--font-mono);
}

.input-control:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-subtle);
}

.select-control {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-hover));
  color: #000;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--text-muted);
}

/* Blueprint & Technical Diagram Viewer */
.blueprint-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.blueprint-toolbar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.diagram-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
}

.diagram-tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.diagram-tab-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-card);
}

.diagram-tab-btn.active {
  background-color: var(--bg-primary);
  color: var(--gold-primary);
  border-color: var(--gold-primary);
}

.viewport-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tool-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  color: var(--text-primary);
  border-color: var(--gold-primary);
}

.zoom-indicator {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-primary);
  padding: 0 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  user-select: none;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  height: 32px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.zoom-indicator:hover {
  border-color: var(--gold-primary);
  background: var(--bg-hover);
}

/* Blueprint Canvas Container - White Architectural Tailoring Canvas */
.blueprint-stage {
  position: relative;
  width: 100%;
  height: 640px;
  background-color: #ffffff;
  background-image: 
    radial-gradient(#e2e8f0 1.2px, transparent 1.2px),
    linear-gradient(rgba(241, 245, 249, 0.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 245, 249, 0.6) 1px, transparent 1px);
  background-size: 20px 20px, 20px 20px, 20px 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: grab;
  touch-action: none;
  outline: none;
}

.blueprint-stage:active,
.blueprint-stage.is-dragging {
  cursor: grabbing !important;
}

[data-theme="dark"] .blueprint-stage {
  background-color: #ffffff; /* User requested same white design as Flutter app */
  background-image: 
    radial-gradient(#cbd5e1 1.2px, transparent 1.2px),
    linear-gradient(rgba(226, 232, 240, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 232, 240, 0.5) 1px, transparent 1px);
  border-color: rgba(255, 255, 255, 0.12);
}

.blueprint-viewport-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  will-change: transform;
}

.blueprint-pan-hint {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  pointer-events: none;
  z-index: 20;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.blueprint-content {
  position: relative;
  height: 92%;
  max-height: 580px;
  aspect-ratio: var(--blueprint-aspect-ratio, 296 / 704);
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: block;
}

.blueprint-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
}

/* Dimension Badges on Blueprint - Exact Parity with Flutter BlueprintLabel */
.dimension-badge {
  position: absolute;
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.7);
  border-radius: 3px;
  padding: 1px 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  transform-origin: center center;
}

/* History / Customer Records Table */
.records-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.records-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-input {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text-primary);
  width: 280px;
  outline: none;
}

.search-input:focus {
  border-color: var(--gold-primary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.records-table th {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.records-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.records-table tr:hover td {
  background-color: var(--bg-card-hover);
}

/* Tutorials Grid */
.tutorials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}

.tutorial-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.tutorial-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-primary);
}

.tutorial-thumbnail-wrap {
  width: 100%;
  height: 180px;
  position: relative;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tutorial-play-icon {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gold-primary);
  transition: transform 0.2s ease;
}

.tutorial-card:hover .tutorial-play-icon {
  transform: scale(1.15);
  background-color: var(--gold-primary);
  color: #000;
}

.tutorial-info {
  padding: 1.25rem;
}

.tutorial-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.tutorial-link-btn {
  color: var(--gold-primary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--gold-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Auth Gate & User Profile */
.auth-gate-modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(16px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.auth-gate-modal.hidden {
  display: none;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-logout {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
}

/* How to Use Step-by-Step Guide */
.how-to-use-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.step-card:hover {
  border-color: var(--gold-primary);
  transform: translateX(4px);
}

.step-number-badge {
  min-width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-hover));
  color: #000;
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.step-sublist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.step-sublist li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-sublist li::before {
  content: "✔";
  color: var(--gold-primary);
  font-weight: bold;
}

.pro-tip-box {
  background: var(--gold-subtle);
  border-left: 4px solid var(--gold-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1.2rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.pro-tip-title {
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 0.2rem;
}

/* Cheat Sheet Grid */
.cheat-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.cheat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.cheat-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 0.5rem;
}

.cheat-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Always hide print container on screen */
#printJobSheetContainer {
  display: none !important;
}

.print-logo {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: cover;
}

/* ==========================================================================
   PRINT STYLES - SINGLE-PAGE A4 BESPOKE JOB SHEET
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide everything on screen */
  .app-header,
  .main-wrapper,
  .app-footer,
  .auth-gate-modal,
  .login-modal-overlay,
  .toast-container {
    display: none !important;
    visibility: hidden !important;
  }

  /* Exclusively display the single-page print job sheet */
  #printJobSheetContainer {
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    max-height: 275mm !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: #ffffff !important;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000000;
    padding-bottom: 6px;
    margin-bottom: 8px;
  }

  .print-brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .print-logo {
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    border-radius: 4px;
    border: 1px solid #000;
    object-fit: cover;
  }

  .print-title {
    font-size: 16pt;
    font-weight: 900;
    letter-spacing: 0.05em;
    margin: 0;
    color: #000;
  }

  .print-subtitle {
    font-size: 7.5pt;
    color: #333;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.04em;
  }

  .print-meta {
    text-align: right;
    font-size: 8pt;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
  }

  .print-client-box {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.4fr 1fr;
    gap: 8px;
    background: #f8fafc !important;
    border: 1px solid #94a3b8;
    padding: 6px 10px;
    margin-bottom: 8px;
    border-radius: 4px;
  }

  .print-client-col {
    display: flex;
    flex-direction: column;
  }

  .print-label {
    font-size: 6.5pt;
    font-weight: 800;
    color: #475569;
    letter-spacing: 0.04em;
  }

  .print-val {
    font-size: 9pt;
    font-weight: 700;
    color: #0f172a;
  }

  .print-measurements-wrapper {
    margin-bottom: 8px;
  }

  .print-measurements-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7.5pt;
  }

  .print-measurements-table th,
  .print-measurements-table td {
    border: 1px solid #94a3b8;
    padding: 3px 6px;
    text-align: center;
  }

  .print-measurements-table th {
    background: #f1f5f9 !important;
    font-weight: 800;
    color: #0f172a;
  }

  .print-measurements-table td {
    font-weight: 700;
    color: #000000;
  }

  /* Explicit physical height prevents print collapse */
  .print-blueprint-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1.5px solid #000000;
    border-radius: 4px;
    background: #ffffff !important;
    padding: 8px;
    margin-bottom: 8px;
    height: 175mm !important;
    max-height: 175mm !important;
    overflow: hidden;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    box-sizing: border-box;
  }

  .print-blueprint-stage {
    position: relative !important;
    height: 165mm !important;
    max-height: 165mm !important;
    aspect-ratio: var(--blueprint-aspect-ratio, 296 / 704) !important;
    background: #ffffff !important;
    display: block !important;
    margin: 0 auto !important;
    box-sizing: border-box;
  }

  .print-blueprint-stage .blueprint-svg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: fill !important;
    display: block !important;
  }

  .print-blueprint-stage .dimension-badge {
    position: absolute !important;
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    border-radius: 2px !important;
    padding: 0.5px 3px !important;
    font-size: 8.5pt !important;
    font-weight: 800 !important;
    box-shadow: none !important;
    z-index: 10 !important;
    white-space: nowrap !important;
  }

  .print-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid #94a3b8;
    padding-top: 6px;
    font-size: 7pt;
    color: #475569;
  }

  .print-cutting-notes {
    max-width: 70%;
    line-height: 1.3;
  }

  .print-signoff {
    text-align: right;
  }

  .signoff-line {
    border-top: 1px solid #000000;
    width: 140px;
    margin-top: 24px;
    padding-top: 2px;
    font-size: 7.5pt;
    font-weight: 700;
    color: #000;
  }
}
