/* Villa Fazenda — адмінка */
body.admin { background: var(--cream); }
body.admin-dark { background: radial-gradient(ellipse at top, var(--night-3), var(--night) 70%); }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.login { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.login__box { width: 100%; max-width: 380px; background: var(--paper); border-radius: 24px; padding: 34px 24px 26px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; text-align: center; }
.login__box img { margin: 0 auto; border-radius: 20px; }
.login__box h1 { margin: 0 0 4px; font-size: 2rem; }
.login__box .field { text-align: left; }
.login .form-error { color: var(--danger); margin: 0; font-size: 14px; }
.login__demo { margin: 0; font-size: 13px; color: var(--muted); }
.login__back { font-size: 14px; color: var(--muted); text-decoration: none; }

.abar { position: sticky; top: 0; z-index: 30; background: var(--night); color: #fff; }
.abar__inner { height: 64px; display: flex; align-items: center; gap: 8px; }
.abar .brand img { border-radius: 10px; }
.abar .brand-text { font-size: 1rem; }
.abar__user { margin-left: auto; font-size: 13px; color: rgba(255,255,255,.6); }
.abar__form { margin: 0; }
.abar__btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; }
.abar__btn:hover { border-color: var(--gold); color: var(--gold); }

.amain { padding-top: 24px; padding-bottom: 64px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.stat { background: var(--paper); border-radius: var(--radius-sm); padding: 14px 16px; border: 1px solid var(--line); }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat b { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; line-height: 1.2; }
.stat--accent { background: var(--night); color: #fff; border-color: var(--night); }
.stat--accent span { color: rgba(255,255,255,.65); }
.stat--accent b { color: var(--gold); }
.atabs { display: flex; flex-wrap: wrap; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #d9573f; color: #fff; font-size: 12px; margin-left: 4px; }
.count:empty { display: none; }

.agrid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .agrid { grid-template-columns: 1.4fr 1fr; gap: 24px; } }
.abox { background: var(--paper); border-radius: var(--radius); padding: 20px 16px; border: 1px solid var(--line); min-width: 0; }
@media (min-width: 600px) { .abox { padding: 24px; } }
.abox__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.abox__head h2 { margin: 0; font-size: 1.8rem; }
.asub { font-size: 1.4rem; margin: 26px 0 10px; }
.sel { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; background: var(--paper); }
.muted { font-size: 14px; }

.list { display: grid; gap: 10px; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.bk { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: grid; gap: 8px; }
.bk.is-new { border-color: var(--gold-2); box-shadow: inset 3px 0 0 var(--gold); }
.bk.is-cancelled { opacity: .55; }
.bk__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bk__right { text-align: right; display: grid; gap: 4px; justify-items: end; }
.bk__name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; line-height: 1.2; }
.bk__phone { color: var(--gold-3); font-weight: 600; font-size: 15px; text-decoration: none; }
.bk__when { font-weight: 600; font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bk__meta { font-size: 13px; color: var(--muted); }
.bk__meta .code { font-family: ui-monospace, Menlo, monospace; }
.bk__comment { font-size: 14px; background: var(--cream); border-radius: 8px; padding: 8px 10px; }
.bk__price { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1; white-space: nowrap; }
.bk__price--req { font-size: 1.1rem; color: var(--gold-3); }
.bk__prepay { font-size: 12px; color: var(--muted); }
.bk__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.unit, .unit-sel { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--sage-soft); color: var(--sage-2); font-size: 13px; font-weight: 700; }
.unit--whole { padding: 4px 10px; background: var(--night); color: var(--gold); }
.unit-sel select { border: 0; border-radius: 999px; padding: 3px 8px; font: inherit; background: var(--paper); cursor: pointer; }
.st { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.st--new { background: #fdeee9; color: #b4452f; }
.st--confirmed { background: var(--free2); color: var(--free2-ink); }
.st--cancelled { background: #eee; color: #777; }
.mini { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); text-decoration: none; display: inline-grid; place-items: center; }
.mini:hover { border-color: var(--night); }
.mini--dark { background: var(--night); color: var(--gold); border-color: var(--night); }
.mini--dark:hover { background: var(--night-3); }

/* календар */
.acal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.acal__head b { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.acal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.aday { border: 0; border-radius: 10px; padding: 6px 2px; font: inherit; display: grid; justify-items: center; gap: 3px; cursor: pointer; min-width: 0; }
.aday.free2 { background: var(--free2); }
.aday.free1 { background: var(--free1); }
.aday.busy { background: var(--busy); }
.aday.is-past { opacity: .5; }
.aday.is-focus { box-shadow: inset 0 0 0 2px var(--night); }
.aday__d { font-weight: 700; font-size: 14px; line-height: 1; }
.aday__pills { display: flex; gap: 2px; }
.aday__p { font-size: 10px; color: var(--muted); line-height: 1; }
.pill { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 5px; font-size: 10px; font-style: normal; font-weight: 700; }
.pill--free { background: rgba(255,255,255,.75); color: var(--free2-ink); }
.pill--booked { background: var(--night); color: var(--gold); }
.pill--blocked { background: repeating-linear-gradient(-45deg, #e7b2a8 0 3px, #d8988c 3px 6px); color: #6e2418; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dayrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dayrow b { min-width: 62px; }
.dayrow .ok { color: var(--free2-ink); font-weight: 600; }
.dayrow .blk { color: var(--busy-ink); font-weight: 600; }
.dayrow .mini { margin-left: auto; }
.dayactions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 8px; }

/* ціни */
.seasons-table { display: grid; gap: 10px; }
.season-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr .8fr .8fr auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.season-row--new { background: var(--sage-soft); border-color: transparent; }
.season-row .field input { min-height: 42px; padding: 8px 10px; font-size: .95rem; }
.season-btns { display: flex; gap: 6px; }
.fixed-rules ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
@media (max-width: 900px) {
  .season-row { grid-template-columns: 1fr 1fr; }
  .season-row .field:first-child { grid-column: 1 / -1; }
  .season-btns, .season-row--new .mini { grid-column: 1 / -1; }
}

.demo-reset { margin-top: 28px; text-align: center; font-size: 13px; color: var(--muted); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--gold-3); text-decoration: underline; font: inherit; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; background: var(--night); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); }

/* вихідні дні */
.weekend-box { margin: 4px 0 18px; padding: 14px 16px 16px; border-radius: var(--radius-sm); background: var(--gold-soft); }
.weekend-box .asub { margin-top: 0; }
.weekend-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.wday { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); cursor: pointer; text-align: center; }
.wday input { width: 18px; height: 18px; accent-color: var(--gold-2); margin: 0 0 2px; }
.wday small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.wday:has(input:checked) { border-color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--gold-2); }
@media (max-width: 600px) { .weekend-days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* вікно підтвердження */
.amodal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 28, .55); }
.amodal__card { width: 100%; max-width: 420px; background: var(--paper); border-radius: var(--radius); padding: 22px 20px 18px; box-shadow: var(--shadow-lg); }
.amodal__text { margin: 0 0 18px; font-size: 16px; line-height: 1.5; }
.amodal__btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.amodal__btns .mini { min-height: 44px; padding: 0 18px; font-size: 14px; }
.mini--danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.mini--danger:hover { background: #9a3423; border-color: #9a3423; }
/* більші кнопки для пальця на телефоні */
@media (max-width: 600px) {
  .bk__actions .mini, .dayrow .mini { min-height: 44px; padding: 0 16px; font-size: 14px; }
  .amodal__btns .mini { flex: 1 1 auto; }
}

/* «Написати гостю» */
.msg { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }
.msg > summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--gold-3); list-style: none; padding: 6px 0; }
.msg > summary::-webkit-details-marker { display: none; }
.msg[open] > summary { color: var(--ink); }
.msg__body { display: grid; gap: 10px; }
.msg__body .sel { width: 100%; min-height: 44px; font-size: 15px; }
.msg__body textarea { width: 100%; font: inherit; font-size: 15px; line-height: 1.45; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; background: #fff; }
.msg__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mbtn { display: inline-grid; place-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; cursor: pointer; }
.mbtn--wa { background: #25d366; border-color: #25d366; color: #fff; }
.mbtn--viber { background: #7360f2; border-color: #7360f2; color: #fff; }
.mbtn--tg { background: #2aa3e0; border-color: #2aa3e0; color: #fff; }
.mbtn--sms { background: var(--night); border-color: var(--night); color: var(--gold); }
.mbtn[aria-disabled] { opacity: .4; cursor: not-allowed; }
.msg__warn { margin: 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.msg__hint { margin: 0; }
@media (max-width: 600px) {
  .msg__btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mbtn { min-height: 46px; padding: 0 6px; font-size: 14px; }
}

/* шаблони повідомлень */
@media (min-width: 1000px) { .agrid--tpl { grid-template-columns: 1.4fr 1fr; } }
.tpl-list { display: grid; gap: 12px; }
.tpl { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
#tplNew { background: var(--sage-soft); border-color: transparent; }
#msgSettings { border: 0; padding: 0; }
.tpl textarea { width: 100%; font: inherit; font-size: 15px; line-height: 1.45; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; resize: vertical; background: #fcfaf5; }
.tpl .field em { font-style: normal; font-weight: 600; color: var(--gold-3); font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.tpl__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.vars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.var { border: 1px solid var(--gold-2); background: var(--gold-soft); color: var(--gold-3); border-radius: 6px; padding: 2px 6px; font: 600 12px/1.4 ui-monospace, Menlo, monospace; cursor: pointer; }
@media (max-width: 600px) { .tpl .mini { min-height: 44px; } }
