/* ==========================================================================
   JEWELFLOW - MACOS SONOMA / VISIONOS GLASSMORPHIC DESIGN SYSTEM
   60% Base: Cream (#FFF4E6) | 30% Primary: Burgundy Red (#800020) | 10% Accent: Liquid Gold (#D4AF37)
   ========================================================================== */

:root {
  --bg-cream: #FFF4E6;
  --bg-cream-alpha: rgba(255, 244, 230, 0.75);
  --bg-cream-subtle: rgba(255, 244, 230, 0.45);
  --card-bg: rgba(255, 255, 255, 0.70);
  --card-bg-glass: rgba(255, 244, 230, 0.82);
  
  --primary-burgundy: #800020;
  --primary-burgundy-hover: #5e0017;
  --primary-burgundy-active: #420010;
  --primary-burgundy-light: rgba(128, 0, 32, 0.08);

  --accent-gold: #D4AF37;
  --accent-gold-light: #E5C158;
  --accent-gold-glow: rgba(212, 175, 55, 0.35);
  --border-gold: rgba(212, 175, 55, 0.45);
  --border-gold-strong: rgba(212, 175, 55, 0.75);

  --text-primary: #1C1917;
  --text-secondary: #57534E;
  --text-muted: #8F8B88;
  --text-gold: #B8860B;
  --text-burgundy: #800020;

  --status-success: #10B981;
  --status-warning: #F59E0B;
  --status-danger: #800020;
  --status-info: #0284C7;

  --glass-blur: blur(20px) saturate(180%);
  --glass-blur-sm: blur(12px) saturate(160%);
  --dock-curve: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-gold: 0 8px 32px 0 rgba(128, 0, 32, 0.12), 0 0 12px rgba(212, 175, 55, 0.25);
  --shadow-gold-hover: 0 12px 36px 0 rgba(128, 0, 32, 0.18), 0 0 16px rgba(212, 175, 55, 0.4);
  --shadow-dock: 0 20px 40px rgba(0, 0, 0, 0.18), 0 0 1px rgba(212, 175, 55, 0.5);
  
  --radius-capsule: 9999px;
  --radius-window: 24px;
  --radius-card: 18px;
  --radius-btn: 12px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-cream);
  background-image: 
    radial-gradient(at 10% 20%, rgba(212, 175, 55, 0.12) 0px, transparent 50%),
    radial-gradient(at 90% 10%, rgba(128, 0, 32, 0.08) 0px, transparent 50%),
    radial-gradient(at 80% 90%, rgba(212, 175, 55, 0.15) 0px, transparent 50%),
    radial-gradient(at 20% 80%, rgba(128, 0, 32, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 126px;
  padding-bottom: 96px;
  overflow-x: hidden;
  user-select: none;
}

/* --------------------------------------------------------------------------
   1. DYNAMIC ISLAND (TOP FLOATING CAPSULE HEADER)
   -------------------------------------------------------------------------- */
.dynamic-island {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-cream-alpha);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-capsule);
  padding: 6px 18px;
  box-shadow: var(--shadow-gold);
  width: min(94vw, 1380px);
  transition: all 0.4s var(--dock-curve);
}

.dynamic-island:hover {
  box-shadow: var(--shadow-gold-hover);
  border-color: var(--border-gold-strong);
}

/* --------------------------------------------------------------------------
   1.1 DETACHED MULTI-COLUMN PILLS RIBBON ROW (BELOW DYNAMIC ISLAND)
   -------------------------------------------------------------------------- */
.header-ribbon-bar {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  width: min(94vw, 1380px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px;
  pointer-events: auto;
  box-sizing: border-box;
}

.ribbon-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 244, 230, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 9999px;
  padding: 5px 14px;
  box-shadow: 0 4px 16px rgba(128, 0, 32, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-burgundy);
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.ribbon-pill:hover {
  border-color: #D4AF37;
  background: rgba(255, 244, 230, 0.98);
  box-shadow: 0 6px 20px rgba(128, 0, 32, 0.16);
  transform: translateY(-1px);
}

.ribbon-desk-pill {
  background: rgba(255, 244, 230, 0.92);
  border-color: rgba(16, 185, 129, 0.45);
  color: #065F46;
}

.ribbon-rate-pill {
  cursor: pointer;
}

.ribbon-pill-tag {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(128, 0, 32, 0.1);
  color: #800020;
  padding: 2px 6px;
  border-radius: 6px;
}

.ribbon-pill-val {
  font-weight: 800;
  font-feature-settings: "tnum";
  color: #800020;
}

.ribbon-pill-sub {
  font-size: 10px;
  font-weight: 600;
  color: #8F8B88;
}

.ribbon-clock-pill {
  font-feature-settings: "tnum";
  min-width: 90px;
  justify-content: center;
  color: #800020;
  font-weight: 800;
}

.island-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.island-logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #800020 0%, #420010 100%);
  border: 1.5px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(128, 0, 32, 0.3);
}

.island-logo-badge svg {
  width: 18px;
  height: 18px;
  fill: #D4AF37;
}

.island-shop-title {
  display: flex;
  flex-direction: column;
}

.island-shop-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary-burgundy);
  white-space: nowrap;
}

.island-shop-subtitle {
  font-size: 9px;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Metal Ticker Pill */
.island-ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-capsule);
  padding: 4px 14px;
  font-size: 11px;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ticker-label {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 10px;
}

.ticker-value {
  font-weight: 800;
  color: var(--primary-burgundy);
  font-feature-settings: "tnum";
}

.ticker-value.gold {
  color: #B8860B;
}

.ticker-divider {
  width: 1px;
  height: 14px;
  background: rgba(212, 175, 55, 0.35);
}

/* Right Status Segment */
.island-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.desk-indicator-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(128, 0, 32, 0.08);
  border: 1px solid rgba(128, 0, 32, 0.2);
  border-radius: var(--radius-capsule);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-burgundy);
  cursor: pointer;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
  animation: pulseLive 2s infinite ease-in-out;
}

@keyframes pulseLive {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.clock-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  font-feature-settings: "tnum";
  min-width: 65px;
  text-align: center;
}

.cart-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #800020 0%, #5e0017 100%);
  color: #FFF4E6;
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-capsule);
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(128, 0, 32, 0.25);
  transition: all 0.25s ease;
}

.cart-pill:hover {
  background: linear-gradient(135deg, #5e0017 0%, #420010 100%);
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(128, 0, 32, 0.35);
}

.cart-badge {
  background: var(--accent-gold);
  color: #1a1a1a;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Simple Round Logout / Lock Button in Dynamic Island */
.island-logout-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(128, 0, 32, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: var(--primary-burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(128, 0, 32, 0.12);
  flex-shrink: 0;
  margin-left: 2px;
}

.island-logout-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.island-logout-btn:hover {
  background: linear-gradient(135deg, #800020 0%, #5e0017 100%);
  color: #FFF4E6;
  border-color: var(--accent-gold);
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(128, 0, 32, 0.35), 0 0 10px rgba(212, 175, 55, 0.4);
}

.island-logout-btn:hover svg {
  transform: scale(1.08);
}

/* --------------------------------------------------------------------------
   2. INVERTED MACOS DOCK (BURGUNDY RED GLASSMORPHIC WITH VISIBLE LABELS)
   -------------------------------------------------------------------------- */
.dock-wrapper {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: 96vw;
  display: flex;
  align-items: center;
  gap: 12px;
}

.macos-dock {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(128, 0, 32, 0.92);
  background: linear-gradient(135deg, rgba(128, 0, 32, 0.94) 0%, rgba(94, 0, 23, 0.92) 50%, rgba(66, 0, 16, 0.95) 100%);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1.5px solid rgba(212, 175, 55, 0.65);
  border-radius: 26px;
  padding: 8px 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 24px rgba(212, 175, 55, 0.35);
  position: relative;
  transition: all 0.3s var(--dock-curve);
}

.dock-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 10px;
  min-width: 64px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 244, 230, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.30);
  color: #FFF4E6;
  cursor: pointer;
  text-decoration: none;
  transform-origin: bottom center;
  transition: transform 0.2s var(--dock-curve), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.dock-item svg {
  width: 22px;
  height: 22px;
  fill: #FFF4E6;
  transition: transform 0.2s ease, fill 0.2s ease;
  flex-shrink: 0;
}

.dock-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #FFF4E6;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.dock-item:hover {
  transform: scale(1.18) translateY(-8px);
  background: rgba(255, 244, 230, 0.25);
  border-color: #D4AF37;
  color: #FFE6A7;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 0 16px rgba(212, 175, 55, 0.6);
  z-index: 10;
}

.dock-item:hover svg {
  fill: #FFE6A7;
  transform: scale(1.08);
}

.dock-item:hover .dock-label {
  color: #FFE6A7;
}

.dock-item.active {
  background: linear-gradient(135deg, #D4AF37 0%, #E5C158 50%, #B8860B 100%);
  color: #420010;
  border-color: #FFF4E6;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.55), 0 0 14px rgba(255, 244, 230, 0.45);
}

.dock-item.active svg {
  fill: #420010;
}

.dock-item.active .dock-label {
  color: #420010;
  font-weight: 800;
  text-shadow: none;
}

.dock-item.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFF4E6;
  box-shadow: 0 0 6px #FFF4E6, 0 0 10px #D4AF37;
}

.dock-separator {
  width: 1.5px;
  height: 36px;
  background: rgba(212, 175, 55, 0.45);
  margin: 0 4px;
  align-self: center;
  border-radius: 2px;
}

/* Dedicated Detached Lock Desk Button */
.dock-dedicated-lock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 62px;
  height: 62px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(128, 0, 32, 0.96) 0%, rgba(70, 0, 18, 0.96) 100%);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1.5px solid rgba(212, 175, 55, 0.75);
  border-radius: 22px;
  color: #FFF4E6;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45), 0 0 22px rgba(128, 0, 32, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.35);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.dock-dedicated-lock-btn svg {
  width: 22px;
  height: 22px;
  fill: #D4AF37;
  transition: transform 0.25s ease, fill 0.25s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.dock-dedicated-lock-btn .dock-dedicated-label {
  font-size: 10px;
  font-weight: 800;
  color: #FFF4E6;
  letter-spacing: 0.3px;
  white-space: nowrap;
  line-height: 1;
}

.dock-dedicated-lock-btn:hover {
  transform: translateY(-4px) scale(1.06);
  border-color: #F59E0B;
  background: linear-gradient(135deg, rgba(150, 0, 38, 0.98) 0%, rgba(90, 0, 24, 0.98) 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(212, 175, 55, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.dock-dedicated-lock-btn:hover svg {
  transform: scale(1.12);
  fill: #FFF4E6;
}

.dock-dedicated-lock-btn:active {
  transform: translateY(-1px) scale(0.98);
}

@media (max-width: 680px) {
  .macos-dock {
    gap: 4px;
    padding: 6px 8px;
    border-radius: 20px;
  }
  .dock-item {
    min-width: 48px;
    height: 48px;
    padding: 4px 6px;
  }
  .dock-item svg {
    width: 18px;
    height: 18px;
  }
  .dock-label {
    font-size: 8.5px;
  }
}

/* --------------------------------------------------------------------------
   3. GLASS CARDS, PANELS & CONTAINERS
   -------------------------------------------------------------------------- */
.sonoma-container {
  width: min(94vw, 1400px);
  margin: 0 auto;
  flex: 1;
}

.glass-card {
  background: var(--card-bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-gold);
  padding: 24px;
  position: relative;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  border-color: var(--border-gold-strong);
}

.glass-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.glass-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-burgundy);
  display: flex;
  align-items: center;
  gap: 10px;
}

.glass-card-title svg {
  width: 20px;
  height: 20px;
  fill: var(--accent-gold);
}

/* --------------------------------------------------------------------------
   4. BUTTONS & CONTROLS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s var(--dock-curve);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #800020 0%, #5e0017 100%);
  color: #FFF4E6;
  border: 1px solid var(--accent-gold);
  box-shadow: 0 4px 14px rgba(128, 0, 32, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5e0017 0%, #420010 100%);
  box-shadow: 0 6px 18px rgba(128, 0, 32, 0.35), 0 0 10px rgba(212, 175, 55, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: #420010;
  transform: translateY(1px);
}

.btn-gold {
  background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
  color: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #E5C158 0%, #D4AF37 100%);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
  border: 1px solid var(--border-gold);
}

.btn-secondary:hover {
  background: #FFF;
  border-color: var(--accent-gold);
  color: var(--primary-burgundy);
}

.btn-danger {
  background: #DC2626;
  color: #FFF;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 11px;
  border-radius: 8px;
}

/* --------------------------------------------------------------------------
   5. INPUT FIELDS & FORM CONTROLS
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.25s ease;
  backdrop-filter: var(--glass-blur-sm);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  background: #FFF;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

/* --------------------------------------------------------------------------
   6. TABLES & DATA WRAPPERS
   -------------------------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: var(--glass-blur-sm);
}

.sonoma-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.sonoma-table th {
  background: rgba(128, 0, 32, 0.06);
  color: var(--primary-burgundy);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-gold);
}

.sonoma-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  color: var(--text-primary);
}

.sonoma-table tbody tr:hover {
  background: rgba(255, 244, 230, 0.6);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-capsule);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.badge-instock {
  background: rgba(16, 185, 129, 0.15);
  color: #065F46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-sold {
  background: rgba(128, 0, 32, 0.12);
  color: var(--primary-burgundy);
  border: 1px solid rgba(128, 0, 32, 0.25);
}

.badge-pledged {
  background: rgba(212, 175, 55, 0.2);
  color: #855800;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.badge-memo {
  background: rgba(59, 130, 246, 0.15);
  color: #1E40AF;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* --------------------------------------------------------------------------
   7. MODAL CRUD ARCHITECTURE (APPLE FLOATING SHEET)
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-sheet {
  background: rgba(255, 250, 243, 0.94);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-window);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25), 0 0 20px rgba(212, 175, 55, 0.35);
  width: min(92vw, 760px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s var(--dock-curve);
}

.modal-overlay.active .modal-sheet {
  transform: scale(1) translateY(0);
}

/* Custom-Tailored Glass Confirmation Dialog */
.confirm-sheet {
  max-width: 420px !important;
  text-align: center;
  padding: 26px 24px;
  border-radius: 24px !important;
  background: rgba(255, 252, 247, 0.96) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.7) !important;
  box-shadow: 0 24px 64px rgba(128, 0, 32, 0.22), 0 0 24px rgba(212, 175, 55, 0.45) !important;
}

.confirm-icon-capsule {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(128, 0, 32, 0.08);
  border: 1.5px solid rgba(212, 175, 55, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: 0 4px 16px rgba(128, 0, 32, 0.12);
}

.confirm-icon-capsule svg {
  width: 28px;
  height: 28px;
  fill: #800020;
}

.confirm-title {
  font-size: 17px;
  font-weight: 800;
  color: #800020;
  margin-bottom: 8px;
}

.confirm-msg {
  font-size: 13px;
  color: #57534E;
  line-height: 1.55;
  margin-bottom: 22px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-actions button {
  min-width: 120px;
  padding: 9px 18px;
  font-weight: 700;
  border-radius: 12px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(128, 0, 32, 0.06) 0%, rgba(212, 175, 55, 0.06) 100%);
  border-bottom: 1px solid var(--border-gold);
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-burgundy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.modal-close-btn:hover {
  background: #800020;
  color: #FFF;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(255, 244, 230, 0.5);
}

/* --------------------------------------------------------------------------
   8. NOTIFICATION TOAST STACK (TOP-RIGHT GLASS TOASTS)
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  top: 78px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  min-width: 300px;
  max-width: 420px;
  animation: slideToastIn 0.35s var(--dock-curve);
  transition: all 0.3s ease;
}

.toast.toast-hiding {
  opacity: 0;
  transform: translateX(100%);
}

@keyframes slideToastIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 2px;
}

.toast-msg {
  font-size: 11px;
  color: var(--text-secondary);
}

.toast-success {
  border-left: 4px solid #10B981;
}
.toast-success .toast-title { color: #065F46; }

.toast-warning {
  border-left: 4px solid #F59E0B;
}
.toast-warning .toast-title { color: #92400E; }

.toast-error {
  border-left: 4px solid #800020;
}
.toast-error .toast-title { color: #800020; }

.toast-notice {
  border-left: 4px solid var(--accent-gold);
}
.toast-notice .toast-title { color: #855800; }

/* --------------------------------------------------------------------------
   9. INACTIVITY COUNTDOWN OVERLAY (9TH MINUTE LOCKSCREEN)
   -------------------------------------------------------------------------- */
.inactivity-warning-modal {
  position: fixed;
  inset: 0;
  background: rgba(128, 0, 32, 0.35);
  backdrop-filter: blur(25px) saturate(200%);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
}

.inactivity-warning-modal.active {
  display: flex;
}

.inactivity-card {
  background: rgba(255, 244, 230, 0.95);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-window);
  padding: 36px;
  text-align: center;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   10. RESPONSIVE BREAKPOINTS (DOWN TO 360PX)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  body {
    padding-top: 130px;
    padding-bottom: 84px;
  }
  .dynamic-island {
    flex-wrap: wrap;
    border-radius: 20px;
    padding: 8px 12px;
  }
  .island-ticker {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
  }
  .macos-dock {
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
  }
  .dock-item {
    width: 40px;
    height: 40px;
  }
  .dock-item svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 992px) {
  .rates-analytics-dashboard {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 540px) {
  .rates-analytics-dashboard > div:nth-child(2) {
    grid-template-columns: 1fr !important;
  }
}

/* --------------------------------------------------------------------------
   RESPONSIVE COMPACT SCALING (1080p, Laptops & Scaled Displays)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1680px), screen and (max-height: 960px) {
  /* 1. Snug, proportionate modals */
  .modal-sheet {
    width: min(92vw, 620px);
    max-height: min(84vh, 600px);
    border-radius: 18px;
  }
  .modal-header {
    padding: 12px 18px;
  }
  .modal-title {
    font-size: 14.5px;
  }
  .modal-close-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .modal-body {
    padding: 14px 18px;
  }
  .modal-footer {
    padding: 10px 18px;
    gap: 8px;
  }
  
  /* 2. Compact Form Controls */
  .form-group {
    margin-bottom: 11px;
    gap: 4px;
  }
  .form-label {
    font-size: 11px;
    margin-bottom: 1px;
  }
  .form-input, .form-select, .form-textarea {
    padding: 7px 11px;
    font-size: 12px;
    border-radius: 10px;
  }
  .btn {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 10px;
  }
  .btn-sm {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 8px;
  }

  /* 3. Snug Item Cards & Catalog in POS Desk */
  .pos-item-card {
    padding: 10px;
    border-radius: 14px;
  }
  .pos-item-thumb {
    height: 85px;
    margin-bottom: 6px;
  }
  .pos-item-thumb svg {
    width: 38px;
    height: 38px;
  }
  .pos-item-name {
    font-size: 12px;
  }
  .pos-item-sku {
    font-size: 10px;
  }
  .pos-item-meta {
    font-size: 10.5px;
    margin: 4px 0;
  }
  .pos-item-price {
    font-size: 12.5px;
  }

  /* 4. Item Detail Modal Adaptive Layout */
  #modalItemDetail .modal-sheet {
    max-width: 600px;
  }
  #modalItemDetail .modal-body > div {
    grid-template-columns: 170px 1fr !important;
    gap: 14px !important;
  }
  #itemDetailImageContainer {
    height: 160px !important;
  }

  /* 5. Dock proportions on laptop / 1080p */
  .macos-dock {
    padding: 6px 12px;
    gap: 8px;
  }
  .dock-item {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .dock-item svg {
    width: 20px;
    height: 20px;
  }
  .dock-item span {
    font-size: 9px;
  }
  .dock-dedicated-lock-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
}

/* Extra Compact Mode for 1366x768 / 1280x720 / 150% scaled screens */
@media screen and (max-width: 1366px), screen and (max-height: 768px) {
  .modal-sheet {
    width: min(94vw, 540px);
    max-height: min(84vh, 500px);
  }
  .modal-header {
    padding: 10px 14px;
  }
  .modal-body {
    padding: 10px 14px;
  }
  .modal-footer {
    padding: 8px 14px;
  }
  .form-group {
    margin-bottom: 8px;
  }
  .form-input, .form-select {
    padding: 6px 9px;
    font-size: 11.5px;
  }
  #modalItemDetail .modal-sheet {
    max-width: 520px;
  }
  #modalItemDetail .modal-body > div {
    grid-template-columns: 150px 1fr !important;
    gap: 10px !important;
  }
  #itemDetailImageContainer {
    height: 140px !important;
  }
}


