/* Orders Management Styles */

/* Custom Checkbox */
.custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.custom-checkbox:hover {
  border-color: #f97316;
}

.custom-checkbox:checked {
  background: #f97316;
  border-color: #f97316;
}

.custom-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox:indeterminate {
  background: #f97316;
  border-color: #f97316;
}

.custom-checkbox:indeterminate::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 6px;
  width: 8px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.custom-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.3);
}

.dark .custom-checkbox {
  background: #1e293b;
  border-color: #475569;
}

.dark .custom-checkbox:checked,
.dark .custom-checkbox:indeterminate {
  background: #f97316;
  border-color: #f97316;
}

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.dark .stat-card {
  background: linear-gradient(145deg, #1e293b 0%, #1a2332 100%);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
}

/* Table Card */
.table-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.05);
  overflow: visible;
}

.table-card > table {
  border-radius: 16px;
}

.table-card > table > thead > tr:first-child > th:first-child {
  border-top-left-radius: 16px;
}

.table-card > table > thead > tr:first-child > th:last-child {
  border-top-right-radius: 16px;
}

.table-card > table > tbody > tr:last-child > td:first-child {
  border-bottom-left-radius: 16px;
}

.table-card > table > tbody > tr:last-child > td:last-child {
  border-bottom-right-radius: 16px;
}

.table-card > table > tbody {
  overflow: visible;
}

.dark .table-card {
  background: linear-gradient(145deg, #1e293b 0%, #1a2332 100%);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Filter Card */
.filter-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
}

.dark .filter-card {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Order row */
.order-row {
  transition: all 0.15s ease;
  position: relative;
}

.order-row:hover {
  background: #f8fafc;
}

.dark .order-row:hover {
  background: rgba(255,255,255,0.03);
}

.order-row td {
  overflow: visible;
}

/* Status Dropdown */
.status-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 180px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.08);
  z-index: 9999;
  overflow: hidden;
}

.dark .status-dropdown {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.status-dropdown-container {
  position: relative;
  z-index: auto;
}

/* Tab Pills */
.tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.tab-pill.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.35);
}

.tab-pill:not(.active) {
  background: white;
  color: #64748b;
  border-color: #e2e8f0;
}

.tab-pill:not(.active):hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.dark .tab-pill:not(.active) {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

.dark .tab-pill:not(.active):hover {
  background: #334155;
  color: #e2e8f0;
}

/* Action icons */
.action-icon {
  padding: 8px;
  border-radius: 8px;
  color: #64748b;
  transition: all 0.15s ease;
}

.action-icon:hover {
  background: #e2e8f0;
  color: #f97316;
}

.dark .action-icon {
  color: #94a3b8;
}

.dark .action-icon:hover {
  background: rgba(255,255,255,0.1);
  color: #fb923c;
}

/* Tooltip - shows below element */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  background: #0f172a;
  color: white;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 99999;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(8px);
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  border: 6px solid transparent;
  border-bottom-color: #0f172a;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 99999;
  pointer-events: none;
}

[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(4px);
}

/* Tooltip in table header - show above */
thead [data-tooltip]::after {
  top: auto;
  bottom: 100%;
  transform: translateX(-50%) translateY(-4px);
}

thead [data-tooltip]:hover::after {
  transform: translateX(-50%) translateY(-8px);
}

thead [data-tooltip]::before {
  top: auto;
  bottom: 100%;
  transform: translateX(-50%) translateY(0);
  border-bottom-color: transparent;
  border-top-color: #0f172a;
}

thead [data-tooltip]:hover::before {
  transform: translateX(-50%) translateY(-4px);
}

/* Checkbox tooltip in thead */
thead th [data-tooltip]::after,
thead th input[data-tooltip]::after,
thead th .custom-checkbox + [data-tooltip]::after {
  top: 100%;
  bottom: auto;
  transform: translateX(-50%) translateY(4px);
}

thead th [data-tooltip]:hover::after,
thead th input[data-tooltip]:hover::after {
  transform: translateX(-50%) translateY(8px);
}

thead th [data-tooltip]::before,
thead th input[data-tooltip]::before {
  top: 100%;
  bottom: auto;
  transform: translateX(-50%) translateY(0);
  border-top-color: transparent;
  border-bottom-color: #0f172a;
}

thead th [data-tooltip]:hover::before,
thead th input[data-tooltip]:hover::before {
  transform: translateX(-50%) translateY(4px);
}

/* Tooltip in fixed bottom bar - show above */
.fixed.bottom-6 [data-tooltip]::after,
[data-orders-bulk-target="actionBar"] [data-tooltip]::after {
  top: auto;
  bottom: 100%;
  transform: translateX(-50%) translateY(-4px);
}

.fixed.bottom-6 [data-tooltip]:hover::after,
[data-orders-bulk-target="actionBar"] [data-tooltip]:hover::after {
  transform: translateX(-50%) translateY(-8px);
}

.fixed.bottom-6 [data-tooltip]::before,
[data-orders-bulk-target="actionBar"] [data-tooltip]::before {
  top: auto;
  bottom: 100%;
  transform: translateX(-50%) translateY(0);
  border-bottom-color: transparent;
  border-top-color: #0f172a;
}

.fixed.bottom-6 [data-tooltip]:hover::before,
[data-orders-bulk-target="actionBar"] [data-tooltip]:hover::before {
  transform: translateX(-50%) translateY(-4px);
}

/* Turbo loading */
.turbo-progress-bar {
  background: linear-gradient(90deg, #f97316, #ea580c);
  height: 3px;
}
