/* ============================================================
   Планировщик чеков — визуальная оболочка
   Палитра: холодная бумага + чернила + кобальт;
   зелёный/красный только для решений по чекам.
   ============================================================ */

:root {
  --bg:        #EDEFF2;
  --card:      #FFFFFF;
  --ink:       #161A20;
  --ink-soft:  #3D4450;
  --mut:       #6A7482;
  --line:      #DDE1E7;
  --accent:    #2A47C9;
  --accent-hv: #203AA8;
  --accent-bg: #E9EDFB;
  --ok:        #178A50;
  --ok-hv:     #10703F;
  --ok-bg:     #E4F3EB;
  --bad:       #C93636;
  --bad-hv:    #A82727;
  --bad-bg:    #FBEAEA;
  --wait:      #8A93A0;
  --warn-bg:   #FCF3E1;
  --warn-line: #E8CD96;
  --warn-ink:  #7A5410;
  --r:         14px;
  --shadow:    0 1px 2px rgba(22, 26, 32, .05), 0 4px 14px rgba(22, 26, 32, .05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Шапка ---------- */
.topbar {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-in {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 56px;
  flex-wrap: wrap;
}
.brand {
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand:hover { text-decoration: none; }
.brand-dot { color: #7D93F5; }
.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav a {
  color: #C6CBD4;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 15px;
}
.nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.08); }
.nav a.on { color: #fff; background: rgba(255,255,255,.14); font-weight: 600; }
.exit {
  margin-left: auto;
  color: #9AA2AE;
  font-size: 14px;
}
.exit:hover { color: #fff; text-decoration: none; }

/* ---------- Контент ---------- */
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 16px 80px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 18px;
}
h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.sub { color: var(--mut); font-size: 15px; margin-top: 4px; }
.crumbs { font-size: 13px; color: var(--mut); margin-bottom: 2px; }

/* ---------- Карточки ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.count-pill {
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
}
.card-danger { border-color: #EAC9C9; }

/* ---------- Деньги ---------- */
.money, .money-sm {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
.money-sm { font-weight: 600; font-size: 14px; }

/* ---------- Флеш-сообщения ---------- */
.flash {
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 12px;
  font-size: 15px;
  border: 1px solid transparent;
}
.flash-ok   { background: var(--ok-bg);   color: var(--ok-hv);   border-color: #BFE3CE; }
.flash-err  { background: var(--bad-bg);  color: var(--bad-hv);  border-color: #EFC5C5; }
.flash-warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }

/* ---------- Формы ---------- */
.fld { display: block; }
.fld > span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 5px;
}
.fld-hint { display: block; font-style: normal; color: var(--mut); font-size: 12.5px; margin-top: 4px; }
input[type="text"], input[type="password"], input[type="number"],
input[type="time"], input[type="date"], textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #FBFCFD;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  min-height: 44px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(42, 71, 201, .13);
}
.grid-form {
  display: grid;
  grid-template-columns: 2fr 1.4fr auto;
  gap: 12px;
  align-items: end;
}
.grid-form-4 { grid-template-columns: repeat(4, 1fr); }
.fld-btn { display: flex; align-items: end; }
.hint { color: var(--mut); font-size: 13.5px; margin: 8px 0 12px; }
.hint-empty { margin-top: 14px; }
.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.inline-form input[type="date"] { width: auto; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 11px;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background .12s ease, transform .05s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hv); color: #fff; }
.btn-ok  { background: var(--ok);  color: #fff; }
.btn-ok:hover  { background: var(--ok-hv); }
.btn-bad { background: var(--bad); color: #fff; }
.btn-bad:hover { background: var(--bad-hv); }
.btn-ghost {
  background: #fff;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  font-weight: 600;
}
.btn-ghost:hover { border-color: var(--mut); }
.btn-ghost.copied { border-color: var(--ok); color: var(--ok); }
.btn-danger-ghost { color: var(--bad); }
.btn-danger-ghost:hover { border-color: var(--bad); }
.btn-wide { width: 100%; }
.icon-btn {
  border: none;
  background: transparent;
  color: var(--mut);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  min-height: 44px;
  min-width: 40px;
  border-radius: 10px;
}
.icon-btn:hover { color: var(--bad); background: var(--bad-bg); }

/* ---------- Бейджи и точки ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
}
.badge-ok   { background: var(--ok-bg);  color: var(--ok-hv); }
.badge-bad  { background: var(--bad-bg); color: var(--bad-hv); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); font-size: 11.5px; padding: 3px 9px; }
.dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.dot-ok   { background: var(--ok); }
.dot-plan { background: var(--accent); }
.dot-free { background: #C4CAD3; }

/* ---------- Баннер нерешённых чеков ---------- */
.banner {
  background: var(--warn-bg);
  border: 1.5px solid var(--warn-line);
  border-radius: var(--r);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.banner-title { font-weight: 800; font-size: 17px; color: var(--warn-ink); }
.banner-sub { color: var(--warn-ink); font-size: 14px; margin: 3px 0 10px; opacity: .85; }
.uch {
  background: #fff;
  border: 1px solid var(--warn-line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.uch-when { font-size: 13px; color: var(--mut); }
.uch-who { font-weight: 600; margin-top: 2px; }
.uch-actions form { display: flex; gap: 8px; }

/* ---------- Лента «Сегодня» (фирменный элемент) ---------- */
.rail {
  position: relative;
  padding-left: 6px;
}
.rail::before {
  content: "";
  position: absolute;
  left: 62px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}
.stop {
  position: relative;
  display: flex;
  gap: 18px;
  margin-bottom: 16px;
}
.stop-side {
  width: 74px;
  flex: 0 0 74px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 14px;
}
.stop-time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 17px;
  color: var(--ink-soft);
}
.stop-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--wait);
  border: 3px solid var(--bg);
  margin-top: 4px;
  position: relative;
  left: 3px;
}
.st-ok  .stop-dot { background: var(--ok); }
.st-bad .stop-dot { background: var(--bad); }
.st-ok  .stop-time { color: var(--ok-hv); }
.st-bad .stop-time { color: var(--bad-hv); text-decoration: line-through; }

.check-card {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--wait);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  min-width: 0;
}
.st-ok  .check-card { border-left-color: var(--ok); }
.st-bad .check-card { border-left-color: var(--bad); opacity: .75; }
.check-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.check-who { font-weight: 700; font-size: 16px; }
.check-total { font-size: 18px; }
.check-items {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  border-top: 1px dashed var(--line);
}
.check-items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
  color: var(--ink-soft);
}
.check-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.decide-form { display: flex; gap: 8px; }
.check-foot .btn-ghost { margin-left: auto; }

/* ---------- Карточка фрилансера в списке ---------- */
.fr-card { display: block; color: inherit; }
.fr-card:hover { text-decoration: none; border-color: var(--accent); }
.fr-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.fr-name { font-weight: 800; font-size: 18px; }
.fr-budget { font-size: 17px; }
.bar {
  height: 8px;
  background: #E7EAEE;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  margin: 12px 0 10px;
}
.bar-done    { background: var(--ok); }
.bar-pending { background: var(--accent); opacity: .55; }
.fr-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--mut);
}
.fr-stats b { color: var(--ink-soft); margin-left: 2px; }
.fr-warn {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--warn-ink);
  background: var(--warn-bg);
  border-radius: 9px;
  padding: 7px 10px;
  display: inline-block;
}
.fr-note { margin-top: 10px; font-size: 13.5px; color: var(--mut); }

/* ---------- Таблица услуг ---------- */
.svc-form { margin-top: 18px; }
.svc-head, .svc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 110px 44px;
  gap: 8px;
  align-items: center;
}
.svc-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 0 2px 6px;
}
.svc-row { margin-bottom: 8px; }
.svc-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.svc-name input { min-width: 0; }
.svc-unusable input { border-color: var(--warn-line); background: #FFFCF4; }
.svc-new { margin-top: 14px; }
.svc-new input { border-style: dashed; }
.svc-actions { margin-top: 14px; }

/* ---------- Чипы дат ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 20px;
  padding: 7px 6px 7px 14px;
  font-size: 14px;
  font-weight: 600;
}
.chip button {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 50%;
}
.chip button:hover { background: rgba(42, 71, 201, .14); }
.chip-past { background: #EAECEF; color: var(--mut); }
.chip-past button:hover { background: rgba(0, 0, 0, .08); }

/* ---------- Пустые состояния ---------- */
.empty {
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: var(--r);
  padding: 42px 24px;
  text-align: center;
  color: var(--mut);
}
.empty-title { font-weight: 800; font-size: 18px; color: var(--ink-soft); margin-bottom: 6px; }
.empty .btn { margin-top: 10px; }

/* ---------- Вход ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
}
.login-brand {
  font-weight: 800;
  font-size: 26px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
}
.login-sub { text-align: center; color: var(--mut); margin: 4px 0 22px; }
.login-card .fld { margin-bottom: 14px; }

/* ---------- Доступность ---------- */
:focus-visible { outline: 3px solid rgba(42, 71, 201, .5); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Мобильная версия ---------- */
@media (max-width: 720px) {
  .topbar-in { padding: 8px 12px; gap: 10px; }
  .brand { font-size: 17px; }
  .nav { order: 3; width: 100%; margin: 0 -4px 2px; }
  .nav a { padding: 7px 10px; font-size: 14.5px; }
  .wrap { padding: 16px 12px 70px; }
  h1 { font-size: 23px; }
  .card { padding: 14px; }
  .grid-form, .grid-form-4 { grid-template-columns: 1fr 1fr; }
  .grid-form .fld:first-child { grid-column: 1 / -1; }
  .fld-btn { grid-column: 1 / -1; }
  .fld-btn .btn { width: 100%; }
  .rail::before { left: 47px; }
  .stop { gap: 12px; }
  .stop-side { width: 58px; flex-basis: 58px; }
  .stop-time { font-size: 15px; }
  .svc-head { display: none; }
  .svc-row {
    grid-template-columns: 1fr 1fr 44px;
    background: #F6F7F9;
    border-radius: 12px;
    padding: 10px;
  }
  .svc-name { grid-column: 1 / -1; }
  .check-foot .btn-ghost { margin-left: 0; width: 100%; }
  .decide-form { width: 100%; }
  .decide-form .btn { flex: 1; }
  .uch-actions { width: 100%; }
  .uch-actions form { width: 100%; }
  .uch-actions .btn { flex: 1; }
}
