/* 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 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,
.fi-sidebar-item-btn:hover .fi-icon {
  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;
}

/* 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;
}

/* 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;
}

/* 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;
}

/* Filter-count badge on toolbar icon buttons: Filament centres it on the
   trigger's right edge (start-full / top-1 / -translate-x/y-1/2), which lands
   it on top of the adjacent column-manager button and hides its icon. Raise
   it above the button row so the neighbour's icon stays visible. */
.fi-ta-header-toolbar .fi-icon-btn > .fi-icon-btn-badge-ctn {
  top: -0.375rem !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;
}

/* 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;
}

.fi-modal-footer {
  border-top: 1px solid var(--gp-gray-200) !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 (na-action-link excluded so the Needs Attention Action links keep the
   per-row text color set inline in the widget blade). */
a:not(.na-action-link) {
  color: var(--gp-blue-light) !important;
}

a:not(.na-action-link):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:hover .fi-sidebar-item-icon,
.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 (solid-button links like .gp-run-pay-btn excluded —
   blue text on their blue background makes the label invisible) */
a:not(.fi-btn):not(.fi-sidebar-item):not(.fi-dropdown-list-item):not(.gp-run-pay-btn):not(.na-action-link) {
  color: #2563eb !important;
}

/* Payment Runs "+ Record Payment" button: white inline text works in light
   mode. In dark mode the button background flips to light blue
   (--gp-c-2563eb → #60a5fa), which is too light for white text, so pin the
   active button to a solid darker blue and keep the label white. */
a.gp-run-pay-btn {
  color: #ffffff !important;
}

.dark a.gp-run-pay-btn {
  color: #ffffff !important;
}

.dark a.gp-run-pay-btn[style*="--gp-c-2563eb"] {
  background: #2563eb !important;
}

a:not(.fi-btn):not(.fi-sidebar-item):not(.fi-dropdown-list-item):not(.na-action-link):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;
  /* Text tokens: gray-500..800 hold the mid/dark grays used for body,
     secondary and muted text. Their light-mode values are too dark to read
     on a dark surface, so they flip to light here. (gray-300/400 are already
     light enough to read on dark, so they are intentionally left un-flipped.) */
  --gp-gray-500: #94a3b8;
  --gp-gray-600: #cbd5e1;
  --gp-gray-700: #e2e8f0;
  --gp-gray-800: #e2e8f0;
  --gp-gray-900: #f1f5f9;
}

/* ============================================================
   STEP 3 — status/pastel tint tokens (light = identity, dark = tint)
   Pastel surfaces -> translucent tints over the dark card;
   dark status text -> bright 400-level so it reads on dark.
   ============================================================ */
:root {
  --gp-c-f9fafb: #f9fafb;
  --gp-c-fafafa: #fafafa;
  --gp-c-f3f4f6: #f3f4f6;
  --gp-c-fef2f2: #fef2f2;
  --gp-c-fee2e2: #fee2e2;
  --gp-c-fffbeb: #fffbeb;
  --gp-c-fef3c7: #fef3c7;
  --gp-c-fff7ed: #fff7ed;
  --gp-c-eff6ff: #eff6ff;
  --gp-c-dbeafe: #dbeafe;
  --gp-c-f0f9ff: #f0f9ff;
  --gp-c-ecfeff: #ecfeff;
  --gp-c-f0fdf4: #f0fdf4;
  --gp-c-dcfce7: #dcfce7;
  --gp-c-ecfdf5: #ecfdf5;
  --gp-c-bfdbfe: #bfdbfe;
  --gp-c-fecaca: #fecaca;
  --gp-c-fca5a5: #fca5a5;
  --gp-c-fde68a: #fde68a;
  --gp-c-bbf7d0: #bbf7d0;
  --gp-c-a7f3d0: #a7f3d0;
  --gp-c-bae6fd: #bae6fd;
  --gp-c-a5f3fc: #a5f3fc;
  --gp-c-b91c1c: #b91c1c;
  --gp-c-dc2626: #dc2626;
  --gp-c-991b1b: #991b1b;
  --gp-c-7f1d1d: #7f1d1d;
  --gp-c-92400e: #92400e;
  --gp-c-78350f: #78350f;
  --gp-c-b45309: #b45309;
  --gp-c-a16207: #a16207;
  --gp-c-ca8a04: #ca8a04;
  --gp-c-c2410c: #c2410c;
  --gp-c-ea580c: #ea580c;
  --gp-c-d97706: #d97706;
  --gp-c-1e40af: #1e40af;
  --gp-c-1d4ed8: #1d4ed8;
  --gp-c-3b82f6: #3b82f6;
  --gp-c-075985: #075985;
  --gp-c-155e75: #155e75;
  --gp-c-0369a1: #0369a1;
  --gp-c-166534: #166534;
  --gp-c-15803d: #15803d;
  --gp-c-14532d: #14532d;
  --gp-c-065f46: #065f46;
  --gp-c-2563eb: #2563eb;
  --gp-c-16a34a: #16a34a;
  --gp-c-1e3a8a: #1e3a8a;
  /* data-viz palette (concentration donut) */
  --gp-c-7c3aed: #7c3aed;
  --gp-c-0891b2: #0891b2;
  --gp-c-be185d: #be185d;
  --gp-c-0d9488: #0d9488;
}

.dark {
  --gp-c-f9fafb: rgba(148,163,184,0.06);
  --gp-c-fafafa: rgba(148,163,184,0.06);
  --gp-c-f3f4f6: rgba(148,163,184,0.10);
  --gp-c-fef2f2: rgba(248,113,113,0.13);
  --gp-c-fee2e2: rgba(248,113,113,0.20);
  --gp-c-fffbeb: rgba(251,191,36,0.13);
  --gp-c-fef3c7: rgba(251,191,36,0.20);
  --gp-c-fff7ed: rgba(251,146,60,0.13);
  --gp-c-eff6ff: rgba(96,165,250,0.13);
  --gp-c-dbeafe: rgba(96,165,250,0.20);
  --gp-c-f0f9ff: rgba(56,189,248,0.13);
  --gp-c-ecfeff: rgba(34,211,238,0.13);
  --gp-c-f0fdf4: rgba(74,222,128,0.13);
  --gp-c-dcfce7: rgba(74,222,128,0.20);
  --gp-c-ecfdf5: rgba(52,211,153,0.13);
  --gp-c-bfdbfe: rgba(96,165,250,0.30);
  --gp-c-fecaca: rgba(248,113,113,0.30);
  --gp-c-fca5a5: rgba(248,113,113,0.40);
  --gp-c-fde68a: rgba(251,191,36,0.35);
  --gp-c-bbf7d0: rgba(74,222,128,0.30);
  --gp-c-a7f3d0: rgba(52,211,153,0.30);
  --gp-c-bae6fd: rgba(56,189,248,0.30);
  --gp-c-a5f3fc: rgba(34,211,238,0.30);
  --gp-c-b91c1c: #f87171;
  --gp-c-dc2626: #f87171;
  --gp-c-991b1b: #fca5a5;
  --gp-c-7f1d1d: #fca5a5;
  --gp-c-92400e: #fbbf24;
  --gp-c-78350f: #fbbf24;
  --gp-c-b45309: #fbbf24;
  --gp-c-a16207: #fbbf24;
  --gp-c-ca8a04: #fbbf24;
  --gp-c-c2410c: #fb923c;
  --gp-c-ea580c: #fb923c;
  --gp-c-d97706: #fb923c;
  --gp-c-1e40af: #60a5fa;
  --gp-c-1d4ed8: #60a5fa;
  --gp-c-3b82f6: #60a5fa;
  --gp-c-075985: #38bdf8;
  --gp-c-155e75: #38bdf8;
  --gp-c-0369a1: #38bdf8;
  --gp-c-166534: #4ade80;
  --gp-c-15803d: #4ade80;
  --gp-c-14532d: #4ade80;
  --gp-c-065f46: #34d399;
  --gp-c-2563eb: #60a5fa;
  --gp-c-16a34a: #4ade80;
  --gp-c-1e3a8a: #93c5fd;
  /* data-viz palette (concentration donut) — brighter on dark */
  --gp-c-7c3aed: #a78bfa;
  --gp-c-0891b2: #22d3ee;
  --gp-c-be185d: #f472b6;
  --gp-c-0d9488: #2dd4bf;
}

/* 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-groups {
  background: #0f172a !important;
}

/* .fi-sidebar-nav uses var(--gp-gray-50) which flips to #1e293b in dark and
   would show lighter than the sidebar below the menu items — match the rail. */
.dark .fi-sidebar-nav {
  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;
}

/* Active sidebar item: the light-mode rule colours its label + icon with
   var(--gp-white), which flips to dark slate (#1e293b) in dark mode and turns
   the active item nearly invisible. Force white in dark mode. */
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-label,
.dark .fi-sidebar-item.fi-active .fi-icon {
  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,
.dark .fi-ta-actions-header-cell,
.dark .fi-ta-empty-header-cell,
.dark .fi-ta thead th {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
  box-shadow: 0 1px 0 0 #334155 !important;
  color: #ffffff !important;
}

/* Header ROW border/background: the light-mode `.fi-ta-table > thead > tr` rule
   sets a white (#e2e8f0) bottom border + light gradient in BOTH modes. Labeled
   cells cover it, but the empty actions cell doesn't — leaving a white line at
   the bottom-right. Override the row itself in dark mode. */
.dark .fi-ta-table > thead > tr {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
}

/* All header text white in dark mode — including the sortable-column button
   and the currently-sorted column, which Filament otherwise colors differently. */
.dark .fi-ta-header-cell,
.dark .fi-ta-header-cell *,
.dark .fi-ta-header-cell-label,
.dark .fi-ta-header-cell-sort-btn,
.dark .fi-ta-header-cell-sort-btn *,
.dark .fi-ta-header-cell-sorted,
.dark .fi-ta-header-cell-sorted * {
  color: #ffffff !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;
}

/* Custom button-style links (e.g. "+ Upload PAMS Statement") set color:#fff
   inline, but the broad `a:not(.fi-btn):not(...):not(...){color:#2563eb!important}`
   rule (specificity 0,3,1) overrides it and hides the text on the solid blue
   button. Match that specificity + one more so white wins on blue button-links.
   Applies in both light and dark mode (button is blue in both). */
a[style*="background: #2563eb"]:not(.fi-btn):not(.fi-sidebar-item):not(.fi-dropdown-list-item),
a[style*="background:#2563eb"]:not(.fi-btn):not(.fi-sidebar-item):not(.fi-dropdown-list-item) {
  color: #ffffff !important;
}

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

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

/* Table toolbar buttons (filter funnel, column manager — rendered as
   .fi-icon-btn inside .fi-ta-header-toolbar): the light-mode toolbar rule
   paints them background: var(--gp-white) (→ #1e293b in dark) but leaves
   color #333333 and border #d0d0d0 unchanged — the currentColor SVG icon
   ends up dark-on-dark and invisible. Lighten icon + border, and keep the
   hover/expanded states dark instead of light-mode #f5f5f5 / #e8f0fe. */
.dark .fi-ta-header-toolbar .fi-btn,
.dark .fi-ta-header-toolbar button {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #cbd5e1 !important;
}

.dark .fi-ta-header-toolbar .fi-btn:hover,
.dark .fi-ta-header-toolbar button:hover {
  background: #334155 !important;
  border-color: #64748b !important;
  color: #f1f5f9 !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: rgba(96, 165, 250, 0.15) !important;
  border-color: #60a5fa !important;
  color: #93c5fd !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;
}

/* Dashboard KPI cards: the shorthand border-color above also greys out the
   coloured top-accent bar set in light mode. Re-assert the per-card accent
   (positional, matching the Ship reference) — dark mode only. Brighter hues
   so the 3px bar reads on the dark card. Each stat is wrapped in its own
   .fi-grid-col, so the per-card colour is keyed off the column position. */
.dark .fi-wi-stats-overview-stat {
  border-top-color: #3b82f6 !important;                 /* card 1 — blue   */
}
.dark .fi-grid-col:nth-child(2) .fi-wi-stats-overview-stat {
  border-top-color: #22c55e !important;                 /* card 2 — green  */
}
.dark .fi-grid-col:nth-child(3) .fi-wi-stats-overview-stat {
  border-top-color: #fbbf24 !important;                 /* card 3 — amber  */
}
.dark .fi-grid-col:nth-child(4) .fi-wi-stats-overview-stat {
  border-top-color: #a78bfa !important;                 /* card 4 — purple */
}
.dark .fi-grid-col:nth-child(5) .fi-wi-stats-overview-stat {
  border-top-color: #22d3ee !important;                 /* card 5 — cyan   */
}

/* The stats-overview widget sits inside a .fi-section whose slate background
   and border show in the gaps between the accent-barred cards (the stripe
   between the coloured bars). Make just that wrapper section transparent so
   each KPI card reads as a standalone tile on the page — dark mode only. */
.dark .fi-section:has(.fi-wi-stats-overview-stat) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* The inner .fi-section-content-ctn keeps its own slate background, which is
   the stripe still showing between the cards — clear it for this section too. */
.dark .fi-section:has(.fi-wi-stats-overview-stat) .fi-section-content-ctn {
  background: transparent !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;
}

/* Dropdown menu item text (e.g. table row ⋯ actions menu): the light-mode
   `body .fi-dropdown-panel .fi-dropdown-list-item ...` rules (specificity
   0,2,2) hard-code #334155, which beats a plain `.dark .fi-dropdown-list-
   item-label` (0,2,0) override and leaves dark text on the dark panel.
   Match with higher specificity so light text wins in dark mode. */
.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 {
  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;
}

/* 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.
   Use background-color (NOT the `background` shorthand) so the checkmark SVG
   that @tailwindcss/forms paints via background-image on :checked survives —
   the shorthand + !important resets background-image to none, leaving a blue
   box with no visible check. */
.dark .fi-ta-cell input[type="checkbox"] {
  background-color: #0f172a !important;
  border-color: #475569 !important;
}

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

/* PartsBox reconciliation — buttons painted inline with
   background: var(--gp-gray-800) + color: #fff (active period chip,
   "Process", "Reset"). In light mode gray-800 is dark slate so white text
   reads fine, but in dark mode --gp-gray-800 flips to light #e2e8f0,
   leaving white-on-light text. Flip the text to dark ink; the inner
   count span ("2/4") inherits. !important beats the inline color. */
.dark button[style*="background: var(--gp-gray-800)"][style*="color: #fff"] {
  color: #0f172a !important;
}

/* Needs Attention widget — Action column links (text + arrow) inherit the
   row's per-priority text color via their inline style. They're excluded from
   the global blue-link + hover rules above so the inline color wins in both
   light and dark mode, keeping the Action text the same color as its row. */
