/* Бородач — стойка администратора барбершопа. Графитовая светлая гамма, латунный акцент,
   Onest + Roboto Mono. Цвет — только в расписании и точках статуса кресел. Сетка 4px. */
:root {
  --bg: #fafafa;
  --card: #ffffff;
  --raised: #f4f4f5;
  --text: #171717;
  --text-2: #525252;
  --muted: #737373;
  --line: rgba(23, 23, 23, .08);
  --line-strong: rgba(23, 23, 23, .14);
  --brass: #b08643;
  --brass-ink: #7a5a1e;
  --brass-soft: #f6efe2;
  --positive: #16a34a;
  --negative: #dc2626;
  --r-sm: 6px; --r: 8px; --r-card: 12px; --r-panel: 16px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --mono: 'Roboto Mono', ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Onest, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14px; line-height: 20px; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brass-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 500; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 500; margin: 0 0 16px; }
h2 small { font-weight: 400; font-size: 12px; margin-left: 8px; }
b, strong { font-weight: 500; }
.mono, code { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .93em; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 16px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { text-align: right; }
.mt { margin-top: 24px; }
.pre { white-space: pre-wrap; margin-top: 4px; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- Каркас ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--raised); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 24px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; font-size: 16px; font-weight: 600; color: var(--text); text-decoration: none !important; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: var(--r); color: var(--text-2); text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.side nav a .ico { color: var(--muted); }
.side nav a:hover { background: rgba(23, 23, 23, .04); color: var(--text); }
.side nav a.active { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .04); }
.side nav a.active .ico { color: var(--brass); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.bot-status { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; color: var(--text-2); font-size: 13px; }
.side-link { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r); background: none; color: var(--text-2); font: inherit; cursor: pointer; }
.side-link .ico { color: var(--muted); }
.side-link:hover { background: rgba(23, 23, 23, .04); color: var(--text); }
.main { margin-left: 248px; padding: 32px; max-width: 1488px; }
.nav-toggle, .burger, .nav-backdrop { display: none; }

.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.card .head { margin-bottom: 16px; }
.card .head h2 { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card { margin-top: 16px; }
.row-between { display: flex; justify-content: space-between; gap: 12px; height: 36px; align-items: center; border-bottom: 1px solid var(--line); }
.row-between:last-child { border-bottom: 0; }

/* ---------- Подпись: статус кресла ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #d4d4d8; }
.dot-busy { background: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }
.dot-free { background: var(--positive); }
.dot-off { background: #d4d4d8; }
.chair-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 24px; }
.chair { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; }
.chair .dot { transform: translateY(-1px); }
.chair-name { font-size: 15px; }

/* ---------- Элементы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--card); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease); }
.btn:hover { background: var(--raised); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn-primary:hover { background: #2b2b2b; }
.btn-quiet { border-color: transparent; background: none; color: var(--text-2); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); gap: 6px; }
.btn-sm .ico { width: 14px; height: 14px; }
.btn-danger { color: var(--negative); }
.btn-danger:hover { background: #fdf2f2; }
.btn-icon { width: 36px; padding: 0; }
.btn-block { width: 100%; }
.input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); font: inherit; background: var(--card); color: inherit; transition: border-color .15s var(--ease); }
textarea.input { height: auto; padding: 8px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--text); }
.input-emoji { width: 56px; text-align: center; }
.input-num { width: 96px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: var(--text-2); }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { margin-bottom: 0; }
.filters .grow { flex: 1; min-width: 180px; }
.inline-form { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.hint { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.flash { padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; border: 1px solid #cfe7d6; background: #f0f8f2; color: #1d5f35; }
.flash-error { border-color: #f3d0d0; background: #fdf3f3; color: #9b1c1c; }
.tag { display: inline-block; font-size: 12px; color: var(--muted); margin-left: 6px; }
.tag::before { content: '· '; }
.tag-warn { color: #9a5b13; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #d4d4d8; }
.status-completed::before { background: var(--positive); }
.status-no_show::before { background: var(--negative); }
.status-booked::before { background: var(--brass); }
.toggle { height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--card); font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.toggle::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #d4d4d8; }
.toggle.on { color: var(--text); }
.toggle.on::before { background: var(--positive); }
.row-off { opacity: .5; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 400; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfcfc; }

/* ---------- Дашборд ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { color: var(--text-2); font-size: 13px; }
.kpi b { font-size: 28px; line-height: 32px; font-weight: 500; }
.kpi small { color: var(--muted); font-size: 12px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; background: #d4d4d8; }
.sw-today { background: var(--brass); }
.sw-future { background: repeating-linear-gradient(135deg, #e4e4e7 0 2px, #fff 2px 4px); border: 1px solid #d4d4d8; }
.bars { display: flex; gap: 8px; height: 280px; align-items: flex-end; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; }
.bar { width: 100%; max-width: 32px; background: #d4d4d8; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-col.future .bar { background: repeating-linear-gradient(135deg, #e4e4e7 0 3px, #fff 3px 6px); border: 1px solid #d4d4d8; border-bottom: 0; }
.bar-col.today .bar { background: var(--brass); }
.bar-val { font-size: 11px; color: var(--muted); }
.bar-label { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.bar-col.today .bar-label { color: var(--text); }
.rank { padding: 8px 0; }
.rank-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.thin-bar { height: 4px; border-radius: 2px; background: var(--raised); margin-bottom: 4px; }
.thin-bar div { height: 100%; border-radius: 2px; background: #a1a1aa; }
.rank:first-of-type .thin-bar div { background: var(--brass); }

/* ---------- Расписание (главный момент) ---------- */
.day-nav { display: flex; gap: 8px; align-items: center; }
.day-nav form { margin: 0; }
.sched-wrap { overflow-x: auto; padding: 0; }
.sched { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(200px, 1fr)); min-width: calc(64px + var(--cols) * 200px); }
.sched-head { position: sticky; top: 0; z-index: 1; background: var(--card); padding: 12px 16px; font-weight: 500; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.sched-head small { color: var(--muted); font-weight: 400; font-size: 12px; }
.sched-head:first-child { border-left: 0; }
.sched-times { position: relative; }
.sched-hour { position: absolute; left: 0; right: 0; padding: 4px 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.sched-col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--px)); }
.sched-off { position: absolute; left: 0; right: 0; top: 0; background: repeating-linear-gradient(135deg, #f4f4f5 0 4px, #fafafa 4px 8px); }
.sched-item { position: absolute; left: 4px; right: 4px; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: var(--r-sm); font-size: 12px; line-height: 16px; overflow: hidden; background: var(--brass-soft); border-left: 3px solid var(--brass); color: var(--text); }
.sched-item .mono { color: var(--brass-ink); }
.sched-item.status-completed { background: #f1f7f3; border-left-color: var(--positive); }
.sched-item.status-completed .mono { color: #1d5f35; }
.sched-item.status-no_show { background: #fdf3f3; border-left-color: var(--negative); }
.sched-item.status-no_show .mono { color: #9b1c1c; }

/* ---------- Мастера, клиенты, рассылки ---------- */
.days { display: flex; gap: 4px; }
.day-chip input { position: absolute; opacity: 0; }
.day-chip span { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r); border: 1px solid var(--line-strong); font-size: 12px; cursor: pointer; user-select: none; color: var(--text-2); }
.day-chip input:checked + span { background: var(--text); color: #fff; border-color: var(--text); }
.day-chip input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }
.search { display: flex; align-items: center; gap: 8px; width: 320px; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--card); color: var(--muted); }
.search input { border: 0; outline: 0; background: none; font: inherit; color: var(--text); width: 100%; }
.search:focus-within { border-color: var(--text); }
.history-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-item .row-between { height: auto; border: 0; }

/* ---------- Вход ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--raised); }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 32px; width: min(380px, 100%); box-shadow: 0 8px 24px rgba(0, 0, 0, .06); }
.login-card .brand { padding: 0; margin-bottom: 24px; }
.login-card h1 { font-size: 20px; margin-bottom: 20px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .side { transform: translateX(-100%); transition: transform .3s var(--ease); }
  .nav-toggle:checked ~ .side { transform: none; }
  .nav-toggle:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .32); z-index: 10; }
  .burger { display: inline-flex; align-items: center; gap: 8px; height: 36px; margin-bottom: 16px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--card); font-weight: 500; cursor: pointer; }
  .main { margin-left: 0; padding: 16px; }
  .kpis { gap: 8px; }
  .kpi b { font-size: 22px; }
  .search { width: 100%; }
  .bars { gap: 4px; }
  .bar-label { display: none; }
  .bar-col.today .bar-label { display: block; }
  .bar-val { font-size: 10px; }
}
