/* Admin panel of www.russischer-psychologe.de — colours of the site, large controls, no external resources. */
:root {
  --bg: #f6f3ee;
  --card: #fff;
  --text: #24303c;
  --muted: #5f6b78;
  --line: #e4ddd2;
  --navy: #16314d;
  --blue: #24507a;
  --green: #2e7d4f;
  --green-dark: #246a41;
  --amber: #a15c00;
  --amber-bg: #fdf1dc;
  --red: #b42318;
  --red-bg: #fdecea;
  --ok-bg: #e7f3ec;
  --focus: #2f6fb0;
  --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--blue); }
h1 { font-size: 30px; line-height: 1.2; margin: 4px 0 8px; color: var(--navy); }
h2 { color: var(--navy); }
.h2 { font-size: 21px; margin: 36px 0 12px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border-radius: 10px; border: 1px solid #c9c0b2; background: #fff; color: var(--navy); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--navy); }
.btn:disabled { opacity: .45; cursor: default; border-color: #c9c0b2; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn-ghost:hover { border-color: var(--line); background: #fff; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 15px; }
.btn-wide { width: 100%; margin-top: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: 600 18px/1 inherit; color: var(--navy); cursor: pointer; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger { color: var(--red); }
.icon-btn:hover:not(:disabled) { border-color: var(--navy); }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 18px; padding: 32px 28px; box-shadow: 0 20px 50px -24px rgba(22, 49, 77, .35); }
.login-form { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.login-form label { font-weight: 600; margin-top: 8px; }
.login-form .show-pass { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-weight: 400; color: var(--muted); cursor: pointer; }
.show-pass input { width: 20px; height: 20px; }
.form-error { color: var(--red); background: var(--red-bg); padding: 10px 12px; border-radius: 8px; margin: 8px 0 0; }

/* inputs */
input[type=text], input[type=url], input[type=number], input[type=date], input:not([type]), input[type=password], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #c9c0b2; border-radius: 10px; background: #fff; color: var(--text); font: inherit;
}
textarea { resize: vertical; line-height: 1.55; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid rgba(47, 111, 176, .25); outline-offset: 0; }
input[type=number] { max-width: 200px; }
input[type=date] { max-width: 240px; }

/* shell */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand-lg { font-size: 22px; }
.mono { width: 38px; height: 38px; border-radius: 9px; background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 15px Georgia, serif; flex: none; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); }
.pub { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pub-state { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 15px; font-weight: 600; }
.pub-state.ok { background: var(--ok-bg); color: var(--green-dark); }
.pub-state.warn { background: var(--amber-bg); color: var(--amber); }
.pub-state.bad { background: var(--red-bg); color: var(--red); }
.pub-state.busy { background: #eaf0f7; color: var(--blue); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.who { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 15px; }
.menu-btn { display: none; }
.body { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 62px); }
.side { border-right: 1px solid var(--line); background: #fbf9f6; padding: 18px 12px 40px; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; }
.side-group { margin-bottom: 18px; }
.side-title { margin: 0 10px 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 16px; }
.side a:hover { background: #fff; }
.side a[aria-current=page] { background: var(--navy); color: #fff; font-weight: 600; }
.main { padding: 28px 36px 140px; max-width: 920px; width: 100%; }
.loading { color: var(--muted); }

/* page head */
.page-head { margin-bottom: 22px; }
.crumb { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--green-dark); }
.crumb a { text-decoration: none; }
.desc { color: var(--muted); max-width: 680px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.card { background: #fff; border-radius: var(--radius); padding: 24px; }

/* home */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; max-width: 720px; }
.steps li { counter-increment: s; background: #fff; border-radius: var(--radius); padding: 14px 18px 14px 58px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 13px; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 28px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: #fff; border-radius: var(--radius); border: 1px solid transparent; text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--navy); }
.tile strong { color: var(--navy); font-size: 18px; }
.tile span { color: var(--muted); font-size: 15px; }

/* blog list */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.post-list a { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 16px 18px; background: #fff; border-radius: var(--radius); text-decoration: none; color: var(--text); border: 1px solid transparent; }
.post-list a:hover { border-color: var(--navy); }
.post-title { font-weight: 600; color: var(--navy); }
.post-meta { color: var(--muted); font-size: 15px; }
.pill { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill-ok { background: var(--ok-bg); color: var(--green-dark); }
.pill-off { background: #eee9e1; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab[aria-selected=true] { color: var(--navy); border-bottom-color: var(--green); }

/* fields */
.fields { display: flex; flex-direction: column; gap: 14px; }
.field { background: #fff; border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.field .field { padding: 0; background: none; border-radius: 0; }
.label { font-weight: 700; color: var(--navy); margin: 0; }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 4px; }
.readonly { margin: 0; font-weight: 600; color: var(--navy); word-break: break-all; }
.field-bool { padding: 16px 20px; }
.switch { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { flex: none; width: 52px; height: 30px; border-radius: 999px; background: #cfc6b8; position: relative; transition: background .2s; margin-top: 2px; }
.switch-ui::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + .switch-ui { background: var(--green); }
.switch input:checked + .switch-ui::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch strong { display: block; color: var(--navy); }
.switch .hint { display: block; margin-top: 2px; }

/* lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: #fdfcfa; }
.item-head { display: flex; align-items: center; justify-content: space-between; }
.item-row { flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; }
.item-row input, .item-row textarea { flex: 1; }
.num { min-width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none; }
.item-tools { display: flex; gap: 6px; flex: none; }
.btn-add { align-self: flex-start; }

/* photos and files */
.media-field { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.media-preview { width: 200px; max-height: 220px; object-fit: contain; border-radius: 10px; background: #f0ebe3; }
.media-empty { width: 200px; min-height: 120px; border: 2px dashed #d5cbbb; border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 15px; text-align: center; padding: 10px; }
.file-field .media-empty { min-height: 60px; }
.media-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.file-current { display: flex; flex-direction: column; gap: 6px; }
.file-current audio { width: 280px; max-width: 100%; }
.progress { display: inline-block; width: 140px; height: 8px; border-radius: 4px; background: #e9e3d9; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }

/* save bar */
.savebar { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; margin-top: 8px; background: #fff; border-radius: var(--radius); box-shadow: 0 -6px 24px -12px rgba(22, 49, 77, .3); }
.savebar-text { margin-right: auto; color: var(--muted); font-weight: 600; }
.savebar.is-dirty { outline: 2px solid var(--amber); }
.savebar.is-dirty .savebar-text { color: var(--amber); }

/* modal, toasts */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(22, 49, 77, .45); display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal h2 { margin: 0 0 12px; font-size: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal .field { padding: 0; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.log { white-space: pre-wrap; font-size: 13px; background: #f4f1ec; padding: 10px; border-radius: 8px; max-height: 300px; overflow: auto; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100vw - 32px)); }
.toast { background: var(--navy); color: #fff; padding: 14px 18px; border-radius: 12px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); transition: opacity .4s; }
.toast-ok { background: var(--green-dark); }
.toast-error { background: var(--red); }
.toast.out { opacity: 0; }

/* visual text editor (editor.js) */
.rte { border: 1px solid #c9c0b2; border-radius: 10px; background: #fff; position: relative; }
.rte:focus-within { border-color: var(--focus); }
.rte-bar { position: sticky; top: 62px; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: #faf8f4; border-radius: 10px 10px 0 0; }
.rte-btn { min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; font-size: 15px; color: var(--navy); cursor: pointer; }
.rte-btn:hover:not(:disabled) { background: #fff; border-color: var(--line); }
.rte-btn[aria-pressed=true] { background: var(--navy); color: #fff; }
.rte-btn:disabled { opacity: .35; cursor: default; }
.rte-b { font-weight: 800; }
.rte-i { font-style: italic; font-family: Georgia, serif; }
.rte-u { text-decoration: underline; }
.rte-style { width: auto; min-height: 38px; padding: 4px 8px; font-size: 15px; }
.rte-area .rte-doc { min-height: 160px; padding: 14px 18px; font: 18px/1.7 Georgia, "Times New Roman", serif; color: #26313b; outline: none; }
.rte-full .rte-doc { min-height: 320px; }
.rte-doc > * { margin: 0; }
.rte-doc > * + * { margin-top: .8em; }
.rte-doc h2 { font-size: 26px; }
.rte-doc h3 { font-size: 21px; }
.rte-doc h4 { font-size: 18px; }
.rte-doc > * + h2, .rte-doc > * + h3, .rte-doc > * + h4 { margin-top: 1.1em; }
.rte-doc blockquote { margin: 0; padding-left: 16px; border-left: 3px solid var(--green); font-style: italic; }
.rte-doc figure { margin: 0; }
.rte-doc figure img { max-width: 100%; height: auto; border-radius: 8px; display: block; }
.rte-doc .ProseMirror-selectednode img { outline: 3px solid var(--focus); }
.rte-doc a { color: var(--blue); }
.rte.is-busy::after { content: 'Загружаем фото…'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .7); font-weight: 700; color: var(--navy); border-radius: 10px; }

/* phones */
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .brand-text { display: none; }
  .who-name { display: none; }
  .top { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .pub { order: 5; width: 100%; justify-content: flex-start; }
  .body { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); height: auto; z-index: 40; box-shadow: 10px 0 40px rgba(0, 0, 0, .25); padding-top: 20px; }
  .menu-open .side { display: block; }
  .menu-open .body::before { content: ''; position: fixed; inset: 0; background: rgba(22, 49, 77, .4); z-index: 30; }
  .main { padding: 20px 16px 140px; }
  h1 { font-size: 25px; }
  .field { padding: 14px; }
  .post-list a { grid-template-columns: 1fr auto; }
  .post-list .post-meta { grid-column: 1; }
  .rte-bar { top: 0; }
  .savebar { padding: 8px 10px; gap: 6px 8px; }
  .savebar .btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 8px; font-size: 15px; white-space: normal; line-height: 1.2; }
  .savebar-text { width: 100%; font-size: 14px; }
  .media-preview, .media-empty { width: 140px; }
}
