/* ==========================================================================
   Тату-запись: общие стили (светлая, чёрно-белая тема)
   ========================================================================== */

:root {
  --bg: #f8f9fa;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --panel-3: #ffffff;
  --line: #d1d5db;
  --line-soft: #e5e7eb;
  --text: #111111;
  --muted: #4b5563;
  --accent: #111111;
  --accent-soft: rgba(17, 17, 17, 0.08);
  --ok: #111111;
  --ok-soft: #eceff1;
  --warn: #374151;
  --warn-soft: #f1f2f4;
  --danger: #111111;
  --danger-soft: #f1f2f4;
  --info: #111111;
  --info-soft: #e5e7eb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* --------------------------- Кнопки и поля ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #f9fafb;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  user-select: none;
}
.btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.btn-primary:hover { background: #000000; border-color: #000000; }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--panel-3); }

.btn-danger { background: #ffffff; border-color: var(--text); color: var(--text); }
.btn-danger:hover { background: #f3f4f6; border-color: #000000; }

.btn-ok { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.btn-ok:hover { background: #000000; border-color: #000000; }

.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }

.input, .field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus,
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input::placeholder, .field textarea::placeholder { color: #6b7285; }
.field textarea { min-height: 84px; resize: vertical; }
.field .hint { font-size: 12px; color: #6b7285; }

.err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* --------------------------- Бейджи и чипы ----------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  background: var(--panel-3);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge.new { background: #111111; color: #ffffff; border-color: #111111; }
.badge.confirmed { background: #e5e7eb; color: #111111; border-color: #d1d5db; }
.badge.done { background: #f3f4f6; color: #111111; border-color: #d1d5db; }
.badge.cancelled { background: #f9fafb; color: var(--muted); border-color: var(--line); }

.chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s ease;
}
.chip:hover { color: var(--text); border-color: #9ca3af; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.chip .n { opacity: .75; margin-left: 5px; }

/* --------------------------- Карточки ----------------------------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 12px;
}

/* --------------------------- Календарь ---------------------------------- */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.cal-title { font-size: 17px; font-weight: 700; }
.cal-nav {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--line);
  background: #ffffff; cursor: pointer; color: var(--muted);
}
.cal-nav:hover { color: var(--text); border-color: #9ca3af; background: #f9fafb; }
.cal-nav:disabled { opacity: .3; cursor: not-allowed; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-bottom: 4px;
}

.cal-day {
  position: relative;
  min-height: 62px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color .12s ease, background .12s ease;
}
.cal-day:hover { border-color: #9ca3af; background: #f9fafb; }
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-day.past { opacity: .4; cursor: not-allowed; }
.cal-day.off { opacity: .42; cursor: not-allowed; }
.cal-day .num { font-weight: 700; font-size: 14px; }
.cal-day .num small { font-weight: 600; color: var(--muted); font-size: 11px; }
.cal-day .marks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.cal-day.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.cal-day.today .num { color: var(--accent); font-weight: 800; }

.mark {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1.3;
}
.mark.free { background: #eceff1; color: #111111; }
.mark.busy { background: #111111; color: #ffffff; }

/* --------------------------- Уведомления -------------------------------- */

.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}
.toast {
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 240px;
  max-width: 380px;
  box-shadow: var(--shadow);
  animation: slide-in .22s ease;
}
.toast.ok { border-left-color: #111111; }
.toast.err { border-left-color: #111111; background: #f3f4f6; }
.toast .t-title { font-weight: 700; margin-bottom: 2px; }
.toast .t-text { font-size: 13px; color: var(--muted); }

@keyframes slide-in {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --------------------------- Анимации ----------------------------------- */

@keyframes pop {
  0% { transform: scale(.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.pop { animation: pop .18s ease; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ------------------- Бренд и подвал ITSB -------------------------------- */

.svc-brand {
  margin-top: 26px;
  padding: 18px 4px 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}
.svc-brand .svc-logo-link { display: inline-block; }
.svc-brand .svc-logo {
  height: 34px;
  width: auto;
  display: block;
  margin-bottom: 12px;
}
.svc-brand .svc-lines {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.svc-brand a { color: var(--text); text-decoration: none; }
.svc-brand a:hover { color: var(--accent); text-decoration: underline; }
.svc-brand b { color: var(--text); font-weight: 700; }

.svc-logo-inline {
  height: 16px;
  width: auto;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 6px;
}
