:root {
  --bg: #0f1210;
  --surface: #171a17;
  --surface-2: #20231f;
  --text: #f3eee4;
  --muted: #aaa69d;
  --line: rgba(243, 238, 228, 0.13);
  --gold: #d7ae5c;
  --gold-soft: #f0d18e;
  --green: #5f8a74;
  --red: #c8756d;
  --admin-header-height: 72px;
  --admin-header-height-mobile: 64px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  height: var(--admin-header-height);
  min-height: var(--admin-header-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(22px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(15, 18, 16, 0.94);
  backdrop-filter: blur(14px);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-brand > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-soft);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.icon-command {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.admin-main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 42px 22px 80px;
}

.login-view {
  display: grid;
  min-height: calc(100vh - 150px);
  place-items: center;
}

.login-form {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.admin-eyebrow {
  margin: 0 0 10px;
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 26px;
  font-size: 34px;
}

h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

h3 {
  margin-bottom: 18px;
  font-size: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: #0d100e;
  outline: none;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(215, 174, 92, 0.11);
}

.login-form .admin-button {
  width: 100%;
  margin-top: 18px;
}

.admin-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 800;
  cursor: pointer;
}

.admin-button.primary {
  color: #11130f;
  background: var(--gold-soft);
}

.admin-button.secondary {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
}

.admin-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.admin-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--gold-soft);
  font-size: 13px;
}

.admin-status.error {
  color: var(--red);
}

.dashboard-title,
.panel-heading,
.services-editor-heading,
.save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-title h1 {
  margin-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.stat-item,
.mini-stat {
  min-height: 142px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.stat-item.accent {
  border-color: rgba(95, 138, 116, 0.55);
}

.stat-item span,
.stat-item small,
.mini-stat span,
.mini-stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-item strong,
.mini-stat strong {
  display: block;
  margin: 12px 0 4px;
  color: var(--text);
  font-size: 36px;
}

.mini-stat {
  min-height: 112px;
}

.mini-stat strong {
  font-size: 30px;
}

.admin-tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow-x: auto;
}

.tab-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button.active {
  color: #12140f;
  background: var(--gold-soft);
}

.tab-panel {
  min-width: 0;
  padding-top: 12px;
}

.panel-heading {
  align-items: end;
  margin-bottom: 22px;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.filters {
  display: flex;
  gap: 10px;
}

.filters label {
  min-width: 160px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  font-size: 13px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 4px;
  color: var(--muted);
}

td select {
  min-width: 150px;
}

td input {
  min-width: 120px;
}

.muted-row {
  opacity: 0.55;
}

.shift-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chart-list {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(180px, 1fr) 54px;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.chart-row:last-child {
  border-bottom: 0;
}

.chart-row strong,
.chart-row small {
  display: block;
}

.chart-row small {
  margin-top: 5px;
  color: var(--muted);
}

.chart-row b {
  color: var(--gold-soft);
  text-align: right;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(243, 238, 228, 0.09);
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold-soft));
}

.row-save {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  color: var(--gold-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.empty-state {
  margin: 0;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(170px, 0.7fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.compact-table table {
  min-width: 900px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.settings-group {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.services-editor-section {
  margin-top: 22px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.services-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.service-editor {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.service-editor .description-field {
  grid-column: 1 / -1;
}

.delete-service {
  align-self: end;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(200, 117, 109, 0.45);
  border-radius: 4px;
  color: #e79a92;
  background: transparent;
  cursor: pointer;
}

.save-bar {
  position: sticky;
  bottom: 16px;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--gold-line, rgba(215, 174, 92, 0.38));
  border-radius: 4px;
  background: rgba(23, 26, 23, 0.96);
  backdrop-filter: blur(14px);
}

.save-bar .admin-status {
  margin: 0;
}

@media (max-width: 980px) {
  .stat-grid,
  .mini-stat-grid,
  .settings-grid,
  .services-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .admin-header {
    height: var(--admin-header-height-mobile);
    min-height: var(--admin-header-height-mobile);
    padding-inline: 14px;
  }

  .admin-brand > span,
  .icon-command {
    width: 34px;
    height: 34px;
  }

  .admin-main {
    padding-inline: 14px;
  }

  .stat-grid,
  .services-editor,
  .two-fields,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .filters,
  .dashboard-title,
  .save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filters label {
    min-width: 0;
  }

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

  .service-editor .description-field {
    grid-column: auto;
  }

  .admin-header-actions > a {
    display: none;
  }

  .mini-stat-grid {
    grid-template-columns: 1fr;
  }

  .shift-fields,
  .chart-row {
    grid-template-columns: 1fr;
  }

  .chart-row b {
    text-align: left;
  }
}
