/* Шрифты - BRAND-alibi.md: Tenor Sans (заголовки, одно начертание 400) + Manrope. Радиусы: 4px поля и записи, 23px кнопки-пилюли. */
:root {
  /* Бьюти Алиби, светлая палитра - Проекты/Бьюти-Алиби/BRAND-alibi.md. bg2/bg3/line/light - оттенки той же гаммы */
  --bg: #F4EBE2;
  --bg2: #EBDFD2;
  --bg3: #E3D5C6;
  --line: #D9C8B6;
  --copper: #C8834A;
  --orange: #EC7A26;
  --light: #A8652F;
  --head: #2A201A;
  --text: #6B5A4C;
  --meta: #8C7968;
  --ok: #5E8A4A;
  --bad: #B5472F;
  --on-accent: #FBF6F1;
  --r: 4px;
  --pill: 23px;
  --slot: 1.6px; /* высота одной минуты в журнале */
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 Manrope, sans-serif; }
body { min-height: 100vh; }
h1, h2, h3 { font-family: 'Tenor Sans', sans-serif; font-weight: 400; color: var(--head); text-transform: uppercase; letter-spacing: .12em; margin: 0; }
h1 { font-size: 28px; line-height: 1.1; }
h2 { font-size: 22px; }
h3 { font-size: 16px; letter-spacing: .12em; color: var(--light); }
a { color: var(--light); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---- шапка ---- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 32px; padding: 16px 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font: 400 18px 'Tenor Sans', sans-serif; letter-spacing: .24em; text-transform: uppercase; color: var(--copper); white-space: nowrap; }
.tabs { display: flex; gap: 8px; flex: 1; }
.tabs a { padding: 8px 16px; border-radius: var(--pill); color: var(--text); text-decoration: none; font-weight: 600; }
.tabs a:hover { color: var(--head); background: var(--bg2); }
.tabs a.on { color: var(--on-accent); background: var(--copper); }
.who { display: flex; align-items: center; gap: 16px; color: var(--meta); white-space: nowrap; }
.link { background: none; border: 0; color: var(--meta); padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--head); }

main { padding: 24px; }

/* ---- кнопки и поля ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 24px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--bg2); color: var(--head); font-weight: 600; transition: background .15s ease, border-color .15s ease; }
.btn:hover { border-color: var(--copper); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tabs a:focus-visible { outline: 2px solid var(--light); outline-offset: 2px; }
.btn.cta { background: var(--orange); border-color: var(--orange); color: #1A0F06; }
.btn.cta:hover { background: var(--light); border-color: var(--light); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: transparent; color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 32px; padding: 4px 16px; font-size: 14px; }

label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--meta); }
input, select, textarea { font: inherit; color: var(--head); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; min-height: 40px; width: 100%; }
textarea { min-height: 72px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--meta); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--meta) 50%), linear-gradient(135deg, var(--meta) 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

/* ---- вход ---- */
.login { max-width: 360px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 16px; }
.login .brand { font-size: 22px; margin-bottom: 8px; }
.login p { color: var(--meta); margin: 0 0 8px; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; }

/* ---- журнал ---- */
.jbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.jbar .day { font: 400 24px 'Tenor Sans', sans-serif; color: var(--head); text-transform: uppercase; letter-spacing: .12em; min-width: 260px; }
.jbar .grow { flex: 1; }
.seg { display: inline-flex; background: var(--bg2); border-radius: var(--pill); padding: 4px; }
.seg button { border: 0; background: transparent; color: var(--text); padding: 4px 16px; border-radius: var(--pill); min-height: 32px; font-weight: 600; }
.seg button.on { background: var(--bg3); color: var(--head); }
.arrows { display: inline-flex; gap: 8px; }
.icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 16px; }
.week-strip button { background: var(--bg2); border: 0; border-radius: var(--r); padding: 8px 4px; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 0; }
.week-strip button b { font: 400 20px 'Tenor Sans', sans-serif; color: var(--head); }
.week-strip button small { font-size: 12px; color: var(--meta); text-transform: uppercase; letter-spacing: .08em; }
.week-strip button.on { background: var(--copper); }
.week-strip button.on b, .week-strip button.on small { color: var(--on-accent); }
.week-strip button .dot { font-size: 12px; color: var(--light); min-height: 16px; }
.week-strip button.on .dot { color: var(--on-accent); }

.grid-wrap { overflow-x: auto; background: var(--bg2); border-radius: var(--r); }
.grid { display: grid; min-width: 100%; }
.col-head { position: sticky; top: 0; z-index: 3; background: var(--bg2); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.col-head b { display: block; color: var(--head); font-weight: 600; }
.col-head small { color: var(--meta); font-size: 13px; }
.col-head .link { font-size: 13px; margin-left: 8px; }
.times { position: relative; border-right: 1px solid var(--line); }
.times span { position: absolute; left: 0; right: 8px; text-align: right; font-size: 12px; color: var(--meta); transform: translateY(-8px); }
.col { position: relative; border-right: 1px solid var(--line); cursor: copy; background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px calc(var(--slot) * 60)); }
.col .off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(42, 32, 26, .07) 0 8px, rgba(42, 32, 26, .03) 8px 16px); pointer-events: none; }
.col .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--light); z-index: 2; pointer-events: none; }
.rec { position: absolute; left: 4px; right: 4px; border-radius: var(--r); padding: 4px 8px; overflow: hidden; cursor: pointer; background: #FBF6F1; color: var(--head); font-size: 13px; line-height: 1.35; box-shadow: 0 1px 2px rgba(42, 32, 26, .12); transition: filter .15s ease; }
.rec:hover { filter: brightness(.96); }
.rec .t { color: var(--light); font-weight: 700; }
.rec .s { color: var(--text); }
.rec.st-confirmed { box-shadow: inset 3px 0 0 var(--copper); }
.rec.st-came { box-shadow: inset 3px 0 0 var(--ok); }
.rec.st-no_show { box-shadow: inset 3px 0 0 var(--bad); opacity: .75; }
.rec.st-cancelled { opacity: .4; text-decoration: line-through; }
.rec.online::after { content: "онлайн"; position: absolute; right: 8px; top: 4px; font-size: 11px; color: var(--meta); }

.week-list { display: flex; flex-direction: column; gap: 24px; }
.week-list .wday h3 { margin-bottom: 8px; }
.row { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 16px; align-items: center; padding: 12px 16px; background: var(--bg2); border-radius: var(--r); cursor: pointer; margin-bottom: 4px; }
.row:hover { background: var(--bg3); }
.row .t { color: var(--light); font-weight: 700; }
.row small { color: var(--meta); }
.empty { color: var(--meta); padding: 16px; }

.badge { display: inline-block; padding: 0 8px; border-radius: var(--pill); font-size: 12px; font-weight: 600; background: var(--bg3); color: var(--text); white-space: nowrap; }
.badge.confirmed { color: var(--copper); }
.badge.came { color: var(--ok); }
.badge.no_show { color: var(--bad); }
.badge.cancelled { color: var(--meta); }

/* ---- модалка ---- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(42, 32, 26, .42); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; }
.sheet { width: 100%; max-width: 720px; background: var(--bg2); border-radius: var(--r); padding: 32px; box-shadow: 0 24px 64px rgba(42, 32, 26, .25); }
.sheet .hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.close { background: none; border: 0; color: var(--meta); font-size: 28px; line-height: 1; padding: 0 4px; }
.close:hover { color: var(--head); }
.fgrid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
.block { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.block > h3 { margin-bottom: 12px; }
.svc { display: grid; grid-template-columns: 1fr 88px 104px 72px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.svc .name { color: var(--head); }
.svc-head span { font-size: 12px; color: var(--meta); margin-bottom: -4px; }
.svc input { min-height: 36px; padding: 4px 8px; }
.svc .x { background: none; border: 0; color: var(--meta); font-size: 20px; }
.svc .x:hover { color: var(--bad); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; color: var(--meta); }
.total b { font: 400 28px 'Tenor Sans', sans-serif; color: var(--head); }
.suggest { position: relative; }
.suggest ul { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--bg3); border-radius: var(--r); box-shadow: 0 12px 32px rgba(42, 32, 26, .2); max-height: 240px; overflow-y: auto; }
.suggest li { padding: 8px 12px; border-radius: var(--r); cursor: pointer; }
.suggest li:hover, .suggest li.hl { background: var(--line); }
.suggest li small { color: var(--meta); margin-left: 8px; }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 12px; background: var(--bg); border-radius: var(--r); }
.picked b { color: var(--head); }
.picked small { color: var(--meta); display: block; }
.statuses { display: flex; gap: 8px; flex-wrap: wrap; }
.statuses button { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: var(--pill); padding: 4px 16px; min-height: 36px; font-weight: 600; }
.statuses button:hover { border-color: var(--meta); }
.statuses button.on { background: var(--bg3); color: var(--head); border-color: var(--copper); }
.statuses button.on[data-s="came"] { border-color: var(--ok); }
.statuses button.on[data-s="no_show"], .statuses button.on[data-s="cancelled"] { border-color: var(--bad); }
.colors { display: flex; gap: 8px; }
.colors button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--line); padding: 0; }
.colors button.on { border-color: var(--head); }
.foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 32px; }
.foot .grow { flex: 1; }
.warn { margin-top: 16px; color: var(--light); font-size: 14px; }
.log { margin-top: 16px; font-size: 13px; color: var(--meta); }
.log div { padding: 4px 0; border-bottom: 1px solid var(--line); }

/* ---- клиентки ---- */
.cbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.cbar input { max-width: 360px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chips button { border: 0; background: var(--bg2); color: var(--text); border-radius: var(--pill); padding: 4px 16px; min-height: 32px; font-weight: 600; }
.chips button b { color: var(--light); margin-left: 4px; }
.chips button.on { background: var(--copper); color: var(--on-accent); }
.chips button.on b { color: var(--on-accent); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font: 600 12px Manrope, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--meta); padding: 8px 16px; }
table.t td { padding: 12px 16px; border-top: 1px solid var(--line); }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--bg2); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t td b { color: var(--head); font-weight: 600; }
table.t td small { display: block; color: var(--meta); }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.card-head p { margin: 4px 0 0; color: var(--meta); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat b { display: block; font: 400 32px 'Tenor Sans', sans-serif; color: var(--head); line-height: 1.1; }
.stat small { color: var(--meta); font-size: 13px; }
.cols2 { display: grid; grid-template-columns: 360px 1fr; gap: 32px; align-items: start; }
.form-col { display: flex; flex-direction: column; gap: 16px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.check input { width: 20px; min-height: 20px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--head); color: var(--on-accent); padding: 12px 24px; border-radius: var(--pill); font-weight: 600; box-shadow: 0 8px 24px rgba(42, 32, 26, .2); }
.toast.bad { background: var(--bad); color: var(--on-accent); }

@media (max-width: 760px) {
  main { padding: 16px; }
  .top { flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; }
  .who { margin-left: auto; }
  .jbar .day { min-width: 0; font-size: 20px; flex: 1 1 auto; }
  .week-strip { gap: 4px; }
  .week-strip button em { display: none; }
  .sheet { padding: 24px 16px; }
  .fgrid { grid-template-columns: 1fr 1fr; }
  .fgrid > :first-child { grid-column: 1 / -1; }
  .svc { grid-template-columns: 1fr 72px 88px 32px; }
  .svc .disc { display: none; }
  .row { grid-template-columns: 72px 1fr; }
  .row > :nth-child(n+3) { grid-column: 2; }
  .cols2 { grid-template-columns: 1fr; }
  table.t .hide-m { display: none; }
}
