.stores-toolbar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.stores-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.stores-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
  flex: 0 0 auto;
}

.stores-toolbar-card .stores-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.stores-toolbar-card .stores-search-input {
  width: 100%;
  height: 46px;
  padding-left: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #0f172a;
  box-sizing: border-box;
}

.stores-toolbar-card .stores-search-input::placeholder {
  color: #94a3b8;
}

.stores-toolbar-card .stores-search-input:focus {
  border-color: #2563eb;
  outline: 2px solid #2563eb;
  outline-offset: 0;
}

.stores-toolbar-card .stores-filter-control {
  height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #0f172a;
  cursor: pointer;
  box-sizing: border-box;
}

.stores-toolbar-card .stores-filter-control:focus {
  border-color: #2563eb;
  outline: 2px solid #2563eb;
  outline-offset: 0;
}

.stores-toolbar-card .stores-filter-control--brand {
  width: 180px;
}

.stores-toolbar-card .stores-filter-control--status {
  width: 160px;
}

.stores-toolbar-card .stores-new-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  background: #ffffff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.stores-toolbar-card .stores-new-button:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.stores-toolbar-card .stores-new-button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.stores-toolbar-card .stores-new-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.stores-table-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.stores-table-scroll {
  overflow-x: auto;
}

.stores-table {
  width: 100%;
  table-layout: fixed;
}

.stores-table thead th {
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.stores-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #0f172a;
  font-size: 13px;
}

.stores-table tbody tr:hover {
  background: #f8fbff;
}

.stores-table tbody tr:last-child td {
  border-bottom: none;
}

.stores-col-code { width: 12%; }
.stores-col-name { width: 26%; }
.stores-col-brand { width: 15%; }
.stores-col-city { width: 20%; }
.stores-col-status { width: 12%; }
.stores-col-actions { width: 15%; }

.stores-table-footer {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
  color: #64748b;
}

.stores-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.stores-status-badge--active {
  background: #ecfdf5;
  color: #059669;
}

.stores-status-badge--inactive {
  background: #f1f5f9;
  color: #64748b;
}

.stores-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}

.stores-action:hover {
  opacity: 0.85;
}

.stores-action--edit {
  color: #2563eb;
  background: transparent;
  border: none;
}

.stores-action--edit:hover {
  background: #eff6ff;
}

.stores-action--danger {
  color: #dc2626;
  background: transparent;
  border: 1px solid #fecaca;
}

.stores-action--danger:hover {
  background: #fef2f2;
}

.stores-action--danger:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

#modal-loja {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.stores-modal-panel {
  width: min(860px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.stores-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #eef2f7;
  flex-shrink: 0;
}

.stores-modal-header-icon,
.stores-form-section-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stores-modal-title-block {
  min-width: 0;
  flex: 1;
}

.stores-modal-title {
  color: #0f172a;
  font-size: 1.625rem;
  line-height: 1.15;
  font-weight: 700;
}

.stores-modal-subtitle {
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.45;
}

.stores-modal-close {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.stores-modal-close:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.stores-modal-close:focus-visible,
.stores-modal-action:focus-visible,
.stores-field .form-input:focus-visible,
.stores-field .form-select:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.stores-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
  overflow-y: auto;
}

.stores-form-section {
  margin: 0;
  padding: 1.125rem 1.125rem 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  min-width: 0;
}

.stores-form-section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: #0f172a;
}

.stores-form-section-heading h4 {
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 700;
}

.stores-form-grid {
  display: grid;
  gap: 1rem;
}

.stores-form-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stores-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.stores-field--full {
  grid-column: 1 / -1;
}

.stores-field .form-label {
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
}

.stores-field .form-input,
.stores-field .form-select {
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  color: #0f172a;
  width: 100%;
  box-sizing: border-box;
}

.stores-field .form-input::placeholder {
  color: #94a3b8;
}

.stores-field .form-input:disabled,
.stores-field .form-select:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.stores-field .form-select {
  cursor: pointer;
}

.stores-required {
  color: #dc2626;
  margin-left: 0.125rem;
}

.stores-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  flex-shrink: 0;
}

.stores-modal-action {
  min-height: 46px;
  padding-left: 1rem;
  padding-right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

#modal-loja .stores-modal-footer [onclick="fecharModalLoja()"] {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  font-weight: 600;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#modal-loja .stores-modal-footer [onclick="fecharModalLoja()"]:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

#modal-loja .stores-modal-footer [onclick="fecharModalLoja()"]:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

#modal-loja .stores-modal-footer [onclick="fecharModalLoja()"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#modal-loja #modal-loja-btn-save {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
  border-radius: 0.75rem;
  font-weight: 600;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

#modal-loja #modal-loja-btn-save:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

#modal-loja #modal-loja-btn-save:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

#modal-loja #modal-loja-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .stores-modal-panel {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 1rem;
  }

  .stores-modal-header,
  .stores-form,
  .stores-modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .stores-modal-header {
    padding-top: 1rem;
  }

  .stores-form-section {
    padding: 1rem;
  }

  .stores-form-grid--two {
    grid-template-columns: 1fr;
  }

  .stores-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .stores-modal-action {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .stores-toolbar-card {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
  }

  .stores-filters {
    width: 100%;
    flex-direction: column;
  }

  .stores-search-wrapper {
    flex: none;
    width: 100%;
  }

  .stores-filters .form-input,
  .stores-filters .form-select,
  .stores-toolbar-card .stores-filter-control {
    width: 100%;
  }

  .stores-toolbar-card .stores-new-button {
    width: 100%;
    justify-content: center;
  }
}
