/* ==========================================================================
   KD ESTIMATE PRO — LUXURY AESTHETIC DESIGN SYSTEM (APK PARITY)
   Obsidian Cream (#F8F5F0) & Imperial Champagne Rose Gold (#B89574)
   ========================================================================== */

:root {
  /* Ultra-Luxury Nude Palette */
  --bg-obsidian: #F8F5F0;        /* Soft Cream Nude Background */
  --card-bg: #FFFFFF;            /* Pure Crisp White Cards */
  --card-surface: #F2ECE4;       /* Soft Nude Control Surface */
  --card-elevated: #EBE3D8;      /* Elevated Nude Surface */
  --glass-border: #E5DDD3;       /* Hairline Nude Border */
  --border-gold: #D9CCB8;        /* Soft Gold Border */

  /* Gold / Champagne Accents */
  --gold-primary: #B89574;       /* Warm Nude Rose Gold Primary */
  --gold-accent: #8C6E54;        /* Rich Nude Espresso Accent */
  --gold-dark: #6E533C;
  --gold-glow: rgba(184, 149, 116, 0.16);
  --gold-gradient: linear-gradient(135deg, #C8A584 0%, #A68262 100%);
  --b2c-card-gradient: linear-gradient(135deg, #FFFFFF 0%, #F7F2EA 100%);

  /* Sapphire Slate Accents (B2B) */
  --sapphire-primary: #6B82A8;
  --sapphire-accent: #4A6288;
  --sapphire-dark: #334A6E;
  --sapphire-glow: rgba(107, 130, 168, 0.16);
  --sapphire-gradient: linear-gradient(135deg, #6B82A8 0%, #4A6288 100%);
  --b2b-card-gradient: linear-gradient(135deg, #F4F7FB 0%, #E8EEF7 100%);

  /* Utility & Status Colors */
  --emerald: #2D8A56;
  --rose: #D9534F;
  --amber: #C89047;

  /* Typography Colors */
  --text-primary: #2C2520;       /* Rich Espresso Charcoal #2C2520 */
  --text-secondary: #7A6F68;     /* Warm Muted Taupe #7A6F68 */
  --text-muted: #A39890;

  /* Elevation Shadows */
  --shadow-sm: 0 2px 8px rgba(44, 37, 32, 0.04);
  --shadow-md: 0 6px 20px rgba(184, 149, 116, 0.12);
  --shadow-lg: 0 14px 34px rgba(44, 37, 32, 0.08);

  /* Fonts */
  --font-serif: 'Cinzel', 'Playfair Display', Georgia, serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Layout */
  --max-screen-width: 580px;     /* Mobile/Tablet Executive Frame */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: #EFE9E0;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* App Shell Container (Mimics Native APK on Phone / Tablet / Desktop) */
#appRoot {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.device-viewport {
  width: 100%;
  max-width: var(--max-screen-width);
  height: 100%;
  background-color: var(--bg-obsidian);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(44, 37, 32, 0.15);
}

@media (min-width: 900px) {
  .device-viewport {
    height: 96vh;
    border-radius: 28px;
    border: 1px solid var(--border-gold);
  }
}

/* Views Navigation Stack */
.screen-view {
  position: absolute;
  inset: 0;
  background-color: var(--bg-obsidian);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.25s ease;
  z-index: 10;
}

.screen-view.hidden {
  display: none !important;
}

.screen-view.slide-left {
  transform: translateX(-100%);
  opacity: 0;
}

.screen-view.slide-right {
  transform: translateX(100%);
  opacity: 0;
}

.screen-view.active {
  transform: translateX(0);
  opacity: 1;
  z-index: 20;
}

/* Common App Bar (AppBar matching Flutter) */
.apk-appbar {
  height: 60px;
  background-color: var(--bg-obsidian);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(229, 221, 211, 0.7);
  flex-shrink: 0;
  z-index: 30;
}

.apk-appbar-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.apk-appbar-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-glow);
  border: 1.2px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-accent);
  flex-shrink: 0;
}

.apk-appbar-icon-badge.b2b {
  background: var(--sapphire-glow);
  border-color: var(--sapphire-primary);
  color: var(--sapphire-primary);
}

.apk-appbar-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.0px;
  color: var(--gold-accent);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apk-appbar-title.b2b {
  color: var(--sapphire-primary);
}

.apk-appbar-subtitle {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apk-appbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.apk-icon-btn {
  background: none;
  border: none;
  color: var(--gold-accent);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.apk-icon-btn:hover {
  background: var(--gold-glow);
}

.apk-icon-btn.b2b {
  color: var(--sapphire-primary);
}
.apk-icon-btn.b2b:hover {
  background: var(--sapphire-glow);
}

/* Scrollable Screen Body */
.screen-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

/* Bottom Bar Padding */
.pad-bottom-nav {
  padding-bottom: 96px;
}
.pad-bottom-sheet {
  padding-bottom: 180px;
}

/* ==========================================================================
   1. SCREEN: PIN LOGIN SCREEN
   ========================================================================== */

#pinLoginScreen {
  background-color: var(--bg-obsidian);
  justify-content: center;
  align-items: center;
  padding: 24px;
  z-index: 100;
}

.pin-emblem-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gold-glow);
  border: 1.8px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-accent);
  margin-bottom: 20px;
  box-shadow: 0 0 24px var(--gold-glow);
}

.pin-title-text {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2.0px;
  color: var(--gold-accent);
}

.pin-subtitle-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 28px;
}

.pin-dots-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.pin-dot-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  background: transparent;
  transition: all 0.2s;
}

.pin-dot-circle.filled {
  background: var(--gold-accent);
  transform: scale(1.15);
  box-shadow: 0 0 10px var(--gold-glow);
}

.pin-error-text {
  color: var(--rose);
  font-size: 12px;
  font-weight: 600;
  min-height: 20px;
  margin-bottom: 18px;
}

/* Tactile Keypad */
.pin-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.pin-key-btn {
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--card-surface);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.pin-key-btn:hover {
  background: var(--card-elevated);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

.pin-key-btn:active {
  background: var(--gold-glow);
  transform: translateY(1px);
}

.pin-key-btn.action-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ==========================================================================
   2. SCREEN: MAIN NAVIGATION SCREEN (DASHBOARD, ESTIMATES, CLIENTS)
   ========================================================================== */

/* Floating Pill Bottom Navigation Bar (Identical to Flutter Container) */
.floating-bottom-nav {
  position: absolute;
  bottom: 14px;
  left: 18px;
  right: 18px;
  height: 62px;
  background: var(--card-bg);
  border-radius: 32px;
  border: 1.2px solid var(--glass-border);
  box-shadow: 0 6px 22px rgba(44, 37, 32, 0.08);
  display: flex;
  align-items: center;
  padding: 4px 8px;
  z-index: 50;
}

.nav-pill-item {
  flex: 1;
  height: 48px;
  border-radius: 24px;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-pill-item.active {
  background: var(--gold-primary);
  color: #FFFFFF;
}

.nav-pill-item span {
  font-size: 10.5px;
  font-weight: 600;
}
.nav-pill-item.active span {
  font-weight: 700;
}

/* Top PRO Badge on Dashboard */
.pro-badge-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--card-surface);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-accent);
}

/* Dashboard Section Headers */
.section-heading-caps {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-accent);
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

/* Big Action Launch Buttons */
.btn-portal-launch {
  width: 100%;
  height: 56px;
  border-radius: 16px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.0px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.btn-portal-launch:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-portal-launch.b2c {
  background: var(--gold-primary);
}

.btn-portal-launch.b2b {
  background: var(--sapphire-primary);
}

/* Outlined Action Buttons */
.btn-outlined-action {
  width: 100%;
  height: 50px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1.2px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.btn-outlined-action:hover {
  border-color: var(--gold-primary);
  color: var(--gold-accent);
}

.btn-outlined-action.gold-border {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* Bullion Rates Card on Dashboard */
.bullion-dashboard-card {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.live-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--emerald-green);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.btn-edit-rates-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(184, 150, 106, 0.12);
  border: 1px solid rgba(184, 150, 106, 0.35);
  color: var(--gold-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-edit-rates-badge:hover {
  background: var(--gold-primary);
  color: #FFFFFF;
}

.bullion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.bullion-item-tile {
  background: var(--card-surface);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.bullion-item-purity {
  font-size: 10.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.bullion-item-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-accent);
  margin-top: 2px;
}

/* B2B Bullion Card Variant */
.bullion-dashboard-card.b2b {
  background: var(--b2b-card-gradient);
  border: 1px solid rgba(107, 130, 168, 0.28);
  box-shadow: 0 4px 18px rgba(107, 130, 168, 0.08);
}

.live-dot-pulse.sapphire {
  background-color: var(--sapphire-primary);
  box-shadow: 0 0 0 0 rgba(107, 130, 168, 0.7);
  animation: pulseSapphire 2s infinite;
}

@keyframes pulseSapphire {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(107, 130, 168, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(107, 130, 168, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(107, 130, 168, 0);
  }
}

.btn-edit-rates-badge.b2b {
  background: rgba(107, 130, 168, 0.12);
  border: 1px solid rgba(107, 130, 168, 0.35);
  color: var(--sapphire-primary);
}

.btn-edit-rates-badge.b2b:hover {
  background: var(--sapphire-primary);
  color: #FFFFFF;
}

.bullion-item-tile.b2b {
  background: #FFFFFF;
  border: 1px solid rgba(107, 130, 168, 0.14);
}

.bullion-item-price.b2b {
  color: var(--sapphire-accent);
}

/* Rates Modal Tab Switcher */
.rates-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--glass-border);
  background: var(--card-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rates-tab-btn.active.b2c {
  background: var(--gold-primary);
  color: #FFFFFF;
  border-color: var(--gold-primary);
}

.rates-tab-btn.active.b2b {
  background: var(--sapphire-primary);
  color: #FFFFFF;
  border-color: var(--sapphire-primary);
}

/* ==========================================================================
   3. SCREEN: ESTIMATES TAB (MODE SELECTION)
   ========================================================================== */

.portal-feature-card {
  background: var(--card-bg);
  border-radius: 22px;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 6px 18px var(--gold-glow);
  padding: 18px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.22s ease;
}

.portal-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px var(--gold-glow);
}

.portal-feature-card.b2b {
  border-color: var(--sapphire-primary);
  box-shadow: 0 6px 18px var(--sapphire-glow);
}

.portal-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-circle-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold-glow);
  border: 1.2px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-accent);
  flex-shrink: 0;
}

.portal-feature-card.b2b .portal-circle-icon {
  background: var(--sapphire-glow);
  border-color: var(--sapphire-primary);
  color: var(--sapphire-primary);
}

.portal-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-accent);
}
.portal-feature-card.b2b .portal-card-title {
  color: var(--sapphire-primary);
}

.portal-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.rates-overview-chip-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border);
  overflow-x: auto;
}

.rate-badge {
  background: var(--card-surface);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.rate-badge strong {
  color: var(--text-primary);
}

/* ==========================================================================
   4. SCREEN: QUOTATION EDITOR (HOME SCREEN)
   ========================================================================== */

/* Mode Pill in Header */
.appbar-mode-pill {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--gold-glow);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
}

.appbar-mode-pill.b2b {
  background: var(--sapphire-glow);
  border-color: var(--sapphire-primary);
  color: var(--sapphire-primary);
}

/* Card Section Container (Matches Flutter Cards) */
.apk-card {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.apk-card.bordered-accent {
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 4px 16px var(--gold-glow);
}

.apk-card.bordered-accent.b2b {
  border-color: var(--sapphire-primary);
  box-shadow: 0 4px 16px var(--sapphire-glow);
}

/* Client Name Input Field */
.client-input-wrapper {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  padding: 4px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.client-name-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 14px 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
  text-transform: uppercase;
}

.client-name-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
}

/* Multi-Photo Attachment Section */
.photo-strip-box {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  padding: 16px;
  margin-bottom: 16px;
}

.photo-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.photo-grid-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px;
}

.photo-picker-tile {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  border: 1.5px dashed var(--gold-primary);
  background: var(--card-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gold-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.photo-thumb-tile {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  border: 1.5px solid var(--border-gold);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.photo-thumb-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tag-pill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(44, 37, 32, 0.85);
  color: #FFF;
  font-size: 8px;
  text-align: center;
  padding: 2px 0;
  font-weight: 700;
}

.photo-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--rose);
  color: #FFF;
  border: none;
  font-size: 10px;
  cursor: pointer;
}

/* ==========================================================================
   JEWELLERY ITEM CARD (EXACT FLUTTER PARITY)
   ========================================================================== */

.jewellery-item-container {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 6px 18px var(--gold-glow);
  padding: 16px;
  margin-bottom: 18px;
}

.jewellery-item-container.b2b {
  border-color: var(--sapphire-primary);
  box-shadow: 0 6px 18px var(--sapphire-glow);
}

.item-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.item-index-badge {
  background: var(--gold-primary);
  color: #000;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
}
.jewellery-item-container.b2b .item-index-badge {
  background: var(--sapphire-primary);
  color: #FFF;
}

.item-category-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.item-subtotal-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-accent);
}
.jewellery-item-container.b2b .item-subtotal-header {
  color: var(--sapphire-primary);
}

/* Plain Gold vs Diamond Jewellery Pills */
.jtype-switch-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.jtype-pill {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--card-surface);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.jtype-pill.active {
  background: var(--card-bg);
  border-color: var(--gold-primary);
  color: var(--gold-accent);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Sub-card inside Jewellery Item */
.spec-box {
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  padding: 14px;
  margin-bottom: 12px;
}

.spec-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.spec-box-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-primary);
  letter-spacing: 0.8px;
}
.jewellery-item-container.b2b .spec-box-title {
  color: var(--sapphire-primary);
}

.spec-box-price {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-accent);
}
.jewellery-item-container.b2b .spec-box-price {
  color: var(--sapphire-primary);
}

/* Clean Input Rows */
.input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.input-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.apk-input, .apk-select {
  width: 100%;
  padding: 9px 12px;
  background: var(--card-surface);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.apk-input:focus, .apk-select:focus {
  border-color: var(--gold-primary);
  background: #FFFFFF;
}

/* Add Item Button */
.btn-add-jewellery-item {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  background: var(--gold-primary);
  color: #000;
  border: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.0px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.jewellery-item-container.b2b + .btn-add-jewellery-item {
  background: var(--sapphire-primary);
  color: #FFF;
}

/* Two-Option Toggle Pills (e.g. Original vs Approx, Sub vs Add) */
.toggle-pills-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.toggle-pill-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-obsidian);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.toggle-pill-btn.active-gold {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #000;
}

.toggle-pill-btn.active-rose {
  background: var(--rose);
  border-color: var(--rose);
  color: #FFF;
}

.toggle-pill-btn.active-emerald {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #FFF;
}

/* ==========================================================================
   5. BOTTOM BREAKDOWN SUMMARY SHEET (FLUTTER WIDGET EXACT MATCH)
   ========================================================================== */

.breakdown-summary-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  border-top: 2px solid var(--gold-primary);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.15);
  padding: 14px 18px;
  z-index: 40;
}

.breakdown-summary-sheet.b2b {
  border-top-color: var(--sapphire-primary);
}

.summary-badges-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.mini-summary-badge {
  display: flex;
  flex-direction: column;
  background: var(--card-surface);
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  padding: 5px 10px;
  min-width: 90px;
}

.mini-badge-title {
  font-size: 9.5px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.mini-badge-val {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.disclaimer-note-text {
  font-size: 9.5px;
  color: var(--gold-accent);
  font-weight: 700;
  margin-top: 4px;
}

.summary-grand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
  margin-top: 6px;
}

.grand-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.grand-number {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--gold-accent);
}

.btn-view-card-gold {
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--gold-primary);
  color: #000;
  border: none;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--gold-glow);
  transition: all 0.2s;
}

.btn-view-card-gold:hover {
  background: #C8A584;
}

/* ==========================================================================
   6. ESTIMATE PREVIEW & EXPORT CARD
   ========================================================================== */

.preview-action-btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.preview-action-btn.gold {
  background: var(--gold-primary);
  color: #000;
}

.preview-action-btn.whatsapp {
  background: #25D366;
  color: #FFF;
}

.preview-action-btn.outlined {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

/* Toast Message */
.toast-msg {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #2C2520;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 1000;
  pointer-events: none;
  animation: fadeIn 0.2s ease-out;
}

.toast-msg.hidden {
  display: none !important;
}

/* ==========================================================================
   7. LUXURY ESTIMATE CARD (100% EXACT PARITY WITH FLUTTER EstimateCard)
   ========================================================================== */

.luxury-estimate-card {
  width: 100%;
  background-color: #F8F5F0;
  border-radius: 20px;
  border: 1.5px solid #D9CCB8;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(184, 149, 116, 0.15);
  box-sizing: border-box;
  color: #2C2520;
  font-family: var(--font-sans);
}

.luxury-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.luxury-brand-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.luxury-diamond-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(184, 149, 116, 0.15);
  border: 1.2px solid #B89574;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #B89574;
  flex-shrink: 0;
}

.luxury-header-title {
  color: #8C6E54;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.2px;
  line-height: 1.2;
}

.luxury-meta-box {
  background: #F2ECE4;
  border-radius: 10px;
  border: 1px solid #D9CCB8;
  padding: 6px 10px;
  text-align: right;
  flex-shrink: 0;
}

.luxury-meta-id {
  color: #8C6E54;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.luxury-meta-date {
  color: #2C2520;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
}

.luxury-meta-time {
  color: #2C2520;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.luxury-divider {
  height: 1px;
  background: rgba(184, 149, 116, 0.4);
  margin: 12px 0;
  border: none;
}

.luxury-client-banner {
  background: #F2ECE4;
  border-radius: 10px;
  border: 1px solid #E5DDD3;
  padding: 8px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.luxury-client-label {
  color: #7A6F68;
  font-weight: 700;
  font-size: 12px;
}

.luxury-client-name {
  color: #2C2520;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.luxury-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.luxury-photo-cell {
  position: relative;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.2px solid rgba(184, 149, 116, 0.5);
  background: #F2ECE4;
}

.luxury-photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.luxury-photo-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(248, 245, 240, 0.94);
  border-radius: 6px;
  border: 0.8px solid rgba(184, 149, 116, 0.6);
  color: #8C6E54;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-align: center;
  padding: 2px 4px;
}

/* Item Breakdown in Luxury Card */
.luxury-item-card {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid rgba(184, 149, 116, 0.4);
  padding: 12px;
  margin-bottom: 12px;
}

.luxury-item-title {
  color: #2C2520;
  font-weight: 700;
  font-size: 13px;
}

.luxury-item-spec {
  color: #2C2520;
  font-weight: 700;
  font-size: 12px;
  margin-top: 1px;
}

.luxury-item-dia-type {
  color: #2C2520;
  font-weight: 700;
  font-size: 11.5px;
  margin-top: 1px;
}

.luxury-solitaire-block {
  margin-top: 4px;
}

.luxury-solitaire-title {
  color: #2C2520;
  font-weight: 700;
  font-size: 12px;
}

.luxury-solitaire-spec {
  color: #2C2520;
  font-weight: 700;
  font-size: 11.5px;
}

.luxury-formula-box {
  background: #F2ECE4;
  border-radius: 8px;
  border: 1px solid #E5DDD3;
  padding: 10px;
  margin-top: 8px;
}

.luxury-formula-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 3px 0;
  color: #2C2520;
  font-size: 11px;
  font-weight: 600;
  gap: 8px;
}

.luxury-formula-row.bold {
  font-weight: 800;
}

.luxury-formula-label {
  flex: 1;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.luxury-formula-val {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.luxury-size-note {
  background: #FAF6F0;
  border-radius: 6px;
  border: 1px solid rgba(200, 144, 71, 0.4);
  padding: 4px 8px;
  margin-top: 6px;
  color: #2C2520;
  font-size: 8.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Overall Summary Table */
.luxury-summary-heading {
  color: #8C6E54;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.0px;
  margin: 14px 0 8px 0;
}

.luxury-summary-table {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #E5DDD3;
  overflow: hidden;
}

.luxury-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  font-size: 11px;
  color: #2C2520;
}

.luxury-summary-row.bold {
  font-weight: 700;
}

.luxury-grand-box {
  background: rgba(184, 149, 116, 0.12);
  border-top: 1.2px solid rgba(184, 149, 116, 0.5);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.luxury-grand-title {
  color: #2C2520;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.luxury-grand-amount {
  color: #2C2520;
  font-size: 18px;
  font-weight: 800;
}

.luxury-fluctuation-note {
  background: #FAF6F0;
  border-radius: 8px;
  border: 1px solid rgba(200, 144, 71, 0.4);
  padding: 7px 10px;
  margin-top: 12px;
  font-size: 9.5px;
  font-weight: 700;
  color: #2C2520;
  display: flex;
  align-items: center;
  gap: 6px;
}

.luxury-remarks-box {
  background: #FAF6F0;
  border-radius: 8px;
  border: 1px solid rgba(200, 144, 71, 0.6);
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #2C2520;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* Seal & QR Code Footer Row */
.luxury-seal-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(184, 149, 116, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.luxury-seal-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.luxury-seal-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px dashed #B89574;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.luxury-seal-badge-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(184, 149, 116, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 6.5px;
  font-weight: 900;
  color: #8C6E54;
  letter-spacing: 0.5px;
  text-align: center;
}

.luxury-seal-text {
  font-size: 9.5px;
  font-weight: 700;
  color: #7A6F68;
  line-height: 1.3;
}

.luxury-qrcode-box {
  width: 52px;
  height: 52px;
  background: #FFFFFF;
  padding: 3px;
  border-radius: 6px;
  border: 1px solid #D9CCB8;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   8. CLIENT DIRECTORY & CRM STYLING
   ========================================================================== */

.client-card-item {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
}

.client-card-item:hover {
  border-color: var(--gold-primary);
  background: var(--card-surface);
}

.client-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(200, 165, 132, 0.15);
  border: 1.2px solid var(--gold-primary);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.client-details-col {
  flex: 1;
  margin-left: 12px;
}

.client-name-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.client-sub-text {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.client-tag-pill {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(200, 165, 132, 0.12);
  color: var(--gold-accent);
}

/* ==========================================================================
   9. SAVED ESTIMATES HISTORY CARDS
   ========================================================================== */

.saved-history-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.saved-history-card:hover {
  border-color: var(--gold-primary);
}

.saved-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.saved-history-id {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-accent);
  letter-spacing: 0.5px;
}

.saved-mode-badge {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
}

.saved-mode-badge.b2c {
  background: rgba(200, 165, 132, 0.2);
  color: var(--gold-accent);
}

.saved-mode-badge.b2b {
  background: rgba(107, 130, 168, 0.25);
  color: var(--sapphire-primary);
}

.saved-history-client {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.saved-history-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.saved-history-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border);
}

.saved-history-total {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.saved-history-actions {
  display: flex;
  gap: 8px;
}

.btn-saved-action {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--glass-border);
  background: var(--card-surface);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-saved-action:hover {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-primary);
}

.btn-saved-action.delete:hover {
  background: var(--rose);
  color: #FFF;
  border-color: var(--rose);
}

/* ==========================================================================
   10. MODAL DIALOGS (Bullion Rates, Client Profile, etc.)
   ========================================================================== */

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(18, 14, 11, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-content-card {
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  background-color: var(--card-bg);
  border: 1.5px solid var(--gold-primary);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-surface);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gold-accent);
  letter-spacing: 1.0px;
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

.modal-body-scrollable {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   11. PRINT / PDF EXPORT MEDIA QUERY
   ========================================================================== */

@media print {
  body, html {
    background: #FFF !important;
    color: #000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #appRoot {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .device-viewport {
    max-width: 100% !important;
    height: auto !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: #FFF !important;
  }

  #screenPinLogin,
  #screenMainNav,
  #screenEditor,
  #screenSavedHistory,
  .apk-appbar,
  .preview-action-btn,
  .floating-bottom-nav,
  .breakdown-summary-sheet {
    display: none !important;
  }

  #screenPreview {
    display: block !important;
    position: static !important;
    background: #FFF !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .screen-scroll-body {
    padding: 0 !important;
    overflow: visible !important;
  }

  #apkEstimateCardWidgetTarget {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .luxury-estimate-card {
    border: none !important;
    box-shadow: none !important;
    padding: 10px !important;
  }
}
