:root {
  --ink: #251946;
  --text: #33294a;
  --muted: #756e80;
  --muted-2: #827b8b;
  --violet: #2f2357;
  --violet-soft: #f2eff8;
  --red: #d7193f;
  --red-dark: #b91133;
  --green: #16834b;
  --green-soft: #e9f8ef;
  --amber: #8b5a08;
  --amber-soft: #fff0d9;
  --surface: #f7f5fa;
  --line: rgba(47, 35, 87, .11);
  --white: #fff;
  --shadow: 0 8px 28px rgba(45, 29, 82, .055);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--surface); color: var(--text); font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
svg { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.admin-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.admin-side { position: sticky; z-index: 40; top: 0; height: 100vh; border-right: 1px solid var(--line); background: #fbfafc; }
.admin-side-inner { display: flex; height: 100%; flex-direction: column; overflow-y: auto; padding: 0 12px; scrollbar-width: thin; }
.admin-brand { display: flex; align-items: center; gap: 12px; min-height: 78px; margin: 0 -12px 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); text-decoration: none; }
.admin-brand > span:last-child { min-width: 0; }
.admin-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: var(--violet); color: #fff; }
.admin-mark svg { width: 18px; height: 18px; }
.admin-brand strong, .admin-brand small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-brand strong { color: var(--ink); font-size: 14px; font-weight: 900; }
.admin-brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.admin-nav-label { height: 32px; padding: 8px 10px 0; color: #8a8391; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.admin-nav { display: grid; gap: 3px; }
.admin-nav a { position: relative; display: flex; min-height: 40px; align-items: center; gap: 11px; border-radius: 8px; padding: 8px 10px; color: #514960; font-size: 14px; font-weight: 700; text-decoration: none; transition: background .16s ease, color .16s ease; }
.admin-nav a:hover { background: #f3f0f7; color: var(--violet); }
.admin-nav a.active { background: #eee9f6; color: var(--violet); font-weight: 900; }
.nav-icon { display: grid; width: 22px; place-items: center; color: #81769a; }
.admin-nav a.active .nav-icon { color: var(--violet); }
.nav-badge { min-width: 21px; margin-left: auto; border-radius: 999px; background: var(--red); padding: 2px 6px; color: #fff; font-size: 10px; line-height: 17px; text-align: center; }
.admin-nav-separator { height: 1px; margin: 15px 8px 8px; background: var(--line); }
.admin-side-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; border-top: 1px solid var(--line); padding: 15px 9px; color: inherit; text-decoration: none; border-radius: 12px; }
.admin-side-footer:hover, .admin-side-footer:focus-visible { background: var(--surface-soft); }
.user-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--violet-soft); color: var(--violet); font-weight: 900; }
.admin-side-footer strong, .admin-side-footer small { display: block; }
.admin-side-footer strong { color: var(--text); font-size: 13px; }
.admin-side-footer small { color: var(--muted); font-size: 11px; }
.admin-overlay { display: none; }
.admin-main { min-width: 0; }
.admin-top { position: sticky; z-index: 30; top: 0; display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); padding: 0 28px; backdrop-filter: blur(12px); }
.admin-greeting { display: flex; align-items: center; gap: 12px; }
.admin-greeting strong, .admin-greeting small { display: block; }
.admin-greeting strong { color: var(--ink); font-size: 18px; font-weight: 900; }
.admin-greeting small { color: var(--muted); font-size: 12px; }
.admin-top-actions { display: flex; align-items: center; gap: 9px; }
.admin-top-actions form { margin: 0; }
.draft-badge { border-radius: 999px; background: var(--green-soft); padding: 6px 11px; color: var(--green); font-size: 11px; font-weight: 900; }
.icon-button { display: inline-grid; width: 39px; height: 39px; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--violet); cursor: pointer; }
.icon-button:hover { background: var(--violet-soft); }
.menu-button { display: none; }
.admin-content { width: min(100%, 1340px); margin: 0 auto; padding: 32px clamp(22px, 4vw, 48px) 42px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.admin-kicker { margin: 0 0 7px !important; color: var(--red) !important; font-size: 12px !important; font-weight: 950; letter-spacing: .16em; text-transform: uppercase; }
.admin-head h1 { margin: 0; color: var(--ink); font-size: clamp(28px, 3vw, 38px); font-weight: 950; line-height: 1.12; letter-spacing: -.035em; }
.admin-head p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.card { border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: var(--shadow); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.metric { min-height: 160px; padding: 21px; }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-label small { color: #655e70; font-size: 14px; font-weight: 700; }
.metric-label span { color: #82759e; }
.metric strong { display: block; margin-top: 22px; color: var(--ink); font-size: 34px; font-weight: 950; line-height: 1; letter-spacing: -.03em; }
.metric p { margin: 11px 0 0; color: var(--muted-2); font-size: 12px; line-height: 1.55; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); gap: 22px; margin-top: 22px; }
.dashboard-panel { padding: 24px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-head strong, .panel-head span { display: block; }
.panel-head strong { color: var(--ink); font-size: 15px; font-weight: 900; }
.panel-head > div > span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.status-pill { border-radius: 999px; background: #fff0f3; padding: 5px 11px; color: var(--red-dark); font-size: 11px; font-weight: 900; }
.task-list { margin-top: 19px; }
.task { display: flex; align-items: flex-start; gap: 12px; border-top: 1px solid var(--line); padding: 15px 0; }
.task:first-child { border-top: 0; padding-top: 0; }
.task:last-child { padding-bottom: 0; }
.task-state { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--violet-soft); color: #796c96; }
.task-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.task-state.done { background: var(--green-soft); color: var(--green); }
.task-state svg { width: 15px; height: 15px; }
.task strong, .task small { display: block; }
.task strong { color: #2c2440; font-size: 14px; font-weight: 900; }
.task small { margin-top: 3px; color: #7a7383; font-size: 12px; line-height: 1.5; }
.consent-title { display: flex; align-items: center; gap: 12px; }
.consent-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 10px; background: var(--green-soft); color: var(--green); }
.consent-title strong, .consent-title small { display: block; }
.consent-title strong { color: var(--ink); font-size: 15px; font-weight: 900; }
.consent-title small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.check-list { display: grid; gap: 11px; margin: 20px 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 25px; color: #554e60; font-size: 13px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; display: grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 950; }
.panel-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; border-radius: 10px; background: var(--violet-soft); padding: 12px 14px; color: var(--violet); font-size: 13px; font-weight: 900; text-decoration: none; }
.panel-link:hover { background: #eae5f3; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 22px; }
.quick { display: flex; min-height: 92px; align-items: center; gap: 13px; padding: 17px; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.quick:hover { border-color: rgba(47,35,87,.24); transform: translateY(-1px); }
.quick-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--violet-soft); color: var(--violet); }
.quick > span:nth-child(2) { min-width: 0; flex: 1; }
.quick strong, .quick small { display: block; }
.quick strong { color: var(--ink); font-size: 14px; font-weight: 900; }
.quick small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.quick > svg { color: #968ca9; }
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 14px; text-align: left; vertical-align: top; }
.table th { background: #faf9fb; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfbfd; }
.slider-preview-cell { width: 138px; }
.slider-thumbnail { display: block; width: 110px; min-width: 110px; max-width: 110px; height: 68px; border-radius: 10px; background: #eeebf2; object-fit: cover; object-position: center; }
.status { display: inline-block; border-radius: 999px; background: #eeeaf3; padding: 4px 9px; font-size: 10px; font-weight: 900; }
.status.good { background: var(--green-soft); color: #12663f; }
.status.warn { background: var(--amber-soft); color: #925312; }
.status.bad { background: #ffe7ec; color: #901b34; }
.button { display: inline-flex; min-height: 41px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 0 15px; background: var(--violet); color: #fff; font-size: 13px; font-weight: 900; text-decoration: none; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.button:hover { background: #241a47; }
.button.red { background: var(--red); }
.button.red:hover { background: var(--red-dark); }
.button.light { background: var(--violet-soft); color: var(--ink); }
.button.outline { border-color: rgba(47,35,87,.2); background: #fff; color: var(--violet); }
.button.outline:hover, .button.light:hover { background: #eae5f3; }
.button.danger { background: #fff0f3; color: #9b1935; }
.button.danger:hover { background: #ffe2e9; }
.button.accept { background: #147a4e; color: #fff; }
.button.accept:hover { background: #0f623e; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 11px; }
.button svg { width: 15px; height: 15px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.form-card { max-width: 1020px; padding: 25px; }
.form-card h2 { margin: 0 0 18px; color: var(--ink); font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--text); font-size: 12px; font-weight: 900; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d9d3e1; border-radius: 9px; background: #fff; padding: 10px 12px; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #8b7baa; outline: none; box-shadow: 0 0 0 3px rgba(111,95,152,.12); }
.field input, .field select { height: 45px; }
.field textarea { min-height: 135px; resize: vertical; }
.field small { color: var(--muted); }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.check { display: flex; min-height: 52px; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fcfbfd; padding: 10px 12px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.check:hover { border-color: rgba(47,35,87,.25); background: #f8f6fb; }
.check input { appearance: none; width: 20px !important; height: 20px !important; min-width: 20px; flex: 0 0 20px; margin: 0; border: 1.5px solid #9c94a8; border-radius: 5px; background: #fff center/14px no-repeat; padding: 0 !important; cursor: pointer; }
.check input:checked { border-color: var(--red); background-color: var(--red); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E"); }
.check input:focus-visible { outline: 3px solid rgba(215,25,63,.2); outline-offset: 2px; }
.check span { color: var(--text); font-size: 13px; font-weight: 800; line-height: 1.3; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.notice { margin-bottom: 18px; border: 1px solid #b9dfcf; border-radius: 10px; background: #effaf5; padding: 12px 14px; color: #12603d; }
.notice.error { border-color: #efbac6; background: #fff1f4; color: #871630; }
.appointment-detail-grid { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(430px, 1.22fr); gap: 20px; align-items: start; }
.appointment-summary, .appointment-response { padding: 24px; }
.appointment-response { max-width: none; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.detail-heading h2 { margin: 2px 0 0; color: var(--ink); font-size: 21px; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 125px 1fr; gap: 14px; border-top: 1px solid var(--line); padding: 13px 0; }
.detail-list dt { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.detail-list dd { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.55; }
.detail-list a { color: var(--violet); font-weight: 800; }
.field-help { margin: 15px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.appointment-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.empty { padding: 42px; text-align: center; color: var(--muted); }
.builder-form { max-width: none; }
.page-meta-grid { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.page-builder-admin { margin-top: 24px; }
.builder-settings { display: grid; grid-template-columns: minmax(210px, 1.2fr) repeat(3, minmax(145px, .8fr)); gap: 12px; align-items: end; border: 1px solid var(--line); border-radius: 12px; background: #faf9fc; padding: 15px; }
.builder-settings > div strong, .builder-settings > div span { display: block; }
.builder-settings > div strong { color: var(--ink); font-size: 14px; }
.builder-settings > div span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.builder-settings label, .builder-field { display: flex; flex-direction: column; gap: 6px; color: var(--text); font-size: 11px; font-weight: 900; }
.builder-settings select, .builder-field input, .builder-field select, .builder-field textarea { width: 100%; border: 1px solid #d9d3e1; border-radius: 8px; background: #fff; padding: 9px 10px; color: var(--ink); font: inherit; font-weight: 600; }
.builder-settings select, .builder-field input, .builder-field select { height: 41px; }
.builder-field textarea { min-height: 105px; resize: vertical; }
.builder-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 15px; border-radius: 12px; background: var(--violet); padding: 13px; }
.builder-palette > div { min-width: 200px; margin-right: auto; color: #fff; }
.builder-palette > div strong, .builder-palette > div span { display: block; }
.builder-palette > div span { color: #d8d2e3; font-size: 10px; }
.builder-palette button { min-height: 36px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.1); padding: 0 11px; color: #fff; font-size: 11px; font-weight: 900; cursor: pointer; }
.builder-palette button:hover { background: #fff; color: var(--violet); }
.builder-workspace { margin-top: 15px; border: 1px dashed #cdc5d8; border-radius: 12px; background: #f8f6fa; padding: 15px; }
.builder-empty { padding: 34px 20px; text-align: center; }
.builder-empty strong, .builder-empty span { display: block; }
.builder-empty strong { color: var(--ink); }
.builder-empty span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.builder-block { overflow: hidden; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 5px 18px rgba(45,29,82,.04); }
.builder-block:first-child { margin-top: 0; }
.builder-block-head { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); background: #fcfbfd; padding: 9px 12px; }
.builder-block-head > div:first-child { display: flex; align-items: center; gap: 9px; }
.builder-block-head strong { color: var(--ink); font-size: 13px; }
.builder-block-number { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; background: var(--violet-soft); color: var(--violet); font-size: 11px; font-weight: 950; }
.builder-block-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.builder-block-actions button { min-height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 0 9px; color: var(--violet); font-size: 10px; font-weight: 900; cursor: pointer; }
.builder-block-actions button:hover { background: var(--violet-soft); }
.builder-block-actions button:disabled { cursor: default; opacity: .38; }
.builder-block-actions button.danger { border-color: #f0cad2; background: #fff5f7; color: #981c36; }
.builder-block-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 15px; }
.builder-block-fields > .builder-field:only-child, .builder-field-full { grid-column: 1 / -1; }
.builder-help { margin: 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.builder-check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 12px; font-weight: 800; cursor: pointer; }
.builder-check input { width: 18px; height: 18px; accent-color: var(--red); }
.builder-style { border-top: 1px solid var(--line); background: #faf9fc; }
.builder-style summary { padding: 10px 15px; color: var(--violet); font-size: 11px; font-weight: 900; cursor: pointer; }
.builder-style-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; padding: 0 15px 15px; }
.builder-image-preview { display: block; width: 150px; height: 90px; margin-top: 4px; border-radius: 8px; object-fit: cover; }
.builder-media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.builder-media-choice { position: relative; display: grid; overflow: hidden; min-width: 0; border: 2px solid transparent; border-radius: 9px; background: var(--surface); cursor: pointer; }
.builder-media-choice.selected { border-color: var(--red); }
.builder-media-choice input { position: absolute; top: 7px; left: 7px; z-index: 2; width: 18px; height: 18px; accent-color: var(--red); }
.builder-media-choice img { width: 100%; height: 95px; object-fit: cover; }
.builder-media-choice span { overflow: hidden; padding: 7px; color: var(--text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.auth-page { display: grid; min-height: 100vh; place-items: center; background: radial-gradient(circle at top left, #55367d 0, #2a1b4e 48%, #21153f 100%); padding: 22px; }
.auth-card { width: min(100%, 510px); border-radius: 22px; background: #fff; padding: 31px; box-shadow: 0 30px 90px rgba(21,10,45,.4); }
.auth-card h1 { margin: .1em 0; color: var(--ink); font-size: 39px; letter-spacing: -.04em; }
.auth-card .button { width: 100%; margin-top: 18px; }
.auth-card > a { display: inline-block; margin-top: 17px; color: var(--violet); font-weight: 800; }
.auth-brand { margin-bottom: 23px; color: var(--ink); }
.auth-card p { color: var(--muted); }
.admin-footer { padding: 25px 30px 30px; color: var(--muted); font-size: 11px; text-align: center; }
.admin-footer a { text-decoration: none; }
@media (max-width: 1120px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .appointment-detail-grid { grid-template-columns: 1fr; }
  .builder-settings { grid-template-columns: 1fr 1fr; }
  .builder-style-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}
@media (max-width: 840px) {
  .admin-shell { display: block; }
  .admin-side { position: fixed; left: 0; width: min(290px, 86vw); transform: translateX(-105%); box-shadow: 18px 0 55px rgba(30,18,56,.18); transition: transform .2s ease; }
  body.admin-menu-open { overflow: hidden; }
  body.admin-menu-open .admin-side { transform: translateX(0); }
  .admin-overlay { position: fixed; z-index: 35; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(31,22,48,.38); }
  body.admin-menu-open .admin-overlay { display: block; }
  .menu-button { display: inline-grid; }
  .admin-top { padding: 0 18px; }
  .admin-content { padding: 25px 20px 36px; }
}
@media (max-width: 620px) {
  .admin-greeting small, .draft-badge, .admin-top-actions .outline span { display: none; }
  .admin-top-actions .outline { width: 39px; padding: 0; }
  .admin-head { display: block; }
  .admin-head > .button { margin-top: 15px; }
  .metrics, .quick-grid, .form-grid, .check-grid { grid-template-columns: 1fr; }
  .builder-settings, .builder-block-fields, .builder-style-grid { grid-template-columns: 1fr; }
  .builder-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder-block-head { align-items: flex-start; flex-direction: column; }
  .metric { min-height: 140px; }
  .field.full { grid-column: auto; }
  .table { min-width: 720px; }
  .auth-card { padding: 24px; }
  .detail-heading { display: block; }
  .detail-heading .status { margin-top: 10px; }
  .detail-list > div { grid-template-columns: 1fr; gap: 4px; }
  .appointment-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
