/* Outer page card stays */
.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 30px;
}

/* config-section should be a light panel inside the card (like config page) */
.config-section {
  background: var(--surface-50);
  padding: 25px;
  border-radius: 0;
  border: 1px solid var(--border-200);
  margin-bottom: 0;
}

.config-section h3 {
  color: var(--brand-800);
  font-size: 20px;
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section-icon svg {
  width: 20px;
  height: 20px;
}

.panel-subtitle {
  color: var(--text-600);
  font-size: 14px;
  margin: 0 0 18px 0;
}

/* --- FLATTEN: inner blocks are NOT cards --- */
.store-stats,
.store-controls,
.store-form {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

/* spacing between “sections” */
.store-stats { margin: 14px 0 14px 0; }
.store-controls { margin: 0 0 18px 0; }
.store-form { margin: 0; }

/* stats should look like a single subtle info strip, not a nested card */
.store-stats {
  background: color-mix(in srgb, var(--brand-800) 8%, var(--white));
  border: 1px solid color-mix(in srgb, var(--brand-800) 18%, var(--white));
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 14px;
}

.store-stats strong {
  color: var(--brand-800);
}

/* Controls: inline, no card wrapper */
.store-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.store-controls select {
  flex: 1;
  min-width: 300px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-300);
  border-radius: var(--r-sm);
  font-size: 14px;
  background: var(--surface);
  color: var(--text-600);
}

.store-controls select:focus {
  outline: none;
  border-color: var(--brand-800);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-800) 12%, var(--white));
}

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

/* Form grid stays but is “flat” */
.store-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

/* Service assignment cards */
.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.service-card {
  border: 1px solid var(--border-200);
  border-radius: var(--r-sm);
  padding: 12px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.service-card .service-name {
  font-weight: 600;
  color: var(--text-900);
}

.service-card .service-meta {
  font-size: 12px;
  color: var(--text-600);
  margin-top: 4px;
}

.service-card.active {
  border-color: var(--brand-800);
  background: color-mix(in srgb, var(--brand-800) 8%, var(--white));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-800) 20%, var(--white));
}

.service-card:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-row.cols-3 {
  grid-template-columns: 2fr 1fr 1.2fr;
}

/* fields */
.form-group {
  margin: 0;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-800);
  font-weight: 600;
  font-size: 13px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-300);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text-900);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-800);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-800) 12%, var(--white));
}

.form-group textarea {
  resize: vertical;
  min-height: 96px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-600);
  font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-panel {
    padding: 20px;
  }

  .config-section {
    padding: 18px;
  }

  .form-row,
  .form-row.cols-3 {
    grid-template-columns: 1fr;
  }

  .service-cards {
    grid-template-columns: 1fr;
  }

  .store-controls select {
    min-width: 100%;
  }

  .store-actions {
    width: 100%;
  }

  .store-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (min-width: 769px) and (max-width: 900px) {
  .form-row.cols-3 {
    grid-template-columns: 1fr 1fr;
  }

  .form-row.cols-3 .form-group:last-child {
    grid-column: 1 / -1;
  }
}
