:root {
  --accent: #0E7C66; --accent-dark: #0B5E4E; --accent-light: #E6F2EF;
  --bg: #F4F5F7; --card: #FFFFFF; --text: #111827; --muted: #4B5563;
  --line: #E5E7EB; --field: #D1D5DB; --danger: #9B1C1C; --danger-bg: #FDECEC;
  --info: #1E3A8A; --info-bg: #EEF3FF;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 Inter, system-ui, sans-serif; }
h1, h2, h3, .brand { font-family: 'Space Grotesk', Inter, sans-serif; }
h1 { font-size: 24px; margin: 4px 0 8px; }
h2 { font-size: 18px; margin: 16px 0 8px; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 160px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.hidden { display: none !important; }

label { font-size: 14px; font-weight: 500; }
input, select { height: 48px; border: 1px solid var(--field); border-radius: 12px; padding: 0 14px; background: #fff; width: 100%; }
input[type=checkbox] { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--accent); }
input[type=number] { text-align: right; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }

.btn { min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--field); background: #fff; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn:disabled { background: var(--field); border-color: var(--field); color: var(--muted); cursor: not-allowed; }
.btn.wide { width: 100%; height: 52px; font-size: 16px; }
.btn.sm { min-height: 44px; padding: 0 12px; font-size: 14px; }

.pick { width: 100%; min-height: 64px; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.pick.on { border-color: var(--accent); background: var(--accent-light); }
.chip { height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--field); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.avatar { width: 48px; height: 48px; border-radius: 24px; background: var(--accent-light); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }

.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > div { height: 6px; background: var(--accent); }

.error { background: var(--danger-bg); color: var(--danger); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.ok-badge { width: 72px; height: 72px; border-radius: 36px; background: var(--accent); display: flex; align-items: center; justify-content: center; margin: 16px auto 0; }
.sumline { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.sumline span:first-child { color: var(--muted); }
.sumline span:last-child { font-weight: 600; text-align: right; }

/* Страница записи — мобильная колонка */
.phone-app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.phone-app header { display: flex; align-items: center; gap: 12px; padding: 16px; background: #fff; border-bottom: 1px solid var(--line); }
.phone-app main { flex: 1; padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.phone-app footer { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.day { min-width: 56px; height: 64px; flex-shrink: 0; border-radius: 14px; border: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.day b { font-size: 18px; }
.day span { font-size: 12px; }
.day.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.slot { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; }
.slot.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Кабинет */
.shell { display: flex; min-height: 100vh; }
.side { width: 220px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 6px; }
.side .tab { height: 44px; text-align: left; padding: 0 12px; border: none; border-radius: 10px; background: transparent; font-weight: 500; cursor: pointer; }
.side .tab.on { background: var(--accent-light); color: var(--accent-dark); font-weight: 600; }
.content { flex: 1; min-width: 0; padding: 24px clamp(16px, 3vw, 36px); display: flex; flex-direction: column; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stats b { display: block; font-size: 22px; }
.split { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.split > .main { flex: 999 1 520px; min-width: 0; }
.split > aside { flex: 1 1 280px; }
.sched { overflow-x: auto; padding: 0; }
.grid { display: grid; min-width: 560px; grid-auto-rows: 22px; }
.grid .h { position: sticky; top: 0; background: #fff; padding: 10px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); grid-row: 1; }
.grid .t { font-size: 12px; color: var(--muted); padding: 0 8px; border-top: 1px solid #F0F1F3; }
.grid .bk { margin: 1px 3px; border-radius: 8px; padding: 3px 8px; font-size: 12px; text-align: left; overflow: hidden; cursor: pointer; border: 2px solid transparent; display: flex; flex-direction: column; }
.bk.new { background: var(--info-bg); color: var(--info); }
.bk.done { background: var(--accent-light); color: var(--accent-dark); }
.bk.no_show { background: var(--danger-bg); color: var(--danger); }
.bk.sel { border-color: var(--text); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-top: 1px solid #F0F1F3; }
th { color: var(--muted); font-weight: 500; border-top: none; }
.tablewrap { overflow-x: auto; padding: 0; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); padding: 10px; }
  .side .brandbox { width: 100%; }
}
