/* ForceShip Theme Colors: #222831, #393E46, #FFD369, #EEEEEE */
:root {
  --fs-primary: #ffd369;
  --fs-primary-light: #ffe294;
  --fs-primary-hover: #f5be38;
  --fs-primary-dark: #d4a024;
  --fs-primary-soft: rgba(255, 211, 105, 0.16);
  --fs-primary-glow: rgba(255, 211, 105, 0.45);

  --fs-secondary: #393e46;
  --fs-secondary-light: #eeeeee;
  --fs-secondary-card: #ffffff;
  --fs-secondary-border: #e0e2e6;
  --fs-secondary-dark: #222831;

  --fs-text-main: #222831;
  --fs-text-muted: #5a6472;
  --fs-bg: #f5f6f8;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--fs-bg);
  color: var(--fs-text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
}

/* Hostinger-Style Heading & Display Typography */
h1, h2, h3, .hostinger-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  letter-spacing: -0.028em;
  color: #0f172a;
  line-height: 1.25;
}

h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1e293b;
}

/* Stat & Metric Numbers */
.metric-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(238, 238, 238, 0.6);
}
::-webkit-scrollbar-thumb {
  background: #cbd0d8;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #393e46;
}

/* Primary Button with Hostinger-like punch */
.btn-primary {
  background-color: var(--fs-primary);
  color: #222831;
  font-weight: 800;
  letter-spacing: -0.015em;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary:hover {
  background-color: var(--fs-primary-hover);
  color: #222831;
  box-shadow: 0 4px 14px var(--fs-primary-glow);
  transform: translateY(-1px);
}

/* Subtle Gold / Brand Badge */
.badge-gold, .badge-green {
  background-color: rgba(255, 211, 105, 0.18);
  color: #926900;
  border: 1px solid rgba(255, 211, 105, 0.45);
  font-weight: 700;
}

/* Active Nav Item */
.nav-item-active {
  background-color: #222831 !important;
  color: #ffd369 !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(34, 40, 49, 0.35);
  border-left: 3px solid #ffd369 !important;
}
.nav-item-active i {
  color: #ffd369 !important;
}

/* Modern Clean Card Styling (Hostinger-inspired) */
.fs-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
  border-radius: 1rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.fs-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -2px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   High-Clarity Table Design System (Clean Background, Prominent Fonts, Legible Details)
   ========================================================================== */

/* Modern card wrapper around all tables */
.overflow-x-auto:has(> table),
.table-responsive,
.table-container {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.875rem !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.02) !important;
  overflow-x: auto !important;
}

/* Global table properties */
table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.875rem !important;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 0.84rem !important; /* ~13.5px for clear readability */
  line-height: 1.5 !important;
  color: #1e293b !important; /* Slate 800 - crisp, high contrast */
  text-align: left;
}

/* Table Header: clean slate background, sharp divider line, prominent uppercase labels */
table thead,
table thead tr {
  background-color: #f8fafc !important; /* Clean light slate background */
}

table thead th {
  padding: 0.9rem 1rem !important; /* Spacious, comfortable header cells */
  font-size: 0.72rem !important; /* ~11.5px bold uppercase */
  font-weight: 800 !important;
  letter-spacing: 0.055em !important;
  text-transform: uppercase !important;
  color: #334155 !important; /* Slate 700 - sharp, easily readable */
  border-bottom: 2px solid #e2e8f0 !important; /* Crisp header border */
  border-top: none !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  background-color: #f8fafc !important;
}

/* Rounded top header corners */
table thead tr:first-child th:first-child {
  border-top-left-radius: 0.875rem;
}
table thead tr:first-child th:last-child {
  border-top-right-radius: 0.875rem;
}

/* Table Body: pure white background with subtle alternating zebra striping */
table tbody {
  background-color: #ffffff !important;
}

table tbody tr {
  background-color: #ffffff !important;
  border-bottom: 1px solid #f1f5f9 !important;
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

/* Subtle zebra striping for effortless scanning on wide screens */
table tbody tr:nth-child(even) {
  background-color: #fafbfc !important;
}

/* Clean, modern row hover highlight */
table tbody tr:hover {
  background-color: #f1f5f9 !important;
}

/* Table Cells: generous padding, clear text alignment */
table tbody td {
  padding: 0.875rem 1rem !important; /* Comfortable breathing room */
  font-size: 0.84rem !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

/* Rounded bottom corners */
table tbody tr:last-child td {
  border-bottom: none !important;
}
table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 0.875rem;
}
table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 0.875rem;
}

/* Prominent Primary Text (Customer name, Product title, Reference, Amounts) */
table tbody td .font-bold:not(button):not(button *):not(.text-white),
table tbody td strong:not(button *):not(.text-white),
table tbody td b:not(button *):not(.text-white),
table tbody td .font-extrabold:not(button):not(button *):not(.text-white) {
  font-weight: 700 !important;
  color: #0f172a !important; /* Deep dark slate for maximum prominence */
}

/* Explicit white text protection for buttons and badges */
table tbody td .text-white,
table tbody td .text-white * {
  color: #ffffff !important;
}

/* Clear Secondary Details (Subtitles, Time, Address, Small notes) */
table tbody td .text-bone-400,
table tbody td .text-bone-500,
table tbody td .text-bone-600,
table tbody td .text-slate-400,
table tbody td .text-slate-500,
table tbody td .text-gray-400,
table tbody td .text-gray-500 {
  color: #64748b !important; /* Crisp Slate 500 instead of washed-out grey */
  font-weight: 500 !important;
}

table tbody td .text-bone-700,
table tbody td .text-bone-800,
table tbody td .text-bone-900 {
  color: #0f172a !important;
}

/* Upgrade microscopic font sizes to clear, readable text */
table tbody td .text-\[9px\],
table tbody td .text-\[10px\] {
  font-size: 0.72rem !important; /* ~11.5px */
  font-weight: 600 !important;
  line-height: 1.25 !important;
}

table tbody td .text-xs {
  font-size: 0.8125rem !important; /* ~13px */
}

/* Monospace Details (SKUs, IDs, Phone numbers, Reference codes) */
table tbody td .font-mono,
table td.font-mono,
table td [class*="font-mono"] {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
}

/* Badges & Status Pills in tables: prominent, clear colors, rounded pill shape */
table span[class*="rounded-full"],
table span[class*="rounded-md"] {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  padding: 0.25rem 0.65rem !important;
  letter-spacing: 0.02em !important;
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

/* Maintain semantic color accents on numbers and labels */
table tbody td.text-emerald-600,
table tbody td.text-emerald-700,
table tbody td .text-emerald-600,
table tbody td .text-emerald-700 {
  color: #047857 !important;
}

table tbody td.text-amber-600,
table tbody td.text-amber-700,
table tbody td .text-amber-600,
table tbody td .text-amber-700 {
  color: #b45309 !important;
}

table tbody td.text-rose-600,
table tbody td.text-rose-700,
table tbody td .text-rose-600,
table tbody td .text-rose-700 {
  color: #e11d48 !important;
}

table tbody td.text-brand-700,
table tbody td.text-brand-800,
table tbody td .text-brand-700,
table tbody td .text-brand-800 {
  color: #222831 !important;
}

/* Action Buttons inside tables: clear, clickable, clean elevation */
table tbody td button:not(.order-btn-icon):not(.order-btn-action) {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  border-radius: 0.5rem !important;
  padding: 0.35rem 0.65rem !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  cursor: pointer !important;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

table tbody td button:not(.order-btn-icon):not(.order-btn-action):hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08) !important;
}

/* Order List Action Buttons - Sleek, Compact, High Contrast */
.order-btn-icon {
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem !important;
  min-height: 2rem !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex-shrink: 0 !important;
}

.order-btn-view {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
.order-btn-view:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
}
.order-btn-view i {
  color: #475569 !important;
  font-size: 0.75rem !important;
}
.order-btn-view:hover i {
  color: #0f172a !important;
}

.order-btn-action {
  height: 2rem !important;
  min-height: 2rem !important;
  padding: 0 0.65rem !important;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  background-color: #059669 !important;
  color: #ffffff !important;
  border: 1px solid #047857 !important;
  border-radius: 0.5rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  font-size: 0.6875rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.025em !important;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25) !important;
  cursor: pointer !important;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}
.order-btn-action:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  background-color: #047857 !important;
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.35) !important;
  transform: translateY(-1px) !important;
}
.order-btn-action,
.order-btn-action *,
.order-btn-action span,
.order-btn-action i {
  color: #ffffff !important;
  fill: #ffffff !important;
}
.order-btn-action i {
  font-size: 0.6875rem !important;
}

.order-btn-delete {
  background-color: #fff1f2 !important;
  border: 1px solid #fecdd3 !important;
  color: #e11d48 !important;
}
.order-btn-delete:hover {
  background-color: #ffe4e6 !important;
  border-color: #fda4af !important;
  color: #be123c !important;
  transform: translateY(-1px) !important;
}
.order-btn-delete i {
  color: #e11d48 !important;
  font-size: 0.75rem !important;
}
.order-btn-delete:hover i {
  color: #be123c !important;
}

/* Product images in tables */
table tbody td img {
  border-radius: 0.625rem !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

/* Empty & Loading states in tables */
table tbody td[colspan] {
  padding: 2.5rem 1rem !important;
  text-align: center !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

/* Print styling for invoices */
@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #ffffff !important;
  }
}

/* Top Announcement Bar Marquee Animation */
@keyframes top-marquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.top-marquee-track {
  display: inline-flex;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
  animation: top-marquee var(--marquee-duration, 32s) linear infinite;
}

.top-marquee-track:hover {
  animation-play-state: paused;
}

@keyframes top-fade-slide {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-top-fade-slide {
  animation: top-fade-slide 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   Mobile-First & Native App Ergonomics (ForceShip Mobile Engine)
   ========================================================================== */

/* Safe area insets for notched iPhones and edge-to-edge Android displays */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

.safe-area-pt {
  padding-top: max(0.5rem, env(safe-area-inset-top));
}

.safe-area-pb {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

/* Touch targets & tap feedback */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Eliminate iOS Safari auto-zoom on input focus by guaranteeing 16px font-size on mobile */
@media (max-width: 640px) {
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Smooth momentum scrolling for iOS & Android */
.overflow-y-auto,
.overflow-x-auto,
main,
aside {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Subtle clean scrollbars on mobile */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 3px;
    height: 3px;
  }
  ::-webkit-scrollbar-thumb {
    background: rgba(57, 62, 70, 0.3);
    border-radius: 9999px;
  }
}

/* Mobile Table Touch Scroll & Responsive Clean Layout */
@media (max-width: 768px) {
  .overflow-x-auto:has(> table),
  .table-responsive,
  .table-container {
    border-radius: 0.75rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  table thead th {
    padding: 0.65rem 0.75rem !important;
    font-size: 0.68rem !important;
  }

  table tbody td {
    padding: 0.75rem 0.75rem !important;
    font-size: 0.8rem !important;
  }

  table tbody td button {
    min-height: 34px !important;
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
  }
}

/* Mobile Modal Bottom Sheet Transformation (Natural Thumb Reach) */
@media (max-width: 640px) {
  #modal-container .fixed.inset-0 {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  #modal-container .fixed.inset-0 > div {
    width: 100% !important;
    max-width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 1.5rem !important;
    border-top-right-radius: 1.5rem !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28) !important;
    animation: mobile-sheet-up 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }

  @keyframes mobile-sheet-up {
    from {
      transform: translateY(100%);
      opacity: 0.8;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

