:root {
  --orange: #f45b22;
  --ink: #181818;
  --paper: #f3f0ea;
  --white: #fff;
  --muted: #716d67;
  --line: #ddd8d0;
  --danger: #c53e2d;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
.admin-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 19px; font-weight: 900; font-style: italic; }
.admin-brand span { width: 11px; height: 23px; background: var(--orange); transform: skewX(-14deg); }
.login-page { min-height: 100svh; color: white; background: #171717; }
.login-shell { width: min(1080px, calc(100% - 32px)); min-height: 100svh; display: grid; grid-template-rows: auto 1fr; margin: auto; padding: 28px 0 50px; }
.login-card { width: min(460px, 100%); align-self: center; margin: auto; padding: 40px; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; background: #212121; box-shadow: 0 36px 90px rgba(0,0,0,.3); }
.login-heading > span, .admin-kicker { color: var(--orange); font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.login-heading h1 { margin: 12px 0 9px; font-size: 48px; letter-spacing: -.05em; }
.login-heading p { margin: 0 0 28px; color: rgba(255,255,255,.55); line-height: 1.55; }
form { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.login-card label { color: rgba(255,255,255,.62); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: white;
  transition: border-color .2s, box-shadow .2s;
}
input, select { height: 44px; padding: 0 12px; }
textarea { min-height: 105px; padding: 12px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244,91,34,.14); }
.primary-button, .secondary-button, .danger-button, .icon-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}
.primary-button { min-height: 46px; padding: 0 23px; color: white; background: var(--orange); }
.primary-button:hover { background: #ff6a30; }
.login-card .primary-button { margin-top: 4px; }
.back-link { display: inline-block; margin-top: 24px; color: rgba(255,255,255,.46); text-decoration: none; font-size: 12px; }
.alert { margin-bottom: 18px; padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.alert-error { color: #ffd8d2; background: rgba(197,62,45,.24); }

.admin-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: white;
  background: var(--ink);
}
.admin-header-actions { display: flex; gap: 20px; }
.admin-header-actions a { color: rgba(255,255,255,.65); text-decoration: none; font-size: 12px; font-weight: 700; }
.admin-shell { width: min(1180px, calc(100% - 48px)); margin: auto; padding: 62px 0 100px; }
.admin-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 40px; }
.admin-intro h1 { margin: 9px 0 0; font-size: clamp(40px, 6vw, 68px); line-height: .95; letter-spacing: -.055em; }
.save-cluster { display: flex; align-items: center; gap: 15px; }
.save-status { color: var(--muted); font-size: 12px; }
.save-status.dirty { color: var(--orange); }
.save-status.error { color: var(--danger); }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.42); }
.tabs button { flex: 1; min-height: 46px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; }
.tabs button.active { color: white; background: var(--ink); }
.admin-panel { display: none; padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.5); }
.admin-panel.active { display: block; }
.panel-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 26px; }
.panel-heading h2 { margin: 0 0 7px; font-size: 26px; letter-spacing: -.03em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.secondary-button { min-height: 42px; padding: 0 17px; border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.secondary-button:hover { color: white; background: var(--ink); }
.editor-list { display: grid; gap: 10px; }
.empty-state { padding: 45px 20px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; }
.service-editor {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(140px, .7fr) 120px 120px 40px;
  gap: 10px;
  align-items: end;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}
.icon-button { width: 40px; height: 40px; color: var(--muted); background: #f0ede7; font-size: 18px; }
.icon-button:hover { color: white; background: var(--danger); }
.popup-editor { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.popup-editor-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 18px; }
.popup-editor-head strong { font-size: 17px; }
.popup-actions { display: flex; align-items: center; gap: 10px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.toggle input { width: 38px; height: 21px; margin: 0; accent-color: var(--orange); }
.popup-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.popup-fields .wide { grid-column: 1 / -1; }
.date-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.field-hint { color: var(--muted); font-size: 10px; font-weight: 500; }

@media (max-width: 860px) {
  .service-editor { grid-template-columns: repeat(2, 1fr); }
  .service-editor .icon-button { grid-column: 2; justify-self: end; }
}
@media (max-width: 620px) {
  .login-card { padding: 30px 24px; }
  .admin-header { padding: 0 16px; }
  .admin-header-actions a:first-child { display: none; }
  .admin-shell { width: calc(100% - 24px); padding: 42px 0 70px; }
  .admin-intro, .panel-heading { align-items: stretch; flex-direction: column; }
  .save-cluster { align-items: stretch; flex-direction: column-reverse; }
  .save-status { text-align: right; }
  .tabs { overflow-x: auto; }
  .tabs button { min-width: 150px; }
  .admin-panel { padding: 20px 14px; }
  .panel-heading .secondary-button { width: 100%; }
  .service-editor, .popup-fields, .date-row { grid-template-columns: 1fr; }
  .service-editor .icon-button, .popup-fields .wide { grid-column: auto; }
  .service-editor .icon-button { justify-self: end; }
  .popup-editor { padding: 17px 14px; }
  .popup-editor-head { align-items: flex-start; }
  .popup-actions { flex-wrap: wrap; justify-content: flex-end; }
}
