/* Melvil Botanical & Book Aesthetic Stylesheet */
:root {
  --color-paper: #fcfbf9;
  --color-ink: #1c2421;
  --color-tea: #2d5a43;
  --color-tea-light: #eaf3ed;
  --color-parchment: #f4ede2;
  --color-amber-gold: #c28834;
}

body {
  background-color: #f7f6f2;
  color: #1e293b;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.font-serif-title {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

.badge-golden {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-urgent {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-locked {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-street {
  background-color: #fef08a;
  color: #854d0e;
  border: 1px solid #facc15;
}

.badge-tea {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* HTMX Transition animations */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator {
  display: inline-block;
}
.htmx-request.htmx-indicator {
  display: inline-block;
}

/* Explicit High-Contrast Fallbacks for Navigation & Action States */
.nav-active {
  background-color: #1c1917 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}
.nav-active svg {
  color: #34d399 !important;
}

/* Dark Header Baseline */
header.bg-stone-900 {
  background-color: #1c1917 !important;
  color: #f5f5f4 !important;
}

/* Responsive Layout Breakpoints & Navigation */
@media (max-width: 1023px) {
  aside.desktop-sidebar {
    display: none !important;
  }
  .mobile-menu-btn {
    display: inline-flex !important;
  }
}

@media (min-width: 1024px) {
  aside.desktop-sidebar {
    display: block !important;
  }
  .mobile-menu-btn {
    display: none !important;
  }
  #mobile-nav-drawer {
    display: none !important;
  }
}

.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* Prevent unwanted double-tap zoom on buttons and interactive elements */
button, a, select, input {
  touch-action: manipulation;
}

/* Minimum 16px font size on inputs prevents iOS Safari auto-zoom */
@media (max-width: 640px) {
  input[type="text"],
  input[type="number"],
  input[type="search"],
  select {
    font-size: 16px !important;
  }
}

/* High-Contrast Utilities & Square Playbook Components */
.text-amber-100 { color: #fef3c7 !important; }
.text-amber-200 { color: #fde68a !important; }
.text-amber-300 { color: #fcd34d !important; }
.text-amber-400 { color: #fbbf24 !important; }
.text-amber-500 { color: #f59e0b !important; }
.text-rose-200  { color: #fecdd3 !important; }
.text-rose-300  { color: #fda4af !important; }
.text-rose-400  { color: #fb7185 !important; }
.text-sky-200   { color: #bae6fd !important; }
.text-sky-300   { color: #7dd3fc !important; }
.text-sky-400   { color: #38bdf8 !important; }
.text-emerald-200 { color: #a7f3d0 !important; }
.text-emerald-300 { color: #6ee7b7 !important; }
.text-emerald-400 { color: #34d399 !important; }
.text-emerald-800 { color: #065f46 !important; }
.text-emerald-900 { color: #064e3b !important; }
.text-emerald-950 { color: #022c22 !important; }
.bg-emerald-50    { background-color: #ecfdf5 !important; }
.bg-emerald-100   { background-color: #d1fae5 !important; }
.border-emerald-300 { border-color: #6ee7b7 !important; }
.text-stone-100 { color: #f5f5f4 !important; }
.text-stone-200 { color: #e7e5e4 !important; }
.text-stone-300 { color: #d6d3d1 !important; }
.text-stone-400 { color: #a8a29e !important; }

.bg-stone-950   { background-color: #0c0a09 !important; }
.bg-stone-900   { background-color: #1c1917 !important; }
.bg-stone-800   { background-color: #292524 !important; }
.bg-stone-700   { background-color: #44403c !important; }

.bg-amber-500\/20 { background-color: rgba(245, 158, 11, 0.2) !important; }
.bg-rose-500\/20  { background-color: rgba(244, 63, 94, 0.2) !important; }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.2) !important; }
.bg-sky-500\/20   { background-color: rgba(14, 165, 233, 0.2) !important; }

.gap-2\.5 { gap: 0.625rem !important; }
.h-6 { height: 1.5rem !important; }
.h-7 { height: 1.75rem !important; }
.w-7 { width: 1.75rem !important; }

.step-num-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  border-radius: 9999px !important;
  background-color: #1c1917 !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  margin-right: 12px !important;
  flex-shrink: 0 !important;
}

.code-box-dark {
  background-color: #0c0a09 !important;
  color: #fde047 !important;
  border: 1px solid #44403c !important;
  border-radius: 8px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 11px !important;
}

.hero-badge-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 12px !important;
  border-radius: 9999px !important;
  background-color: rgba(245, 158, 11, 0.18) !important;
  border: 1px solid rgba(251, 191, 36, 0.35) !important;
  color: #fde68a !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

.active-store-pill {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 12px !important;
  border-radius: 9999px !important;
  background-color: #f5f5f4 !important;
  border: 1px solid #d6d3d1 !important;
  color: #1c1917 !important;
  font-weight: 700 !important;
  font-size: 12px !important;
}

.store-select-compact {
  max-width: 110px !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}
@media (min-width: 380px) {
  .store-select-compact {
    max-width: 135px !important;
  }
}
@media (min-width: 640px) {
  .store-select-compact {
    max-width: 200px !important;
  }
}
@media (min-width: 1024px) {
  .store-select-compact {
    max-width: 280px !important;
  }
}

/* Universal Modal System Utilities - Immune to Tailwind Purging */
.fixed {
  position: fixed !important;
}
.inset-0 {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
}
.z-50 {
  z-index: 50 !important;
}
.z-999 {
  z-index: 999 !important;
}
.z-9999 {
  z-index: 9999 !important;
}
.backdrop-blur-sm {
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}
.bg-black\/70 {
  background-color: rgba(0, 0, 0, 0.7) !important;
}
.bg-black\/80 {
  background-color: rgba(0, 0, 0, 0.8) !important;
}

.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

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

.modal-dialog-content {
  position: relative !important;
  z-index: 10000 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

/* Botanical Terminal & Authentication Components */
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  border: 2px solid #d6d3d1;
  background-color: transparent;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.pin-dot.filled {
  background-color: #2d5a43 !important;
  border-color: #2d5a43 !important;
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(45, 90, 67, 0.35);
}
.pin-key-themed {
  background-color: #fafaf9 !important;
  border: 1px solid #e7e5e4 !important;
  color: #1c1917 !important;
  transition: all 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.pin-key-themed:active {
  background-color: #e7e5e4 !important;
  transform: scale(0.96);
  border-color: #d6d3d1 !important;
}
.form-input-themed {
  background-color: #fafaf9 !important;
  color: #1c1917 !important;
  border: 1px solid #d6d3d1 !important;
  outline: none !important;
  font-size: 14px !important;
  line-height: 20px !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
  transition: all 0.15s ease;
}
.form-input-themed:focus {
  background-color: #ffffff !important;
  border-color: #2d5a43 !important;
  box-shadow: 0 0 0 2px rgba(45, 90, 67, 0.2) !important;
}

/* Bookshop & Tea Cafe Design System Polish */
body {
  background-color: var(--color-paper, #f7f6f2);
  color: var(--color-ink, #1c2421);
}

.topbar-ink {
  background-color: #1c2421;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-shell {
  background-color: #ffffff;
  border: 1px solid #e7e5e4;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(28, 36, 33, 0.04);
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #78716c;
  padding: 10px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #44403c;
  transition: background-color 0.12s ease, color 0.12s ease;
  text-decoration: none;
}

.nav-item:hover {
  background-color: #f5f5f4;
  color: #1c1917;
}

.nav-item.is-active {
  background-color: #2d5a43;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(45, 90, 67, 0.25);
}

.nav-item.is-active svg {
  color: #a7f3d0;
}

/* Mobile drawer inherits dark ink theme for .nav-item */
#mobile-nav-drawer .nav-section-label {
  color: #a8a29e;
}

#mobile-nav-drawer .nav-item {
  color: #e7e5e4;
}

#mobile-nav-drawer .nav-item:hover {
  background-color: #292524;
  color: #ffffff;
}

#mobile-nav-drawer .nav-item.is-active {
  background-color: #2d5a43;
  color: #ffffff;
}

.nav-tools-details > summary {
  list-style: none;
  cursor: pointer;
}

.nav-tools-details > summary::-webkit-details-marker {
  display: none;
}

.nav-tools-details[open] > summary svg.chevron-icon {
  transform: rotate(90deg);
}

/* Unified Card & Table Refinement */
main .bg-white.rounded-2xl,
main .bg-white.rounded-xl {
  box-shadow: 0 1px 3px rgba(28, 36, 33, 0.04);
}

main table thead th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #57534e;
}

main table tbody tr {
  transition: background-color 0.1s ease;
}

main table tbody tr:hover {
  background-color: rgba(245, 245, 244, 0.65);
}

/* Core Positioning & Icon Alignment Utilities (Immune to Tailwind Purging) */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.inset-0 { top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; }
.inset-y-0 { top: 0 !important; bottom: 0 !important; }
.left-0 { left: 0 !important; }
.right-0 { right: 0 !important; }
.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.left-2 { left: 0.5rem !important; }
.left-2\.5 { left: 0.625rem !important; }
.left-3 { left: 0.75rem !important; }
.top-2 { top: 0.5rem !important; }
.top-2\.5 { top: 0.625rem !important; }
.top-3 { top: 0.75rem !important; }
.pointer-events-none { pointer-events: none !important; }
.pl-8 { padding-left: 2rem !important; }
.pl-9 { padding-left: 2.25rem !important; }
.pl-10 { padding-left: 2.5rem !important; }
.whitespace-nowrap { white-space: nowrap !important; }

