/* Улучшение видимости текста в select фильтра времени */
select.filter-input {
  font-size: 14px;
  padding-top: 2px;
  padding-bottom: 2px;
  padding-left: 6px;
  padding-right: 24px;
  line-height: 20px;
}
/* Одинаковая высота для input/select фильтров даты и времени */
.filter-input[type="date"],
.filter-input[type="text"],
.filter-input[type="number"],
.filter-input,
select.filter-input {
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  box-sizing: border-box;
}

/* Уменьшенный шрифт для полей даты */
.filter-input[type="date"] {
  font-size: 11px;
}

/* Уменьшенный шрифт для селектов времени */
.filter-input-time {
  font-size: 11px;
}
/* Одинаковая высота для всех быстрых кнопок фильтрации дат и времени */
.date-shortcut-btn,
.time-shortcut-btn {
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding-top: 0;
  padding-bottom: 0;
  box-sizing: border-box;
}
/* Global Styles */
:root {
  --primary-color: #4a90e2;
  --secondary-color: #f5a623;
  --success-color: #7ed321;
  --danger-color: #d0021b;
  --warning-color: #f8e71c;
  --info-color: #50e3c2;
  --text-color: #333;
  --border-color: #e0e0e0;
  --bg-color: #f9f9f9;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  min-height: 100vh;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-box {
  background: white;
  border-radius: 8px;
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-box h1 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.login-box .subtitle {
  color: #999;
  margin-bottom: 30px;
  font-size: 14px;
}

.login-form {
  text-align: left;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.error-message {
  color: var(--danger-color);
  margin-bottom: 20px;
  padding: 10px;
  background-color: rgba(208, 2, 27, 0.1);
  border-radius: 4px;
  font-size: 14px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background-color: #357abd;
}

.btn-primary:disabled {
  background-color: #999;
  cursor: not-allowed;
  opacity: 0.7;
}

.spinner-small {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-small {
  padding: 8px 16px;
  font-size: 12px;
}

/* Header */
.header {
  background: white;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header h1 {
  font-size: 24px;
  margin-right: 30px;
  min-width: 150px;
}

.nav-tabs {
  display: flex;
  gap: 10px;
  flex: 1;
}

.nav-tab {
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text-color);
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.nav-tab:hover {
  color: var(--primary-color);
}

.nav-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Map Page */
.map-page {
  display: flex;
  flex-direction: row;
  gap: 12px;
  height: calc(100vh - 81px);
  padding: 12px;
  max-width: 100%;
}

/* Left sidebar with filters */
.filters-sidebar {
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.search-panel-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.update-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.last-update {
  font-size: 11px;
  color: #999;
}

.loading-indicator {
  font-size: 11px;
  color: #1976d2;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-weight: 600;
  font-size: 11px;
  color: #8B0000;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
}

.filter-select {
  min-height: 38px;
}

.filter-select-tall {
  min-height: 200px;
}

.filter-select-small {
  min-height: 95px;
}

.filter-select-medium {
  min-height: 120px;
}

.filter-select-large {
  min-height: 520px;
}

/* Map Container */
.map-container {
  flex: 1;
  position: relative;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 0;
}

#map {
  width: 100%;
  height: 100%;
}

/* Deals Counter */
.deals-counter {
  position: absolute;
  top: 10px;
  left: 10px;
  background: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-color);
  box-shadow: var(--shadow);
  z-index: 5;
}

.deals-counter span {
  color: var(--primary-color);
  font-weight: 600;
}

/* Deal Card */
.deal-card {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 320px;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 10;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.close-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  z-index: 11;
}

.close-btn:hover {
  color: var(--danger-color);
}

.card-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  background: #f5f5f5;
}

.card-tab {
  flex: 1;
  padding: 15px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.card-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: white;
}

.card-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.card-field {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.card-field:last-of-type {
  border-bottom: none;
}

.card-field-label {
  font-size: 10px;
  color: #c62828;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: 0.5px;
}

.card-field-value {
  font-size: 13px;
  color: var(--text-color);
  word-break: break-word;
  line-height: 1.4;
}

.card-field-value a {
  color: var(--primary-color);
  text-decoration: none;
}

.card-field-value a:hover {
  text-decoration: underline;
}

.dispatcher-comment {
  width: 100%;
  min-height: 70px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.dispatcher-comment.has-comment {
  color: #c62828;
  border-color: #ffcdd2;
  background: #fff8f8;
  font-weight: 500;
}

.dispatcher-comment:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.history-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.history-event {
  padding: 12px;
  border-left: 4px solid var(--border-color);
  background: #f9f9f9;
  border-radius: 4px;
}

.history-event.courier_change {
  border-left-color: var(--secondary-color);
  background-color: rgba(245, 166, 35, 0.05);
}

.history-event.stage_change {
  border-left-color: var(--primary-color);
  background-color: rgba(74, 144, 226, 0.05);
}

.history-event.comment {
  border-left-color: var(--info-color);
  background-color: rgba(80, 227, 194, 0.05);
}

.event-type {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.event-time {
  font-size: 11px;
  color: #999;
  margin-bottom: 5px;
}

.event-description {
  font-size: 13px;
  color: var(--text-color);
  line-height: 1.4;
}

.text-truncate {
  max-height: 60px;
  overflow: hidden;
  position: relative;
}

.text-truncate.expanded {
  max-height: none;
}

.expand-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 12px;
  padding: 5px 0;
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin: 15px -20px -20px -20px;
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  background: #f9f9f9;
}

.card-actions .btn {
  flex: 1;
  padding: 10px 15px;
  font-size: 12px;
}

/* Couriers Page */
.couriers-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.couriers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.courier-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--border-color);
}

.courier-card.load-0-3 {
  border-left-color: #90ee90;
  background-color: #f0fff0;
}

.courier-card.load-4-6 {
  border-left-color: var(--warning-color);
  background-color: #fffacd;
}

.courier-card.load-7plus {
  border-left-color: var(--danger-color);
  background-color: #ffe4e1;
}

.courier-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
}

.courier-order-count {
  font-size: 12px;
  color: #999;
  margin-bottom: 15px;
}

.courier-orders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-item {
  background: white;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 12px;
}

.order-item-name {
  font-weight: 500;
  margin-bottom: 3px;
}

.order-item-name a {
  color: var(--primary-color);
  text-decoration: none;
}

.order-item-name a:hover {
  text-decoration: underline;
}

.order-item-address {
  color: #666;
  font-size: 11px;
  margin-bottom: 3px;
}

.order-item-time {
  color: #999;
  font-size: 10px;
  margin-bottom: 5px;
}

.order-item-stage {
  display: inline-block;
  padding: 3px 8px;
  background: #f0f0f0;
  border-radius: 3px;
  font-size: 10px;
  color: #666;
}

/* Dashboard Page */
.dashboard-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.metric {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}

.metric-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.metric-label {
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Logs Page */
.logs-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.logs-container {
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 20px;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
}

.logs-table thead {
  background: #f5f5f5;
  border-bottom: 1px solid var(--border-color);
}

.logs-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
}

.logs-table td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.logs-table tbody tr:hover {
  background-color: #f9f9f9;
}

.log-time {
  font-weight: 500;
  color: #666;
  min-width: 150px;
}

.log-message {
  color: var(--text-color);
  line-height: 1.4;
}

/* ─── Date Shortcut Buttons ─── */
.date-shortcuts {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.date-shortcut-btn {
  flex: 1;
  padding: 5px 4px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
  white-space: nowrap;
}

.date-shortcut-btn:hover {
  background: #e8f0fe;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.date-shortcut-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* ─── Time Shortcuts ─── */
.time-shortcuts {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.time-shortcut-btn {
  flex: 1;
  min-width: 50px;
  padding: 5px 4px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
  white-space: nowrap;
}

.time-shortcut-btn:hover {
  background: #e8f0fe;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.time-shortcut-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* ─── Time Range Row ─── */
.time-range-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-range-row .time-select {
  flex: 1;
  min-width: 0;
}

.time-dash {
  color: #999;
  font-size: 14px;
  flex-shrink: 0;
}

/* ─── All Deals List Panel ─── */
.deals-list-panel {
  position: absolute;
  left: 50px;
  top: 10px;
  width: 320px;
  max-height: calc(100% - 30px);
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dlp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #f5f5f5;
  font-size: 13px;
  flex-shrink: 0;
}

.dlp-content {
  overflow-y: auto;
  flex: 1;
}

.dlp-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
}

.dlp-item:hover {
  background: #f5f8ff;
}

.dlp-title {
  font-size: 12px;
  font-weight: 600;
  color: #222;
  margin-bottom: 3px;
}

.dlp-address {
  font-size: 11px;
  color: #555;
  margin-bottom: 4px;
}

.dlp-stage {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  background: #e8f0fe;
  color: #1565c0;
  font-size: 10px;
  font-weight: 500;
  white-space: normal;
}

.dlp-courier {
  font-size: 11px;
  color: #555;
  margin-left: 4px;
}

/* ─── Courier Change Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  width: 340px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 0;
}

.modal-close:hover {
  color: var(--danger-color);
}

.modal-body {
  padding: 14px 18px;
}

.modal-deal-title {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-body .filter-select {
  min-height: 160px;
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
}

.modal-footer .btn {
  flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .nav-tabs {
    flex-direction: column;
    gap: 5px;
  }

  .map-page {
    flex-direction: column;
  }

  .filters-sidebar {
    width: 100%;
    min-width: unset;
  }

  .map-container {
    height: 400px;
  }

  .deal-card {
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .couriers-list {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }
}
/* Bulk Assign Panel Styles */
#bulkAssignPanel {
  display: none;
  margin-top: 16px;
  padding: 12px;
  background: #fff3e0;
  border: 2px solid #FF9800;
  border-radius: 4px;
  animation: slideIn 0.3s ease-in-out;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  position: sticky;
  bottom: 0;
  overflow: visible;
}

#bulkAssignPanel.visible {
  display: block !important;
}

.bulk-panel-title {
  margin-bottom: 10px;
  font-weight: 600;
  color: #E65100;
  font-size: 14px;
}

#selectedCount {
  display: inline-block;
  background: #FF5722;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  margin-left: 4px;
  font-size: 18px;
}

.bulk-panel-courier-select {
  margin-bottom: 10px;
}

.bulk-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #333;
}

.bulk-courier-search-input {
  width: 100%;
  margin-bottom: 6px;
  border: 1px solid #FFB74D;
  padding: 6px 8px;
  border-radius: 3px;
  font-size: 12px;
}

.bulk-courier-search-input:focus {
  outline: none;
  border-color: #FF9800;
  box-shadow: 0 0 4px rgba(255, 152, 0, 0.2);
}

.bulk-courier-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid #FFB74D;
  border-radius: 3px;
  padding: 4px;
  background: white;
}

.bulk-courier-option {
  padding: 6px 8px;
  border: 1px solid #E0E0E0;
  background: white;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: background-color 0.2s, border-color 0.2s;
}

.bulk-courier-option:hover {
  background: #FFF9E6;
  border-color: #FFB74D;
}

.bulk-courier-option.selected {
  background: #FF9800;
  color: white;
  border-color: #FF9800;
  font-weight: 500;
}

.bulk-courier-select {
  width: 100%;
  border: 1px solid #FFB74D;
  background: white;
  color: #333;
}

.bulk-courier-select:focus {
  outline: none;
  border-color: #FF9800;
  box-shadow: 0 0 4px rgba(255, 152, 0, 0.3);
}

.bulk-panel-buttons {
  display: flex;
  gap: 6px;
}

.bulk-assign-btn {
  flex: 1;
  padding: 8px;
  font-size: 12px;
}

.bulk-cancel-btn {
  flex: 1;
  padding: 8px;
  font-size: 12px;
}

.bulk-panel-hint {
  font-size: 10px;
  color: #666;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #FFD699;
  text-align: center;
}

/* Additional utility styles for form elements */
.filters-top-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-search {
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-search:hover {
  background: #f0f0f0;
  border-color: var(--primary-color);
}

.apply-filters-btn {
  margin-bottom: 0;
  flex: 1;
  height: 26px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
}

.date-range-container {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}

.date-input {
  width: 120px;
}

.date-separator {
  font-size: 18px;
}

.date-shortcuts-first {
  margin-top: 2px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.date-shortcuts-second {
  margin-top: 4px;
  display: flex;
  gap: 6px;
}

.time-range-container {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 4px;
}

.time-select {
  width: 70px;
}

.time-separator {
  font-size: 12px;
  color: #999;
}

.time-shortcuts-grid {
  margin-top: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
}

.type-filter-container {
  display: flex;
  gap: 6px;
}

.type-filter-btn {
  flex: 1;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.type-filter-btn:hover {
  border-color: #999;
}

.type-filter-btn.active {
  border-color: #FF9800;
  background: #FFF3E0;
}

.update-row {
  margin-bottom: 12px;
}

.loading-indicator {
  display: inline-block;
}

.loading-indicator:not([style*="display"]) {
  display: none;
}

.deals-list-panel {
  display: none;
}

.deals-list-panel[style*="display: block"] {
  display: block !important;
}

.dlp-close-btn {
  position: static;
}

.card-content-hidden {
  display: none;
}

.courier-search-input {
  margin-bottom: 6px;
}

.deal-card {
  display: none;
}

.deal-card[style*="display: block"] {
  display: block !important;
}

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

#bulkAssignPanel:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ─── Search Modal ─── */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.search-modal-content {
  background: white;
  border-radius: 8px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.search-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.search-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.search-modal-header .close-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 24px;
  border: none;
  background: none;
  cursor: pointer;
  color: #999;
}

.search-modal-header .close-btn:hover {
  color: #333;
}

.search-modal-input {
  width: 100%;
  height: 32px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 12px;
}

.search-modal-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.search-modal-hint {
  font-size: 12px;
  color: #999;
  font-style: italic;
}

/* ─── Filter Accordion (Spoiler) ─── */
.filter-accordion {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.filter-accordion-summary {
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: white;
  border-bottom: 1px solid transparent;
  transition: all 0.15s;
}

.filter-accordion-summary:hover {
  background: #f9f9f9;
  border-bottom-color: var(--border-color);
}

.filter-accordion[open] .filter-accordion-summary {
  border-bottom-color: var(--border-color);
  background: #f9f9f9;
}

.filter-accordion-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  background: white;
}

.filter-accordion-content .filter-input,
.filter-accordion-content .filter-select {
  margin: 0;
}