/* Filter Icons */
.excel-filter-icon {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  user-select: none;
  position: relative;
  background: var(--filter-icon-bg, rgba(255, 255, 255, 0.1));
  border: 1px solid var(--filter-icon-border, rgba(255, 255, 255, 0.2));
}

.excel-filter-icon:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.excel-filter-icon:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Filter icon active state (when filter is applied) */
.excel-filter-icon.active {
  opacity: 1;
  background: #ffc107;
  border-color: #ffa000;
}

.excel-filter-icon.active:hover {
  background: #ffca28;
  border-color: #ffb300;
}

/* Filter Dropdown */
.excel-filter-dropdown {
  z-index: var(--z-popover, 250) !important;
  width: max-content;
  max-width: calc(100vw - 20px);
  max-height: min(400px, calc(100vh - 20px)) !important;
  border-color: var(--border, #d1d5db) !important;
  border-radius: 10px !important;
  background: var(--filter-dropdown-bg, #fff) !important;
  color: var(--filter-dropdown-text, #333);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 13px;
}

.excel-filter-dropdown > div:first-child {
  color: var(--text-primary, #333) !important;
  border-color: var(--border, #eee) !important;
}

.excel-filter-dropdown .title {
  font-weight: bold;
  padding: 5px 0 10px 0;
  border-bottom: 1px solid var(--border, #eee);
  margin-bottom: 10px;
  color: var(--text-primary, #333);
}

.excel-filter-dropdown .actions {
  display: flex;
  gap: 10px;
  padding: 10px 0 5px 0;
  border-top: 1px solid var(--border, #eee);
  margin-top: 10px;
}

.excel-filter-dropdown button {
  flex: 1;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: background 0.2s;
}

.excel-filter-dropdown button:focus-visible,
.excel-filter-dropdown input:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.excel-filter-select-all {
  background: #28a745;
  color: white;
}

.excel-filter-select-all:hover {
  background: #218838;
}

.excel-filter-clear {
  background: #dc3545;
  color: white;
}

.excel-filter-clear:hover {
  background: #c82333;
}

.excel-filter-option {
  display: flex;
  align-items: center;
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.excel-filter-option:hover {
  background: var(--filter-option-hover, #f5f5f5) !important;
}

.excel-filter-option input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 2px 10px 0 0 !important;
  cursor: pointer;
  accent-color: #2563eb;
}

.excel-filter-option label {
  cursor: pointer;
  flex: 1;
  color: var(--text-primary, #333);
  text-align: left;
}

.excel-filter-option span {
  text-align: left;
  color: var(--text-primary, #333) !important;
}

/* Status Indicator Dots in Dropdown */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  box-sizing: border-box;
}

.status-active {
  background: #4CAF50;
}

.status-inactive {
  background: #fff;
  border: 2px solid #ccc;
}

.status-processing {
  background: #f59e0b;
}

.status-not_delivering {
  background: #f44336;
}

/* Numeric Filter Dropdown Styles */
.numeric-filter-dropdown {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.numeric-filter-container {
  display: flex;
  flex-direction: column;
}

.operator-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.operator-group label {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s ease;
  user-select: none;
}

.operator-group label:hover {
  background: var(--filter-option-hover, #f5f5f5) !important;
}

.operator-group input[type="radio"] {
  flex: 0 0 16px;
  margin: 0 8px 0 0 !important;
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #667eea;
}

.operator-group span {
  font-size: 13px;
  color: var(--text-primary, #333) !important;
  font-weight: 500;
}

.numeric-inputs {
  margin-bottom: 12px;
}

.numeric-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #ddd);
  background: var(--bg-input, #fff);
  color: var(--text-primary, #333);
  border-radius: 4px;
  font-size: 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  margin: 0 !important;
  border-color: var(--border, #ddd) !important;
  background: var(--bg-input, #fff) !important;
  color: var(--text-primary, #333) !important;
}

.numeric-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.numeric-input::placeholder {
  color: var(--text-muted, #999);
}

.range-inputs {
  display: flex;
  gap: 10px;
  align-items: center;
}

.numeric-filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.numeric-filter-apply,
.numeric-filter-clear {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.numeric-filter-apply {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.numeric-filter-apply:hover {
  background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.numeric-filter-apply:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.numeric-filter-clear {
  background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
  color: white;
}

.numeric-filter-clear:hover {
  background: linear-gradient(135deg, #c82333 0%, #d63384 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.numeric-filter-clear:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.excel-filter-dropdown {
  box-sizing: border-box;
  min-width: min(220px, calc(100vw - 20px)) !important;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px) !important;
  overflow-y: auto;
}
.numeric-filter-dropdown {
  width: min(320px, calc(100vw - 20px));
}
.numeric-filter-dropdown input {
  min-width: 0;
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  .excel-filter-dropdown, .numeric-filter-dropdown { transition: none !important; }
}
