/* Go-Parts Ship Theme - ShipStation Inspired with Go-Parts Colors */

:root {
  /* Primary Colors (Go-Parts) */
  --gp-blue: #1e3a8a;
  --gp-blue-light: #2563eb;
  --gp-blue-dark: #1e3a8a;
  --gp-yellow: #fbbf24;
  --gp-yellow-dark: #f59e0b;
  --gp-orange: #f59e0b;

  /* Semantic Colors */
  --gp-success: #10b981;
  --gp-danger: #dc2626;
  --gp-warning: #f59e0b;
  --gp-info: #3b82f6;

  /* Neutral Colors */
  --gp-white: #ffffff;
  --gp-gray-50: #f8fafc;
  --gp-gray-100: #f1f5f9;
  --gp-gray-200: #e2e8f0;
  --gp-gray-300: #cbd5e1;
  --gp-gray-400: #94a3b8;
  --gp-gray-500: #64748b;
  --gp-gray-600: #475569;
  --gp-gray-700: #334155;
  --gp-gray-800: #1e293b;
  --gp-gray-900: #0f172a;

  /* Typography */
  --gp-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --gp-font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ============================================
   PHASE 1: HEADER / TOP BAR
   ============================================ */

/* Main Header/Topbar - Multiple selectors for specificity */
.fi-topbar,
header.fi-topbar,
.fi-layout > .fi-topbar,
[class*="fi-topbar"] {
  background: #1e3a8a !important;
  background-color: #1e3a8a !important;
  border-bottom: none !important;
  min-height: 48px !important;
}

.fi-topbar nav,
.fi-topbar > nav {
  height: 48px !important;
  background: #1e3a8a !important;
}

/* Logo in header - make it white (but NOT the user avatar) */
.fi-topbar .fi-logo img,
.fi-topbar img.fi-logo,
.fi-sidebar-header .fi-logo img {
  filter: brightness(0) invert(1) !important;
  height: 28px !important;
}

/* User avatar should NOT be inverted */
.fi-topbar .fi-user-avatar,
.fi-topbar .fi-user-menu img,
.fi-topbar img.fi-avatar {
  filter: none !important;
}

/* Topbar text and icons - be very specific */
.fi-topbar,
.fi-topbar *,
.fi-topbar span,
.fi-topbar svg,
.fi-topbar button,
.fi-topbar a {
  color: rgba(255, 255, 255, 0.9) !important;
}

.fi-topbar svg {
  stroke: rgba(255, 255, 255, 0.9) !important;
}

.fi-topbar a:hover,
.fi-topbar button:hover {
  color: #ffffff !important;
}

/* User menu button in topbar */
.fi-topbar .fi-dropdown-trigger,
.fi-topbar [class*="dropdown"] {
  color: rgba(255, 255, 255, 0.9) !important;
}

.fi-topbar .fi-dropdown-trigger:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 4px;
}

/* User menu in topbar */
.fi-topbar .fi-user-menu {
  display: flex !important;
  align-items: center !important;
}

/* User menu trigger button */
.fi-topbar .fi-user-menu-trigger {
  display: flex !important;
  align-items: center !important;
  padding: 4px !important;
  border-radius: 50% !important;
  background: transparent !important;
  transition: background 0.2s !important;
}

.fi-topbar .fi-user-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

/* Avatar in topbar - make visible with white background */
.fi-topbar .fi-user-avatar,
.fi-topbar .fi-avatar,
.fi-topbar img.fi-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.6) !important;
  background-color: #ffffff !important;
  object-fit: cover !important;
}

/* If avatar is default/placeholder, show initials background */
.fi-topbar .fi-avatar[src*="ui-avatars"],
.fi-topbar .fi-avatar:not([src]),
.fi-topbar .fi-avatar[src=""] {
  background-color: #fbbf24 !important;
}

/* Dropdown trigger button in header */
.fi-topbar .fi-dropdown > button,
.fi-topbar button.fi-user-menu-trigger {
  color: #ffffff !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
}

.fi-topbar .fi-dropdown > button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 6px !important;
}

/* Breadcrumbs in header */
.fi-topbar .fi-breadcrumbs,
.fi-topbar [class*="breadcrumb"] {
  color: rgba(255, 255, 255, 0.9) !important;
}

.fi-topbar .fi-breadcrumbs a {
  color: rgba(255, 255, 255, 0.7) !important;
}

.fi-topbar .fi-breadcrumbs a:hover {
  color: #ffffff !important;
}

/* Global search in header */
.fi-topbar .fi-global-search-input,
.fi-topbar input[type="search"] {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

.fi-topbar .fi-global-search-input::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}

.fi-topbar .fi-global-search-input:focus {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Ensure topbar container has blue bg */
.fi-layout .fi-topbar,
.fi-main-ctn .fi-topbar,
body .fi-topbar {
  background: #1e3a8a !important;
}

/* ============================================
   PHASE 2: SIDEBAR
   ============================================ */

/* Sidebar Container - compact width */
.fi-sidebar {
  background: var(--gp-gray-50) !important;
  border-right: 1px solid var(--gp-gray-200) !important;
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
}

/* Sidebar sticky offset must match the 48px topbar above. Filament's
   default assumes a 4rem (64px) topbar, which let the sticky sidebar
   slide 16px lower on pages tall enough to scroll — making the search
   bar's distance from the header differ between pages. */
@media (min-width: 64rem) {
  .fi-body-has-topbar .fi-sidebar {
    top: 48px !important;
    height: calc(100dvh - 48px) !important;
  }
}

/* Sidebar Nav - no side padding, items go edge to edge */
.fi-sidebar-nav {
  background: var(--gp-gray-50) !important;
  width: 200px !important;
  padding: 8px 0 !important;
}

/* Reset Filament's margins and ensure full width on all sidebar elements */
.fi-sidebar-nav ul,
.fi-sidebar-nav > ul,
.fi-sidebar-nav li,
.fi-sidebar-nav > ul > li {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  width: 200px !important;
  max-width: 200px !important;
}

/* Sidebar Header - hide since logo is in topbar */
.fi-sidebar-header {
  display: none !important;
}

/* Sidebar item container - full width */
.fi-sidebar-item {
  width: 200px !important;
  max-width: 200px !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Sidebar Item Buttons - full width, minimal padding */
.fi-sidebar-item-btn {
  color: var(--gp-gray-700) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  padding: 9px 8px 9px 12px !important;
  border-radius: 0 !important;
  margin: 0 !important;
  width: 200px !important;
  max-width: 200px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  border-left: 3px solid transparent !important;
  box-sizing: border-box !important;
}

.fi-sidebar-item-label {
  color: var(--gp-gray-700) !important;
  font-size: 13px !important;
}

.fi-sidebar-item-btn .fi-icon {
  color: var(--gp-gray-500) !important;
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
}

/* Sidebar Hover State */
.fi-sidebar-item-btn:hover {
  background: var(--gp-gray-200) !important;
}

.fi-sidebar-item-btn:hover .fi-sidebar-item-label {
  color: var(--gp-gray-800) !important;
}

/* Sidebar Active State - full width with left accent */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
  background: var(--gp-blue) !important;
  border-left: 3px solid var(--gp-yellow) !important;
  border-radius: 0 !important;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-sidebar-item.fi-active .fi-icon {
  color: var(--gp-white) !important;
}

/* Sidebar Group Labels */
.fi-sidebar-group-label {
  color: var(--gp-gray-500) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 12px 16px 6px !important;
}

/* Sidebar Group Collapse Button */
.fi-sidebar-group-btn {
  color: var(--gp-gray-500) !important;
}

/* ============================================
   PHASE 3: BUTTONS - Colorful & Vibrant
   ============================================ */

/* Primary Button - Blue */
.fi-btn-primary,
.fi-btn[wire\:click*="create"],
.fi-btn.fi-color-primary,
button[type="submit"].fi-btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  height: 34px !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3) !important;
  transition: all 0.2s ease !important;
}

.fi-btn-primary span,
.fi-btn[wire\:click*="create"] span,
.fi-btn.fi-color-primary span,
button[type="submit"].fi-btn span {
  color: #ffffff !important;
}

.fi-btn-primary svg,
.fi-btn[wire\:click*="create"] svg,
.fi-btn.fi-color-primary svg,
button[type="submit"].fi-btn svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.fi-btn-primary:hover,
.fi-btn[wire\:click*="create"]:hover,
.fi-btn.fi-color-primary:hover,
button[type="submit"].fi-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-1px) !important;
}

/* Gray toolbar buttons on orders listing pages (Print, Bulk Shipment, More,
   Assign To, Tag, Bulk Update, Reship, Other Actions, Hold) — icons match
   the label text color */
.fi-btn.toolbar-icon-inherit .fi-icon {
  color: inherit !important;
}

/* Bootstrap Primary Button (e.g. "Add Item" on order create) */
.fi-btn.btn-bootstrap-primary {
  background: #0d6efd !important;
  border: 1px solid #0d6efd !important;
  color: #ffffff !important;
}

.fi-btn.btn-bootstrap-primary span {
  color: #ffffff !important;
}

.fi-btn.btn-bootstrap-primary svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.fi-btn.btn-bootstrap-primary:hover {
  background: #0b5ed7 !important;
  border-color: #0a58ca !important;
}

/* Info Button - Cyan */
.fi-btn-info,
.fi-btn.fi-color-info,
[class*="fi-ac-btn-action"][class*="info"] {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
  border: none !important;
  color: var(--gp-white) !important;
  box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3) !important;
}

.fi-btn-info:hover,
.fi-btn.fi-color-info:hover {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
  box-shadow: 0 4px 8px rgba(6, 182, 212, 0.4) !important;
}

/* Success Button - Green */
.fi-btn-success,
.fi-btn.fi-color-success,
[class*="fi-ac-btn-action"][class*="success"] {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: none !important;
  color: var(--gp-white) !important;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3) !important;
}

.fi-btn-success:hover,
.fi-btn.fi-color-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4) !important;
}

/* Success buttons are filled green above with white text, so their icons
   must be white too (Filament colors filled-button icons from its palette
   via .fi-btn:not(.fi-outlined).fi-color > .fi-icon { color: var(--text) }) */
.fi-btn-success .fi-icon,
.fi-btn.fi-color-success .fi-icon,
[class*="fi-ac-btn-action"][class*="success"] .fi-icon {
  color: var(--gp-white) !important;
}

/* Warning Button - Amber */
.fi-btn-warning,
.fi-btn.fi-color-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border: none !important;
  color: var(--gp-white) !important;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3) !important;
}

.fi-btn-warning:hover,
.fi-btn.fi-color-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4) !important;
}

/* Danger Button - Red */
.fi-btn-danger,
.fi-btn.fi-color-danger,
.fi-btn[wire\:click*="delete"] {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border: none !important;
  color: var(--gp-white) !important;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3) !important;
}

.fi-btn-danger:hover,
.fi-btn.fi-color-danger:hover,
.fi-btn[wire\:click*="delete"]:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4) !important;
}

/* Danger buttons are filled red above, so their icons must be white
   (Filament colors outlined-button icons red via .fi-btn.fi-outlined.fi-color > .fi-icon) */
.fi-btn-danger .fi-icon,
.fi-btn.fi-color-danger .fi-icon,
.fi-btn[wire\:click*="delete"] .fi-icon {
  color: var(--gp-white) !important;
}

/* Secondary/Gray Button */
.fi-btn-secondary,
.fi-btn.fi-color-gray {
  background: var(--gp-white) !important;
  border: 1px solid var(--gp-gray-300) !important;
  color: var(--gp-gray-700) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  height: 34px !important;
  transition: all 0.2s ease !important;
}

.fi-btn-secondary:hover,
.fi-btn.fi-color-gray:hover {
  background: var(--gp-gray-50) !important;
  border-color: var(--gp-blue-light) !important;
  color: var(--gp-blue) !important;
}

/* Action buttons in header */
.fi-header-actions .fi-btn {
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  height: 34px !important;
}

/* Edit button - make it blue outlined */
.fi-header-actions .fi-btn[href*="edit"],
.fi-ac-action[wire\:click*="mountAction('edit')"] .fi-btn {
  background: var(--gp-white) !important;
  border: 1px solid #2563eb !important;
  color: #2563eb !important;
}

.fi-header-actions .fi-btn[href*="edit"]:hover {
  background: #eff6ff !important;
  border-color: #1d4ed8 !important;
}

/* Button with icon */
.fi-btn .fi-icon,
.fi-btn svg {
  width: 16px !important;
  height: 16px !important;
}

/* Action Group Buttons */
.fi-ac-group-btn {
  background: var(--gp-white) !important;
  border: 1px solid var(--gp-gray-300) !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  transition: all 0.2s ease !important;
}

.fi-ac-group-btn:hover {
  background: var(--gp-gray-50) !important;
  border-color: var(--gp-blue-light) !important;
}

/* ============================================
   PHASE 4: FORM ELEMENTS
   ============================================ */

/* Text Inputs */
.fi-input,
.fi-input-wrp input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"] {
  height: 32px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  border: 1px solid var(--gp-gray-300) !important;
  border-radius: 4px !important;
  background: var(--gp-white) !important;
  color: var(--gp-gray-800) !important;
}

.fi-input:focus,
.fi-input-wrp input:focus,
input:focus {
  border-color: var(--gp-blue-light) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
  outline: none !important;
}

.fi-input::placeholder,
input::placeholder {
  color: var(--gp-gray-400) !important;
}

/* Select Dropdowns */
.fi-select,
select {
  height: 32px !important;
  padding: 6px 28px 6px 10px !important;
  font-size: 13px !important;
  border: 1px solid var(--gp-gray-300) !important;
  border-radius: 4px !important;
  background: var(--gp-white) !important;
}

.fi-select:focus,
select:focus {
  border-color: var(--gp-blue-light) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
}

/* Textarea */
.fi-textarea,
textarea {
  padding: 8px 10px !important;
  font-size: 13px !important;
  border: 1px solid var(--gp-gray-300) !important;
  border-radius: 4px !important;
}

.fi-textarea:focus,
textarea:focus {
  border-color: var(--gp-blue-light) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
}

/* Checkboxes */
.fi-checkbox-input,
input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  border: 1px solid var(--gp-gray-300) !important;
  border-radius: 3px !important;
}

.fi-checkbox-input:checked,
input[type="checkbox"]:checked {
  background-color: var(--gp-blue) !important;
  border-color: var(--gp-blue) !important;
}

/* Labels */
.fi-fo-field-wrp-label,
label {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--gp-gray-600) !important;
  margin-bottom: 4px !important;
}

/* Helper Text */
.fi-fo-field-wrp-helper-text {
  font-size: 11px !important;
  color: var(--gp-gray-500) !important;
}

/* ============================================
   PHASE 5: DATA TABLES - Clean with Padding
   ============================================ */

/* Table Page Container - Add padding */
.fi-page-content > div {
  padding: 16px !important;
}

/* Table Main Container - with border and padding */
.fi-ta {
  background: var(--gp-white) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  overflow: hidden !important;
}

/* Table Content Container */
.fi-ta-ctn {
  background: var(--gp-white) !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Table Content Area with Horizontal Scroll */
.fi-ta-content-ctn {
  overflow-x: auto !important;
  border: none !important;
  border-radius: 0 !important;
}

/* Table Element */
.fi-ta-table {
  width: 100% !important;
  border-collapse: collapse !important;
  border: none !important;
}

/* Table Header Row */
.fi-ta-table > thead > tr {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* Table Header Cells - Clean Style with More Padding */
.fi-ta-header-cell {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 12px 16px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  border-radius: 0 !important;
}

/* Header cell with sort - dropdown arrow indicator */
.fi-ta-header-cell-sort-btn {
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  gap: 4px !important;
}

.fi-ta-header-cell-sort-btn .fi-icon {
  width: 12px !important;
  height: 12px !important;
  color: #64748b !important;
}

/* Table Body */
.fi-ta-table > tbody {
  background: var(--gp-white) !important;
}

/* Table Rows - More Padding */
.fi-ta-row {
  border-bottom: 1px solid #f1f5f9 !important;
  background: var(--gp-white) !important;
  transition: background-color 0.15s ease !important;
}

.fi-ta-row:hover {
  background: #f8fafc !important;
}

/* Alternate row colors for better readability */
.fi-ta-row:nth-child(even) {
  background: #fafbfc !important;
}

.fi-ta-row:nth-child(even):hover {
  background: #f1f5f9 !important;
}

/* Selected Row - Blue highlight */
.fi-ta-row.fi-selected {
  background: #eff6ff !important;
  border-left: 3px solid #2563eb !important;
}

.fi-ta-row.fi-selected:hover {
  background: #dbeafe !important;
}

.fi-ta-row.fi-selected > *:first-child::before {
  background: var(--gp-blue) !important;
}

/* Table Cells - More Padding */
.fi-ta-cell {
  padding: 0 !important;
  font-size: 13px !important;
  color: #334155 !important;
  vertical-align: middle !important;
  border-bottom: none !important;
}

/* Column wrapper inside cell - More Padding */
.fi-ta-cell > .fi-ta-col {
  padding: 12px 16px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

/* Text columns */
.fi-ta-text {
  font-size: 13px !important;
  color: #334155 !important;
}

.fi-ta-text-item {
  font-size: 13px !important;
}

/* Links in table - Blue color */
.fi-ta-cell a,
.fi-ta-text a,
.fi-ta-text-item a {
  color: #2563eb !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

.fi-ta-cell a:hover,
.fi-ta-text a:hover,
.fi-ta-text-item a:hover {
  color: #1d4ed8 !important;
  text-decoration: underline !important;
}

.fi-ta-cell a:hover,
.fi-ta-text a:hover,
.fi-ta-text-item a:hover {
  color: #004499 !important;
  text-decoration: underline !important;
}

/* Checkbox Column */
.fi-ta-cell:has(.fi-ta-record-checkbox),
.fi-ta-selection-cell {
  width: 32px !important;
  padding: 8px 8px 8px 12px !important;
}

.fi-ta-record-checkbox {
  margin: 0 !important;
}

/* Actions Column */
.fi-ta-cell:has(.fi-ta-actions) {
  padding: 4px 8px !important;
}

/* Icon Columns */
.fi-ta-icon-item {
  width: 16px !important;
  height: 16px !important;
}

.fi-ta-icon-item-icon {
  width: 16px !important;
  height: 16px !important;
}

/* Boolean Icons */
.fi-ta-cell .fi-icon {
  width: 16px !important;
  height: 16px !important;
}

/* Table Footer */
.fi-ta-table > tfoot {
  background: #f5f5f5 !important;
}

/* ============================================
   TABLE PAGINATION - ShipStation Style
   ============================================ */

/* Pagination Container */
.fi-ta-pagination {
  background: var(--gp-white) !important;
  border-top: 1px solid var(--gp-gray-200) !important;
  padding: 8px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 12px !important;
  color: #666666 !important;
}

/* Pagination Info - "Viewing 1 - 12 of 12" */
.fi-ta-pagination-records-count,
.fi-ta-pagination .fi-ta-pagination-records-count {
  font-size: 12px !important;
  color: #666666 !important;
}

/* Per Page Select */
.fi-ta-pagination-records-per-page-select {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.fi-ta-pagination-records-per-page-select select {
  height: 28px !important;
  padding: 4px 24px 4px 8px !important;
  font-size: 12px !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 0 !important;
  background: var(--gp-white) !important;
}

/* Pagination Buttons */
.fi-ta-pagination-btn {
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 8px !important;
  font-size: 12px !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 0 !important;
  background: var(--gp-white) !important;
  color: #333333 !important;
}

.fi-ta-pagination-btn:hover:not(:disabled) {
  background: #f5f5f5 !important;
  border-color: var(--gp-gray-400) !important;
}

.fi-ta-pagination-btn:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* Empty State */
.fi-ta-empty-state {
  padding: 48px 24px !important;
  text-align: center !important;
}

.fi-ta-empty-state-heading {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--gp-gray-700) !important;
}

.fi-ta-empty-state-description {
  font-size: 13px !important;
  color: var(--gp-gray-500) !important;
}

/* ============================================
   TABLE CONTAINER STYLING - Clean with Padding
   ============================================ */

/* Table container with subtle border and rounded corners */
.fi-ta-ctn,
div.fi-ta-ctn,
[class*="fi-ta-ctn"] {
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  overflow: hidden !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
}

/* Override Tailwind utilities */
.fi-ta-ctn.rounded-xl {
  border-radius: 8px !important;
}

.fi-ta-ctn.shadow-sm {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.fi-ta-ctn.ring-1 {
  --tw-ring-shadow: 0 0 #0000 !important;
}

/* Override all possible Tailwind ring utilities on table */
.fi-ta[class*="ring"],
.fi-ta-ctn[class*="ring"],
[class*="fi-ta"][class*="ring"],
.ring-1.fi-ta-ctn,
.ring-gray-950\/5.fi-ta-ctn {
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
}

/* Override all possible Tailwind rounded utilities on table */
.fi-ta[class*="rounded"],
.fi-ta-ctn[class*="rounded"],
[class*="fi-ta"][class*="rounded"],
.rounded-xl.fi-ta-ctn {
  border-radius: 8px !important;
}

/* Override all shadow utilities */
.fi-ta[class*="shadow"],
.fi-ta-ctn[class*="shadow"],
.shadow-sm.fi-ta-ctn {
  box-shadow: none !important;
  --tw-shadow: 0 0 #0000 !important;
}

/* ============================================
   PHASE 6: ACTION & FILTER BARS - ShipStation Style
   ============================================ */

/* Table Header Container (above the table) */
.fi-ta-header {
  background: var(--gp-white) !important;
  padding: 0 !important;
  border-bottom: none !important;
}

/* Header Toolbar - Contains search, actions, filters */
.fi-ta-header-toolbar {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 0 !important;
  background: var(--gp-white) !important;
  border-bottom: 1px solid var(--gp-gray-200) !important;
}

/* Actions Row (Print, Void Label, etc.) */
.fi-ta-header-toolbar-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid var(--gp-gray-200) !important;
  background: var(--gp-white) !important;
}

/* Action Buttons Style */
.fi-ta-header-toolbar .fi-btn,
.fi-ta-header-toolbar button {
  height: 30px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 3px !important;
  background: var(--gp-white) !important;
  color: #333333 !important;
  white-space: nowrap !important;
}

.fi-ta-header-toolbar .fi-btn:hover,
.fi-ta-header-toolbar button:hover {
  background: #f5f5f5 !important;
  border-color: #b0b0b0 !important;
}

/* Primary action buttons (like Export) */
.fi-ta-header-toolbar .fi-btn-primary,
.fi-ta-header-toolbar .fi-btn.fi-btn-primary {
  background: var(--gp-white) !important;
  color: #333333 !important;
  border: 1px solid #d0d0d0 !important;
}

/* Search and Filter Row */
.fi-ta-header-toolbar-search-and-filters {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  background: var(--gp-white) !important;
  flex-wrap: wrap !important;
}

/* "Filter By:" Label - Add via CSS or component */
.fi-ta-filters-container::before {
  content: "Filter By:" !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #666666 !important;
  margin-right: 8px !important;
}

/* Search Input in Table */
.fi-ta-search-field {
  order: -1 !important;
  flex: 0 0 200px !important;
}

.fi-ta-search-input,
.fi-ta-search-field input {
  height: 28px !important;
  padding: 4px 10px 4px 32px !important;
  font-size: 12px !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 3px !important;
  background: var(--gp-white) !important;
}

.fi-ta-search-input:focus,
.fi-ta-search-field input:focus {
  border-color: var(--gp-blue-light) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

/* Filter Buttons - ShipStation dropdown style */
.fi-ta-filters-btn,
.fi-ta-toggle-column-trigger-btn,
.fi-ta-header-toolbar [class*="filter"] button {
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 3px !important;
  background: var(--gp-white) !important;
  color: #333333 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.fi-ta-filters-btn:hover,
.fi-ta-toggle-column-trigger-btn:hover {
  background: #f5f5f5 !important;
  border-color: #b0b0b0 !important;
}

/* Active Filter Button (when filter is applied) */
.fi-ta-filters-btn[data-active="true"],
.fi-ta-filters-btn.fi-active,
.fi-ta-header-toolbar button[aria-expanded="true"] {
  background: #e8f0fe !important;
  border-color: #4a90d9 !important;
  color: #1a5dad !important;
}

/* Filter Dropdown Indicator */
.fi-ta-filters-btn::after,
.fi-ta-toggle-column-trigger-btn .fi-icon {
  content: "" !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 4px solid transparent !important;
  border-right: 4px solid transparent !important;
  border-top: 4px solid #666666 !important;
  margin-left: 4px !important;
}

/* Filter Dropdown Panel */
.fi-ta-filters {
  background: var(--gp-white) !important;
  border: 1px solid var(--gp-gray-200) !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  padding: 12px !important;
  min-width: 200px !important;
}

/* Filter Form in Panel */
.fi-ta-filters .fi-fo-field-wrp {
  margin-bottom: 8px !important;
}

.fi-ta-filters .fi-fo-field-wrp:last-child {
  margin-bottom: 0 !important;
}

/* Clear Filters Link - ShipStation Red X style */
.fi-ta-clear-filters-btn {
  color: #cc0000 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-left: 8px !important;
  text-decoration: none !important;
}

.fi-ta-clear-filters-btn::before {
  content: "✕" !important;
  font-size: 10px !important;
  font-weight: bold !important;
}

.fi-ta-clear-filters-btn:hover {
  color: #990000 !important;
  text-decoration: underline !important;
}

/* Column Toggle Button */
.fi-ta-toggle-column-trigger-btn {
  order: 100 !important;
}

/* Bulk Actions Dropdown */
.fi-ta-bulk-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.fi-ta-bulk-actions-btn {
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 3px !important;
  background: var(--gp-white) !important;
}

/* ============================================
   PHASE 6B: TABS & PAGE LAYOUT - ShipStation Style
   ============================================ */

/* Page Title Area */
.fi-header {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Page Header Container */
.fi-header-heading {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #333333 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Tabs Container (like ShipStation's "All" tab) */
.fi-tabs {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  border-bottom: 1px solid var(--gp-gray-200) !important;
  background: var(--gp-white) !important;
  margin-bottom: 0 !important;
}

.fi-tabs-nav {
  display: flex !important;
  gap: 0 !important;
}

/* Individual Tab */
.fi-tabs-tab {
  padding: 10px 16px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #666666 !important;
  border-bottom: 2px solid transparent !important;
  background: transparent !important;
  transition: all 0.15s ease !important;
  cursor: pointer !important;
}

.fi-tabs-tab:hover {
  color: #333333 !important;
  background: #f5f5f5 !important;
}

/* Active Tab */
.fi-tabs-tab.fi-active,
.fi-tabs-tab[aria-selected="true"] {
  color: #1a5dad !important;
  border-bottom: 2px solid #1a5dad !important;
  background: transparent !important;
}

/* Columns Button (right side) */
.fi-ta-toggle-column-trigger-btn,
button[data-toggle="columns"] {
  position: relative !important;
  margin-left: auto !important;
  color: #0066cc !important;
  font-size: 12px !important;
  background: transparent !important;
  border: none !important;
  padding: 4px 8px !important;
}

.fi-ta-toggle-column-trigger-btn:hover {
  text-decoration: underline !important;
  background: transparent !important;
  border: none !important;
}

/* Table Container - No outer border anywhere */
.fi-page .fi-ta,
.fi-main .fi-ta,
.fi-ta,
.fi-ta-ctn {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Horizontal Scrollbar styling */
.fi-ta-content-ctn::-webkit-scrollbar {
  height: 10px !important;
}

.fi-ta-content-ctn::-webkit-scrollbar-track {
  background: #f1f1f1 !important;
}

.fi-ta-content-ctn::-webkit-scrollbar-thumb {
  background: #c1c1c1 !important;
  border-radius: 0 !important;
}

.fi-ta-content-ctn::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1 !important;
}

/* ============================================
   PHASE 6C: INLINE FILTERS - ShipStation Style
   ============================================ */

/* Inline filters row */
.fi-ta-header-toolbar > div {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 8px 12px !important;
}

/* Filter groups inline */
.fi-ta-filters-dropdown {
  display: inline-flex !important;
  align-items: center !important;
}

/* Make select filters look like ShipStation dropdowns */
.fi-ta-header-toolbar select,
.fi-ta .fi-select-input {
  height: 28px !important;
  padding: 4px 28px 4px 10px !important;
  font-size: 12px !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 0 !important;
  background: var(--gp-white) !important;
  color: #333333 !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666666' d='M6 8L2 4h8z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
}

.fi-ta-header-toolbar select:hover,
.fi-ta .fi-select-input:hover {
  border-color: #b0b0b0 !important;
}

.fi-ta-header-toolbar select:focus,
.fi-ta .fi-select-input:focus {
  border-color: #4a90d9 !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2) !important;
}

/* ============================================
   PHASE 7: TYPOGRAPHY & SPACING
   ============================================ */

/* Base Typography */
body {
  font-family: var(--gp-font-family) !important;
  font-size: 13px !important;
  color: var(--gp-gray-700) !important;
}

/* Page Title */
.fi-header-heading {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--gp-gray-800) !important;
}

/* Section Titles */
.fi-section-header-heading {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--gp-gray-800) !important;
}

/* Main Content Area - Full width, no right-side gap */
.fi-main {
  background: var(--gp-white) !important;
  padding: 12px 0 12px 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Override Filament's default padding on main content */
.fi-main.px-4,
.fi-main.md\:px-6,
.fi-main.lg\:px-8 {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Main content container - full width */
.fi-main-ctn {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* Page content wrapper */
.fi-page {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
}

/* Table should span full width */
.fi-ta {
  width: 100% !important;
  max-width: 100% !important;
}

/* Header area - full width with small padding */
.fi-header {
  padding: 12px 16px !important;
  margin: 0 !important;
}

/* Layout wrapper - full width */
.fi-layout {
  width: 100% !important;
  max-width: 100% !important;
}

/* Body - full width */
.fi-body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* Ensure content stretches edge to edge */
.fi-ta-ctn,
.fi-ta-content-ctn,
.fi-ta-header-toolbar {
  width: 100% !important;
  max-width: 100% !important;
}

/* Cards - Flat design, no rounded corners */
.fi-section,
.fi-card {
  background: var(--gp-white) !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* ============================================
   PHASE 8: POLISH & MISC
   ============================================ */

/* Badges */
.fi-badge {
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 2px !important;
}

.fi-badge-success {
  background: #d1fae5 !important;
  color: #065f46 !important;
}

.fi-badge-warning {
  background: #fef3c7 !important;
  color: #92400e !important;
}

.fi-badge-danger {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

.fi-badge-info {
  background: #dbeafe !important;
  color: #1e40af !important;
}

/* Dropdowns */
.fi-dropdown-panel {
  border: 1px solid var(--gp-gray-200) !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
  background: var(--gp-white) !important;
}

/* Ship Date filter dropdown: Filament clamps the panel to 14rem (224px) with
   `max-width: 14rem !important` inside @layer components, while the custom
   content needs 280px. An unlayered !important loses to a layered one, so this
   override must live in the same `components` layer; the doubled class bumps
   specificity above Filament's `:scope .fi-dropdown-panel`. Sizing the panel
   keeps the content (width: 100%) inside its border instead of overflowing
   past the right edge. */
@layer components {
  .fi-dropdown-panel.fi-dropdown-panel:has(> .ship-date-dropdown) {
    width: 280px !important;
    max-width: 280px !important;
  }
}

/* Dropdown panel text - reset from topbar white text */
.fi-dropdown-panel,
.fi-dropdown-panel *,
.fi-dropdown-panel span,
.fi-dropdown-panel button,
.fi-dropdown-panel a,
.fi-dropdown-panel svg {
  color: var(--gp-gray-700) !important;
}

.fi-dropdown-panel svg {
  stroke: var(--gp-gray-500) !important;
}

/* Dropdown header */
.fi-dropdown-header {
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--gp-gray-200) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.fi-dropdown-header span {
  font-weight: 500 !important;
  color: var(--gp-gray-800) !important;
}

/* Dropdown list items */
.fi-dropdown-list {
  padding: 4px 0 !important;
}

.fi-dropdown-list-item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 16px !important;
  width: 100% !important;
  text-align: left !important;
  color: var(--gp-gray-700) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  font-size: 13px !important;
}

.fi-dropdown-list-item:hover {
  background: var(--gp-gray-100) !important;
}

.fi-dropdown-list-item svg {
  width: 16px !important;
  height: 16px !important;
  color: var(--gp-gray-500) !important;
  fill: var(--gp-gray-500) !important;
}

/* Dropdown list item label - specifically target the text span */
.fi-dropdown-list-item-label,
.fi-dropdown-list-item span,
.fi-dropdown-panel .fi-dropdown-list-item-label,
span.fi-dropdown-list-item-label {
  color: var(--gp-gray-700) !important;
}

/* Override any inherited white text from topbar */
body .fi-dropdown-panel .fi-dropdown-list-item,
body .fi-dropdown-panel .fi-dropdown-list-item span,
body .fi-dropdown-panel .fi-dropdown-list-item-label {
  color: #334155 !important;
}

/* Modals - hide by default, Alpine.js x-show will override with inline display */
.fi-modal {
  border-radius: 4px !important;
  display: none !important;
}

/* When modal is explicitly opened by Alpine.js, it adds fi-modal-open class */
.fi-modal.fi-modal-open {
  display: block !important;
}

/* Ensure modal close overlay never shows unless modal is open */
.fi-modal-close-overlay {
  display: none !important;
}

.fi-modal.fi-modal-open > .fi-modal-close-overlay {
  display: block !important;
}

/* Ensure modal window container shows when modal is open */
.fi-modal-window-ctn {
  display: none !important;
}

.fi-modal.fi-modal-open > .fi-modal-window-ctn {
  display: grid !important;
}

.fi-modal-header {
  border-bottom: 1px solid var(--gp-gray-200) !important;
}

/* Symmetric header padding so the heading sits centered between the modal top
   and the divider, level with the absolutely-positioned close button (top: 16px).
   Icon modals (confirmations) keep Filament's centered layout untouched. */
.fi-modal-window:not(.fi-modal-window-has-icon) > .fi-modal-header {
  padding: 16px 24px !important;
  align-items: center !important;
}

.fi-modal-footer {
  border-top: 1px solid var(--gp-gray-200) !important;
  padding: 16px 24px !important;
}

/* Filament's default modal Cancel button carries no fi-color-* class, so it keeps
   the stock 36px sizing while themed buttons are 34px — normalize footer buttons */
.fi-modal-footer .fi-btn {
  height: 34px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
}

/* Fix notification badge clipping in topbar */
.fi-topbar-ctn {
  overflow: visible !important;
}

/* Remove white background from notification badge container and shift badge down */
.fi-topbar .fi-icon-btn-badge-ctn {
  background: transparent !important;
  top: 0.6rem !important;
  transform: translateX(-50%) !important;
}

/* Notification Bell Badge - Override topbar white text for visibility */
.fi-topbar .fi-icon-btn-badge-ctn .fi-badge,
.fi-topbar .fi-topbar-database-notifications-btn .fi-badge {
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 5px !important;
  border-radius: 9px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  border: 2px solid #1e3a8a !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Notifications */
.fi-notification {
  border-radius: 4px !important;
}

/* Links */
a {
  color: var(--gp-blue-light) !important;
}

a:hover {
  color: var(--gp-blue) !important;
}

/* Widget styling */
.fi-widget {
  background: var(--gp-white) !important;
  border: 1px solid var(--gp-gray-200) !important;
  border-radius: 4px !important;
}

/* Stats Overview Widget */
.fi-wi-stats-overview-stat {
  border-right: 1px solid var(--gp-gray-200) !important;
}

.fi-wi-stats-overview-stat:last-child {
  border-right: none !important;
}

/* Account Widget */
.fi-wi-account-widget {
  background: var(--gp-white) !important;
}

/* ============================================
   CUSTOM TOP NAVIGATION BAR (ShipStation Style)
   ============================================ */

/* Hide Filament's default logo in topbar - we have our own */
.fi-topbar .fi-logo,
.fi-topbar [class*="fi-logo"] {
  display: none !important;
}

/* But NOT our custom logo */
.gp-logo {
  display: flex !important;
}

/* Main Navigation Container - integrates into Filament topbar */
.gp-topbar-nav {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  height: 100% !important;
  flex: 1 !important;
  margin-left: 0 !important;
}

.gp-topbar-nav-inner {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 100% !important;
  width: 100% !important;
}

/* Custom Logo in our nav */
.gp-logo {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  padding: 0 16px !important;
  margin-right: 8px !important;
}

.gp-logo img {
  height: 28px !important;
  width: auto !important;
  filter: brightness(0) invert(1) !important;
}

/* Navigation Items Container */
.gp-nav-items {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0 !important;
  height: 100% !important;
}

/* Right side - settings button */
.gp-nav-right {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  margin-left: auto !important;
  margin-right: 8px !important;
}

/* Individual Navigation Item */
.gp-nav-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 0 12px !important;
  height: 100% !important;
  color: rgba(255, 255, 255, 0.9) !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: all 0.15s ease !important;
  border-bottom: 2px solid transparent !important;
  background: transparent !important;
  white-space: nowrap !important;
}

.gp-nav-item:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.gp-nav-item.active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-bottom: 2px solid #fbbf24 !important;
}

.gp-nav-icon {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  stroke: currentColor !important;
  flex-shrink: 0 !important;
}

.gp-nav-item span {
  font-size: 13px !important;
  line-height: 1 !important;
}

/* Settings Button */
.gp-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.15s ease;
}

.gp-settings-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.gp-settings-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.gp-settings-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Ensure sidebar overlay never blocks the page on desktop */
.fi-sidebar-close-overlay {
  display: none !important;
}

/* Settings Overlay */
.gp-settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 50;
}

/* Settings Sidebar */
.gp-settings-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: #ffffff;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
  z-index: 51;
  display: flex;
  flex-direction: column;
}

.gp-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Settings header text - override topbar white */
.gp-settings-sidebar .gp-settings-header h3,
.gp-settings-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b !important;
}

.gp-settings-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b !important;
  transition: all 0.15s ease;
}

.gp-settings-close:hover {
  background: #e2e8f0;
  color: #334155 !important;
}

.gp-settings-sidebar .gp-settings-close svg,
.gp-settings-close svg {
  width: 20px;
  height: 20px;
  stroke: #64748b !important;
}

.gp-settings-close:hover svg {
  stroke: #334155 !important;
}

.gp-settings-content {
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}

/* Settings sidebar items - override topbar white color */
.gp-settings-sidebar .gp-settings-item,
.gp-settings-sidebar .gp-settings-item span,
.gp-settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #334155 !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.gp-settings-sidebar .gp-settings-item:hover,
.gp-settings-item:hover {
  background: #f1f5f9;
  color: #0f172a !important;
}

.gp-settings-sidebar .gp-settings-item svg,
.gp-settings-item svg {
  width: 20px;
  height: 20px;
  stroke: #64748b !important;
  flex-shrink: 0;
}

.gp-settings-sidebar .gp-settings-item:hover svg,
.gp-settings-item:hover svg {
  stroke: #334155 !important;
}

/* Transition utilities for Alpine.js */
.translate-x-full {
  transform: translateX(100%);
}

.translate-x-0 {
  transform: translateX(0);
}

/* ============================================
   COLORFUL STATUS BADGES & ACCENTS
   ============================================ */

/* Status Badge Base */
.fi-badge,
.status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
}

/* Awaiting Payment - Yellow/Amber */
.fi-badge-warning,
.status-awaiting-payment,
[class*="warning"] .fi-badge {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  color: #92400e !important;
  border: 1px solid #fcd34d !important;
}

/* On Hold - Gray */
.status-on-hold {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

/* Awaiting Shipment - Blue */
.fi-badge-info,
.status-awaiting-shipment,
[class*="info"] .fi-badge {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
  color: #1e40af !important;
  border: 1px solid #93c5fd !important;
}

/* Shipped - Green */
.fi-badge-success,
.status-shipped,
[class*="success"] .fi-badge {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
  color: #065f46 !important;
  border: 1px solid #6ee7b7 !important;
}

/* Delivered - Dark Green */
.status-delivered {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  color: #ffffff !important;
  border: none !important;
}

/* Cancelled - Red */
.fi-badge-danger,
.status-cancelled,
[class*="danger"] .fi-badge {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
  color: #991b1b !important;
  border: 1px solid #fca5a5 !important;
}

/* Table Action Buttons - Colorful */
.fi-ta-actions .fi-btn,
.fi-ta-row-actions .fi-btn {
  padding: 4px 8px !important;
  font-size: 12px !important;
  border-radius: 4px !important;
}

/* View Button - Blue */
.fi-ta-actions .fi-btn[href*="view"],
.fi-link-action[href*="view"] {
  color: #2563eb !important;
}

.fi-ta-actions .fi-btn[href*="view"]:hover {
  color: #1d4ed8 !important;
  background: #eff6ff !important;
}

/* Edit Button - Amber */
.fi-ta-actions .fi-btn[href*="edit"],
.fi-link-action[href*="edit"] {
  color: #d97706 !important;
}

.fi-ta-actions .fi-btn[href*="edit"]:hover {
  color: #b45309 !important;
  background: #fffbeb !important;
}

/* Delete Button - Red */
.fi-ta-actions .fi-btn[wire\:click*="delete"],
.fi-icon-btn-danger {
  color: #dc2626 !important;
}

.fi-ta-actions .fi-btn[wire\:click*="delete"]:hover {
  color: #b91c1c !important;
  background: #fef2f2 !important;
}

/* Sidebar Navigation - Colorful Icons */
.fi-sidebar-item-icon {
  color: #64748b !important;
  transition: color 0.2s ease !important;
}

.fi-sidebar-item-active .fi-sidebar-item-icon {
  color: #2563eb !important;
}

/* Active Sidebar Item - Blue accent */
.fi-sidebar-item-active {
  background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%) !important;
  border-left: 3px solid #2563eb !important;
}

.fi-sidebar-item-active .fi-sidebar-item-label {
  color: #1e40af !important;
  font-weight: 600 !important;
}

/* Header Actions - More Colorful */
.fi-header-actions {
  display: flex !important;
  gap: 8px !important;
}

/* Create/New Button - Always Blue */
.fi-header-actions .fi-btn[href*="create"],
.fi-header-actions .fi-ac-action:first-child .fi-btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: white !important;
  border: none !important;
}

/* Pagination - Subtle colors */
.fi-ta-pagination-btn {
  border-radius: 4px !important;
}

.fi-ta-pagination-btn:hover:not(:disabled) {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #2563eb !important;
}

/* Cards and Sections - Subtle shadow */
.fi-section,
.fi-card,
.fi-infolist-section {
  background: var(--gp-white) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Infolist - Better spacing and colors */
.fi-in-entry-wrp {
  padding: 12px 16px !important;
}

.fi-in-entry-wrp-label {
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.fi-in-text {
  color: #1e293b !important;
  font-size: 14px !important;
}

/* Notifications - Colorful */
.fi-notification-success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
  border-left: 4px solid #10b981 !important;
}

.fi-notification-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  border-left: 4px solid #f59e0b !important;
}

.fi-notification-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
  border-left: 4px solid #ef4444 !important;
}

.fi-notification-info {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
  border-left: 4px solid #3b82f6 !important;
}

/* Table Row Checkbox - Blue when checked */
.fi-ta-row input[type="checkbox"]:checked {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
}

/* Empty State - More inviting */
.fi-ta-empty-state {
  padding: 60px 24px !important;
}

.fi-ta-empty-state-icon {
  color: #94a3b8 !important;
  margin-bottom: 16px !important;
}

.fi-ta-empty-state-heading {
  color: #334155 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  margin-bottom: 8px !important;
}

.fi-ta-empty-state-description {
  color: #64748b !important;
  font-size: 14px !important;
  margin-bottom: 20px !important;
}

.fi-ta-empty-state-actions .fi-btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: white !important;
}

/* Focus states - Blue ring */
.fi-input:focus,
.fi-select:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Links - Always blue */
a:not(.fi-btn):not(.fi-sidebar-item):not(.fi-dropdown-list-item) {
  color: #2563eb !important;
}

a:not(.fi-btn):not(.fi-sidebar-item):not(.fi-dropdown-list-item):hover {
  color: #1d4ed8 !important;
}

/* ============================================
   CHART WIDGET SPACING FIX
   ============================================ */

/* Chart widget container */
.fi-wi-chart {
  height: auto !important;
}

/* Section content inside chart widget */
.fi-wi-chart .fi-section-content-ctn,
.fi-wi-chart .fi-section-content {
  padding-bottom: 8px !important;
}

/* The chart container div with x-data */
.fi-wi-chart .fi-section-content > div[wire\:poll],
.fi-wi-chart .fi-section-content > div {
  height: auto !important;
  width: 100% !important;
}

/* The actual chart div with x-load - LINE charts (full width) */
.fi-wi-chart[style*="col-span-lg: 1 / -1"] [x-load][data-chart-type="line"] {
  height: 250px !important;
  width: 100% !important;
}

/* Doughnut/pie charts in half-width containers */
.fi-wi-chart:not([style*="col-span-lg: 1 / -1"]) [x-load][data-chart-type="doughnut"],
.fi-wi-chart:not([style*="col-span-lg: 1 / -1"]) [x-load][data-chart-type="pie"] {
  height: 200px !important;
  width: 100% !important;
}

/* Canvas element - ensure full width */
.fi-wi-chart canvas {
  width: 100% !important;
}

/* ============================================
   SIDEBAR SEARCH BAR
   ============================================ */

.gp-sidebar-search {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--gp-gray-200, #e2e8f0);
}

.gp-sidebar-search-form {
  margin: 0;
}

.gp-sidebar-search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--gp-white, #ffffff);
  border: 1px solid var(--gp-gray-300, #cbd5e1);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gp-sidebar-search-input-wrapper:focus-within {
  border-color: var(--gp-blue-light, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.gp-sidebar-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--gp-gray-800, #1e293b);
  background: transparent;
  line-height: 1.4;
}

.gp-sidebar-search-input::placeholder {
  color: var(--gp-gray-400, #94a3b8);
}

.gp-sidebar-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--gp-gray-500, #64748b);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.gp-sidebar-search-btn:hover {
  color: var(--gp-blue-light, #2563eb);
  background-color: var(--gp-gray-50, #f8fafc);
}

/* ============================================================
   P1 PRODUCTION AUDIT FIXES
   ============================================================ */

/* P1-1: Compact table rows for high-volume scanning */
.fi-ta-cell {
  padding-top: 0.15rem !important;
  padding-bottom: 0.15rem !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.fi-ta-row {
  min-height: auto !important;
}

.fi-ta-cell .fi-ta-text-item {
  font-size: 13px !important;
  line-height: 1.3 !important;
}

/* Compact header cells */
.fi-ta-header-cell {
  padding-top: 0.35rem !important;
  padding-bottom: 0.35rem !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

/* Reduce badge padding for compact rows */
.fi-ta-cell .fi-badge {
  padding-top: 0.05rem !important;
  padding-bottom: 0.05rem !important;
  font-size: 11px !important;
}

/* Compact checkbox cells */
.fi-ta-cell input[type="checkbox"],
.fi-ta-header-cell input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
}

/* Tighter action button spacing */
.fi-ta-actions {
  gap: 0.25rem !important;
}

/* Reduce icon size in cells */
.fi-ta-cell .fi-ta-text-item-icon {
  width: 14px !important;
  height: 14px !important;
}

/* P1-2: Sticky table headers */
.fi-ta-header-cell {
  position: sticky;
  top: 0;
  z-index: 10;
  background: white;
  box-shadow: 0 1px 0 0 #e2e8f0;
}

/* P1: Table row hover state for clickability feedback */
.fi-ta-row:hover {
  background-color: #f8fafc !important;
  transition: background-color 0.1s ease;
}

/* Item Name truncation with styled tooltip on hover */
.item-name-truncate {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
  cursor: default;
  position: relative;
}

/* Hidden tooltip child — positioned by JS outside table overflow */
.item-name-tooltip {
  display: none;
}

/* Global floating tooltip created by JS */
#gp-tooltip {
  position: fixed;
  background: #1e293b;
  color: #f1f5f9;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  max-width: 480px;
  white-space: normal;
  word-break: break-word;
  z-index: 99999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  animation: tooltipFadeIn 0.15s ease-out;
}

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

/* P1-10: Consistent form card styling across Create Shipment and Browse Rate */
.form-card,
.info-card {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.form-card-header {
  border-radius: 12px 12px 0 0;
}

/* P1: Navigation badge styling */
.fi-sidebar-item-badge {
  font-size: 11px !important;
  min-width: 20px;
  text-align: center;
}

/* ============================================================
   P2 PRODUCTION AUDIT FIXES
   ============================================================ */

/* P2-1: Enhanced dashboard KPI stat cards */
.fi-wi-stats-overview-stat {
  border-top: 3px solid var(--gp-blue-light, #2563eb) !important;
  border-radius: 10px !important;
}

.fi-wi-stats-overview-stat:nth-child(2) {
  border-top-color: #16a34a !important;
}

.fi-wi-stats-overview-stat:nth-child(3) {
  border-top-color: #f59e0b !important;
}

.fi-wi-stats-overview-stat:nth-child(4) {
  border-top-color: #8b5cf6 !important;
}

.fi-wi-stats-overview-stat:nth-child(5) {
  border-top-color: #06b6d4 !important;
}

.fi-wi-stats-overview-stat-value {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

.fi-wi-stats-overview-stat-description {
  font-size: 0.8rem !important;
  margin-top: 4px;
}

/* P2-2: Mobile dashboard responsive fixes */
@media (max-width: 640px) {
  .fi-wi-stats-overview-stat {
    min-width: 140px !important;
    flex-shrink: 0 !important;
  }

  .fi-wi-stats-overview {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }

  .fi-wi-stats-overview > div {
    flex-wrap: nowrap !important;
    min-width: max-content;
  }

  .fi-wi-stats-overview-stat {
    scroll-snap-align: start;
  }

  .fi-wi-stats-overview-stat-value {
    font-size: 1.35rem !important;
  }
}

@media (max-width: 768px) {
  .fi-wi-chart-container,
  .fi-wi-stats-chart {
    min-height: 200px;
  }
}

/* P2-4: Improved topbar active state indicator */
.gp-nav-item.active {
  background: rgba(255, 255, 255, 0.15) !important;
  border-bottom: 3px solid #ffffff !important;
  font-weight: 600 !important;
  padding-bottom: calc(0.5rem - 3px) !important;
}

.gp-settings-btn.active {
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px;
}

/* ============================================================
   DARK MODE OVERRIDES
   Filament adds .dark to <html> when dark mode is active.
   These override the hardcoded light-mode colors above.
   ============================================================ */

.dark {
  --gp-white: #1e293b;
  --gp-gray-50: #1e293b;
  --gp-gray-100: #334155;
  --gp-gray-200: #475569;
  --gp-gray-800: #e2e8f0;
  --gp-gray-900: #f1f5f9;
}

/* Topbar stays the same brand blue in dark mode */

/* Sidebar */
.dark .fi-sidebar {
  background: #0f172a !important;
  border-right-color: #334155 !important;
}

.dark .fi-sidebar-nav,
.dark .fi-sidebar-nav-groups {
  background: #0f172a !important;
}

.dark .fi-sidebar-item-label,
.dark .fi-sidebar-group-label {
  color: #cbd5e1 !important;
}

.dark .fi-sidebar-item-button:hover {
  background: #1e293b !important;
}

.dark .fi-sidebar-item-button.fi-active {
  background: #1e3a8a !important;
  color: #ffffff !important;
}

/* Page backgrounds */
.dark .fi-body,
.dark .fi-main,
.dark .fi-page {
  background: #0f172a !important;
}

.dark .fi-section,
.dark .fi-section-content-ctn {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* Table container */
.dark .fi-ta {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* Table header */
.dark .fi-ta-header-cell {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
  box-shadow: 0 1px 0 0 #334155 !important;
  color: #94a3b8 !important;
}

.dark .fi-ta-header-cell-label {
  color: #94a3b8 !important;
}

/* Table rows */
.dark .fi-ta-row {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
}

.dark .fi-ta-row:hover {
  background: #334155 !important;
}

.dark .fi-ta-row:nth-child(even) {
  background: #1a2536 !important;
}

.dark .fi-ta-row:nth-child(even):hover {
  background: #334155 !important;
}

/* Table selected rows */
.dark .fi-ta-row.fi-selected {
  background: #172554 !important;
  border-left-color: #3b82f6 !important;
}

.dark .fi-ta-row.fi-selected:hover {
  background: #1e3a8a !important;
}

/* Table cell text */
.dark .fi-ta-cell .fi-ta-text-item {
  color: #e2e8f0 !important;
}

.dark .fi-ta-cell {
  color: #e2e8f0 !important;
}

.dark .fi-ta-text {
  color: #e2e8f0 !important;
}

.dark .fi-ta-cell > .fi-ta-col {
  color: #e2e8f0 !important;
}

.dark .fi-ta-cell a {
  color: #60a5fa !important;
}

.dark .fi-ta-cell a:hover {
  color: #93bbfd !important;
}

/* Empty state */
.dark .fi-ta-empty-state {
  color: #94a3b8 !important;
}

/* Filters */
.dark .fi-ta-filters {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* Pagination */
.dark .fi-ta-pagination {
  background: #1e293b !important;
  border-top-color: #334155 !important;
}

/* Cards & widgets */
.dark .fi-wi-stats-overview-stat {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.dark .fi-wi-stats-overview-stat-value {
  color: #f1f5f9 !important;
}

.dark .fi-wi-stats-overview-stat-description {
  color: #94a3b8 !important;
}

.dark .fi-wi-stats-overview-stat-label {
  color: #cbd5e1 !important;
}

.dark .fi-card,
.dark .fi-wi-chart {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* Forms & inputs */
.dark .fi-input-wrp,
.dark .fi-fo-field-wrp {
  background: #0f172a !important;
  border-color: #475569 !important;
}

.dark .fi-input,
.dark .fi-select-input {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}

.dark input,
.dark select,
.dark textarea {
  color: #e2e8f0 !important;
}

/* Modals */
.dark .fi-modal-window {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.dark .fi-modal-heading {
  color: #f1f5f9 !important;
}

/* Dropdown menus */
.dark .fi-dropdown-panel {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.dark .fi-dropdown-list-item-label {
  color: #e2e8f0 !important;
}

.dark .fi-dropdown-list-item:hover {
  background: #334155 !important;
}

/* Buttons */
.dark .fi-btn-color-gray {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

/* Filled success/danger buttons (New Order, Mark as Shipped, Cancel
   Orders) get their text from `var(--gp-white)`, which .dark remaps to
   #1e293b — making the label dark-on-green/red. Force real white. */
.dark .fi-btn-success,
.dark .fi-btn.fi-color-success,
.dark [class*="fi-ac-btn-action"][class*="success"],
.dark .fi-btn-danger,
.dark .fi-btn.fi-color-danger,
.dark .fi-btn[wire\:click*="delete"] {
  color: #ffffff !important;
}
.dark .fi-btn-success .fi-icon,
.dark .fi-btn.fi-color-success .fi-icon,
.dark [class*="fi-ac-btn-action"][class*="success"] .fi-icon,
.dark .fi-btn-danger .fi-icon,
.dark .fi-btn.fi-color-danger .fi-icon,
.dark .fi-btn[wire\:click*="delete"] .fi-icon {
  color: #ffffff !important;
}

/* Tabs */
.dark .fi-tabs-tab {
  color: #94a3b8 !important;
}

.dark .fi-tabs-tab[aria-selected="true"] {
  color: #60a5fa !important;
}

/* Tooltip override */
.dark #gp-tooltip {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

/* Topbar navigation items in dark mode */
.dark .gp-nav-item {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Select/combobox dropdowns */
.dark .choices__list--dropdown {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.dark .choices__item--selectable {
  color: #e2e8f0 !important;
}

/* Notification badges */
.dark .fi-badge {
  border-color: transparent !important;
}

/* Search inputs */
.dark .fi-global-search-field input {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

/* Breadcrumbs */
.dark .fi-breadcrumbs li {
  color: #94a3b8 !important;
}

/* Checkbox styling in dark mode */
.dark .fi-ta-cell input[type="checkbox"] {
  background: #0f172a !important;
  border-color: #475569 !important;
}

.dark .fi-ta-cell input[type="checkbox"]:checked {
  background: #2563eb !important;
  border-color: #2563eb !important;
}

/* ============================================
   FIX: Dropdown menus above grids must have a
   solid background. Without this, the open
   dropdown overlaps the table below and the
   grid text bleeds through, making the menu
   items unreadable. Applies to all order
   pages (Awaiting Shipment / Payment, On Hold,
   Cancelled, Shipped, Manual, Search). */
.fi-dropdown-panel {
  background-color: #ffffff !important;
  background: #ffffff !important;
  z-index: 50 !important;
}

/* Cover any direct child wrapper of the panel
   (e.g., the Tag dropdown uses custom inline
   divs instead of fi-dropdown-list). */
.fi-dropdown-panel > *,
.fi-dropdown-panel .fi-dropdown-list {
  background-color: #ffffff !important;
}

/* Default state of items inside the panel must
   stay transparent so the panel's white bg
   shows through; hover keeps the gray accent. */
.fi-dropdown-panel .fi-dropdown-list-item {
  background-color: transparent !important;
}
.fi-dropdown-panel .fi-dropdown-list-item:hover {
  background-color: var(--gp-gray-100) !important;
}

/* Dark mode parity */
.dark .fi-dropdown-panel,
.dark .fi-dropdown-panel > *,
.dark .fi-dropdown-panel .fi-dropdown-list {
  background-color: #1e293b !important;
}

/* Scrollbar for scrollable dropdown panels (searchable select listboxes such
   as Edit Tags, and any long menu). Filament only sets overflow-y: auto, and
   the resulting default scrollbar sits flush against the panel with almost no
   contrast — the list reads as truncated with no hint that it scrolls. Give
   the track and thumb explicit colors in both themes, matching the treatment
   the tables already get above. */
.fi-dropdown-panel.fi-scrollable::-webkit-scrollbar {
  width: 10px !important;
}
.fi-dropdown-panel.fi-scrollable::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
}
.fi-dropdown-panel.fi-scrollable::-webkit-scrollbar-thumb {
  background: #c1c8d1 !important;
  border: 2px solid #f1f5f9 !important;
  border-radius: 999px !important;
}
.fi-dropdown-panel.fi-scrollable::-webkit-scrollbar-thumb:hover {
  background: #94a3b8 !important;
}

.dark .fi-dropdown-panel.fi-scrollable::-webkit-scrollbar-track {
  background: #1e293b !important;
}
.dark .fi-dropdown-panel.fi-scrollable::-webkit-scrollbar-thumb {
  background: #64748b !important;
  border: 2px solid #1e293b !important;
}
.dark .fi-dropdown-panel.fi-scrollable::-webkit-scrollbar-thumb:hover {
  background: #94a3b8 !important;
}

/* Firefox has no ::-webkit-scrollbar, so give it the standard properties.
   Gated behind @supports so Chromium/Safari never see them — setting
   scrollbar-color there makes Chrome ignore the rules above. */
@supports not selector(::-webkit-scrollbar) {
  .fi-dropdown-panel.fi-scrollable {
    scrollbar-width: thin;
    scrollbar-color: #c1c8d1 #f1f5f9;
  }
  .dark .fi-dropdown-panel.fi-scrollable {
    scrollbar-color: #64748b #1e293b;
  }
}

/* ============================================================
   DARK MODE — COMPREHENSIVE OVERRIDES (added in audit)
   These rules ONLY apply when <html class="dark"> is present.
   They override hardcoded light colors (incl. inline styles)
   from blade pages and the upper part of this file. Light mode
   is unaffected.
   ============================================================ */

/* Fill in missing CSS variables for dark mode so anything still
   using var(--gp-gray-*) cascades correctly. */
.dark {
  --gp-gray-300: #475569;
  --gp-gray-400: #64748b;
  --gp-gray-500: #94a3b8;
  --gp-gray-600: #cbd5e1;
  --gp-gray-700: #e2e8f0;
}

/* Body inheritance must read as light text on dark surfaces. */
.dark body {
  color: #e2e8f0 !important;
}

/* ---------- Pagination ---------- */
.dark .fi-ta-pagination {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-top-color: #334155 !important;
}
.dark .fi-ta-pagination-records-count,
.dark .fi-ta-pagination .fi-ta-pagination-records-count,
.dark .fi-ta-pagination * {
  color: #cbd5e1 !important;
}
.dark .fi-ta-pagination-btn {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
.dark .fi-ta-pagination-btn:hover:not(:disabled) {
  background: #334155 !important;
  border-color: #64748b !important;
  color: #ffffff !important;
}
.dark .fi-ta-pagination-records-per-page-select select {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

/* ---------- Table header toolbar (search, filters, columns) ---------- */
.dark .fi-ta-header,
.dark .fi-ta-header-toolbar,
.dark .fi-ta-header-toolbar-actions,
.dark .fi-ta-header-toolbar-search-and-filters {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.dark .fi-ta-header-toolbar .fi-btn,
.dark .fi-ta-header-toolbar button {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
.dark .fi-ta-header-toolbar .fi-btn:hover,
.dark .fi-ta-header-toolbar button:hover {
  background: #334155 !important;
  border-color: #64748b !important;
}
.dark .fi-ta-search-input,
.dark .fi-ta-search-field input {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
.dark .fi-ta-search-input::placeholder,
.dark .fi-ta-search-field input::placeholder {
  color: #94a3b8 !important;
}
.dark .fi-ta-filters-btn,
.dark .fi-ta-toggle-column-trigger-btn {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
.dark .fi-ta-filters-btn:hover,
.dark .fi-ta-toggle-column-trigger-btn:hover {
  background: #334155 !important;
  border-color: #64748b !important;
}
.dark .fi-ta-filters-btn[data-active="true"],
.dark .fi-ta-filters-btn.fi-active,
.dark .fi-ta-header-toolbar button[aria-expanded="true"] {
  background: #1e3a8a !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}
.dark .fi-ta-filters-btn::after {
  border-top-color: #cbd5e1 !important;
}
.dark .fi-ta-clear-filters-btn {
  color: #f87171 !important;
}
.dark .fi-ta-clear-filters-btn:hover {
  color: #fca5a5 !important;
}
.dark .fi-ta-table > thead > tr {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
  border-bottom-color: #334155 !important;
}
.dark .fi-ta-table > tfoot {
  background: #0f172a !important;
}
.dark .fi-ta-header-cell-sort-btn {
  color: #cbd5e1 !important;
}
.dark .fi-ta-header-cell-sort-btn .fi-icon {
  color: #94a3b8 !important;
}

/* Table empty state (e.g., "No orders awaiting payment") */
.dark .fi-ta-empty-state-heading {
  color: #e2e8f0 !important;
}
.dark .fi-ta-empty-state-description {
  color: #94a3b8 !important;
}
.dark .fi-ta-empty-state-icon {
  color: #64748b !important;
}

/* ---------- Tabs ---------- */
.dark .fi-tabs {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
}
.dark .fi-tabs-tab:hover {
  color: #f1f5f9 !important;
  background: #334155 !important;
}
.dark .fi-tabs-tab.fi-active,
.dark .fi-tabs-tab[aria-selected="true"] {
  color: #93bbfd !important;
  border-bottom-color: #60a5fa !important;
  background: transparent !important;
}

/* ---------- Sidebar (active item + group btn + light gradient) ----------
   Filament uses TWO separate classes on the active <li>:
   `fi-sidebar-item fi-active` (NOT a single `.fi-sidebar-item-active`).
   The light-mode rule at line ~287 sets active label/icon color to
   `var(--gp-white)`, which I remap to #1e293b for `.dark` further up
   in this file — that makes the active label invisible on the dark
   blue bg. These rules force white text/icon for the active state. */
.dark .fi-sidebar-item-active,
.dark .fi-sidebar-item.fi-active,
.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
  background: linear-gradient(90deg, #1e3a8a 0%, #0f172a 100%) !important;
  border-left: 3px solid #fbbf24 !important;
}
.dark .fi-sidebar-item-active .fi-sidebar-item-label,
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-label,
.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label {
  color: #ffffff !important;
}
.dark .fi-sidebar-item-active .fi-sidebar-item-icon,
.dark .fi-sidebar-item-active .fi-icon,
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-icon,
.dark .fi-sidebar-item.fi-active .fi-icon,
.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}
.dark .fi-sidebar-group-btn {
  color: #94a3b8 !important;
}
.dark .fi-sidebar-item-icon {
  color: #94a3b8 !important;
}

/* ---------- Sidebar search (override blade inline styles) ---------- */
.dark .gp-sidebar-search {
  border-bottom-color: #334155 !important;
}
.dark .gp-sidebar-search > div,
.dark .gp-sidebar-search form > div {
  background: #0f172a !important;
  border-color: #475569 !important;
}
.dark .gp-sidebar-search input {
  background: transparent !important;
  color: #e2e8f0 !important;
}
.dark .gp-sidebar-search input::placeholder {
  color: #94a3b8 !important;
}
.dark .gp-sidebar-search button {
  color: #94a3b8 !important;
}
.dark .gp-sidebar-search svg {
  stroke: #94a3b8 !important;
}

/* ---------- Settings slide-out drawer ---------- */
.dark .gp-settings-sidebar {
  background: #1e293b !important;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.6) !important;
}
.dark .gp-settings-header {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
}
.dark .gp-settings-sidebar .gp-settings-header h3,
.dark .gp-settings-header h3 {
  color: #f1f5f9 !important;
}
.dark .gp-settings-close {
  color: #94a3b8 !important;
}
.dark .gp-settings-close:hover {
  background: #334155 !important;
  color: #e2e8f0 !important;
}
.dark .gp-settings-sidebar .gp-settings-close svg,
.dark .gp-settings-close svg {
  stroke: #94a3b8 !important;
}
.dark .gp-settings-close:hover svg {
  stroke: #e2e8f0 !important;
}
.dark .gp-settings-sidebar .gp-settings-item,
.dark .gp-settings-item {
  color: #cbd5e1 !important;
}
.dark .gp-settings-sidebar .gp-settings-item:hover,
.dark .gp-settings-item:hover {
  background: #334155 !important;
  color: #f1f5f9 !important;
}
.dark .gp-settings-sidebar .gp-settings-item svg,
.dark .gp-settings-item svg {
  stroke: #94a3b8 !important;
}
.dark .gp-settings-sidebar .gp-settings-item:hover svg,
.dark .gp-settings-item:hover svg {
  stroke: #e2e8f0 !important;
}

/* ---------- Dropdown panel — items text & icons (action menus on order pages: Print, More, Bulk Update, Tag, Assign To, etc.) ---------- */
.dark .fi-dropdown-panel,
.dark .fi-dropdown-panel * {
  color: #f1f5f9 !important;
}
.dark .fi-dropdown-panel svg {
  stroke: #cbd5e1 !important;
}
/* Filament's compiled CSS sets .fi-dropdown-list-item-label { color: var(--gray-700) },
   which becomes #374151 in dark mode (invisible). Force light text with high specificity. */
.dark .fi-dropdown-panel .fi-dropdown-list-item,
.dark .fi-dropdown-panel .fi-dropdown-list-item-label,
.dark .fi-dropdown-panel .fi-dropdown-list-item span,
.dark .fi-dropdown-panel button.fi-dropdown-list-item,
.dark .fi-dropdown-panel a.fi-dropdown-list-item,
.dark body .fi-dropdown-panel .fi-dropdown-list-item,
.dark body .fi-dropdown-panel .fi-dropdown-list-item span,
.dark body .fi-dropdown-panel .fi-dropdown-list-item-label,
.dark html .fi-dropdown-panel .fi-dropdown-list-item-label {
  color: #f1f5f9 !important;
}
.dark .fi-dropdown-panel .fi-dropdown-list-item:hover,
.dark .fi-dropdown-panel .fi-dropdown-list-item:not(.fi-disabled):not([disabled]):hover,
.dark .fi-dropdown-panel .fi-dropdown-list-item:focus-visible,
.dark .fi-dropdown-panel .fi-dropdown-list-item.fi-selected {
  background: #334155 !important;
}
.dark .fi-dropdown-panel .fi-dropdown-list-item:hover .fi-dropdown-list-item-label,
.dark .fi-dropdown-panel .fi-dropdown-list-item:hover span {
  color: #ffffff !important;
}
.dark .fi-dropdown-panel .fi-dropdown-list-item svg,
.dark .fi-dropdown-panel .fi-dropdown-list-item > .fi-icon {
  color: #cbd5e1 !important;
  fill: #cbd5e1 !important;
}
.dark .fi-dropdown-header {
  border-bottom-color: #334155 !important;
}
.dark .fi-dropdown-header span {
  color: #f1f5f9 !important;
}

/* ---------- Action button hover flashes (view/edit/delete) ---------- */
.dark .fi-ta-actions .fi-btn[href*="view"]:hover {
  background: #1e3a8a !important;
  color: #93bbfd !important;
}
.dark .fi-ta-actions .fi-btn[href*="edit"] {
  color: #fbbf24 !important;
}
.dark .fi-ta-actions .fi-btn[href*="edit"]:hover {
  background: #78350f !important;
  color: #fde68a !important;
}
.dark .fi-ta-actions .fi-btn[wire\:click*="delete"] {
  color: #f87171 !important;
}
.dark .fi-ta-actions .fi-btn[wire\:click*="delete"]:hover {
  background: #7f1d1d !important;
  color: #fca5a5 !important;
}

/* ---------- Cards / sections / widgets / infolist ---------- */
.dark .fi-section,
.dark .fi-card,
.dark .fi-infolist-section,
.dark .fi-wi-account-widget {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.dark .fi-section-header-heading {
  color: #f1f5f9 !important;
}
.dark .fi-in-text {
  color: #e2e8f0 !important;
}
.dark .fi-in-entry-wrp-label {
  color: #94a3b8 !important;
}

/* ---------- Form labels / helper / inputs ---------- */
.dark .fi-fo-field-wrp-label,
.dark label {
  color: #cbd5e1 !important;
}
.dark .fi-fo-field-wrp-helper-text {
  color: #94a3b8 !important;
}
.dark .fi-input::placeholder,
.dark input::placeholder {
  color: #64748b !important;
}

/* ---------- Notifications — muted dark variants ---------- */
.dark .fi-notification-success {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%) !important;
  border-left-color: #10b981 !important;
  color: #d1fae5 !important;
}
.dark .fi-notification-warning {
  background: linear-gradient(135deg, #78350f 0%, #92400e 100%) !important;
  border-left-color: #f59e0b !important;
  color: #fef3c7 !important;
}
.dark .fi-notification-danger {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%) !important;
  border-left-color: #ef4444 !important;
  color: #fee2e2 !important;
}
.dark .fi-notification-info {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%) !important;
  border-left-color: #3b82f6 !important;
  color: #dbeafe !important;
}
.dark .fi-notification * {
  color: inherit !important;
}

/* ---------- Badges — keep light pastels (already readable),
   only tone down on dark cards if absolutely needed. ---------- */
.dark .fi-badge-success {
  background: #064e3b !important;
  color: #a7f3d0 !important;
  border-color: #065f46 !important;
}
.dark .fi-badge-warning {
  background: #78350f !important;
  color: #fde68a !important;
  border-color: #92400e !important;
}
.dark .fi-badge-danger {
  background: #7f1d1d !important;
  color: #fecaca !important;
  border-color: #991b1b !important;
}
.dark .fi-badge-info {
  background: #1e3a8a !important;
  color: #bfdbfe !important;
  border-color: #1e40af !important;
}

/* ---------- Modal header/footer borders ---------- */
.dark .fi-modal-header {
  border-bottom-color: #334155 !important;
}
.dark .fi-modal-footer {
  border-top-color: #334155 !important;
  background: #0f172a !important;
}

/* ---------- Scrollbars ---------- */
.dark .fi-ta-content-ctn::-webkit-scrollbar-track {
  background: #0f172a !important;
}
.dark .fi-ta-content-ctn::-webkit-scrollbar-thumb {
  background: #475569 !important;
}
.dark .fi-ta-content-ctn::-webkit-scrollbar-thumb:hover {
  background: #64748b !important;
}

/* ---------- Sticky header sticky white background ---------- */
.dark .fi-ta-header-cell {
  background: #0f172a !important;
}

/* ---------- Header heading / breadcrumbs in page bodies ---------- */
.dark .fi-header-heading {
  color: #f1f5f9 !important;
}
.dark .fi-breadcrumbs li,
.dark .fi-breadcrumbs a {
  color: #94a3b8 !important;
}
.dark .fi-breadcrumbs a:hover {
  color: #cbd5e1 !important;
}

/* ---------- Secondary / gray buttons ---------- */
.dark .fi-btn-secondary,
.dark .fi-btn.fi-color-gray {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
.dark .fi-btn-secondary:hover,
.dark .fi-btn.fi-color-gray:hover {
  background: #334155 !important;
  border-color: #60a5fa !important;
  color: #93bbfd !important;
}
.dark .fi-header-actions .fi-btn[href*="edit"] {
  background: transparent !important;
  border-color: #60a5fa !important;
  color: #93bbfd !important;
}
.dark .fi-header-actions .fi-btn[href*="edit"]:hover {
  background: #1e3a8a !important;
  border-color: #3b82f6 !important;
}

/* ---------- Bulk action buttons ---------- */
.dark .fi-ta-bulk-actions-btn {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

/* ---------- Action group buttons ---------- */
.dark .fi-ac-group-btn {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
.dark .fi-ac-group-btn:hover {
  background: #334155 !important;
  border-color: #60a5fa !important;
}

/* ---------- Generic links (overrides line 2104) ---------- */
.dark a:not(.fi-btn):not(.fi-sidebar-item):not(.fi-dropdown-list-item):not(.action-btn) {
  color: #60a5fa !important;
}
.dark a:not(.fi-btn):not(.fi-sidebar-item):not(.fi-dropdown-list-item):not(.action-btn):hover {
  color: #93bbfd !important;
}

/* ---------- Inline-styled cards inside Filament pages
   (profile/change-password/api-credentials wrapper cards).
   Targets any wrapper that page CSS set to white. ---------- */
.dark .profile-card,
.dark .credentials-card,
.dark .password-card,
.dark .info-card,
.dark .form-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
.dark .profile-card *,
.dark .credentials-card *,
.dark .password-card * {
  color: inherit;
}

/* Common alert boxes used on api-credentials / orders pages */
.dark .success-alert,
.dark [class*="success"][style*="#f0fdf4"],
.dark [class*="success"][style*="#bbf7d0"] {
  background: #064e3b !important;
  color: #a7f3d0 !important;
  border-color: #065f46 !important;
}
.dark .warning-alert {
  background: #78350f !important;
  color: #fde68a !important;
  border-color: #92400e !important;
}
.dark .danger-alert {
  background: #7f1d1d !important;
  color: #fecaca !important;
  border-color: #991b1b !important;
}
.dark .info-box {
  background: #1e3a8a !important;
  color: #bfdbfe !important;
  border-color: #1e40af !important;
}

/* ---------- Stats overview override (dashboard inline-style block) ---------- */
.dark .fi-wi-stats-overview-stat {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border-color: #334155 !important;
}
.dark .fi-wi-stats-overview-stat-value {
  color: #f1f5f9 !important;
}
.dark .fi-wi-stats-overview-stat-label {
  color: #94a3b8 !important;
}
.dark .fi-wi-stats-overview-stat-description {
  color: #cbd5e1 !important;
}

/* ---------- Chart widget header (dashboard) ---------- */
.dark .fi-wi-chart {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.dark .fi-wi-chart .fi-section-header {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
  border-bottom-color: #334155 !important;
}
.dark .fi-wi-chart .fi-section-header-heading {
  color: #f1f5f9 !important;
}

/* ---------- Top Products widget (custom) ---------- */
.dark .top-products-widget,
.dark .top-products-widget * {
  color: #e2e8f0;
}
.dark .top-products-widget .fi-section,
.dark .top-products-widget .top-products-header,
.dark .top-products-widget [class*="header"] {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
  border-color: #334155 !important;
}

/* ---------- Specific inline-style overrides for known patterns
   in order pages / modals / JS-injected rows ---------- */
/* JS-injected expanded-order rows (background:#f8fafc) */
.dark tr[style*="#f8fafc"],
.dark tr[style*="rgb(248, 250, 252)"] {
  background-color: #1a2536 !important;
}
.dark td[style*="color:#374151"],
.dark td[style*="color: #374151"] {
  color: #e2e8f0 !important;
}
.dark td[style*="color:#6b7280"],
.dark td[style*="color: #6b7280"] {
  color: #94a3b8 !important;
}
.dark td[style*="color:#2563eb"],
.dark td[style*="color: #2563eb"] {
  color: #60a5fa !important;
}

/* Status-update dropdown buttons in order pages */
.dark button[style*="color:#374151"][style*="background: none"],
.dark button[style*="color: #374151"][style*="background: none"] {
  color: #e2e8f0 !important;
}

/* Order summary modal / Combine Preview modal — light surfaces */
.dark .order-summary-modal,
.dark [id*="order-summary"] .modal-panel,
.dark .combine-preview-modal {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

/* ---------- "Configure Shipment" left empty card (Create Shipment) ---------- */
.dark .fi-section[class*="form-card"],
.dark .fi-section.fi-section--empty,
.dark .create-shipment-empty {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
.dark .create-shipment-empty svg,
.dark .form-empty-state svg {
  stroke: #475569 !important;
  color: #475569 !important;
}

/* ---------- Topbar dropdown text (it inherits white from .fi-topbar *) ---------- */
.dark .fi-topbar .fi-dropdown-panel,
.dark .fi-topbar .fi-dropdown-panel * {
  color: #e2e8f0 !important;
}
.dark .fi-topbar .fi-dropdown-panel .fi-dropdown-list-item:hover {
  background: #334155 !important;
}

/* ---------- Topbar gear button highlight when settings open ---------- */
.dark .gp-settings-btn.active {
  background: rgba(255, 255, 255, 0.18) !important;
}

/* ---------- Date filter bar / blue gradient bar (dashboard, reports) ----------
   Keep the blue gradient since it's a brand element, but ensure inner select
   is dark-readable on click and option text is visible. */
.dark .date-filter-bar select {
  background-color: rgba(15, 23, 42, 0.85) !important;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}
.dark .date-filter-bar select option {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}
.dark .date-filter-bar select:hover {
  background-color: #1e293b !important;
}

/* ---------- "Showing X of Y" type plain text in admin pages ---------- */
.dark .fi-pagination-overview,
.dark .fi-ta-pagination-records-info,
.dark .fi-ta-pagination > div {
  color: #cbd5e1 !important;
}

/* ---------- Heavy inline-style overrides for order pages
   These selectors match the recurring inline styles used in
   awaiting-shipment / search-orders / cancelled-orders / manual-orders /
   shipped-orders / on-hold-orders / awaiting-payment-orders to flip
   light backgrounds & text to dark equivalents WITHOUT editing each
   blade file. They are scoped under `.dark` so light mode is unaffected. */

/* Backgrounds */
.dark [style*="background: white"],
.dark [style*="background:white"],
.dark [style*="background: #fff"]:not(.fi-topbar):not(.fi-topbar *),
.dark [style*="background:#fff"]:not(.fi-topbar):not(.fi-topbar *),
.dark [style*="background: #ffffff"]:not(.fi-topbar):not(.fi-topbar *),
.dark [style*="background:#ffffff"]:not(.fi-topbar):not(.fi-topbar *),
.dark [style*="background-color: #ffffff"]:not(.fi-topbar):not(.fi-topbar *),
.dark [style*="background-color: white"]:not(.fi-topbar):not(.fi-topbar *) {
  background: #1e293b !important;
  background-color: #1e293b !important;
}

/* Light-gray utility backgrounds */
.dark [style*="background: #f8fafc"],
.dark [style*="background:#f8fafc"],
.dark [style*="background-color: #f8fafc"] {
  background: #0f172a !important;
  background-color: #0f172a !important;
}
.dark [style*="background: #f9fafb"],
.dark [style*="background:#f9fafb"],
.dark [style*="background-color: #f9fafb"] {
  background: #0f172a !important;
  background-color: #0f172a !important;
}
.dark [style*="background: #f1f5f9"],
.dark [style*="background:#f1f5f9"] {
  background: #1a2536 !important;
}
.dark [style*="background: #f3f4f6"],
.dark [style*="background:#f3f4f6"] {
  background: #334155 !important;
}
.dark [style*="background: #fafbfc"] {
  background: #1a2536 !important;
}
.dark [style*="background:#e5e7eb"],
.dark [style*="background: #e5e7eb"] {
  background: #334155 !important;
}

/* Pastel success/info/warning backgrounds inside order pages */
.dark [style*="background: #f0fdf4"],
.dark [style*="background:#f0fdf4"] {
  background: #064e3b !important;
}
.dark [style*="background: #eff6ff"],
.dark [style*="background:#eff6ff"] {
  background: #1e3a8a !important;
}
.dark [style*="background: #fef3c7"],
.dark [style*="background:#fef3c7"] {
  background: #78350f !important;
}
.dark [style*="background: #fef2f2"],
.dark [style*="background:#fef2f2"] {
  background: #7f1d1d !important;
}
.dark [style*="background: #dbeafe"],
.dark [style*="background:#dbeafe"] {
  background: #1e3a8a !important;
}

/* Dark-on-light text colors inside inline styles → flip to light-on-dark */
.dark [style*="color: #374151"],
.dark [style*="color:#374151"] {
  color: #e2e8f0 !important;
}
.dark [style*="color: #1e293b"],
.dark [style*="color:#1e293b"]:not(#gp-tooltip):not(#gp-tooltip *) {
  color: #f1f5f9 !important;
}
.dark [style*="color: #334155"],
.dark [style*="color:#334155"] {
  color: #e2e8f0 !important;
}
.dark [style*="color: #475569"],
.dark [style*="color:#475569"] {
  color: #cbd5e1 !important;
}
.dark [style*="color: #64748b"],
.dark [style*="color:#64748b"] {
  color: #94a3b8 !important;
}
.dark [style*="color: #6b7280"],
.dark [style*="color:#6b7280"] {
  color: #94a3b8 !important;
}
.dark [style*="color: #6c757d"],
.dark [style*="color:#6c757d"] {
  color: #94a3b8 !important;
}
.dark [style*="color: #111827"],
.dark [style*="color:#111827"] {
  color: #f1f5f9 !important;
}

/* Pastel-text-on-pastel-bg (alerts) — flip to light text */
.dark [style*="color: #166534"],
.dark [style*="color:#166534"],
.dark [style*="color: #15803d"],
.dark [style*="color:#15803d"] {
  color: #a7f3d0 !important;
}
.dark [style*="color: #92400e"],
.dark [style*="color:#92400e"],
.dark [style*="color: #854d0e"],
.dark [style*="color:#854d0e"] {
  color: #fde68a !important;
}
.dark [style*="color: #991b1b"],
.dark [style*="color:#991b1b"] {
  color: #fecaca !important;
}
.dark [style*="color: #1e40af"],
.dark [style*="color:#1e40af"],
.dark [style*="color: #0369a1"],
.dark [style*="color:#0369a1"] {
  color: #93bbfd !important;
}

/* Inline borders */
.dark [style*="border: 1px solid #e2e8f0"],
.dark [style*="border:1px solid #e2e8f0"],
.dark [style*="border-bottom: 1px solid #e2e8f0"],
.dark [style*="border-top: 1px solid #e2e8f0"] {
  border-color: #334155 !important;
}
.dark [style*="border: 1px solid #e5e7eb"],
.dark [style*="border-bottom: 1px solid #e5e7eb"],
.dark [style*="border-top: 1px solid #e5e7eb"] {
  border-color: #334155 !important;
}
.dark [style*="border: 1px solid #d1d5db"] {
  border-color: #475569 !important;
}
.dark [style*="border: 1px solid #cbd5e1"] {
  border-color: #475569 !important;
}
.dark [style*="border: 1px solid #bbf7d0"] {
  border-color: #065f46 !important;
}
.dark [style*="border: 1px solid #fde68a"] {
  border-color: #92400e !important;
}
.dark [style*="border: 1px solid #fecaca"] {
  border-color: #991b1b !important;
}
.dark [style*="border: 1px solid #bfdbfe"] {
  border-color: #1e40af !important;
}

/* ---------- Nested / second-level submenus inside action dropdowns
   Order pages (awaiting-shipment, search-orders, awaiting-payment,
   on-hold, shipped, cancelled, manual) build a "Update Status"
   submenu out of inline-styled buttons whose onmouseover handlers
   write `this.style.backgroundColor='#f3f4f6'` at runtime. The
   browser normalises the style attribute to rgb(...), so attribute
   selectors against hex no longer match. Use rgb() forms and real
   :hover pseudo selectors with !important to win over the inline
   mutation. */

/* Light hover backgrounds written by JS at runtime — flip to dark slate */
.dark [style*="rgb(243, 244, 246)"],
.dark [style*="rgb(243,244,246)"],
.dark [style*="background-color: rgb(243, 244, 246)"],
.dark [style*="background-color:rgb(243,244,246)"] {
  background: #334155 !important;
  background-color: #334155 !important;
}
.dark [style*="rgb(249, 250, 251)"],
.dark [style*="rgb(249,250,251)"] {
  background-color: #334155 !important;
}
.dark [style*="rgb(248, 250, 252)"],
.dark [style*="rgb(248,250,252)"] {
  background-color: #1a2536 !important;
}
.dark [style*="rgb(241, 245, 249)"],
.dark [style*="rgb(241,245,249)"] {
  background-color: #334155 !important;
}
/* Also catch the post-normalised color form */
.dark [style*="rgb(55, 65, 81)"],
.dark [style*="rgb(55,65,81)"] {
  color: #f1f5f9 !important;
}
.dark [style*="rgb(51, 65, 85)"],
.dark [style*="rgb(51,65,85)"] {
  color: #e2e8f0 !important;
}
.dark [style*="rgb(100, 116, 139)"],
.dark [style*="rgb(100,116,139)"] {
  color: #94a3b8 !important;
}
.dark [style*="rgb(107, 114, 128)"],
.dark [style*="rgb(107,114,128)"] {
  color: #94a3b8 !important;
}

/* Floating submenu panels (Update Status submenu) — match by their
   distinctive inline positioning */
.dark [style*="left: 100%"][style*="position: absolute"],
.dark [style*="left:100%"][style*="position:absolute"] {
  background: #1e293b !important;
  background-color: #1e293b !important;
  border-color: #475569 !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}
.dark [style*="left: 100%"][style*="position: absolute"] button,
.dark [style*="left:100%"][style*="position:absolute"] button {
  color: #e2e8f0 !important;
}
.dark [style*="left: 100%"][style*="position: absolute"] button:hover,
.dark [style*="left:100%"][style*="position:absolute"] button:hover {
  background: #334155 !important;
  background-color: #334155 !important;
  color: #ffffff !important;
}

/* Parent row (the "Update Status" trigger) that holds the relative
   div with chevron — Tailwind's hover:bg-gray-50 class lights its
   background; force dark hover in dark mode. */
.dark .fi-dropdown-panel .hover\:bg-gray-50:hover,
.dark .fi-dropdown-panel [class*="hover:bg-gray-50"]:hover {
  background-color: #334155 !important;
}
.dark .fi-dropdown-panel .hover\:bg-gray-50,
.dark .fi-dropdown-panel [class*="hover:bg-gray-50"] {
  color: #e2e8f0 !important;
}

/* Defensive: any button inside a dropdown-panel that uses inline
   `style` for color/bg keeps light-on-dark on hover regardless of
   what its onmouseover writes. */
.dark .fi-dropdown-panel button[style]:hover,
.dark .fi-dropdown-panel a[style]:hover {
  background-color: #334155 !important;
  color: #ffffff !important;
}
.dark .fi-dropdown-panel button[style] span,
.dark .fi-dropdown-panel a[style] span {
  color: inherit !important;
}

/* ---------- Ship Date filter dropdown (shipments-list, search-shipments)
   The blade pages render a custom `.ship-date-dropdown` panel with an
   inline `background-color: #ffffff !important` plus an embedded
   <style> block whose `.ship-date-option { color: #374151 !important }`
   forces light-only colors. Override here with `.dark` rules of higher
   specificity (extra class) so dark mode renders correctly without
   touching light mode. */
.dark .ship-date-dropdown {
  background-color: #1e293b !important;
}
.dark .ship-date-option {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-bottom-color: #334155 !important;
}
.dark .ship-date-option:hover {
  background-color: #334155 !important;
  color: #ffffff !important;
}
.dark .ship-date-option.selected {
  background-color: #1e3a8a !important;
  color: #ffffff !important;
}

/* Custom-range date inputs inside the panel */
.dark .ship-date-dropdown input[type="date"] {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
  color-scheme: dark;
}
.dark .ship-date-dropdown input[type="date"]:focus {
  border-color: #3b82f6 !important;
}

/* Remove (text-link) button — pre-existing inline color #2563eb is fine,
   but bump for stronger contrast on dark panel. */
.dark .ship-date-dropdown button[style*="color: #2563eb"],
.dark .ship-date-dropdown button[style*="color:#2563eb"] {
  color: #60a5fa !important;
}
.dark .ship-date-dropdown button[style*="color: rgb(37, 99, 235)"],
.dark .ship-date-dropdown button[style*="color:rgb(37, 99, 235)"],
.dark .ship-date-dropdown button[style*="color:rgb(37,99,235)"] {
  color: #60a5fa !important;
}
/* Hover state written by inline onmouseover → color: #1d4ed8 / rgb(29, 78, 216) */
.dark .ship-date-dropdown button[style*="color: rgb(29, 78, 216)"],
.dark .ship-date-dropdown button[style*="color:rgb(29, 78, 216)"],
.dark .ship-date-dropdown button[style*="color:rgb(29,78,216)"] {
  color: #93bbfd !important;
}

/* End comprehensive dark-mode overrides */

/* Tags filter dropdown - force white text in light mode only */
html:not(.dark) .tags-filter-dropdown label span {
  color: #ffffff !important;
}

/* Ship Date filter Apply button — keep text white in both modes. The inline
   color: #fff loses to the panel-wide `.fi-dropdown-panel * { color: ... !important }`
   resets (light and dark), so this higher-specificity rule restores it. */
.ship-date-dropdown .ship-date-apply,
.dark .ship-date-dropdown .ship-date-apply {
  color: #ffffff !important;
}

/* ============================================================
   Order messages panel — dark mode
   ------------------------------------------------------------
   The bubbles in resources/views/livewire/order-messages.blade.php carry
   light inline colours. The blanket inline-style overrides above match a
   background by SUBSTRING, so `[style*="background:#fff"]` also catches the
   cream `#fff7ed` of an incoming message and flips it to dark slate — while
   nothing rewrites the inline `color:#3f3f46`, leaving dark text on a dark
   bubble (1.4:1, effectively unreadable).

   These rules target the .gp-msg-* classes instead of the inline colours, so
   both the background AND the text are set together and stay in step. Light
   mode is untouched — the inline styles still drive it.
   ============================================================ */

/* Incoming (the other party) — warm tint, mirroring the cream used in light mode. */
.dark .gp-msg.gp-msg-theirs {
  background: #2f2823 !important;
  background-color: #2f2823 !important;
  color: #f3e8dc !important;
}

/* My own side, written by a teammate — tint of the same blue as "mine". */
.dark .gp-msg.gp-msg-ours {
  background: #17304e !important;
  background-color: #17304e !important;
  color: #dbeafe !important;
  border-color: #2f5c92 !important;
}

/* My own message — already solid blue on white; pinned so no blanket rule steals it. */
.dark .gp-msg.gp-msg-mine {
  background: #2563eb !important;
  background-color: #2563eb !important;
  color: #ffffff !important;
}

/* Author prefix inside a bubble. The light values (#1d4ed8 / #64748b / #f59e0b)
   are mid-tones that disappear against the dark bubbles above. */
.dark .gp-msg.gp-msg-ours .gp-msg-author { color: #93c5fd !important; }
.dark .gp-msg.gp-msg-theirs .gp-msg-author { color: #fbbf24 !important; }

/* Centred audit line (solved / re-opened / assigned). */
.dark span.gp-msg-system {
  background: #172033 !important;
  background-color: #172033 !important;
  color: #a9b6c9 !important;
  border-color: #334155 !important;
}

/* ---- Message editing (staff) ----------------------------------------------
   Same trap as the bubbles above: the inline `background:#fff` on the editor
   and its textarea is caught by the blanket substring overrides and flipped to
   dark slate, while the inline `color:#1e293b` on the text is left alone — you
   would be typing dark grey into a dark box. Set both together here. */
.dark .gp-msg-edit {
  background: #17304e !important;
  background-color: #17304e !important;
  border-color: #2f5c92 !important;
}

.dark .gp-msg-edit-input {
  background: #0f2138 !important;
  background-color: #0f2138 !important;
  color: #e2e8f0 !important;
  border-color: #2f5c92 !important;
}

/* "edited" marker and the Edit link. #94a3b8 / #64748b are mid-tones that sit
   too close to the dark surfaces they render on. */
.dark .gp-msg-edited { color: #94a3b8 !important; }
.dark .gp-msg-edit-btn { color: #93c5fd !important; }
