/* Дизайн-система личного кабинета БухСистемы (по ТЗ от 25.08.2026).
   Палитра: Graphite #202526 · Electric Teal #26A69A · Soft Teal #8CD5CD · фон #F4F6F5 */

:root {
  --teal: #26A69A;
  --teal-dark: #1e8a80;
  --teal-soft: #8CD5CD;
  --teal-bg: #E9F5F3;
  --graphite: #202526;
  --ink: #202526;
  --muted: #667174;
  --line: #E2E8E6;
  --bg: #F4F6F5;
  --white: #fff;
  --r: 16px;
  --warn: #E8912D;
  --danger: #D9534F;
  --ok: #2E9E5B;
  --stat: #8E6FD8; /* статотчётность */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.cab-body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "General Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
}

/* ---------- Каркас ---------- */
.cab-app { display: flex; min-height: 100vh; }
.cab-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cab-content { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 26px 28px 60px; }

/* ---------- Sidebar ---------- */
.sb {
  width: 240px; flex: none; background: var(--white); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sb .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.sb .brand img { width: 30px; height: 30px; }
.sb nav { padding: 4px 10px 10px; flex: 1; }
.sb .sec { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; margin: 18px 10px 6px; }
.sb a.it {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; margin: 1px 0;
  transition: background .15s;
}
.sb a.it:hover { background: var(--bg); }
.sb a.it.on { background: var(--teal-bg); color: var(--teal-dark); font-weight: 600; }
.sb a.it.grp-on { color: var(--teal-dark); }
.sb a.it.sub { padding: 7px 12px 7px 40px; font-size: 13.5px; }
.sb a.it .ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sb a.it .count { margin-left: auto; background: var(--teal); color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 1px 7px; }
.sb a.it .tag-new { margin-left: auto; background: var(--teal-bg); color: var(--teal-dark); font-size: 10.5px; font-weight: 600; border-radius: 8px; padding: 2px 7px; }
.sb .plan-card {
  margin: 10px 14px 16px; background: var(--teal-bg); border-radius: 12px; padding: 13px 14px; font-size: 13px;
}
.sb .plan-card b { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.sb .plan-card .until { color: var(--muted); margin: 3px 0 8px; }
.sb .plan-card a { color: var(--teal-dark); font-weight: 600; text-decoration: none; }

/* ---------- Topbar ---------- */
.tb {
  background: var(--white); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 10px 22px; position: sticky; top: 0; z-index: 40;
}
.tb .burger { display: none; }
.tb .search { flex: 1; max-width: 480px; position: relative; }
.tb .search input {
  width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px;
  padding: 9px 12px 9px 36px; font: inherit; color: var(--ink); outline: none;
}
.tb .search input:focus { border-color: var(--teal-soft); background: #fff; }
.tb .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; }
.tb .spacer { flex: 1; }
.tb .ib { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); text-decoration: none; }
.tb .ib:hover { background: var(--bg); }
.tb .ib .ic { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; }
.tb .ib .dot { position: absolute; top: 5px; right: 6px; min-width: 15px; height: 15px; border-radius: 8px; background: var(--teal); color: #fff; font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.tb .me { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.tb .ava { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.tb .who { line-height: 1.2; font-size: 13.5px; }
.tb .who .nm { font-weight: 600; }
.tb .who .sub { color: var(--muted); font-size: 12px; }
.tb .bal { font-size: 13px; color: var(--teal-dark); text-decoration: none; font-weight: 600; background: var(--teal-bg); border-radius: 10px; padding: 8px 12px; white-space: nowrap; }

/* ---------- Компоненты ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.h1 { font-size: 24px; font-weight: 700; margin: 0; }
.h2 { font-size: 17px; font-weight: 650; margin: 0 0 14px; }
.sub { color: var(--muted); margin: 4px 0 0; }
.muted { color: var(--muted); }
.row { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--teal); color: #fff; border: 0; border-radius: 10px; height: 42px;
  padding: 0 18px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: background .15s;
}
.btn:hover { background: var(--teal-dark); }
.btn.sec { background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.btn.sec:hover { background: var(--bg); }
.btn.dark { background: var(--graphite); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 8px; }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 8px; padding: 3px 9px; font-size: 12px; font-weight: 600; }
.badge.free { background: var(--teal-bg); color: var(--teal-dark); }
.badge.pro { background: var(--graphite); color: #fff; }
.badge.own { background: #E7F3EB; color: var(--ok); }
.badge.soon { background: var(--bg); color: var(--muted); }
.badge.warn { background: #FCF1E2; color: var(--warn); }
.badge.late { background: #FBEAEA; color: var(--danger); }
.badge.stat { background: #EFEAF9; color: var(--stat); }

/* Метрики */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.metric { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; }
.metric .lbl { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; align-items: center; }
.metric .lbl .ic { width: 16px; height: 16px; stroke: var(--teal); fill: none; stroke-width: 1.9; }
.metric .val { font-size: 24px; font-weight: 700; margin-top: 5px; }
.metric .mnote { color: var(--muted); font-size: 12px; }

/* Карточка курса на дашборде */
.course-card { flex: 1; min-width: 240px; display: flex; flex-direction: column; }
.course-card .lvl { font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--teal-dark); text-transform: uppercase; }
.course-card h3 { margin: 6px 0 2px; font-size: 15.5px; }
.course-card .next { color: var(--muted); font-size: 13px; margin: 6px 0 12px; flex: 1; }
.pbar { height: 6px; border-radius: 4px; background: var(--bg); overflow: hidden; margin-bottom: 12px; }
.pbar i { display: block; height: 100%; background: var(--teal); border-radius: 4px; transition: width .3s; }

/* Быстрый доступ */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.quick .card { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.quick .card .ic { width: 22px; height: 22px; stroke: var(--teal); fill: none; stroke-width: 1.9; stroke-linecap: round; }
.quick .card b { font-size: 14.5px; }
.quick .card p { margin: 0; color: var(--muted); font-size: 12.5px; flex: 1; }
.quick .card a { color: var(--teal-dark); font-weight: 600; text-decoration: none; font-size: 13.5px; }

/* Правая колонка */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.rcol { display: flex; flex-direction: column; gap: 16px; }
.rcol .card { padding: 16px 18px; }
.co-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bg); text-decoration: none; color: inherit; }
.co-row:last-of-type { border-bottom: 0; }
.co-row .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--teal-bg); display: flex; align-items: center; justify-content: center; flex: none; }
.co-row .ico .ic { width: 17px; height: 17px; stroke: var(--teal-dark); fill: none; stroke-width: 1.9; }
.co-row b { font-size: 13.5px; display: block; }
.co-row .muted { font-size: 12px; }

/* Событие календаря */
.ev { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bg); font-size: 13.5px; flex-wrap: wrap; }
.ev:last-child { border-bottom: 0; }
.ev .k { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ev .k.tax { background: var(--warn); }
.ev .k.stat { background: var(--stat); }
.ev .k.pay { background: var(--ok); }

/* Инструменты */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 20px; }
.chip { border: 1px solid var(--line); background: var(--white); border-radius: 18px; padding: 7px 15px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; }
.tool-card .cat { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tool-card h3 { margin: 0; font-size: 15px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.tool-card .foot2 { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* Empty state */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* Скелетоны */
.skel { background: linear-gradient(90deg, var(--bg) 25%, #eceff0 50%, var(--bg) 75%); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 8px; color: transparent !important; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Ойшы-виджет */
.oyshy-card { background: linear-gradient(135deg, #F2FBFA, #E9F5F3); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.oyshy-card img { width: 110px; }

/* ---------- Мобильная версия ---------- */
.mnav { display: none; }
@media (max-width: 1160px) {
  .dash { grid-template-columns: 1fr; }
  .rcol { flex-direction: row; flex-wrap: wrap; }
  .rcol .card { flex: 1; min-width: 240px; }
}
@media (max-width: 820px) {
  .sb { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .sb.open { transform: none; }
  .sb-veil { display: none; position: fixed; inset: 0; background: rgba(32,37,38,.35); z-index: 55; }
  .sb-veil.show { display: block; }
  .tb .burger { display: flex; }
  .tb .who, .tb .bal { display: none; }
  .cab-content { padding: 18px 14px 90px; }
  .mnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--white); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 10.5px; font-weight: 500; padding: 4px 0; }
  .mnav a.on { color: var(--teal-dark); }
  .mnav .ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; }
}

/* ---------- Календарь бухгалтера: Список / Год ---------- */
.bscal-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bscal-bar.wrap2 { row-gap: 8px; }
.bscal-title { font-size: 16px; margin-left: 4px; }
.bscal-spacer { flex: 1; }
.bscal-bar select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font: inherit; font-size: 13.5px; background: #fff; color: var(--ink); }
.bscal { position: relative; }
.seg2 { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg2 button { border: 0; background: #fff; font: inherit; font-size: 13.5px; font-weight: 500; padding: 9px 16px; cursor: pointer; color: var(--ink); }
.seg2 button.on { background: var(--teal-bg); color: var(--teal-dark); font-weight: 600; }
.bscal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.bscal-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }

.bsy { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 36px; row-gap: 30px; }
@media (max-width: 1200px) { .bsy { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .bsy { grid-template-columns: repeat(2, 1fr); } }
.bsy.one { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
.bsm-t { text-align: center; font-weight: 650; font-size: 14.5px; margin-bottom: 8px; }
.bsm-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.bsm-g .wd { text-align: center; font-size: 11px; font-weight: 500; color: var(--muted); padding: 3px 0; }
.bsm-g .wd.we { color: #C86A66; }
.bsm-g .dy { position: relative; border: 0; background: none; font: inherit; font-size: 12px; color: var(--ink);
  min-height: 32px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 4px 0 2px; }
.bsm-g .dy.we { color: #b06a67; }
.bsm-g .dy.has { cursor: pointer; }
.bsm-g .dy.has:hover { background: var(--bg); }
.bsm-g .dy.td > span { background: var(--teal); color: #fff; border-radius: 999px; width: 21px; height: 21px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
/* активная дата: подсвечены число и фон, а не мелкая точка */
.bsm-g .dy.has > span { border-radius: 999px; width: 22px; height: 22px; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 650; }
.bsm-g .dy.ev-plan > span { background: var(--teal-bg); color: var(--teal-dark); }
.bsm-g .dy.ev-done > span { background: #E7F2EA; color: #3E7D57; }
.bsm-g .dy.ev-soon > span { background: #FCF1E2; color: #A96B14; }
.bsm-g .dy.ev-late > span { background: #FBEAEA; color: var(--danger); }
.bsm-g .dy.ev-pre > span { background: #EEF1F0; color: var(--muted); } /* сроки до добавления компании */
.bsm-g .dy.td.has > span { box-shadow: 0 0 0 2px var(--teal); } /* сегодня + событие: кольцо поверх статусного фона */
.bsm-g .dy .cnt { font-style: normal; font-size: 9px; font-weight: 600; color: var(--muted); line-height: 1; margin-top: 1px; }
.bsm-g .dy.ev-done .cnt { color: #3E7D57; }
.bsm-g .dy.ev-late .cnt { color: var(--danger); }

/* popover дня (desktop hover) */
.bscal-pop { position: absolute; z-index: 60; background: var(--graphite); color: #fff; border-radius: 12px;
  padding: 12px 14px; width: 260px; font-size: 12.5px; box-shadow: 0 10px 30px rgba(32,37,38,.25); pointer-events: none; }
.bscal-pop b { font-size: 13px; }
.bscal-pop .pc { font-weight: 650; margin-top: 9px; color: #CDE9E5; }
.bscal-pop .pe { display: flex; gap: 7px; align-items: flex-start; margin-top: 5px; }
.bscal-pop .pe i { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 4px; }
.bscal-pop .pe em { display: block; font-style: normal; color: #AEB9B7; font-size: 11.5px; }
.bsm-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; }

.bscal .evrow .k { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.bscal-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 340px; max-width: 94vw; background: #fff;
  border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(32,37,38,.12); z-index: 75;
  transform: translateX(105%); transition: transform .2s; overflow-y: auto; }
.bscal-drawer.open { transform: none; }
.bscal-drawer .inner2 { padding: 18px; }
.bscal-veil { display: none; position: fixed; inset: 0; background: rgba(32,37,38,.25); z-index: 72; }
.bscal-veil.show { display: block; }
.bscal-devent { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--bg); font-size: 13.5px; }
.bscal-devent .k { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; }
