body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f6f7f9;
  color: #1f2937;
}

header {
  background: #111827;
  color: white;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
}

header p {
  margin: 4px 0 0;
  color: #cbd5e1;
}

nav a {
  color: white;
  margin-left: 18px;
  text-decoration: none;
}

main {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 20px;
}

.hero, .card {
  background: white;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
}

.hero h2 {
  font-size: 32px;
  margin: 0 0 8px;
}

.actions {
  margin-top: 18px;
}

.button, button {
  background: #111827;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

.button.secondary {
  background: #4b5563;
}

form {
  display: grid;
  gap: 14px;
  max-width: 640px;
}

/* Service add/edit forms fill their container (the card / modal) instead of the
   narrow 640px default — they have far more fields than a login form. Bounded
   by main's 1100px max-width, so it never gets absurdly wide. */
form.form-wide {
  max-width: none;
}

/* Help text inside the wide forms shouldn't keep the narrow 260px cap (which
   wraps each paragraph into many short lines) — let it use the field width. */
form.form-wide .small-text {
  max-width: none;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input, select {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

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

th, td {
  text-align: left;
  padding: 11px;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background: #f3f4f6;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.metrics div {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  background: #f9fafb;
}

.metrics strong {
  display: block;
  font-size: 28px;
}

.metrics span {
  color: #6b7280;
}

pre {
  white-space: pre-wrap;
  background: #f3f4f6;
  padding: 16px;
  border-radius: 10px;
}

.muted {
  color: #6b7280;
}

.small-button {
  display: inline-block;
  background: #111827;
  color: white;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge.active {
  background: #dcfce7;
  color: #166534;
}

.badge.inactive {
  background: #fee2e2;
  color: #991b1b;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkbox-row input {
  width: auto;
}

.help-box {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  color: #374151;
}

.small-text {
  font-size: 12px;
  color: #4b5563;
  max-width: 260px;
  word-break: break-word;
}


.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.filter-label {
  font-weight: 800;
  font-size: 13px;
  color: #374151;
}

.filter-chip {
  display: inline-block;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  text-decoration: none;
  color: #111827;
  background: #ffffff;
  font-size: 14px;
}

.filter-chip.active {
  background: #111827;
  color: white;
  border-color: #111827;
}

.metrics-seven {
  grid-template-columns: repeat(7, 1fr);
}

@media (max-width: 1000px) {
  .metrics, .metrics-seven {
    grid-template-columns: repeat(2, 1fr);
  }
}

.date-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  max-width: none;
  margin: 16px 0;
}

.date-field {
  display: grid;
  gap: 6px;
}

.date-field label {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
}

.metrics-six {
  grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1000px) {
  .metrics-six {
    grid-template-columns: repeat(2, 1fr);
  }
}

.services-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
}

.modal-content {
  position: relative;
  z-index: 1001;
  width: min(820px, 100%);
  max-height: none;
}

.modal-title-row,
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.link-config-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

/* NOTE: .req (the required-field marker) is deliberately NOT here. It lives in
   templates/shared/_hours_fields.html, which renders under this stylesheet AND
   under the owner dashboard's Tailwind build; defining it there keeps one rule
   for both surfaces. */

.form-legend {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 14px;
}

/* Form-level validation banner. The admin console is plain CSS (no Tailwind),
   so the owner dashboard's red-50/red-200 pairing is expressed directly. */
.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
}

.danger-button {
  background: #991b1b;
  color: white;
  padding: 10px 12px;
}

button.secondary {
  background: #4b5563;
}

textarea {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: Arial, sans-serif;
}

@media (max-width: 800px) {
  .services-header,
  .modal-title-row,
  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .link-row {
    grid-template-columns: 1fr;
  }
}
