/* Общие стили CRM «Студия Бразэрз» */
:root {
  --ink: #1C1B22; --ink-2: #3F3D48; --muted: #6A6874; --line: #E6E4EA; --line-2: #D9D6DF;
  --bg: #F6F5F8; --card: #FFFFFF; --accent: #8E4A80; --accent-ink: #5E2853; --accent-bg: #F2E4EF;
  --ok: #2B7A4B; --ok-ink: #1F5E39; --ok-bg: #E3F2E8; --bad: #A61E4D; --now: #C2255C;
  --yandex-bg: #FFF1BF; --yandex: #5C4300; --avito-bg: #DDEBFF; --avito: #0B3A80;
  --site-bg: #F2E4EF; --site: #5E2853; --phone-bg: #ECEBF0; --phone: #3F3D48;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Manrope, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: #BDB9C5; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #33313C; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 44px; min-height: 44px; padding: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.input, .field input, .field select, .field textarea { min-height: 44px; padding: 10px 12px; border: 1px solid #CFCBD6; border-radius: 12px; background: #fff; font-size: 15px; font-weight: 500; color: var(--ink); width: 100%; }
.field textarea { resize: vertical; min-height: 70px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .btn:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }

.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.src-yandex { background: var(--yandex-bg); color: var(--yandex); }
.src-avito { background: var(--avito-bg); color: var(--avito); }
.src-site { background: var(--site-bg); color: var(--site); }
.src-phone, .src-walkin, .src-other { background: var(--phone-bg); color: var(--phone); }
.st-pending { color: var(--bad); }
.st-confirmed { color: var(--ok); }
.st-done, .st-cancelled, .st-noshow { color: var(--muted); }

.seg { display: flex; gap: 4px; padding: 3px; background: #F1F0F4; border-radius: 12px; }
.seg button { flex: 1 1 0; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: #55525E; font-weight: 800; cursor: pointer; padding: 0 10px; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(28,27,34,.15); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { min-height: 52px; border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; text-align: left; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.slot b { font-size: 14px; }
.slot span { font-size: 11px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.free { border: 1.5px solid var(--ok); color: var(--ok-ink); }
.slot.booked { background: var(--accent-bg); color: var(--accent-ink); border-color: var(--accent-bg); cursor: default; }
.slot.break, .slot.closed { background: repeating-linear-gradient(135deg, #F1F0F4 0, #F1F0F4 6px, #DCDAE2 6px, #DCDAE2 12px); color: var(--ink-2); border-color: #CFCBD6; }
.slot.break { cursor: default; }
.slot.past { background: var(--bg); color: var(--muted); cursor: default; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 100; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: var(--bad); }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); }
dialog::backdrop { background: rgba(28,27,34,.45); }
.dlg { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex: none; }
