/* ===== STORES & TERRITORIES POPUP (PIXEL-PERFECT MATCH) ===== */
.st-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  pointer-events: auto;
}

.st-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.st-modal-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
  box-sizing: border-box;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

.st-modal-overlay.open .st-modal-card {
  transform: translateY(0) scale(1);
}

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

.st-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.st-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.st-icon-blue {
  background: #eff6ff;
  color: #2563eb;
}

.st-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.3px;
}

.st-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.st-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Search Box Container */
.st-search-box {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  height: 42px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 0 14px !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
  margin-bottom: 14px !important;
}

.st-search-box:focus-within {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
}

.st-search-lens {
  display: none !important;
}

.st-search-box input {
  flex: 1 !important;
  min-width: 0 !important;
  height: 100% !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  padding: 0 4px !important;
  margin: 0 !important;
  font-size: 13.5px !important;
  font-family: inherit !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

.st-search-box input::placeholder {
  color: transparent !important;
  opacity: 0 !important;
}

/* Subtitle Count */
.st-count-sub {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 12px;
}

/* Stores List */
.st-stores-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 380px;
  padding-right: 4px;
}

.st-stores-list::-webkit-scrollbar,
.st-terrs-grid::-webkit-scrollbar {
  width: 5px;
}
.st-stores-list::-webkit-scrollbar-thumb,
.st-terrs-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.st-store-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.12s;
}

.st-store-row:hover {
  background: #f8fafc;
}

.st-store-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.st-store-logo {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.st-store-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
}

.st-type-pill {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 12px;
}

.st-store-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.st-status-badge {
  background: #ecfdf5;
  color: #10b981;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.st-visit-link {
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.12s;
}

.st-visit-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.st-url-none {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
}

/* Territories Grid (3 Columns) */
.st-terrs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
  overflow-y: auto;
  max-height: 380px;
  padding-right: 4px;
}

.st-terr-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  transition: background 0.1s;
}

.st-terr-item:hover {
  background: #f1f5f9;
}

.st-flag-img {
  width: 20px !important;
  height: 15px !important;
  object-fit: cover !important;
  border-radius: 2.5px !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
  flex-shrink: 0 !important;
  vertical-align: middle !important;
}

.st-flag-code-fallback {
  font-size: 11px !important;
  font-weight: 700 !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  padding: 1px 4px !important;
  border-radius: 3px !important;
}

.st-country-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toggle Show All Button */
.st-toggle-btn {
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: none;
  padding: 12px 0 0 0;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}

.st-toggle-btn:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.st-empty-state {
  padding: 32px 16px;
  text-align: center;
  color: #64748b;
}

.st-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.st-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.st-empty-state p {
  font-size: 12.5px;
  margin: 0;
  color: #64748b;
}

.st-empty-search {
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  grid-column: span 3;
}
