/* Учёт личных доходов и расходов — оформление интерфейса */
:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --text: #15191b;
  --muted: #6d7166;
  --line: #e4e0d6;
  --nav: #121516;
  --nav-text: #b3b9ae;
  --accent: #55634c;
  --accent-hover: #46533e;
  --accent-light: #a9c08f;      /* акцент на тёмном фоне */
  --accent-soft: #e9ede2;
  --income: #2f7a44;
  --expense: #b5463b;
  --warn: #a8761c;
  --surface: #ffffff; --input-border: #d3cfc4; --soft: #f7f5ef; --hover: #f2efe8;
  --badge-bg: #eeebe3; --ok-bg: #e3eedf; --bad-bg: #f8e6e3; --warn-bg: #f8efdc;
  --msg-ok-bg: #edf3e8; --msg-ok-border: #c7d8bd; --msg-ok-text: #2f5a2a;
  --msg-err-bg: #fdeceb; --msg-err-border: #f2c1bd; --msg-err-text: #8f241e;
  --bar-bg: #ece8df; --hl-bg: #fbf1ee; --vc-bg: #eef3ea; --toolbar-border: #cfd8c4;
  --chart-in: #6f8460; --chart-out: #c7776d; --link: #55634c;
  color-scheme: light;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- каркас: боковое меню + рабочая область ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--nav); color: var(--nav-text);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.brand { color: #fff; font-weight: 700; font-size: 17px; line-height: 1.25; padding: 0 8px 18px; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--nav-text); margin-top: 3px; }
.nav a {
  display: block; color: var(--nav-text); padding: 8px 10px; border-radius: 7px; margin-bottom: 2px;
}
.nav a:hover { background: #1f2421; text-decoration: none; color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.nav .sep { height: 1px; background: #262b28; margin: 10px 4px; }
.userbox { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid #262b28; font-size: 13px; }
.userbox b { color: #fff; display: block; }
.userbox form { margin-top: 8px; }
.userbox button { background: none; border: 1px solid #343a35; color: var(--nav-text); border-radius: 6px;
  padding: 4px 10px; cursor: pointer; font: inherit; }
.main { flex: 1; padding: 26px 32px 40px; max-width: 1180px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
h1 { font-size: 23px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---- карточки и сетка ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.mt { margin-top: 16px; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; white-space: nowrap; }

/* ---- таблицы ---- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.income { color: var(--income); }
.expense { color: var(--expense); }
.muted { color: var(--muted); }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 20px;
  padding: 1px 8px; font-size: 12px; margin-right: 3px; }
.badge { display: inline-block; white-space: nowrap; border-radius: 6px; padding: 2px 8px; font-size: 12px; background: var(--badge-bg); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--income); }
.badge.bad { background: var(--bad-bg); color: var(--expense); }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; }

/* ---- кнопки и формы ---- */
.btn { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #fff;
  border-radius: 7px; padding: 7px 14px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn.light { background: var(--surface); color: var(--accent); }
.btn.green { background: var(--income); border-color: var(--income); }
.btn.red { background: var(--expense); border-color: var(--expense); }
.btn.sm { padding: 3px 9px; font-size: 13px; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0 4px; }
.link-btn.del { color: var(--expense); }
form.stack { max-width: 560px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input, select { width: 100%; padding: 8px 10px; border: 1px solid var(--input-border); border-radius: 7px; font: inherit;
  background: var(--surface); color: var(--text); }
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type=checkbox] { width: auto; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { margin: 0; min-width: 130px; flex: 1; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ---- сообщения ---- */
.msg { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid; }
.msg.ok { background: var(--msg-ok-bg); border-color: var(--msg-ok-border); color: var(--msg-ok-text); }
.msg.error { background: var(--msg-err-bg); border-color: var(--msg-err-border); color: var(--msg-err-text); }

/* ---- полосы для диаграмм ---- */
.bar { height: 8px; background: var(--bar-bg); border-radius: 6px; overflow: hidden; min-width: 120px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.bar.over > span { background: var(--expense); }
.bar.warn > span { background: var(--warn); }
.bar.ok > span { background: var(--income); }
.month-bars { display: flex; align-items: flex-end; gap: 22px; height: 190px; padding: 6px 4px 0; }
.month-bars .m { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.month-bars .pair { flex: 1; display: flex; align-items: flex-end; gap: 6px; width: 100%; justify-content: center; }
.month-bars .pair div { width: 34%; border-radius: 5px 5px 0 0; }
.month-bars .in { background: var(--chart-in); }
.month-bars .out { background: var(--chart-out); }
.month-bars .cap { font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-size: 13px; color: var(--muted); }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---- страница входа ---- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth .card { width: 400px; max-width: 100%; padding: 28px 30px; }
.auth h1 { margin-bottom: 4px; }
.auth .sub { margin-bottom: 20px; }

@media print {
  .sidebar, .no-print { display: none !important; }
  .main { padding: 0; }
}

/* ---- иконки, переключатели ---- */
.ico { vertical-align: -3px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; vertical-align: -1px; }
.switch { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { flex-shrink: 0; width: 38px; height: 22px; border-radius: 11px; background: var(--input-border); position: relative; transition: background .15s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: left .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 19px; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch b { display: block; font-size: 14px; }
.switch small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--input-border); border-radius: 7px; overflow: hidden; }
.seg label { padding: 6px 12px; font-size: 14px; border-right: 1px solid var(--input-border); cursor: pointer; margin: 0; font-weight: 500; }
.seg label:last-child { border-right: none; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--accent); color: #fff; }
.picker { display: flex; gap: 6px; flex-wrap: wrap; }
.picker label { margin: 0; cursor: pointer; border-radius: 7px; padding: 4px; border: 1px solid transparent; }
.picker input { display: none; }
.picker label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.picker .chip { width: 22px; height: 22px; border-radius: 6px; display: block; }
.formula { font-size: 13px; color: var(--muted); line-height: 1.7; }
.formula b { color: var(--text); font-weight: 600; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }

/* ---- календарь смен ---- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; padding: 0 4px 2px; }
.cal .day { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 92px; padding: 6px 7px; position: relative; color: var(--text); display: block; }
.cal a.day:hover { border-color: var(--accent); text-decoration: none; }
.cal .day.empty { background: transparent; border: none; }
.cal .day.we .dn, .cal .day.hl .dn { color: var(--expense); }
.cal .day.hl { background: var(--hl-bg); }
.cal .day.vc { background: var(--vc-bg); }
.cal .day.today { outline: 2px solid var(--accent); outline-offset: -1px; }
.cal .day.cur { border-color: var(--accent); background: var(--accent-soft); }
.cal .dn { font-weight: 600; font-size: 14px; }
.cal .short { font-size: 10px; color: var(--warn); margin-left: 4px; font-weight: 600; }
.cal .chk { position: absolute; top: 6px; right: 7px; width: auto; }
.stag { display: flex; align-items: center; gap: 4px; border-radius: 6px; padding: 2px 6px; font-size: 12px; font-weight: 600; margin-top: 5px; overflow: hidden; white-space: nowrap; }
.stime { font-size: 11px; color: var(--muted); margin-top: 2px; }
.marks { display: flex; gap: 6px; margin-top: 3px; font-size: 11px; color: var(--muted); align-items: center; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--toolbar-border); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; font-size: 14px; }
.toolbar select { width: auto; min-width: 180px; }
.choice { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.choice label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-weight: 500; cursor: pointer; margin: 0; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { width: auto; margin: 0; }
.side { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.sticky { position: sticky; top: 20px; }
@media (max-width: 1100px) { .side { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }
.cal .daylink { position: absolute; inset: 0; border-radius: 8px; }
.cal .day:hover { border-color: var(--accent); }
.cal .chk { z-index: 2; }
table.compact td { padding: 5px 10px; }

/* ======================= Аккаунт, правовые страницы ======================= */
.userbox-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.userbox-actions a { color: var(--nav-text); border: 1px solid #343a35; border-radius: 6px; padding: 3px 10px; }
.userbox-actions form { margin: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 0 0 14px; cursor: pointer; line-height: 1.4; }
.check input { width: auto; margin: 3px 0 0; flex-shrink: 0; }
.check.consent { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.auth { padding: 24px 16px; }
.auth-logo { border-radius: 13px; display: block; margin-bottom: 12px; }
.legal-links { font-size: 12px; margin: 14px 0 0; }
.legal { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }
.legal .card { padding: 28px 32px; line-height: 1.6; }
.legal h2 { margin-top: 22px; }
.legal li { margin-bottom: 4px; }
.card.danger { border-color: var(--msg-err-border); }
.footer { margin-top: 32px; font-size: 12px; color: var(--muted); }
.footer a { color: var(--muted); }
.nav-light a { color: var(--text); padding: 12px 10px; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; }
.nav-light a.active { background: var(--accent-soft); color: var(--accent); }
.nav-light a:hover { background: var(--hover); color: var(--text); }
.nav-light .sep { background: transparent; height: 8px; margin: 0; }
.menu-list { padding: 4px 14px; }
.tabbar { display: none; }
.ftoggle, .fbtn { display: none; }

/* ======================= Телефон ======================= */
@media (max-width: 760px) {
  body { font-size: 15px; -webkit-text-size-adjust: 100%; }
  .sidebar { display: none; }
  .layout { display: block; }
  .main { padding: calc(14px + env(safe-area-inset-top)) 14px calc(86px + env(safe-area-inset-bottom)); max-width: none; }
  h1 { font-size: 21px; }
  h2 { font-size: 15px; }
  .page-head { flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
  .page-head > div:first-child { flex: 1 1 100%; }
  .page-head .sub { font-size: 12.5px; }
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-2, .side { grid-template-columns: 1fr; }
  .grid { gap: 12px; }
  .mt { margin-top: 12px; }
  .card { padding: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .kpi .value { font-size: 18px; white-space: normal; }
  .kpi .label { font-size: 12px; }
  th, td { padding: 8px 7px; font-size: 14px; }
  th { font-size: 11px; }
  .actions { white-space: normal; }
  input, select, textarea { font-size: 16px; }             /* iOS не увеличивает страницу при фокусе */
  .btn { padding: 9px 14px; }
  .row { flex-wrap: wrap; }
  .row > * { min-width: 130px; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .field { min-width: 0; }
  .filters > div:last-child .btn { width: 100%; }
  .page-head input[type=month] { width: 170px; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* фильтры журнала — сворачиваются */
  .fbox { padding: 0; }
  .fbtn { display: block; padding: 12px 14px; font-weight: 600; font-size: 14px; cursor: pointer; }
  .fbtn::after { content: " ▾"; color: var(--muted); }
  .fbody { display: none; padding: 0 14px 14px; }
  .ftoggle:checked ~ .fbody { display: flex; }

  /* журнал операций — карточками */
  table.ops thead { display: none; }
  table.ops tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "cat sum" "desc desc" "date acc" "act act"; padding: 9px 0; border-bottom: 1px solid var(--line); }
  table.ops td { border: none; padding: 1px 0; }
  table.ops .c-cat { grid-area: cat; font-weight: 600; }
  table.ops .c-sum { grid-area: sum; font-weight: 600; padding-left: 10px; }
  table.ops .c-desc { grid-area: desc; font-size: 13px; }
  table.ops .c-desc:empty { display: none; }
  table.ops .c-date { grid-area: date; font-size: 12px; color: var(--muted); }
  table.ops .c-acc { grid-area: acc; font-size: 12px; color: var(--muted); text-align: right; }
  table.ops .c-act { grid-area: act; text-align: left; font-size: 13px; padding-top: 3px; }
  table.ops tfoot tr { display: flex; justify-content: space-between; gap: 8px; }
  table.ops tfoot td { border: none; font-size: 13px; padding: 10px 0 0; }
  .month-bars { gap: 8px; }
  .sticky { position: static; }
  .toolbar { gap: 8px; }
  .toolbar select { min-width: 0; flex: 1 1 100%; }
  .footer { text-align: center; }
  .legal .card { padding: 18px; }
  .auth { justify-content: flex-start; padding-top: calc(32px + env(safe-area-inset-top)); }
  .auth .card { padding: 22px 18px; }

  /* календарь смен */
  .cal { gap: 3px; }
  .cal .dow { font-size: 10px; padding: 0 2px; text-align: center; }
  .cal .day { min-height: 58px; padding: 4px 3px; border-radius: 6px; }
  .cal .dn { font-size: 12px; }
  .cal .short { display: none; }
  .cal .stime, .cal .marks { display: none; }
  .cal .chk { top: 3px; right: 2px; transform: scale(.85); }
  .stag { font-size: 9.5px; padding: 1px 3px; gap: 2px; margin-top: 3px; border-radius: 4px; text-overflow: clip; }
  .stag img { width: 11px; height: 11px; }

  /* нижняя панель вкладок */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(18, 21, 22, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid #262b28; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px;
    color: #8d9388; text-decoration: none; padding: 2px 0; }
  .tabbar a .ti { font-size: 19px; line-height: 22px; }
  .tabbar a.on { color: var(--accent-light); }
  .tabbar a.add { flex: 0 0 64px; }
  .tabbar a.add .ti { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff;
    font-size: 28px; line-height: 44px; text-align: center; margin-top: -14px; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
}
@media (display-mode: standalone) and (max-width: 760px) {
  .main { padding-top: calc(10px + env(safe-area-inset-top)); }
}

/* ======================= Фирменный стиль ShiftPay ======================= */
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); filter: none; }
.btn.green:hover { background: #276838; border-color: #276838; }
.btn.red:hover { background: #9d3a30; border-color: #9d3a30; }
.btn.light:hover { background: var(--accent-soft); }
a { color: var(--link); }
.legal a, .sub a, .hint a, .msg a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.brand span { display: block; font-size: 18px; letter-spacing: .01em; }
.brand small { margin-top: 1px; color: var(--accent-light); text-transform: uppercase; font-size: 10px; letter-spacing: .08em; }
.nav a.active { background: var(--accent); }
.auth { background: radial-gradient(circle at 50% 0%, #252b26 0%, var(--nav) 60%); flex-direction: column; gap: 18px; }
.auth-brand { width: 150px; height: 150px; display: block; filter: drop-shadow(0 8px 24px rgba(0,0,0,.45)); }
.auth .card { border: none; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.auth .legal-links a, .auth .sub a { color: var(--link); }
.kpi .value.income, .value.income { color: var(--income); }
.card { border-color: var(--line); }
h1 { letter-spacing: -.01em; }
@media (max-width: 760px) {
  .auth { padding-top: calc(24px + env(safe-area-inset-top)); }
  .auth-brand { width: 120px; height: 120px; }
  .tabbar a.add .ti { border: 3px solid var(--nav); }
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.brand small { white-space: nowrap; font-size: 9px; }

/* ---- поля даты/времени: iOS Safari растягивает их шире колонки ---- */
input[type=date], input[type=month], input[type=time] {
  -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block;
  min-height: 40px; text-align: left; background: var(--surface);
}
input::-webkit-date-and-time-value { text-align: left; }
.field { min-width: 0; }
.row > * { min-width: 0; }

@media (max-width: 760px) {
  /* поля формы — по одному в строке, без «съезжания» */
  .row { flex-direction: column; gap: 0; }
  .row > * { min-width: 0; width: 100%; }
  /* переключатель типа графика — отдельные кнопки-«таблетки» */
  .seg { display: flex; flex-wrap: wrap; gap: 6px; border: none; border-radius: 0; overflow: visible; }
  .seg label { border: 1px solid var(--input-border); border-radius: 8px; padding: 8px 12px; background: var(--surface); }
  .seg label:last-child { border-right: 1px solid var(--input-border); }
  .seg label:has(input:checked) { border-color: var(--accent); }
  input[type=date], input[type=month], input[type=time] { min-height: 44px; }
}

/* ---- вкладки раздела «Смены» ---- */
.subtabs { display: flex; gap: 6px; margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { flex-shrink: 0; padding: 7px 14px; border-radius: 20px; border: 1px solid var(--input-border); background: var(--surface);
  color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; }
.subtabs a:hover { border-color: var(--accent); text-decoration: none; }
.subtabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- выбор смены плитками (цвет + иконка + время) ---- */
.spick { display: flex; flex-wrap: wrap; gap: 6px; }
.spick-item { display: flex; align-items: center; gap: 7px; margin: 0; cursor: pointer; padding: 6px 10px 6px 8px;
  border: 1px solid var(--input-border); border-left: 4px solid var(--sc); border-radius: 8px; background: var(--surface); font-weight: 400; }
.spick-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.spick-item:has(input:checked) { border-color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, var(--surface));
  box-shadow: 0 0 0 1px var(--sc) inset; }
.spick-item:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.spick-ico { display: inline-flex; width: 18px; justify-content: center; }
.spick-ico:empty::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--sc); }
.spick-txt { display: flex; flex-direction: column; line-height: 1.15; }
.spick-txt b { font-size: 14px; color: var(--sc); }
.spick-txt small { font-size: 11.5px; color: var(--muted); }
.toolbar .spick { flex: 1 1 100%; }
.toolbar-title { flex: 1 1 100%; font-weight: 600; }
.cal .day.has-shift { background: color-mix(in srgb, var(--sc) 9%, var(--surface)); border-color: color-mix(in srgb, var(--sc) 35%, var(--surface)); }
.stag .stag-name { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .subtabs { margin-bottom: 12px; }
  .spick-item { padding: 7px 10px 7px 8px; }
  .cal .day.has-shift { background: color-mix(in srgb, var(--sc) 16%, var(--surface)); }
  .stag { justify-content: flex-start; }
}

/* генератор: вторая смена нужна только для «день–ночь–отсыпной–выходной» */
.only-dnov { display: none; }
form:has(input[name=pattern][value=DNOV]:checked) .only-dnov { display: block; }
form:has(input[name=pattern][value=DNOV]:checked) label .only-dnov { display: inline; }
form:has(input[name=pattern][value=DNOV]:checked) .not-dnov { display: none; }
@media (max-width: 760px) {
  .stag .stag-name { text-overflow: clip; }
}

/* ======================= Тёмная тема ======================= */
:root[data-theme="dark"] {
  --bg: #0f1211; --card: #171b1a; --surface: #1c2120; --text: #e4e7e1; --muted: #9aa095; --line: #2a302d;
  --nav: #0a0c0c; --nav-text: #a7ada2;
  --accent: #66805a; --accent-hover: #74906a; --accent-soft: #233021; --accent-light: #a9c08f; --link: #a9c08f;
  --income: #6cc28a; --expense: #e58376; --warn: #e0ac4f;
  --input-border: #353c38; --soft: #1f2523; --hover: #222826;
  --badge-bg: #262c2a; --ok-bg: #1f3325; --bad-bg: #3a2220; --warn-bg: #352c1a;
  --msg-ok-bg: #1b2b1f; --msg-ok-border: #2f4a35; --msg-ok-text: #a9d6b2;
  --msg-err-bg: #2f1c1a; --msg-err-border: #5a2f2a; --msg-err-text: #f0b1a8;
  --bar-bg: #262c2a; --hl-bg: #2a1e1c; --vc-bg: #1c2a20; --toolbar-border: #2f3b2c;
  --chart-in: #7f9a6b; --chart-out: #c96e63;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0f1211; --card: #171b1a; --surface: #1c2120; --text: #e4e7e1; --muted: #9aa095; --line: #2a302d;
    --nav: #0a0c0c; --nav-text: #a7ada2;
    --accent: #66805a; --accent-hover: #74906a; --accent-soft: #233021; --accent-light: #a9c08f; --link: #a9c08f;
    --income: #6cc28a; --expense: #e58376; --warn: #e0ac4f;
    --input-border: #353c38; --soft: #1f2523; --hover: #222826;
    --badge-bg: #262c2a; --ok-bg: #1f3325; --bad-bg: #3a2220; --warn-bg: #352c1a;
    --msg-ok-bg: #1b2b1f; --msg-ok-border: #2f4a35; --msg-ok-text: #a9d6b2;
    --msg-err-bg: #2f1c1a; --msg-err-border: #5a2f2a; --msg-err-text: #f0b1a8;
    --bar-bg: #262c2a; --hl-bg: #2a1e1c; --vc-bg: #1c2a20; --toolbar-border: #2f3b2c;
    --chart-in: #7f9a6b; --chart-out: #c96e63;
    color-scheme: dark;
  }
}
.card { background: var(--card); }
.cal .day { background: var(--card); }
.btn.light { color: var(--link); border-color: var(--accent); }
.link-btn { color: var(--link); }
.nav-light a.active { color: var(--link); }
/* в тёмной теме у бейджей «ок/плохо» текст светлее */
.badge.ok { color: var(--income); } .badge.bad { color: var(--expense); }
/* переключатель темы */
.theme-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.theme-pick label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 14px; border: 1px solid var(--input-border);
  border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 500; }
.theme-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.theme-pick label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.theme-pick .dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--input-border); }
.theme-pick .dot.l { background: #f4f1ea; } .theme-pick .dot.d { background: #171b1a; }
.theme-pick .dot.s { background: linear-gradient(135deg, #f4f1ea 50%, #171b1a 50%); }
