@import url("theme.css");

/* --- Navigation Overlay Layout ---
   Default/base state is solid Midnight Navy. This covers every sub-page
   (auth.html, custom-order.html, order-success.html, etc.) automatically,
   since those pages never apply a modifier class to .atelier-header.
   The ONLY state that goes transparent is the explicit .lookbook-mode
   class, applied by JS for the index.html hero overlay. See the
   "HEADER STATE SYSTEM" block near the end of this file for the
   canonical mode definitions. --- */
.atelier-header {
  position: relative;
  width: 100%;
  z-index: 10;
  padding: 1.5rem 4rem;
  background-color: var(--color-primary) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

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

.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* --- 3D animated brand mark (header nav) ---
   perspective on the wrapper + preserve-3d/rotateY-rotateX on the image
   is what actually produces the 3D effect on a flat asset — a real
   photoreal 3D re-render of the logo isn't something CSS can do, but a
   perspective-correct tilt reads as genuinely dimensional rather than a
   flat spin. clamp() keeps it fluidly responsive without needing a
   separate breakpoint override for every screen size. */
.brand-logo-3d-wrap {
  display: inline-block;
  perspective: 600px;
}

.brand-logo-img {
  display: block;
  height: clamp(30px, 4.5vw, 46px);
  width: auto;
  transform-style: preserve-3d;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
  animation: brandLogoFloat3D 6s ease-in-out infinite;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-logo:hover .brand-logo-img {
  animation-play-state: paused;
  transform: rotateY(20deg) rotateX(-4deg) scale(1.06);
}

@keyframes brandLogoFloat3D {
  0%,
  100% {
    transform: rotateY(-12deg) rotateX(3deg);
  }
  50% {
    transform: rotateY(12deg) rotateX(-3deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo-img {
    animation: none;
  }
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 3rem;
}

.nav-links a {
  color: var(--color-bg-canvas) !important; /* #FBFBFA — Tailor's Chalk Off-White, pinned for contrast in every header state */
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid transparent;
  transition: var(--transition-luxury);
}

.nav-links a.active,
.nav-links a:hover {
  border-bottom: 1px solid #C5A880 !important; /* Antique Gold underline */
}

/* --- Immersive 100vh Hero Stage --- */
.hero-stage {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 4rem;
  overflow: hidden;
  background:
    linear-gradient(
      rgba(0, 0, 0, 0.875),
      rgba(0, 0, 0, 0.587),
      rgba(0, 0, 0, 0.684)
    ),
    url(/images/suit03.JPG);
  background-size: cover;
  background-position: top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Background Image Layer */
/* .hero-background-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65; 
  z-index: 1;
  url(https://i.pinimg.com/1200x/61/1a/f7/611af7e3548261545940ff2e2e0412a1.jpg);
} */

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  color: var(--color-bg-canvas);
}

.hero-tagline {
  font-size: var(--font-size-h3font-size-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: #fabf6d;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-hero);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

/* --- Clean Buttons Architecture --- */
.btn-premium-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--color-bg-canvas);
  color: var(--color-primary);
  font-size: var(--font-size-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.9rem 2.2rem;
  border: 1px solid var(--color-bg-canvas);
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-luxury);
  /* Overflow guard: an inline-flex box sizes to fit its label on one line
     by default, which is exactly what let a long label like the old
     "Lock Architecture & Place Commission" push past the viewport edge
     on narrow phones instead of staying centered. max-width + box-sizing
     means any button using this class will wrap its label rather than
     blow out of its container, however long the text is. */
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
}

.btn-premium-pill:hover {
  background-color: transparent;
  color: var(--color-bg-canvas);
}

/* --- Lookbook E-Commerce Matrix Layout --- */
.storefront-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 6rem 4rem;
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: var(--font-size-h1);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.atelier-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2.5rem;
}

.atelier-card {
  grid-column: span 4;
  border: 1px solid var(--color-border-slate);
  background: transparent;
  transition: var(--transition-luxury);
  /* CARD ALIGNMENT FIX ------------------------------------------------------
     Grid rows stretch every card to the tallest card's height (default
     align-items: stretch on .atelier-grid), but a plain block card just
     leaves that extra space dangling *after* its content instead of using
     it. That's what let "Acquire Piece" buttons sit at different heights
     whenever one card's apparel description/subtitle wrapped to more
     lines than its neighbours. Turning the card into a column flexbox
     that fills its full stretched height fixes that at the source. */
  height: 100%;
  display: flex;
  flex-direction: column;
}

.atelier-card:hover {
  border-color: var(--color-accent);
}

/* Desktop default for the "Commission Your Exact Proportions" CTA card —
   matches its old inline grid-column: span 4. Overridden to span the full
   row (1 / -1) below 1024px; see the LOOKBOOK PORTFOLIO GRID SYSTEM section
   further down for the tablet/mobile column-count rules themselves. */
.cta-highlight-card {
  grid-column: span 4;
}

.product-media {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background-color: #eaeaea;
  flex-shrink: 0; /* never let the image get squashed by the flex column */
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-luxury);
}

.atelier-card:hover .product-media img {
  transform: scale(1.03);
}

.product-details {
  padding: 1.5rem;
  /* Fill whatever vertical space is left below the image so the footer
     action block (below) always has a consistent floor to anchor to. */
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.product-name {
  font-family: var(--font-heading);
  font-size: var(--font-size-h3);
  font-weight: 400;
}

/* Clamp the subtitle/apparel description to two lines. This keeps the
   *natural* height variance between cards small, and — combined with
   .product-action-footer's margin-top: auto below — guarantees the
   Acquire Piece buttons land on the exact same baseline across a row
   even when one description is noticeably longer than another. */
.product-subtitle {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-price {
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Wraps the size matrix + Acquire Piece button. margin-top: auto pushes
   this block to the bottom of .product-details regardless of how tall
   the name/subtitle/meta row above it grew, so every card in a row
   bottom-aligns its button on the same line. */
.product-action-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.size-selector-group {
  border: none;
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.size-box {
  border: 1px solid var(--color-border-slate);
  padding: 0.4rem 0.8rem;
  font-size: var(--font-size-small);
  cursor: pointer;
}

/* ==========================================================================
   SUIT BOSS FASHION - BRAND ATELIER FOOTER
   ========================================================================== */

.atelier-footer {
  background-color: var(--color-primary);
  color: white;
  padding: 6rem 4rem 3rem 4rem;
  border-top: 1px solid var(--color-border-slate);
  font-family: var(--font-body);
}

.footer-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3rem;
}

.footer-column {
  grid-column: span 2;
}

/* Giving the brand statement asymmetric weight (spanning 4 columns) */
.footer-column.brand-column {
  grid-column: span 4;
}

.footer-column.status-column {
  grid-column: span 4;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* --- Typography Implementations --- */
.footer-logo {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  color: var(--text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.footer-statement {
  font-size: var(--font-size-small);
  line-height: 1.7;
  opacity: 0.65;
  font-weight: 300;
  max-width: 320px;
}

.footer-heading {
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* --- Links & Navigation Matrices --- */
.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.85rem;
}

.footer-links a {
  font-size: var(--font-size-small);
  color: var(--text-light);
  opacity: 0.6;
  font-weight: 300;
  transition: var(--transition-luxury);
}

.footer-links a:hover {
  opacity: 1;
  color: var(--color-accent);
  padding-left: 4px; /* Soft, intentional interaction feedback */
}

.footer-meta-text {
  font-size: var(--font-size-small);
  opacity: 0.6;
  font-weight: 300;
  margin-bottom: 0.5rem;
}

/* Tactile metadata badge to anchor the high-end operational feel */
.system-badge {
  margin-top: 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  border: 1px solid rgba(197, 168, 128, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sharp);
  display: inline-block;
}

/* --- Bottom Row Formatting --- */
.footer-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 1440px;
  margin: 4rem auto 2rem auto;
}

.footer-sub-row {
  width: 100%;
}

.footer-sub-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-small);
  opacity: 0.4;
  font-weight: 300;
}

.footer-philosophy-tag {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
  .footer-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
  .footer-column {
    grid-column: span 2 !important;
  }
  .footer-column.status-column {
    text-align: left;
    align-items: flex-start;
  }
}

@media (max-width: 576px) {
  .footer-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
  }
  .footer-sub-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ==========================================================================
   SUIT BOSS FASHION - BESPOKE MEASUREMENT SYSTEM LAYOUTS
   ========================================================================== */

.internal-header {
  position: relative !important;
  background-color: var(--color-primary) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.form-canopy {
  max-width: 1440px;
  margin: 0 auto;
  padding: 5rem 4rem 3rem 4rem;
  text-align: center;
}

.canopy-sub {
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.canopy-title {
  font-size: var(--font-size-h1);
  margin-bottom: 1rem;
}

.canopy-desc {
  font-size: var(--font-size-body);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 300;
}

.measurement-stage {
  max-width: 1440px;
  margin: 0 auto 6rem auto;
  padding: 0 4rem;
}

.measurement-stage select {
  width: 100%;
  box-sizing: border-box;
  padding: 1rem;
  border: 1px solid var(--color-border-slate);
  background-color: var(--color-bg-canvas);
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: var(--color-primary);
  outline: none;
  appearance: none; /* Kills default basic operating system UI styling */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path fill='%230F1A2C' d='M0 3l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.measurement-form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3rem;
  width: 100%;
  box-sizing: border-box;
}

.form-tier {
  grid-column: span 6;
  border: 1px solid var(--color-border-slate);
  padding: 3rem 2.5rem;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}

.tier-heading {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  color: var(--color-primary);
  padding: 0 1rem;
  text-transform: capitalize;
}

.input-cell {
  display: flex;
  flex-direction: column;
  margin-top: 2rem;
}

.input-cell label {
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  /* --text-dark was never defined anywhere in theme.css/main.css, so this
     var() silently fell back to the inherited color instead of a specified
     one. --color-primary (Midnight Navy) is what every other dark-on-light
     label/text token in this form pane actually resolves to. */
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.input-cell input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border-slate);
  padding: 0.75rem 0.5rem;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--color-primary);
  outline: none;
  transition: var(--transition-luxury);
  width: 100%;
}

.input-cell input:focus {
  border-bottom-color: var(--color-accent);
}

/* --- Bespoke Commission: Reference Image upload (Custom Silhouette) ---
   Light-theme counterpart to the admin dashboard's dark .inv-file-drop-zone
   pattern — same structure and behavior, restyled to match this page's
   white-canvas / gold-accent aesthetic instead of reusing the dark admin
   classes verbatim. */
.bespoke-image-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  background-color: transparent;
  border: 1.5px dashed var(--color-border-slate);
  padding: 1.75rem 1.25rem;
  cursor: pointer;
  color: var(--color-primary);
  transition: var(--transition-luxury);
}

.bespoke-image-drop-zone:hover,
.bespoke-image-drop-zone.is-drag-active {
  border-color: var(--color-accent);
  background-color: rgba(197, 168, 128, 0.06);
  color: var(--color-accent);
}

.bespoke-image-drop-text {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  text-transform: none;
  letter-spacing: normal;
}

.bespoke-image-drop-hint {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--color-border-slate);
}

.bespoke-image-preview-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.75rem;
  border: 1px solid var(--color-border-slate);
  padding: 0.6rem;
}

.bespoke-image-preview {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--color-accent);
  padding: 2px;
  background: var(--color-bg-canvas);
  border-radius: 2px;
  flex-shrink: 0;
}

.bespoke-image-preview-clear {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--color-border-slate);
  background-color: transparent;
  color: var(--color-primary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-luxury);
  margin-left: auto;
}

.bespoke-image-preview-clear:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* --- Password visibility toggle ---
   Wraps the password <input> so the eye-toggle button can be absolutely
   positioned inside it without disturbing the underline-only input style
   used throughout this form. */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  /* Room for the toggle button so typed characters never run under it */
  padding-right: 2.25rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-border-slate);
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition-luxury);
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
  color: var(--color-accent);
}

.password-toggle-btn:focus-visible {
  outline: 1px solid var(--color-accent);
  outline-offset: 2px;
}

.pw-icon {
  width: 18px;
  height: 18px;
}

/* Form Submission Mechanics Anchor Row */
.form-submission-anchor {
  grid-column: span 12;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0 0.5rem;
}

.submit-action {
  background-color: var(--color-primary);
  color: var(--text-light);
  border-color: var(--color-primary);
  padding: 1.2rem 4rem;
}

.submit-action:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary);
}

@media screen and (max-width: 480px) {
  .submit-action {
    padding: 1.1rem 2rem;
  }
}

.error-indicator {
  font-size: 0.75rem;
  color: #a34848;
  margin-top: 0.35rem;
  height: 12px;
}

/* --- Responsive Layout Rules --- */
@media (max-width: 992px) {
  .form-tier {
    grid-column: span 12;
  }
}

/* The canopy header and measurement stage were both centered with
   margin: 0 auto, but their fixed 4rem (64px) horizontal padding was never
   scaled down for mobile. On a ~390–430px phone that's over 30% of the
   viewport width eaten by padding on each side, which reads as a
   cramped, off-balance layout even though the container itself is
   mathematically centered. Scaling the padding down restores a properly
   centered, breathable look at phone widths. */
@media screen and (max-width: 768px) {
  .form-canopy {
    padding: 3rem 1.5rem 2rem 1.5rem;
  }

  .measurement-stage {
    padding: 0 1.5rem;
  }

  .form-tier {
    padding: 2.25rem 1.5rem;
  }
}

@media screen and (max-width: 480px) {
  .form-canopy {
    padding: 2.5rem 1.25rem 1.75rem 1.25rem;
  }

  .canopy-title {
    font-size: 1.9rem;
  }

  .measurement-stage {
    padding: 0 1.25rem;
  }

  .form-tier {
    padding: 2rem 1.25rem;
  }

  .measurement-form-grid {
    gap: 1.75rem;
  }
}

/* ==========================================================================
   SUIT BOSS FASHION - PORTAL SYSTEM STYLES
   ========================================================================== */

.auth-portal-stage {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--color-bg-canvas);
}

/* --- Left Column: Context Canopy --- */
.auth-canopy-pane {
  position: relative;
  width: 45%;
  display: flex;
  align-items: flex-end;
  padding: 5rem 4rem;
  background-color: var(--color-primary);
  overflow: hidden;
}

.auth-bg-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  z-index: 1;
}

/* --- Auth canopy slideshow ---
   Two absolutely-stacked slides (the existing photo + the generated
   fashion illustration) crossfade every 3.5s via .is-active, controlled by
   the inline script at the bottom of auth.html. */
.auth-canopy-slideshow {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.auth-canopy-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-canopy-slide.is-active {
  opacity: 1;
}

.auth-canopy-slide .auth-bg-media {
  /* Nested opacity multiplies with the slide's own 0/1 crossfade value, so
     each slide keeps its own resting visibility once active. */
  position: absolute;
}

/* The illustration is thin gold linework on a near-black navy fill, not a
   busy photo — at the photo's 0.35 resting opacity it would nearly
   disappear. It gets its own, more visible resting opacity instead. */
.auth-bg-media--illustration {
  opacity: 0.85;
}

/* Slow, continuous drift while a slide is showing — the detail that reads
   as "premium slideshow" rather than a flat crossfade. Runs independently
   of the JS interval, so it never needs to resync. */
.auth-canopy-slide.is-active .auth-bg-media {
  animation: canopyKenBurns 8s ease-in-out infinite alternate;
}

@keyframes canopyKenBurns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-canopy-slide {
    transition-duration: 0.3s;
  }
  .auth-canopy-slide.is-active .auth-bg-media {
    animation: none;
  }
}

.auth-canopy-content {
  position: relative;
  z-index: 2;
  color: var(--color-bg-canvas);
  max-width: 460px;
}

.auth-brand-logo {
  display: block;
  text-decoration: none;
  margin-bottom: 4rem;
}

.auth-brand-logo-3d-wrap {
  display: inline-block;
  perspective: 700px;
}

.auth-brand-logo-img {
  display: block;
  height: clamp(52px, 8vw, 88px);
  width: auto;
  transform-style: preserve-3d;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
  animation: brandLogoFloat3D 6s ease-in-out infinite;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-brand-logo:hover .auth-brand-logo-img {
  animation-play-state: paused;
  transform: rotateY(20deg) rotateX(-4deg) scale(1.06);
}

.auth-editorial-headline {
  font-size: var(--font-size-h1);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.auth-editorial-sub {
  font-size: var(--font-size-h3);
  color: var(--text-light);
  font-weight: 300;
  opacity: 0.75;
  line-height: 1.6;
}

/* --- Right Column: Interaction Form Framework --- */
.auth-form-pane {
  width: 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}

.auth-form-wrapper {
  width: 100%;
  max-width: 420px;
}

.auth-pane-header {
  margin-bottom: 2.5rem;
}

.auth-pane-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h1);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.auth-pane-switch {
  font-size: var(--font-size-small);
  color: var(--text-muted);
}

.auth-pane-switch a {
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: 500;
}

/* --- OAuth Layout Vectors --- */
.oauth-federation-matrix {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.btn-oauth {
  width: 100%;
  background: transparent;
  border: 1px solid var(--color-border-slate);
  border-radius: var(--radius-sharp);
  padding: 0.85rem 1.5rem;
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: var(--transition-luxury);
}

.btn-oauth:hover {
  border-color: var(--color-primary);
  background-color: rgba(15, 26, 44, 0.02);
}

.oauth-icon {
  width: 18px;
  height: 18px;
}

/* --- Visual Separators --- */
.auth-matrix-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
}

.divider-line {
  flex: 1;
  height: 1px;
  background-color: var(--color-border-slate);
  opacity: 0.5;
}

.divider-text {
  padding: 0 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* --- Inline Utilities & Control Layouts --- */
.auth-utilities-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
  font-size: var(--font-size-small);
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
}

.checkbox-container input {
  display: none;
}

.custom-checkbox {
  width: 14px;
  height: 14px;
  border: 1px solid var(--color-border-slate);
  display: inline-block;
  transition: var(--transition-luxury);
}

.checkbox-container input:checked + .custom-checkbox {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.auth-recovery-link {
  color: var(--text-muted);
  transition: var(--transition-luxury);
}

.auth-recovery-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.auth-submit-action {
  width: 100%;
  padding: 1.1rem;
  background-color: var(--color-primary);
  color: var(--text-light);
  border-color: var(--color-primary);
}

/* .btn-premium-pill's default :hover (transparent bg + off-white text) was
   built for buttons sitting on DARK surfaces — the hero section, where
   "transparent" reveals a dark image behind it. This button sits on the
   light .auth-form-pane instead, so that same hover made the background go
   transparent (revealing the near-white page) while the text went
   near-white too — button and label both effectively vanished. Matches the
   already-established .submit-action:hover pattern used on the bespoke
   commission page for the same reason: gold fill, navy text, full contrast
   on a light background regardless of state. */
.auth-submit-action:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary);
}

/* --- Viewport Responsiveness Overrides --- */
@media (max-width: 992px) {
  .auth-portal-stage {
    flex-direction: column;
  }
  .auth-canopy-pane {
    width: 100%;
    min-height: 300px;
    padding: 3rem 2rem;
  }
  .auth-brand-logo {
    margin-bottom: 2rem;
  }
  .auth-form-pane {
    width: 100%;
    padding: 4rem 2rem;
  }
}

/* --- Premium Notification System Styles --- */
.toast-wrapper {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 90%;
  max-width: 450px;
  pointer-events: none;
}

.atelier-toast {
  background-color: var(--color-primary); /* Midnight Navy */
  color: var(--color-bg-canvas); /* Tailor's Off-White */
  padding: 1.25rem 2rem;
  border-left: 3px solid var(--color-accent); /* Antique Gold Accent */
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-20px);
  animation: toastFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Variant color settings if something breaks */
.atelier-toast.error-alert {
  border-left-color: #ff4d4d; /* Luxury Crimson for security rejections */
}

@keyframes toastFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastFadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* --- Atelier Dashboard Layout Grid --- */
.dashboard-stage {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 8rem 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
}

@media (max-width: 968px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

.dashboard-column {
  background-color: transparent;
}

/* --- Premium Transaction Status Cards --- */
.orders-stream-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.atelier-order-card {
  border: 1px solid var(--color-border-slate);
  background-color: var(--color-bg-canvas);
  padding: 2rem;
  transition: var(--transition-luxury);
}

.atelier-order-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 10px 30px rgba(15, 26, 44, 0.03);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-slate);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.order-tracking-tag {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.order-status-badge {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--color-border-slate);
}

/* Dynamic State border tints */
.order-status-badge[data-status="Pending Studio Review"] {
  border-color: var(--color-accent);
  color: var(--color-primary);
}

.order-status-badge[data-status="In Cutting Stage"] {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.order-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.order-textile-meta {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: #7f8c8d;
}

.order-textile-meta span {
  color: var(--color-primary);
  font-weight: 400;
}

.order-card-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--color-border-slate);
}

.financial-tag {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: #7f8c8d;
}

.invoice-status {
  color: var(--color-primary);
  font-weight: 500;
}

.empty-state-banner {
  text-align: center;
  padding: 4rem 2rem;
  border: 1px dashed var(--color-border-slate);
}

/* ============================================================================
   COLLAPSIBLE DASHBOARD SIDEBAR SYSTEM
   Shared shell for both the client and admin dashboards. Sidebar sits in
   normal document flow below the site header (which is position: relative
   here, not fixed — see HEADER STATE SYSTEM), so a simple sticky offset is
   enough to keep it in view while the content pane scrolls, with no fragile
   header-height math involved.

   Deliberately flat throughout: solid borders and background-color
   transitions only. No box-shadow glow on any interactive element — hover
   and active states are communicated with color and a left accent bar,
   the same way .btn-premium-pill and every other button in this project
   already does it.
   ============================================================================ */

.dash-shell {
  display: flex;
  /* align-items: stretch (the flex default) is what makes the sidebar match
     the content pane's height. This was previously flex-start, which sized
     the sidebar to its own nav items only — leaving empty space beside any
     content pane taller than the nav list. Sidebar height is intentionally
     never set explicitly (no 100vh / fixed px): it simply grows to match
     whatever height .dash-content-pane naturally reaches, so it scales with
     real content on every dashboard route. */
  align-items: stretch;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  min-height: 60vh;
}

/* --- Sidebar --- */
.dash-sidebar {
  position: sticky;
  top: 1.5rem;
  flex-shrink: 0;
  width: 240px;
  background-color: var(--color-primary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.dash-sidebar-collapse-btn {
  align-self: flex-end;
  width: 32px;
  height: 32px;
  margin: 0.75rem 0.75rem 0.25rem;
  flex-shrink: 0;
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-luxury);
}

.dash-sidebar-collapse-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.dash-sidebar-collapse-btn svg {
  transition: transform 0.3s ease;
}

.dash-shell.is-collapsed .dash-sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.dash-sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
}

.dash-sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dash-sidebar-footer {
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* app.js's site-wide auth observer sets style.display="inline-block"
   directly on every .js-logout-btn (nav bar, mobile drawer, and now this
   sidebar item all share that class). Inline styles beat class rules, so
   without this override the sidebar's own flex layout for icon+label
   alignment would silently lose to that inline style once signed in. */
.dash-nav-signout {
  display: flex !important;
}

/* --- Nav items (shared by both regular sections and the sign-out link) --- */
.dash-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background-color: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-luxury);
  white-space: nowrap;
}

.dash-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.dash-nav-item.is-active {
  background-color: rgba(197, 168, 128, 0.1);
  border-left-color: var(--color-accent);
  color: var(--color-accent);
}

.dash-nav-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s ease;
}

.dash-nav-badge {
  margin-left: auto;
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 0.4rem;
  border-radius: 10px;
  background-color: var(--color-accent);
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Collapsed state: icon rail only --- */
.dash-shell.is-collapsed .dash-sidebar {
  width: 68px;
}

.dash-shell.is-collapsed .dash-nav-label,
.dash-shell.is-collapsed .dash-nav-badge {
  display: none;
}

.dash-shell.is-collapsed .dash-nav-item {
  justify-content: center;
  padding: 0.85rem;
}

.dash-shell.is-collapsed .dash-sidebar-collapse-btn {
  align-self: center;
}

/* --- Content pane --- */
.dash-content-pane {
  flex: 1;
  min-width: 0;
  padding: 0 0 0 2.5rem;
}

.dash-section-header {
  margin-bottom: 2rem;
}

.dash-section-eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin: 0 0 0.4rem 0;
}

.dash-section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 500;
  color: var(--color-primary);
  margin: 0 0 0.4rem 0;
  line-height: 1.15;
}

.dash-section-sub {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: #5a6672;
  margin: 0;
  max-width: 60ch;
}

.dash-section-body {
  margin-top: 0;
}

/* --- Overview quick stats --- */
.dash-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.dash-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background-color: #ffffff;
  border: 1px solid var(--color-border-slate);
  padding: 1.25rem 1.5rem;
}

.dash-stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 500;
  color: var(--color-primary);
  line-height: 1;
}

.dash-stat-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7f8c8d;
}

.btn-dash-view-all {
  display: inline-block;
  margin-top: 1.25rem;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-secondary);
  cursor: pointer;
  transition: var(--transition-luxury);
}

.btn-dash-view-all:hover {
  color: var(--color-accent);
}

/* --- Notifications feed --- */
.dash-notification-row {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border-slate);
}

.dash-notification-row:last-child {
  border-bottom: none;
}

.dash-notification-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(197, 168, 128, 0.12);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-notification-text {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--color-primary);
  line-height: 1.5;
}

.dash-notification-meta {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: #9a9a9a;
  margin-top: 0.2rem;
}

/* --- Mobile: sidebar collapses to icon rail automatically; no separate
       drawer needed since the icon rail alone is already narrow enough to
       stay usable next to the content pane on a phone-width screen. --- */
@media screen and (max-width: 900px) {
  .dash-shell {
    padding: 1rem 1rem 3rem;
  }

  .dash-sidebar {
    width: 68px !important;
  }

  .dash-nav-label,
  .dash-nav-badge {
    display: none;
  }

  .dash-nav-item {
    justify-content: center;
    padding: 0.85rem;
  }

  .dash-sidebar-collapse-btn {
    display: none;
  }

  .dash-content-pane {
    padding-left: 1.25rem;
  }

  .dash-stat-row {
    grid-template-columns: 1fr;
  }

  .dash-section-title {
    font-size: 1.5rem;
  }
}

/* --- Tailor Shop Admin Workspace --- */
.admin-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 8rem;
  padding-left: 2rem;
  padding-right: 2rem;
}

.admin-banner-row {
  margin-bottom: 2.5rem;
}

.admin-panel-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h1);
  color: var(--color-secondary);
}

.admin-panel-sub {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: #040c34;
  margin-top: 0.5rem;
}

.admin-stream-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 168, 128, 0.45) transparent;
}

.admin-stream-container::-webkit-scrollbar {
  width: 8px;
}

.admin-stream-container::-webkit-scrollbar-track {
  background: transparent;
}

.admin-stream-container::-webkit-scrollbar-thumb {
  background-color: rgba(197, 168, 128, 0.45);
  border-radius: 4px;
}

.admin-stream-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(197, 168, 128, 0.7);
}

/* ==========================================================================
   NEW FEATURE — ORDER DATE SEARCH + DATE GROUPING
   Sits above .admin-stream-container on both the Bespoke and Ready-To-Wear
   admin ledgers. Lets the admin jump to every order that arrived on a given
   day; orders themselves are rendered inside .order-date-group blocks so
   they read as clearly separated, date-labelled batches.
   ========================================================================== */
.order-date-search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--color-accent);
}

.order-date-search-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.order-date-search-field label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9a9a9a;
}

.order-date-search-input {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-light);
  background: #0c0c0c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.55rem 0.75rem;
  color-scheme: dark;
}

.order-date-search-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.btn-date-clear {
  align-self: flex-end;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #9a9a9a;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-date-clear:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.order-date-search-status {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--color-accent);
  margin: 0;
  flex-basis: 100%;
}

.order-date-group {
  margin-bottom: 0.5rem;
}

.order-date-group-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(197, 168, 128, 0.35);
}

.order-date-heading {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-light);
  margin: 0;
}

.order-date-count {
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.order-date-empty-notice {
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .order-date-search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-date-clear {
    align-self: stretch;
  }
}

.admin-order-card {
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--color-accent);
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: var(--transition-luxury);
}

.admin-order-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  border-left-color: var(--color-accent);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   NEW FEATURE — ORDER UTILITY BAR: "Mark as Attended" checkbox + "Delete"
   button, shown at the top of every admin order card (bespoke and
   Ready-To-Wear). Unattended orders keep the gold left-edge accent above
   so freshly-arrived orders stay visually distinct from ones the admin has
   already dealt with; checking "Attended" mutes the card so the list reads
   at a glance which orders still need action.
   ========================================================================== */
.order-utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.order-attended-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-body);
  color: #9a9a9a;
}

.order-attended-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.order-attended-toggle .attended-toggle-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.order-attended-toggle:has(input:checked) .attended-toggle-label {
  color: var(--color-accent);
}

.btn-delete-order {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: rgba(220, 38, 38, 0.75);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.btn-delete-order:hover:not(:disabled) {
  background-color: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.65);
  color: #ef4444;
}

.btn-delete-order:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-delete-order svg {
  flex-shrink: 0;
}

/* Attended state: dim the whole card and swap the accent edge to a neutral
   tone so the eye is drawn to what's still outstanding, not what's done.
   Hovering brings it back to full strength so nothing is ever hard to read. */
.admin-order-card.is-attended {
  border-left-color: rgba(255, 255, 255, 0.12);
  opacity: 0.6;
}

.admin-order-card.is-attended:hover {
  opacity: 1;
}

.admin-order-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1.5fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 768px) {
  .admin-order-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.admin-id-tag {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.admin-client-email {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: #9a9a9a;
  margin-top: 0.25rem;
}

.admin-details-cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-details-cell h4 {
  font-family: var(--font-heading);
  color: var(--text-light);
}

.textile-desc {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: #9a9a9a;
}

.admin-reference-image-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition-luxury);
}

.admin-reference-image-link:hover {
  color: #fff;
}

.admin-reference-image-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 1px solid var(--color-accent);
  border-radius: 2px;
  background: #111;
  flex-shrink: 0;
}

.admin-pipeline-group-cell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.admin-pipeline-cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pipeline-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7f8c8d;
  display: block;
  margin-bottom: 0.5rem;
}

/* ============================================================================
   READY-TO-WEAR ORDER CARD — organized structure
   Replaces the old single 3-column grid (built for the simpler bespoke
   commission cards) with clearly separated sections: header, contact
   details, pipeline controls, and delivery dispatch — each divided by a
   hairline so the card reads top-to-bottom instead of as one dense block.
   Every text color below is an explicit value against the card's #141414
   background, not opacity stacked on inherited color, so contrast stays
   predictable regardless of nesting context.
   ============================================================================ */

.rtw-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.rtw-card-id-block {
  min-width: 0;
}

.rtw-garment-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-light);
  margin: 0.35rem 0 0.2rem 0;
}

.rtw-card-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--color-accent);
  padding: 2px;
  background: #111;
  border-radius: 3px;
  flex-shrink: 0;
}

.rtw-card-thumb--empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.15);
}

.rtw-card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 1.25rem 0;
}

/* --- Customer contact block --- */
.rtw-customer-info {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rtw-info-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.rtw-info-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-top: 0.1rem;
}

.rtw-info-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.5;
  /* Concrete muted value, not opacity — opacity on light text over a dark
     card stacks with any inherited dimming and is how contrast quietly
     erodes. This stays exactly as legible however it's nested. */
  color: #b8b8b8;
  word-break: break-word;
}

/* --- Pipeline controls --- */
.rtw-pipeline-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* --- Delivery dispatch section --- */
.rtw-dispatch-section .pipeline-label {
  margin-bottom: 0.6rem;
}

.rtw-dispatch-cell {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
}

.rtw-delivery-dispatcher {
  flex: 1;
  min-width: 0;
  resize: none;
  color-scheme: dark;
  background: #1e1e1e;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.4;
  outline: none;
  /* Grows with content up to this cap (see autoGrowDispatchTextarea in
     dashboard.js), then scrolls internally instead of the card stretching
     indefinitely for a long delivery message. */
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 168, 128, 0.45) transparent;
}

.rtw-delivery-dispatcher::-webkit-scrollbar {
  width: 5px;
}

.rtw-delivery-dispatcher::-webkit-scrollbar-thumb {
  background-color: rgba(197, 168, 128, 0.45);
  border-radius: 3px;
}

.rtw-delivery-dispatcher:focus {
  border-color: var(--color-accent);
}

.rtw-delivery-dispatcher::placeholder {
  color: #8a8a8a;
}

.btn-send-delivery-note {
  flex-shrink: 0;
  background: var(--color-accent);
  color: var(--color-primary);
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition-luxury);
}

.btn-send-delivery-note:hover {
  background: #d8bf98;
}

.btn-send-delivery-note:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media screen and (max-width: 560px) {
  .rtw-pipeline-controls {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .rtw-dispatch-cell {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-send-delivery-note {
    width: 100%;
  }
}

/* Luxury Admin Dropdown Elements */
.status-modifier-dropdown,
.billing-modifier-dropdown {
  appearance: none;
  -webkit-appearance: none;
  /* Tells the browser this control belongs in a dark UI — appearance:none
     only overrides the closed box; without this, some browsers still
     render the open option-list popup with light native OS chrome
     regardless, which is exactly the washed-out/low-contrast look this
     is meant to prevent. */
  color-scheme: dark;
  background: #1e1e1e;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  border-radius: 4px;
  position: relative;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%237f8c8d' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.status-modifier-dropdown:focus,
.billing-modifier-dropdown:focus {
  border-color: var(--color-accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(197, 168, 128, 0.15);
}

.status-modifier-dropdown:hover,
.billing-modifier-dropdown:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-inspect-metrics {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #9a9a9a;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-decoration: underline;
  transition: var(--transition-luxury);
  align-self: flex-start;
}

.btn-inspect-metrics:hover,
.btn-inspect-metrics.active-toggle {
  color: var(--color-accent);
}

.admin-metrics-drawer {
  background-color: #1a1a1a;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  margin-top: 1.5rem;
  padding: 1.5rem 0 0;
  animation: fadeInDrawer 0.3s ease-out forwards;
}

.drawer-inner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.metric-pill {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #d8d8d8;
  background: #1e1e1e;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
}

.metric-pill span {
  color: #7f8c8d;
}

@keyframes fadeInDrawer {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Success Gateway Core View --- */
.success-viewport {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 2rem;
}

/* Utility: used to center the icon/label/ID stack inside .success-card */
.text-center {
  text-align: center;
}

.success-card {
  background-color: var(--color-primary);
  color: var(--color-bg-canvas);
  border: 1px solid rgba(197, 168, 128, 0.2);
  padding: 4rem 3rem;
  max-width: 580px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(15, 26, 44, 0.15);
}

.success-icon-wrapper {
  margin-bottom: 1.5rem;
}

/* Wraps the receipt label + ID stack; matches the spacing the old
   .receipt-tracking-box used to provide before the markup dropped it */
.success-message-block {
  margin: 2.5rem 0;
}

.receipt-tracking-box {
  background-color: #fbfbf9;
  border: 1px dashed var(--color-border-slate);
  padding: 1.5rem;
  margin: 2.5rem 0;
}

.receipt-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  display: block;
  margin-bottom: 0.25rem;
}

.receipt-id {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--color-bg-canvas);
  letter-spacing: 0.05em;
  margin: 0;
}

.success-action-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-premium-primary {
  background-color: var(--color-accent);
  color: var(--color-primary);
  border: none;
  padding: 1rem 2rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: var(--transition-luxury);
}

.btn-premium-primary:hover {
  background-color: #d4b97a;
}

.btn-premium-secondary {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition-luxury);
}

.btn-premium-secondary:hover {
  color: var(--color-bg-canvas);
}

/* --- Client Dashboard Presentation Rules --- */
.dashboard-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8rem 4rem 4rem 4rem;
}

.dashboard-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--color-border-slate);
  padding-bottom: 1.5rem;
}

.dash-welcome-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h1);
  color: var(--color-primary);
  margin: 0 0 0.5rem 0;
}

/* --- Animated time-of-day greeting ---
   Replaces the old static "Private Studio Ledger" heading. Each line
   cascades in with a staggered delay for a smooth, deliberate reveal
   rather than a flat fade — the eyebrow leads, the greeting follows,
   the subtitle settles in last. Re-plays naturally every time the client
   dashboard mounts, since mainContent.innerHTML is rebuilt fresh each time. */
.dash-greeting-eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
  opacity: 0;
  animation: dashGreetingSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0s forwards;
}

.dash-greeting-title {
  opacity: 0;
  animation: dashGreetingSlideIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.12s forwards;
}

.dash-greeting-name {
  color: var(--color-accent);
  font-style: italic;
}

.dash-greeting-fade {
  opacity: 0;
  animation: dashGreetingSlideIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.24s forwards;
}

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

@media (prefers-reduced-motion: reduce) {
  .dash-greeting-eyebrow,
  .dash-greeting-title,
  .dash-greeting-fade {
    animation: none;
    opacity: 1;
  }
}

.dash-welcome-sub {
  font-family: var(--font-body);
  color: #7f8c8d;
  font-size: var(--font-size-small);
  margin: 0;
}

.client-meta-badge {
  font-family: var(--font-body);
  font-size: 0.8rem;
  background-color: #f0f4f8;
  color: var(--color-primary);
  padding: 0.5rem 1rem;
  font-weight: 500;
}

.dashboard-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.dashboard-card-pane {
  background: #ffffff;
  border: 1px solid var(--color-border-slate);
  padding: 2.5rem;
}

.card-pane-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  color: var(--color-primary);
  margin: 0 0 0.25rem 0;
}

.card-pane-sub {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #95a5a6;
  margin: 0 0 2rem 0;
}

/* Inline Modifier Grid */
.blueprint-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-input-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metric-input-field label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #34495e;
  font-weight: 500;
}

.metric-input-field input {
  padding: 0.75rem;
  font-family: var(--font-body);
  border: 1px solid var(--color-border-slate);
  background-color: #fbfbf9;
  outline: none;
  font-size: 0.9rem;
  transition: var(--transition-luxury);
}

.metric-input-field input:focus {
  border-color: var(--color-accent);
  background-color: #ffffff;
}

.btn-dashboard-save {
  width: 100%;
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: 1rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: var(--transition-luxury);
}

.btn-dashboard-save:hover {
  background-color: #1c2d42;
}

/* Client Order Stream Row Layout — capped height so a growing order
   history scrolls within its own card instead of stretching the whole
   dashboard taller with every new commission. */
.orders-stream-box {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 168, 128, 0.45) transparent;
}

.orders-stream-box::-webkit-scrollbar {
  width: 8px;
}

.orders-stream-box::-webkit-scrollbar-track {
  background: transparent;
}

.orders-stream-box::-webkit-scrollbar-thumb {
  background-color: rgba(197, 168, 128, 0.45);
  border-radius: 4px;
}

.orders-stream-box::-webkit-scrollbar-thumb:hover {
  background-color: rgba(197, 168, 128, 0.7);
}

.client-order-row-card {
  border: 1px solid var(--color-border-slate);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: #fbfbf9;
}

.client-order-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.badge-order-id {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.25rem;
}

.client-order-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0 0 0.25rem 0;
  color: var(--color-primary);
}

.client-order-textile {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #7f8c8d;
  margin: 0;
}

.client-order-status-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.pipeline-indicator-pill {
  font-family: var(--font-body);
  font-size: 0.75rem;
  background-color: #e2e8f0;
  color: #4a5568;
  padding: 0.35rem 0.75rem;
  font-weight: 500;
}

.financial-indicator-pill {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  font-weight: 600;
}

.paid-token {
  background-color: #d1fae5;
  color: #065f46;
}

.unpaid-token {
  background-color: #fef3c7;
  color: #92400e;
}

.empty-stream-card {
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed var(--color-border-slate);
}

.empty-stream-card p {
  font-family: var(--font-body);
  color: #7f8c8d;
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

.inline-atelier-link {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.inline-atelier-link:hover {
  text-decoration: underline;
}

@media (max-width: 992px) {
  .dashboard-grid-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .dashboard-wrapper {
    padding: 6rem 2rem 2rem 2rem;
  }
}

/* --- Real-Time Progress Bar & Status Pill Custom Styles --- */
.atelier-progress-track {
  width: 100%;
  background-color: #e2e8f0;
  height: 4px;
  margin-top: 0;
  overflow: hidden;
}

.atelier-progress-bar {
  height: 100%;
  width: 15%;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Production State Dynamic Colors */
.status-pending {
  background-color: #7f8c8d !important;
  color: #ffffff;
}
.pipeline-indicator-pill.status-pending {
  background-color: #e2e8f0;
  color: #4a5568;
}

.status-cutting {
  background-color: #d97706 !important; /* Premium Amber */
}
.pipeline-indicator-pill.status-cutting {
  background-color: #fef3c7;
  color: #b45309;
}

.status-fitting {
  background-color: #2563eb !important; /* Royal Sapphire Blue */
}
.pipeline-indicator-pill.status-fitting {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.status-completed {
  background-color: #16a34a !important; /* Deep Emerald Green */
}
.pipeline-indicator-pill.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

/* ==========================================================================
   PHASE 3 & 4 UPGRADES — SUIT BOSS FASHION
   Inventory Matrix, Live Lookbook, Nav Fixes, Header Stability
   ========================================================================== */

/* ==========================================================================
   TASK 4A — NAVBAR COLOR GLITCH FIX (COMPLETE AUDIT)
   RULE: The header background MUST NEVER flip to white or any light tone.
   The canonical mode definitions (base / .lookbook-mode / .dashboard-mode /
   .internal-header) now live in one place — the "HEADER STATE SYSTEM" block
   near the end of this file. The rules retained here are defensive
   hardening only, guarding against scroll-listener or anchor-jump edge
   cases that the canonical block doesn't otherwise cover.
   ========================================================================== */

/* ── STICKY / SCROLL HARDENING ────────────────────────────────────────────────
   If a scroll listener ever assigns position:sticky or position:fixed to the
   header, this rule guarantees the background stays deep navy — never white.
   The !important chain ensures no inline style or scripted class can override. */
.atelier-header[style*="position: sticky"],
.atelier-header[style*="position:sticky"],
.atelier-header[style*="position: fixed"],
.atelier-header[style*="position:fixed"] {
  background-color: var(--color-primary) !important;
}

/* Anchor jumps must NEVER receive .active regardless of JS timing */
.nav-links a[href="#kaftans"],
.nav-links a[href="#shirts"],
.nav-links a[href="#support"],
.nav-links a[href="#measurement-guide"],
.nav-links a[href="#consultations"] {
  border-bottom: none !important;
}

/* ── NAV LOGOUT BUTTON — preserve luxury tone in all header states ── */
.nav-logout {
  color: var(--color-bg-canvas) !important;
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.nav-logout:hover {
  opacity: 1;
  border-bottom: 1px solid rgba(197, 168, 128, 0.5) !important;
}

/* ── LOOKBOOK SIZE BUTTONS: Phase 4 dynamic size toggles ── */
.lookbook-size-btn {
  border: 1px solid var(--color-border-slate);
  background: transparent;
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 36px;
  text-align: center;
}

.lookbook-size-btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
  color: var(--color-bg-canvas);
}

.lookbook-size-btn.is-active {
  background-color: var(--color-primary);
  color: var(--color-bg-canvas);
  border-color: var(--color-primary);
}

.lookbook-size-btn.is-unavailable {
  opacity: 0.28;
  cursor: not-allowed;
  border-style: dashed;
}

/* Price display — smooth animated value swap */
.lookbook-price-value {
  display: inline-block;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* CTA link inside each lookbook card */
.lookbook-order-cta {
  display: inline-block;
  margin-top: 1.2rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--color-border-slate);
  transition: var(--transition-luxury);
}

.lookbook-order-cta:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ── PHASE 3: INVENTORY MATRIX PANEL ── */

.inventory-matrix-panel {
  background-color: #111111;
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 2.5rem;
  margin-bottom: 3rem;
}

.inventory-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.inventory-panel-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  color: #e8e8e8;
  margin: 0 0 0.25rem 0;
}

.inventory-panel-sub {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: #7f8c8d;
  margin: 0;
}

/* ── LEDGER SECTION HEADERS — light-background context ──────────────────
   inventory-panel-title/sub above are styled for .inventory-matrix-panel's
   own #111111 background. The Commission Order Ledger section has no such
   background — it sits directly on the page's light canvas — so reusing
   those same near-white colors there made the heading nearly invisible.
   These are the correctly-contrasted equivalents for that context. */
.ledger-section-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  color: var(--color-secondary);
  margin: 0 0 0.25rem 0;
}

.ledger-section-sub {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: #5a6672;
  margin: 0;
}

.btn-inventory-add {
  background: var(--color-primary);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  transition: var(--transition-luxury);
  white-space: nowrap;
  margin-top: 10px;
}

.btn-inventory-add:hover {
  background-color: var(--color-accent);
  color: var(--color-primary);
}

/* ── INVENTORY CREATION DRAWER ── */
.inventory-add-drawer {
  background-color: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem;
  margin-bottom: 2rem;
  animation: fadeInDrawer 0.3s ease-out forwards;
}

.drawer-form-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #d8d8d8;
  margin: 0 0 1.75rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.inventory-creation-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.inv-form-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.inv-form-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .inv-form-row--2col {
    grid-template-columns: 1fr;
  }
}

.inv-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.inv-form-field--full {
  width: 100%;
}

.inv-form-field label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9a9a9a;
  font-weight: 500;
}

.inv-form-field input,
.inv-form-field select {
  background-color: #222222;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e8e8e8;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.25s ease;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
}

.inv-form-field input:focus,
.inv-form-field select:focus {
  border-color: var(--color-accent);
  background-color: #262626;
}

.inv-form-field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%237f8c8d' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  cursor: pointer;
}

/* ── GARMENT IMAGE PICKER ──────────────────────────────────────────────
   Two mutually-exclusive source modes (upload from computer / paste a
   URL) sharing one live preview beneath them, so the admin can actually
   see what they're about to publish to the Lookbook rather than trusting
   a pasted link blind. */
.inv-image-source-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.inv-image-source-btn {
  flex: 1;
  background-color: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9a9a9a;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  transition: var(--transition-luxury);
}

.inv-image-source-btn:hover {
  border-color: rgba(197, 168, 128, 0.35);
  color: #d8d8d8;
}

.inv-image-source-btn.is-active {
  background-color: rgba(197, 168, 128, 0.12);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.inv-image-source-panel {
  margin-bottom: 0.75rem;
}

/* --- Upload drop zone --- */
.inv-file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  background-color: #1a1a1a;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  padding: 2rem 1.5rem;
  cursor: pointer;
  color: #7f8c8d;
  transition: var(--transition-luxury);
}

.inv-file-drop-zone:hover,
.inv-file-drop-zone.is-drag-active {
  border-color: var(--color-accent);
  background-color: rgba(197, 168, 128, 0.06);
  color: var(--color-accent);
}

.inv-file-drop-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #d8d8d8;
}

.inv-file-drop-zone:hover .inv-file-drop-text,
.inv-file-drop-zone.is-drag-active .inv-file-drop-text {
  color: var(--color-accent);
}

.inv-file-drop-hint {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: #6a6a6a;
}

/* --- Shared preview --- */
.inv-image-preview-wrap {
  align-items: center;
  gap: 0.85rem;
  background-color: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem;
}

.inv-image-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--color-accent);
  padding: 2px;
  background: #111;
  border-radius: 2px;
  flex-shrink: 0;
}

.inv-image-preview-clear {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: transparent;
  color: #9a9a9a;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-luxury);
  margin-left: auto;
}

.inv-image-preview-clear:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* ── SIZE PRICING BLOCK ── */
.inv-size-pricing-block {
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.5rem;
  background-color: #1e1e1e;
}

.inv-size-pricing-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.inv-size-price-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .inv-size-price-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.inv-size-price-cell {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.inv-size-price-cell label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #c0c0c0;
}

.inv-size-price-cell input {
  width: 100%;
  background-color: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8e8e8;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.6rem 0.5rem;
  text-align: center;
  outline: none;
  transition: border-color 0.25s ease;
}

.inv-size-price-cell input:focus {
  border-color: var(--color-accent);
}

/* ── FORM ACTION BUTTONS ── */
.inv-form-actions {
  display: flex;
  gap: 1rem;
  padding-top: 0.5rem;
  flex-wrap: wrap;
}

.btn-inv-submit {
  background-color: var(--color-accent);
  color: var(--color-primary);
  border: none;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.9rem 2rem;
  cursor: pointer;
  transition: var(--transition-luxury);
}

.btn-inv-submit:hover:not(:disabled) {
  background-color: #d4b97a;
}

.btn-inv-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-inv-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #9a9a9a;
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.9rem 1.5rem;
  cursor: pointer;
  transition: var(--transition-luxury);
}

.btn-inv-cancel:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #e8e8e8;
}

/* ── INVENTORY STREAM GRID (Live Cards) ── */
.inventory-stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.inv-collection-card {
  background-color: #161616;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.inv-collection-card:hover {
  border-color: rgba(197, 168, 128, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.inv-card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  background-color: #1e1e1e;
}

.inv-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.inv-collection-card:hover .inv-card-image {
  transform: scale(1.04);
}

.inv-card-stock-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
}

.badge-in-stock {
  background-color: rgba(22, 163, 74, 0.85);
  color: #ffffff;
}

.badge-out-stock {
  background-color: rgba(220, 38, 38, 0.85);
  color: #ffffff;
}

.inv-card-body {
  padding: 1.25rem;
}

.inv-card-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: #e8e8e8;
  margin: 0 0 0.2rem 0;
}

.inv-card-subtitle {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: #7f8c8d;
  margin: 0 0 1.25rem 0;
}

/* ── LIVE PRICE INPUT GRID (on each inv card) ── */
.inv-card-price-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.inv-card-size-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.inv-card-size-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inv-price-live-input {
  width: 100%;
  background-color: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8e8e8;
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 0.4rem 0.25rem;
  text-align: center;
  outline: none;
  transition: border-color 0.25s ease;
  border-radius: 2px;
  /* Remove number spinners for cleaner look */
  -moz-appearance: textfield;
  appearance: textfield;
}

.inv-price-live-input::-webkit-outer-spin-button,
.inv-price-live-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.inv-price-live-input:focus {
  border-color: var(--color-accent);
  background-color: #242424;
}

/* Confirmed save flash */
.inv-price-live-input[style*="border-color: rgb(22, 163, 74)"] {
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

/* ── STOCK TOGGLE BUTTON ── */
.inv-card-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
}

.btn-inv-toggle-stock {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9a9a9a;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
}

.btn-inv-toggle-stock:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ── ADMIN ORDERS SECTION WRAPPER ── */
.admin-orders-section {
  padding-top: 1rem;
  padding-bottom: 6rem;
}

/* ── LOOKBOOK LOADING STATES ── */
.loading-text {
  font-family: var(--font-body);
  font-size: var(--font-size-small);
  color: #9a9a9a;
  text-align: center;
}

.loading-mini {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #9a9a9a;
}

/* ==========================================================================
   HEADER STATE SYSTEM — CANONICAL SOURCE OF TRUTH
   This is the ONLY place mode-specific header backgrounds are defined.
   Default (no modifier class) = solid Midnight Navy. That covers every
   sub-page automatically. `.lookbook-mode` is the sole exception, used
   for the index.html hero overlay.
   ========================================================================== */

/* dashboard-mode / internal-header: fully opaque navy, locked, no exceptions */
.atelier-header.dashboard-mode,
.atelier-header.internal-header {
  position: relative !important;
  background-color: var(--color-primary) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* lookbook-mode: transparent hero overlay — the only state allowed to be see-through */
.atelier-header.lookbook-mode {
  position: absolute !important;
  top: 0;
  left: 0;
  background-color: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Fix: hero-stage must not render behind the relative-positioned header in dashboard mode */
.dashboard-active-layout .hero-stage {
  display: none;
}

/* ── RESPONSIVE ADJUSTMENTS: Inventory matrix ── */
@media (max-width: 992px) {
  .inventory-stream-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  .inv-card-price-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
  }
  .inv-size-price-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .admin-wrapper {
    padding-top: 2rem;
  }
}

@media (max-width: 576px) {
  .inventory-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-inventory-add {
    width: 100%;
    text-align: center;
  }
  .inv-card-price-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .inventory-stream-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   TASK 4B — GLASS CHECKOUT MODAL OVERLAY COMPONENTS
   Frosted glass RTW order checkout — #ready-order-modal-portal contents
   ========================================================================== */

/* ── MODAL PORTAL WRAPPER ── */
.atelier-modal-portal {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none; /* Inactive when display:none; JS sets display:block */
}

.atelier-modal-portal[style*="display: block"],
.atelier-modal-portal[style*="display:block"] {
  pointer-events: auto;
}

/* ── BACKDROP: Fixed viewport cover with dark amber tint + blur ── */
.atelier-glass-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 19, 32, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.5rem;
}

/* ── MODAL CARD: Dark frosted glass panel ── */
.atelier-glass-modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(197, 168, 128, 0.2);
  padding: 2.5rem;
  color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── MODAL HEADER ── */
.rtw-modal-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(197, 168, 128, 0.15);
  position: relative;
}

.rtw-modal-eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  margin: 0 0 0.4rem 0;
}

.rtw-modal-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  font-weight: 400;
  color: #f0ece6;
  margin: 0;
  padding-right: 2.5rem; /* clearance for close button */
}

/* Close button — top-right corner */
.rtw-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s ease;
}

.rtw-modal-close:hover {
  color: var(--color-accent);
}

/* ── CONFIRMATION CHIPS: read-only size + price ── */
.rtw-modal-confirmation-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.rtw-confirmation-chip {
  flex: 1;
  min-width: 120px;
  background: rgba(197, 168, 128, 0.07);
  border: 1px solid rgba(197, 168, 128, 0.18);
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rtw-chip-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
}

.rtw-chip-value {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: #f0ece6;
  letter-spacing: 0.03em;
}

.rtw-price-value {
  color: var(--color-accent);
}

/* ── FORM FIELDS ── */
.rtw-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rtw-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rtw-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.rtw-input {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f0ece6;
  /* Needed for type="date" inputs (the new delivery-date field) — without
     this, the native calendar picker icon and popup default to light OS
     chrome regardless of how dark this input itself is styled. */
  color-scheme: dark;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.85rem 1rem;
  outline: none;
  transition:
    border-color 0.25s ease,
    background-color 0.25s ease;
  width: 100%;
  resize: none;
}

.rtw-input:focus {
  border-color: var(--color-accent);
  background-color: rgba(197, 168, 128, 0.06);
  box-shadow: 0 0 0 2px rgba(197, 168, 128, 0.12);
}

.rtw-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.rtw-textarea {
  min-height: 80px;
}

/* ── SUBMIT BUTTON: Antique Gold accent ── */
.rtw-modal-submit {
  background-color: var(--color-accent);
  color: var(--color-primary);
  border: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: var(--transition-luxury);
  margin-top: 0.5rem;
  width: 100%;
}

.rtw-modal-submit:hover:not(:disabled) {
  background-color: #d4b97a;
}

.rtw-modal-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── SECURITY NOTE ── */
.rtw-modal-security-note {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  margin: 1.25rem 0 0 0;
  line-height: 1.5;
}

/* ── RESPONSIVE ── */
@media (max-width: 576px) {
  .atelier-glass-modal-card {
    padding: 1.75rem 1.25rem;
    max-width: 100%;
  }

  .rtw-modal-confirmation-row {
    flex-direction: column;
  }

  .rtw-confirmation-chip {
    min-width: unset;
  }
}

/* ==========================================================================
   TASK 4B — ACQUIRE PIECE BUTTON: Lookbook card minimalist action button
   ========================================================================== */
.btn-acquire-piece {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  background-color: var(--color-primary);
  color: var(--color-bg-canvas);
  border: 1px solid var(--color-primary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: var(--transition-luxury);
  text-align: center;
}

.btn-acquire-piece:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary);
}

/* ==========================================================================
   TASK 4A — DELETE BUTTON: .btn-delete-inventory — admin inventory card
   Inherits the inv-card-actions zone; styled with danger crimson micro-border.
   ========================================================================== */
.btn-delete-inventory {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  background: none;
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: rgba(220, 38, 38, 0.75);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-delete-inventory:hover:not(:disabled) {
  background-color: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.65);
  color: #ef4444;
}

.btn-delete-inventory:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── CLIENT ORDER ROW: thumbnail frame alignment ── */
.client-order-top-row {
  align-items: flex-start;
}

/* When a thumbnail is present, give the top row a flex gap so the image
   sits cleanly left of the meta block. The <img> carries its own inline
   styles per spec; this provides the structural context. */
.client-order-top-row img {
  flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE HARDENING — HOME PAGE / LOOKBOOK
   Pure CSS additions only. No HTML structure, JS routing, Firebase hooks,
   or class-toggle mechanics are touched. Every selector below targets
   markup and classes that already exist in index.html / app.js.

   Breakpoints:
     1024px — Tablet / small laptop
      768px — Mobile landscape / phablet
      480px — Mobile portrait (ultimate target)

   Custom properties (--color-primary, --color-accent, --transition-luxury,
   etc.) are consumed as-is from theme.css — no values are hardcoded where
   a token already exists.
   ========================================================================== */

/* --------------------------------------------------------------------------
   D. GLOBAL SAFEGUARD — never let any structural container bleed past
   the viewport edge, regardless of what a scroll listener or dynamically
   mounted card injects.
   -------------------------------------------------------------------------- */
html,
body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* --------------------------------------------------------------------------
   A. HEADER & MOBILE HAMBURGER + GLASS-MORPHIC DRAWER NAVIGATION SYSTEM
   -------------------------------------------------------------------------- */

/* --- Hamburger Trigger ----------------------------------------------------
   Hidden by default (desktop). Revealed only inside the ≤768px media query
   below. Built from three precision-drawn spans — no stock icon set — that
   morph into a clean gold "X" when .is-active is toggled by app.js. */
.atelier-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 60;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 1.5px;
  background-color: var(--color-accent);
  transition: var(--transition-luxury);
  transform-origin: center;
}

.atelier-hamburger.is-active .hamburger-line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.atelier-hamburger.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.atelier-hamburger.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Fixed-position variant used on auth.html, which has no .atelier-header
   bar to sit inside of. A soft glass chip keeps it legible whether it's
   resting over the dark canopy image or the light form pane beneath it. */
.atelier-hamburger.auth-hamburger-fixed {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 90;
  background: rgba(15, 26, 44, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 50%;
}

/* --- Dimming Backdrop ------------------------------------------------------
   Sits behind the drawer panel; tapping it closes the menu. */
.atelier-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 17, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 70;
}

.atelier-drawer-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* --- The Glass-Morphic Drawer Panel ---------------------------------------
   Full-screen slide-in from the right, luxury deceleration curve, authentic
   frosted-glass fill over the Midnight Navy canvas with a hairline gold
   dividing border on the leading edge. */
.atelier-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* dodges mobile browser chrome jump */
  background: rgba(15, 26, 44, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(197, 168, 128, 0.15);
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 80;
  overflow-y: auto;
}

.atelier-mobile-drawer.drawer-active {
  transform: translateX(0);
}

.atelier-mobile-drawer nav {
  height: 100%;
}

.drawer-nav-links {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2.5rem;
  min-height: 100%;
  padding: 4rem 2.5rem;
  list-style: none;
}

.drawer-nav-links a {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 7vw, 2.5rem);
  font-weight: 400;
  color: var(--text-light);
  letter-spacing: 0.02em;
  opacity: 0.82;
  transition: var(--transition-luxury);
}

.drawer-nav-links a:hover,
.drawer-nav-links a.active {
  opacity: 1;
  color: var(--color-accent);
}

/* Locks the underlying page scroll while the drawer is open (belt-and-braces
   alongside the inline document.body.style.overflow toggle in app.js). */
body.atelier-drawer-open {
  overflow: hidden;
}

@media screen and (max-width: 768px) {
  .atelier-header {
    padding: 1rem 1.5rem;
  }

  .header-container {
    flex-wrap: nowrap;
    gap: 1rem;
  }

  .brand-logo {
    font-size: var(--font-size-h3);
    letter-spacing: 0.08em;
    flex-shrink: 0;
  }

  /* The inline desktop link list is replaced by the drawer above it. */
  .header-container > nav {
    display: none;
  }

  .atelier-hamburger {
    display: flex;
    margin-left: auto;
  }
}

@media screen and (max-width: 480px) {
  .atelier-header {
    padding: 0.85rem 1rem;
  }

  .drawer-nav-links {
    padding: 3.5rem 1.75rem;
    gap: 2rem;
  }
}

/* --------------------------------------------------------------------------
   A-2. SMALL-SCREEN POLISH — AUTH SPLIT PANE & SUCCESS CARD
   -------------------------------------------------------------------------- */
@media screen and (max-width: 480px) {
  .auth-hamburger-fixed {
    top: 1rem;
    right: 1rem;
  }

  .auth-canopy-pane {
    min-height: 220px;
    padding: 2.5rem 1.5rem;
  }

  .auth-editorial-headline {
    font-size: 1.85rem;
  }

  .auth-editorial-sub {
    font-size: var(--font-size-body);
  }

  .auth-form-pane {
    padding: 3rem 1.5rem;
  }

  .success-viewport {
    padding: 1.25rem;
  }

  .success-card {
    padding: 2.75rem 1.5rem;
  }

  .receipt-id {
    font-size: 1.3rem;
    word-break: break-word;
  }
}

/* --------------------------------------------------------------------------
   B. HERO / LOOKBOOK STAGE COVER LAYER
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
  .hero-stage {
    height: 100svh; /* dodges mobile browser chrome jump better than 100vh */
    padding: 0 1.75rem;
    /* Fixed attachment is a known cause of jank + overflow on mobile Safari */
    background-attachment: scroll;
    background-position: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-tagline {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
  }

  .hero-title {
    font-size: clamp(2.2rem, 7vw, var(--font-size-hero));
    line-height: 1.15;
  }

  .hero-content .btn-premium-pill {
    padding: 0.85rem 1.9rem;
  }
}

@media screen and (max-width: 480px) {
  .hero-stage {
    padding: 0 1.25rem;
  }

  .hero-title {
    font-size: 2.2rem; /* explicit mobile-portrait token per spec */
  }

  .hero-tagline {
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
  }
}

/* Background hero media — protects aspect ratio across narrow smartphone
   viewports whenever an <img>/<video> element (rather than a CSS
   background) is used for the hero or auth canopy layer. */
.hero-bg-media,
.auth-bg-media {
  object-fit: cover;
  object-position: center;
}

/* --------------------------------------------------------------------------
   C. LOOKBOOK PORTFOLIO GRID SYSTEM (.atelier-grid / .atelier-card)

   Deliberately explicit column counts rather than auto-fill/minmax: with
   auto-fill, the actual column count depends on a live calculation against
   the card's minmax() floor, the grid gap, and the section's padding —
   three numbers that are each independently reasonable in isolation but
   can combine to silently produce 2 columns on a phone. Pinning the exact
   column count per range removes that ambiguity entirely:
     • ≤767px            → 1 column   (phones)
     • 768px – 1024px     → 2 columns  (standard tablets)
     • ≥1025px (default)  → 3 columns  (.atelier-card grid-column: span 4
                                          against the base 12-col grid)
   -------------------------------------------------------------------------- */

/* The "Commission Your Exact Proportions" CTA card always spans the full
   row width below desktop, regardless of the column count in that range. */
@media screen and (max-width: 1024px) {
  .cta-highlight-card {
    grid-column: 1 / -1 !important;
  }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
  .storefront-section {
    padding: 4.5rem 2.5rem;
  }

  .atelier-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  /* Release the fixed 4-of-12 span so cards fill one of the two explicit
     tracks above instead of forcing the old 3-per-row desktop math. */
  .atelier-card {
    grid-column: auto;
  }
}

@media screen and (max-width: 767px) {
  .storefront-section {
    padding: 3rem 1.5rem;
  }

  .section-header {
    margin-bottom: 2.25rem;
  }

  .section-title {
    font-size: var(--font-size-h2);
  }

  /* Single-column stack — the deterministic guarantee against overlap or
     compression of card actions, metadata text, images, and badges on any
     phone, from the smallest budget Android up through Pro Max-class
     devices. */
  .atelier-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .atelier-card {
    grid-column: auto;
  }

  .product-media {
    aspect-ratio: 4/3;
  }

  .product-details {
    padding: 1.25rem;
  }

  .product-name {
    font-size: 1.3rem;
  }

  .product-meta-row {
    margin-bottom: 0.75rem;
  }

  .size-selector-group {
    flex-wrap: wrap;
  }

  .size-box {
    padding: 0.5rem 0.9rem;
  }

  /* Touch target hardening — boutique action controls must clear 44px */
  .btn-acquire-piece,
  .size-box {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   FOOTER — fluid collapse to protect the same 480px/768px targets
   (kept here rather than duplicating the footer's own block above, since
   it is part of the homepage's below-the-fold layout).
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
  .footer-wrapper {
    grid-template-columns: repeat(6, 1fr);
    gap: 2.5rem;
  }

  .footer-column.brand-column {
    grid-column: span 6;
  }

  .footer-column.status-column {
    grid-column: span 6;
    text-align: left;
    align-items: flex-start;
  }

  .footer-column {
    grid-column: span 3;
  }
}

@media screen and (max-width: 768px) {
  .atelier-footer {
    padding: 4rem 1.5rem 2.5rem 1.5rem;
  }

  .footer-wrapper {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 1.5rem;
  }

  .footer-column.brand-column,
  .footer-column.status-column {
    grid-column: span 2;
  }

  .footer-statement {
    max-width: 100%;
  }

  .footer-sub-container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media screen and (max-width: 480px) {
  .footer-wrapper {
    grid-template-columns: 1fr;
  }

  .footer-column.brand-column,
  .footer-column.status-column,
  .footer-column {
    grid-column: span 1;
  }

  .footer-column.status-column {
    align-items: flex-start;
    text-align: left;
  }
}

/* ============================================================================
   ADMIN & CLIENT DASHBOARD PORTAL — MOBILE RESPONSIVENESS
   Everything mounted into #main-content at the #dashboard / #account hash
   routes (mountAtelierDashboard in dashboard.js): the client's own ledger +
   sizing blueprint view, and — for admin/tailor accounts — the workshop
   terminal (order queue, inventory matrix, financial summary). None of this
   had dedicated mobile treatment before; the storefront/auth/checkout pages
   did. This section brings the portal up to the same standard.
   ============================================================================ */

/* --- A. Shared containers (both client + admin views) --- */
@media screen and (max-width: 768px) {
  .dashboard-wrapper {
    padding: 6.5rem 1.5rem 2.5rem 1.5rem;
  }

  .admin-wrapper {
    padding-top: 6.5rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .dashboard-header-row {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .dash-welcome-title {
    font-size: 1.9rem;
  }

  .admin-panel-title {
    font-size: 1.9rem;
  }

  .dashboard-card-pane {
    padding: 1.75rem;
  }
}

@media screen and (max-width: 480px) {
  .dashboard-wrapper {
    padding: 6rem 1.1rem 2rem 1.1rem;
  }

  .admin-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .dash-welcome-title,
  .admin-panel-title {
    font-size: 1.6rem;
  }

  .dashboard-card-pane {
    padding: 1.4rem;
  }
}

/* --- B. Client ledger — sizing blueprint form --- */
@media screen and (max-width: 600px) {
  /* Two number-input columns get thumb-cramped once each is under ~140px
     wide. One column keeps every field a comfortable, unambiguous tap
     target on any phone. */
  .blueprint-input-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}

/* --- C. Admin — Ready-To-Wear toggle summary card --- */
@media screen and (max-width: 480px) {
  .admin-summary-grid {
    flex-wrap: wrap !important;
  }

  .admin-summary-card {
    flex-basis: 100% !important;
    max-width: 100% !important;
  }
}

/* --- D. Admin — Financial Summary Matrix ---
   .financial-matrix-hub is inline-styled with a fixed
   `grid-template-columns: repeat(3, 1fr)`; an external rule needs
   !important to win over that inline declaration at the breakpoints
   where 3 cramped columns stop being readable. */
@media screen and (max-width: 700px) {
  .financial-matrix-hub {
    grid-template-columns: 1fr !important;
  }

  .fin-metric-block p[id^="fin-metric-"] {
    font-size: 1.75rem !important;
  }
}

/* --- E. Admin — Order queue cards (.admin-order-card / .admin-order-row) ---
   .admin-order-row already collapses to a single column at 768px; this
   just tightens the surrounding card padding and gives the top row
   (order ID + status pill) room to wrap on the narrowest phones. */
@media screen and (max-width: 480px) {
  .admin-order-card {
    padding: 1.25rem;
  }

  .client-order-top-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .order-utility-bar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* --- F. Admin — Inventory Matrix panel + add-collection form --- */
@media screen and (max-width: 768px) {
  .inventory-matrix-panel {
    padding: 1.75rem 1.25rem;
  }

  .inventory-add-drawer {
    padding: 1.5rem 1.25rem;
  }
}

@media screen and (max-width: 600px) {
  /* Same fragile auto-fill/minmax pattern the storefront lookbook grid
     had — pinning it to a single column removes the ambiguity rather
     than relying on a live width calculation to land on 1 column. */
  .inventory-stream-grid {
    grid-template-columns: 1fr;
  }

  /* The read-only 5-size price display on each inventory card was
     missing the same 3-column safety net its sibling form grid
     (.inv-size-price-grid) already had at this exact breakpoint. */
  .inv-card-price-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .drawer-inner-grid {
    grid-template-columns: 1fr;
  }

  .orders-stream-box,
  .admin-stream-container {
    max-height: 65vh;
    padding-right: 0.25rem;
  }
}

/* --- G. Touch target hardening across the whole portal ---
   Matches the 44px minimum already applied to the storefront's size
   selectors and Acquire Piece buttons. */
@media screen and (max-width: 768px) {
  .btn-dashboard-save,
  .btn-inventory-add,
  .btn-inv-submit,
  .btn-inv-cancel,
  .btn-delete-inventory,
  .btn-inv-toggle-stock,
  .btn-send-delivery-note,
  .status-modifier-dropdown,
  .billing-modifier-dropdown,
  .btn-delete-order,
  .order-attended-toggle input[type="checkbox"] {
    min-height: 44px;
  }
}


/* ============================================================================
   ADMIN — BOUTIQUE ORDERS LAUNCH CARD, GLASS MODAL, & SCROLLABLE INVENTORY
   ============================================================================ */

/* --- A. Ready-To-Wear launch card (replaces the old inline-styled toggle
   button — it no longer swaps state, it opens the modal below) --- */
.rtw-summary-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 320px;
  max-width: 420px;
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(197, 168, 128, 0.22);
  background: var(--color-primary);
  color: var(--text-light);
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  transition: var(--transition-luxury);
  font-family: inherit;
}

.rtw-summary-card:hover,
.rtw-summary-card:focus-visible {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.rtw-summary-card:active {
  transform: translateY(0);
}

.rtw-summary-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(197, 168, 128, 0.12);
  color: var(--color-accent);
}

.rtw-summary-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rtw-summary-card-eyebrow {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.rtw-summary-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rtw-summary-card-hint {
  font-family: var(--font-body);
  font-size: 0.78rem;
  opacity: 0.7;
  margin-top: 0.3rem;
}

.rtw-summary-card-arrow {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--color-accent);
  opacity: 0.7;
  transition: var(--transition-luxury);
}

.rtw-summary-card:hover .rtw-summary-card-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* Live order-count badge — hidden (display:none) until dashboard.js finds
   rtwCount > 0 on the financial summary snapshot */
.rtw-toggle-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--color-accent);
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary);
}

/* --- B. Boutique Orders glass modal --- */
.admin-glass-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 17, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-glass-modal-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.admin-glass-modal {
  width: 100%;
  max-width: 920px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: rgba(15, 26, 44, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(197, 168, 128, 0.25);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.admin-glass-modal-backdrop.is-active .admin-glass-modal {
  transform: translateY(0) scale(1);
}

.admin-glass-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid rgba(197, 168, 128, 0.18);
  flex-shrink: 0;
}

.admin-glass-modal-eyebrow {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.35rem;
}

.admin-glass-modal-title {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--text-light);
  margin: 0 0 0.4rem 0;
}

.admin-glass-modal-sub {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 46ch;
}

.admin-glass-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-light);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-luxury);
}

.admin-glass-modal-close:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: rotate(90deg);
}

/* The scrollable body — this is the actual "responsive glass scrollable
   modal" requirement. Header stays put; only the order list scrolls. */
.admin-glass-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem 2rem 2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 168, 128, 0.45) transparent;
}

.admin-glass-modal-body::-webkit-scrollbar {
  width: 8px;
}

.admin-glass-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.admin-glass-modal-body::-webkit-scrollbar-thumb {
  background-color: rgba(197, 168, 128, 0.45);
  border-radius: 4px;
}

.admin-glass-modal-body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(197, 168, 128, 0.7);
}

/* Order cards render dark (.admin-order-card) inside a light-adjacent admin
   panel elsewhere, but inside the glass modal they need to read correctly
   against the frosted navy — the existing dark card styling already suits
   this context directly, no override needed. */

/* Fully responsive: edge-to-edge sheet on phones instead of a centered card */
@media screen and (max-width: 700px) {
  .admin-glass-modal-backdrop {
    padding: 0;
  }

  .admin-glass-modal {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .admin-glass-modal-header {
    padding: 1.5rem 1.25rem;
  }

  .admin-glass-modal-title {
    font-size: 1.5rem;
  }

  .admin-glass-modal-body {
    padding: 1.25rem 1.25rem 2rem 1.25rem;
  }
}

/* --- C. Scrollable inventory matrix ---
   Caps the collection grid's height so a growing product catalog scrolls
   within its own panel instead of pushing the rest of the admin dashboard
   (order queue, financial summary) further and further down the page. */
.inventory-stream-grid {
  max-height: 620px;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 168, 128, 0.45) transparent;
}

.inventory-stream-grid::-webkit-scrollbar {
  width: 8px;
}

.inventory-stream-grid::-webkit-scrollbar-track {
  background: transparent;
}

.inventory-stream-grid::-webkit-scrollbar-thumb {
  background-color: rgba(197, 168, 128, 0.45);
  border-radius: 4px;
}

.inventory-stream-grid::-webkit-scrollbar-thumb:hover {
  background-color: rgba(197, 168, 128, 0.7);
}

@media screen and (max-width: 768px) {
  .inventory-stream-grid {
    max-height: 70vh;
  }
}

@media screen and (max-width: 480px) {
  .inventory-stream-grid {
    max-height: 65vh;
    padding-right: 0.25rem;
  }
}


/* ============================================================================
   REAL-TIME ATELIER CHAT — GLASSMORPHIC MESSAGING WIDGET
   Built by chat-engine.js (initClientChat / initAdminChat). One shared shell
   — floating launcher + slide-up panel — with role-specific content inside:
   a single support thread for clients, a two-pane inbox for staff.
   ============================================================================ */

.atelier-chat-widget {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 150;
}

/* --- Launcher --- */
.atelier-chat-launcher {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(197, 168, 128, 0.45);
  background: rgba(15, 26, 44, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  transition: var(--transition-luxury);
}

.atelier-chat-launcher:hover {
  transform: translateY(-3px);
  border-color: var(--color-accent);
}

.atelier-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  background: #c0392b;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary);
}

/* --- Panel: strong, visible glass — the whole point of this treatment ---
   Sized for an actual reading/typing surface rather than a quick utility
   popover — the previous compact pass (320×440) made composing anything
   longer than a short line feel cramped, which is exactly what this fixes. */
.atelier-chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.75rem;
  width: 400px;
  max-width: calc(100vw - 2rem);
  height: 600px;
  max-height: calc(100vh - 7.5rem);
  display: flex;
  flex-direction: column;
  background: rgba(15, 26, 44, 0.82);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  border: 1px solid rgba(197, 168, 128, 0.4);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  z-index: 151;
}

.atelier-chat-panel.is-active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.atelier-chat-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(197, 168, 128, 0.22);
  flex-shrink: 0;
}

.atelier-chat-eyebrow {
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.2rem;
}

.atelier-chat-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-light);
  margin: 0;
}

.atelier-chat-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--text-light);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-luxury);
}

.atelier-chat-close:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: rotate(90deg);
}

.atelier-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* required for the nested scroll region to actually scroll */
}

/* --- Message thread (client single-thread + admin's active thread pane) --- */
.chat-thread-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 168, 128, 0.45) transparent;
}

.chat-thread-scroll::-webkit-scrollbar {
  width: 6px;
}

.chat-thread-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.chat-thread-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(197, 168, 128, 0.45);
  border-radius: 3px;
}

.chat-empty-state,
.atelier-chat-body .loading-mini {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  margin: auto;
  padding: 1rem;
}

.chat-bubble-row {
  display: flex;
  position: relative;
}

.chat-bubble-row.is-mine {
  justify-content: flex-end;
}

.chat-bubble {
  position: relative;
  max-width: 80%;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
}

.chat-bubble.is-deleted {
  background: rgba(255, 255, 255, 0.04);
  border-style: dashed;
}

.chat-bubble-deleted-text {
  font-style: italic;
  color: rgba(255, 255, 255, 0.4) !important;
}

.chat-bubble-row.is-mine .chat-bubble {
  background: rgba(197, 168, 128, 0.92);
  border-color: var(--color-accent);
}

.chat-bubble-text {
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-light);
  word-break: break-word;
  white-space: pre-wrap;
  padding-right: 1.1rem; /* clears the kebab button on own messages */
}

.chat-bubble-row.is-mine .chat-bubble-text {
  color: var(--color-primary);
}

.chat-bubble-time {
  display: block;
  font-size: 0.6rem;
  margin-top: 0.25rem;
  color: rgba(255, 255, 255, 0.5);
}

.chat-bubble-row.is-mine .chat-bubble-time {
  color: rgba(15, 26, 44, 0.6);
}

.chat-bubble-edited-tag {
  font-style: italic;
}

/* --- Message action kebab (own messages only) --- */
.chat-bubble-menu-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.35rem;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(15, 26, 44, 0.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition-luxury);
}

.chat-bubble-menu-btn:hover {
  background: rgba(15, 26, 44, 0.12);
  color: var(--color-primary);
}

/* --- Floating message context menu (copy / edit / delete / forward) --- */
.chat-bubble-context-menu {
  position: fixed;
  min-width: 150px;
  max-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(15, 26, 44, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(197, 168, 128, 0.4);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  padding: 0.35rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.chat-bubble-context-menu[hidden] {
  display: none;
}

.chat-bubble-context-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 0.76rem;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-luxury);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-bubble-context-menu button:hover {
  background: rgba(197, 168, 128, 0.16);
}

.chat-bubble-context-menu button.is-danger {
  color: #e57373;
}

.chat-bubble-context-menu button.is-danger:hover {
  background: rgba(229, 115, 115, 0.14);
}

.chat-bubble-context-menu button svg {
  flex-shrink: 0;
}

.chat-menu-label {
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  padding: 0.35rem 0.6rem 0.1rem 0.6rem;
}

/* --- Edit-mode composer banner --- */
.chat-editing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  background: rgba(197, 168, 128, 0.1);
  border-top: 1px solid rgba(197, 168, 128, 0.22);
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--color-accent);
  flex-shrink: 0;
}

.chat-editing-banner span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-editing-banner button {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-decoration: underline;
  cursor: pointer;
}

.chat-editing-banner button:hover {
  color: var(--text-light);
}

/* --- Input row ---
   align-items: flex-end keeps the send button anchored to the bottom edge
   as the textarea grows taller with a longer message, instead of drifting
   to a vertically-centered position that looks off once the box isn't a
   single line anymore. */
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid rgba(197, 168, 128, 0.22);
  flex-shrink: 0;
}

.chat-input-row textarea {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 0.55rem 0.9rem;
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.4;
  outline: none;
  resize: none;
  /* Mirrors the 140px cap in autoGrowTextarea() — grows with content up to
     this height, then scrolls internally instead of pushing the panel
     layout around. */
  max-height: 140px;
  overflow-y: auto;
  transition: border-color 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 168, 128, 0.45) transparent;
}

.chat-input-row textarea::-webkit-scrollbar {
  width: 5px;
}

.chat-input-row textarea::-webkit-scrollbar-thumb {
  background-color: rgba(197, 168, 128, 0.45);
  border-radius: 3px;
}

.chat-input-row textarea:focus {
  border-color: var(--color-accent);
}

.chat-input-row textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-send-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-luxury);
}

.chat-send-btn:hover {
  background: #d8bf98;
  transform: scale(1.06);
}

/* --- Admin two-pane inbox layout --- */
.chat-admin-layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.chat-admin-list {
  width: 42%;
  flex-shrink: 0;
  border-right: 1px solid rgba(197, 168, 128, 0.22);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(197, 168, 128, 0.45) transparent;
}

.chat-admin-list::-webkit-scrollbar {
  width: 6px;
}

.chat-admin-list::-webkit-scrollbar-thumb {
  background-color: rgba(197, 168, 128, 0.45);
  border-radius: 3px;
}

.chat-convo-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: var(--text-light);
  text-align: left;
  cursor: pointer;
  position: relative;
  width: 100%;
  transition: var(--transition-luxury);
}

.chat-convo-item:hover,
.chat-convo-item.is-active {
  background: rgba(197, 168, 128, 0.14);
}

.chat-convo-item.has-unread {
  background: rgba(197, 168, 128, 0.08);
}

.chat-convo-email {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding-right: 1.5rem;
}

.chat-convo-preview {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.chat-convo-unread-dot {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #c0392b;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.chat-admin-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.chat-admin-back {
  display: none; /* revealed only on mobile, see media query below */
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: transparent;
  color: var(--color-accent);
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 0.75rem 1rem 0 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* --- Responsive: single-pane-at-a-time inbox on small phones --- */
@media screen and (max-width: 560px) {
  .atelier-chat-widget {
    bottom: 1.1rem;
    right: 1.1rem;
  }

  .atelier-chat-panel {
    right: 0.85rem;
    left: 0.85rem;
    width: auto;
    max-width: none;
    bottom: 4.75rem;
    height: min(620px, calc(100vh - 6rem));
  }

  .chat-admin-list,
  .chat-admin-thread {
    width: 100%;
  }

  .chat-admin-list {
    border-right: none;
  }

  .chat-admin-thread {
    display: none;
  }

  .chat-admin-layout.is-thread-active .chat-admin-list {
    display: none;
  }

  .chat-admin-layout.is-thread-active .chat-admin-thread {
    display: flex;
  }

  .chat-admin-back {
    display: flex;
  }
}

@media screen and (max-width: 400px) {
  .atelier-chat-launcher {
    width: 46px;
    height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atelier-chat-panel {
    transition: opacity 0.2s ease;
  }
}