:root {
  --ink: #18252b;
  --muted: #607078;
  --teal: #155b68;
  --teal-dark: #0f424c;
  --rose: #b84f4a;
  --paper: #f3f6f5;
  --white: #ffffff;
  --line: #d5dfdc;
  --success: #2f6d4f;
  --danger: #9e3535;
  --shadow: 0 18px 50px rgba(19, 53, 61, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

:focus-visible {
  outline: 4px solid rgba(184, 79, 74, 0.25);
  outline-offset: 3px;
}

.admin-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-top: 6px solid var(--rose);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.admin-header__inner {
  width: min(100% - 40px, 1120px);
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
}

.admin-brand {
  display: flex;
  flex-direction: column;
  color: var(--teal-dark);
  line-height: 1.25;
  text-decoration: none;
}

.admin-brand__eyebrow,
.section-kicker {
  color: var(--rose);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-header__actions {
  display: flex;
  gap: 10px;
}

.admin-header__actions form {
  margin: 0;
}

.admin-shell {
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  padding: 46px 0 80px;
}

h1,
h2 {
  margin: 0;
  color: var(--teal-dark);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.12;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
}

.button:hover {
  border-color: var(--teal);
}

.button--primary {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.button--primary:hover {
  background: var(--teal-dark);
}

.button--ghost {
  background: transparent;
}

.button--small {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 0.87rem;
}

.flash {
  margin-bottom: 24px;
  padding: 15px 18px;
  border-left: 5px solid currentColor;
  border-radius: 6px;
  background: var(--white);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(19, 53, 61, 0.07);
}

.flash--error {
  color: var(--danger);
}

.flash--success {
  color: var(--success);
}

.auth-card {
  max-width: 580px;
  margin: 8vh auto 0;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.auth-card > p:not(.section-kicker) {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.auth-form label,
.field {
  display: grid;
  gap: 8px;
  color: var(--teal-dark);
  font-weight: 800;
}

.auth-form small {
  color: var(--muted);
  font-weight: 400;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #b9c8c4;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.editor-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.editor-heading p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.panel {
  margin-bottom: 28px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 12px 34px rgba(19, 53, 61, 0.07);
}

.panel__heading {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 32px;
}

.panel__heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel__number {
  flex: 0 0 auto;
  color: var(--rose);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 900;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  width: 50px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #9caaa7;
  transition: background 160ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 160ms ease;
}

.switch-row input:checked + .switch {
  background: var(--success);
}

.switch-row input:checked + .switch::after {
  transform: translateX(22px);
}

.switch-row input:focus-visible + .switch {
  outline: 4px solid rgba(184, 79, 74, 0.25);
  outline-offset: 3px;
}

.color-picker {
  margin: 25px 0 0;
  padding: 0;
  border: 0;
}

.color-picker legend,
.field-label {
  margin-bottom: 10px;
  color: var(--teal-dark);
  font-weight: 800;
}

.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: #f1f4f3;
  font-size: 0.9rem;
  font-weight: 700;
}

.color-option:has(input:checked) {
  border-color: var(--ink);
}

.color-option input {
  position: absolute;
  opacity: 0;
}

.color-option span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.13);
}

.color-option--red span { background: #a93636; }
.color-option--blue span { background: #165f8c; }
.color-option--green span { background: #2f6d4f; }
.color-option--orange span { background: #a95716; }
.color-option--gray span { background: #4c5960; }

.panel .field + .field,
.panel .field + .color-picker {
  margin-top: 28px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.wysiwyg {
  overflow: hidden;
  border: 1px solid #b9c8c4;
  border-radius: 7px;
  background: var(--white);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #f4f7f6;
}

.toolbar button {
  min-width: 38px;
  min-height: 36px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--teal-dark);
}

.toolbar button:hover {
  border-color: var(--line);
  background: var(--white);
}

.editable {
  min-height: 150px;
  padding: 16px;
  color: var(--ink);
  font-weight: 400;
  outline: 0;
}

.editable:focus {
  box-shadow: inset 0 0 0 3px rgba(21, 91, 104, 0.17);
}

.editable p:first-child { margin-top: 0; }
.editable p:last-child { margin-bottom: 0; }

.hours-editor {
  display: grid;
  gap: 10px;
}

.hour-row {
  display: grid;
  grid-template-columns: 30px minmax(130px, 0.55fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf9;
}

.hour-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hour-row input {
  min-height: 44px;
  font-size: 1rem;
  text-transform: none;
}

.drag-handle {
  align-self: center;
  color: #82918d;
  font-size: 1.2rem;
  letter-spacing: -0.2em;
}

.row-actions {
  display: flex;
  gap: 5px;
  padding-bottom: 2px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--teal-dark);
  font-size: 1.1rem;
}

.icon-button:hover {
  border-color: var(--teal);
}

.remove-row {
  color: var(--danger);
}

.save-bar {
  position: sticky;
  z-index: 8;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 16px 14px 22px;
  border: 1px solid #b8c8c3;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  color: var(--muted);
}

.statistics-heading {
  align-items: center;
}

.range-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.range-picker a {
  padding: 7px 11px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.range-picker a:hover,
.range-picker a.is-active {
  background: var(--teal);
  color: var(--white);
}

.statistics-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  min-height: 178px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(19, 53, 61, 0.06);
}

.stat-card--primary {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.stat-card > span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-card--primary > span,
.stat-card--primary small {
  color: #d7e8eb;
}

.stat-card strong {
  margin-top: auto;
  color: var(--teal-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 6vw, 4.4rem);
  line-height: 1;
}

.stat-card--primary strong {
  color: var(--white);
}

.stat-card small {
  margin-top: 8px;
  color: var(--muted);
}

.statistics-panel {
  padding-inline: 0;
}

.statistics-panel > .panel__heading {
  padding-inline: clamp(24px, 4vw, 42px);
}

.statistics-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

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

.statistics-table th,
.statistics-table td {
  padding: 15px clamp(14px, 3vw, 26px);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.statistics-table thead th {
  background: #f4f7f6;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.statistics-table tbody th {
  min-width: 150px;
  color: var(--teal-dark);
}

.statistics-table tbody tr:last-child th,
.statistics-table tbody tr:last-child td {
  border-bottom: 0;
}

.chart-cell {
  width: 44%;
  min-width: 140px;
}

.chart-bar {
  height: 12px;
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), #4c8790);
}

.number-cell {
  width: 120px;
  color: var(--teal-dark);
  font-size: 1.12rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right !important;
}

.statistics-empty {
  margin: 0 clamp(24px, 4vw, 42px);
  padding: 28px;
  border: 1px dashed #b9c8c4;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.statistics-empty p {
  margin: 5px 0 0;
}

.statistics-note {
  max-width: 850px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 760px) {
  .admin-header__inner,
  .admin-shell {
    width: min(100% - 28px, 1120px);
  }

  .admin-header__inner {
    min-height: 76px;
  }

  .admin-header__actions .view-site-button {
    display: none;
  }

  .editor-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .statistics-summary {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 155px;
  }

  .save-top {
    display: none;
  }

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

  .drag-handle {
    display: none;
  }

  .row-actions {
    justify-content: flex-end;
  }

  .save-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    bottom: 8px;
    padding: 13px;
    text-align: center;
  }
}
