/* Оформление в стиле сайта «Налоговый навигатор»: тёплый светлый фон, шалфейный зелёный,
   заголовки Literata, текст Golos Text. Шрифты лежат локально (static/fonts, лицензия OFL). */

@font-face { font-family: "Literata"; font-weight: 500; font-display: swap;
  src: url("fonts/literata-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Literata"; font-weight: 500; font-display: swap;
  src: url("fonts/literata-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+20BD, U+2122; }
@font-face { font-family: "Literata"; font-weight: 600; font-display: swap;
  src: url("fonts/literata-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Literata"; font-weight: 600; font-display: swap;
  src: url("fonts/literata-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+20BD, U+2122; }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap;
  src: url("fonts/golos-text-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap;
  src: url("fonts/golos-text-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+20BD, U+2122; }
@font-face { font-family: "Golos Text"; font-weight: 500; font-display: swap;
  src: url("fonts/golos-text-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 500; font-display: swap;
  src: url("fonts/golos-text-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+20BD, U+2122; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap;
  src: url("fonts/golos-text-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap;
  src: url("fonts/golos-text-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+20BD, U+2122; }

:root {
  --bg: #f6f4ef; --card: #ffffff; --soft: #ecf0e8; --beige: #e8e6de;
  --text: #202020; --muted: #565c57; --line: #dedcd3;
  --sage: #a3c6a3; --sage-hover: #93ba93; --green: #5c7360; --green-mid: #6e8571; --green-bg: #e4ece2;
  --red: #a8322b; --red-bg: #f6e3e0; --ochre: #8a6420; --ochre-bg: #f5ecd8; --cream: #fbf7ea;
  --slate: #4d5a6b; --slate-bg: #e6e9ee;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Golos Text", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--sans); background: var(--bg); color: var(--text); }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--sage); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 19px; margin: 0 0 12px; }
h2.section { margin: 26px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
h3 { font-size: 16px; margin: 16px 0 6px; }
code, .code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.container { max-width: 1280px; margin: 0 auto; padding: 24px 20px 40px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; }
.break { word-break: break-all; }
.nowrap { white-space: nowrap; }

/* Шапка — как на сайте: светлая, полупрозрачная, с тонкой линией снизу */
.topbar { background: rgba(246, 244, 239, .95); border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 24px; padding: 0 20px; position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(1.2) blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 10px 0; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand img { width: 34px; height: auto; display: block; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.brand-tag { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--green);
  border: 1px solid var(--sage); border-radius: 999px; padding: 1px 8px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; flex: 1; }
.nav a, .nav .link { color: var(--text); padding: 22px 9px 20px; display: block; font-size: 14.5px; font-weight: 500;
  border-bottom: 2px solid transparent; }
.nav a:hover { text-decoration: none; border-bottom-color: var(--line); }
.nav a.active { border-bottom-color: var(--sage); }
.nav form { margin-left: auto; }
.menu-toggle, .menu-button { display: none; }

/* Кнопки: «таблетки», основная — шалфейная, вторичная — с тёмной обводкой */
button, .button { font: 500 14.5px/1.3 var(--sans); cursor: pointer; border: 1.5px solid var(--text); background: transparent;
  color: var(--text); padding: 9px 20px; border-radius: 999px; display: inline-block; transition: background .15s, border-color .15s; }
button:hover, .button:hover { background: var(--card); text-decoration: none; color: var(--text); }
.primary, button.primary { background: var(--sage); border-color: var(--sage); color: var(--text); }
.primary:hover, button.primary:hover { background: var(--sage-hover); border-color: var(--sage-hover); }
.button.active { background: var(--green-bg); border-color: var(--green-mid); }
.danger { color: var(--red); border-color: #dcb4ae; }
.danger:hover { background: var(--red-bg); color: var(--red); }
button.small, .small button { padding: 4px 12px; font-size: 13px; border-width: 1px; }
button.link { background: none; border: none; padding: 0; color: var(--green); border-radius: 0; }
button.link:hover { background: none; text-decoration: underline; }
.nav button.link { color: var(--muted); padding: 22px 9px 20px; font-weight: 500; }
form.inline { display: inline; }

input, select, textarea { font: 15px/1.4 var(--sans); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); width: 100%; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(163, 198, 163, .35); }
textarea { resize: vertical; }
textarea.code, input.code { background: #faf9f5; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-weight: 500; font-size: 14px; }
.field.wide { grid-column: 1 / -1; }
.field .help, .help { color: var(--muted); font-size: 13px; }
.field .error { color: var(--red); font-size: 13px; }
.field.has-error input, .field.has-error select { border-color: var(--red); }
.req { color: var(--red); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 18px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: normal !important; }
.check input { width: auto; accent-color: var(--green); }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; grid-column: 1 / -1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 18px; }
.filters input, .filters select { width: auto; min-width: 180px; flex: 1 1 180px; }
.filters input[type=date] { flex: 0 1 170px; min-width: 150px; }
.filters button { flex: 0 0 auto; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--green); font-weight: 500; }
details form { margin-top: 12px; }
.danger-zone { margin: 20px 0; }

/* Карточки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(32, 32, 32, .03); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.cols > .card { margin-bottom: 0; }
.cols + .card, .cols + section { margin-top: 18px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.login { max-width: 420px; margin: 10vh auto; text-align: left; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-logo img { width: 48px; }
.login-logo span { font-family: var(--serif); font-weight: 600; font-size: 22px; }
.sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 28px; }
.props { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 5px 14px; margin: 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }

/* Списки и таблицы */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: none; }
.list.compact > li { padding: 5px 0; }
.list > li[class*="row-"] { padding-left: 10px; padding-right: 10px; margin: 0 -10px; border-radius: 8px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.card .table-wrap { border: none; border-radius: 0; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #faf9f5; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* Срочность */
.badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 9px; border-radius: 999px; background: var(--soft); color: var(--green); white-space: nowrap; }
.badge.overdue { background: var(--red); color: #fff; }
.badge.urgent { background: var(--red-bg); color: var(--red); }
.badge.soon { background: var(--ochre-bg); color: var(--ochre); }
.row-overdue { background: var(--red-bg); }
.row-urgent { background: #fbefed; }
.row-soon { background: var(--cream); }
.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 9px; border-radius: 999px; background: var(--beige); color: var(--muted); }
.tag.stage { background: var(--green-bg); color: var(--green); }

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--soft); border-left: 3px solid var(--green-mid); }
.flash.ok { background: var(--green-bg); color: var(--green); border-left-color: var(--sage); }
.flash.error { background: var(--red-bg); color: var(--red); border-left-color: var(--red); }
.flash.warn { background: var(--ochre-bg); color: var(--ochre); border-left-color: #c9a25a; }

/* Доски */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.column { background: var(--beige); border-radius: 14px; padding: 12px; min-height: 120px; }
.column h2 { font-family: var(--sans); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.column-won { background: var(--green-bg); }
.column-lost { background: #ebeae6; }
.tile { background: var(--card); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); }
.tile > a { font-weight: 500; }
.tile-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

/* Календарь */
.legend .item { display: inline-block; margin-right: 6px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.month .wd { background: #faf9f5; padding: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; }
.month .day { background: var(--card); min-height: 112px; padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.month .day.other { background: #faf9f5; }
.month .day.other .num { color: #b9b7ae; }
.month .day.weekend { background: #fcfbf8; }
.month .day.today { box-shadow: inset 0 0 0 2px var(--sage); }
.month .day.today .num { background: var(--sage); color: var(--text); border-radius: 999px; }
.month .num { font-size: 13px; color: var(--muted); align-self: flex-end; padding: 0 7px; }
.item { display: block; font-size: 12px; padding: 2px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.item:hover { text-decoration: none; filter: brightness(.96); color: var(--text); }
.item.deadline { background: var(--red-bg); color: var(--red); }
.item.deadline.overdue { background: var(--red); color: #fff; }
.item.control { background: var(--ochre-bg); color: var(--ochre); }
.item.event { background: var(--green-bg); color: var(--green); }
.item.task { background: var(--beige); color: var(--text); }
.item.lead { background: var(--slate-bg); color: var(--slate); }
.agenda-title { margin-top: 24px; }
.agenda > li > ul { list-style: none; padding: 4px 0 0; margin: 0; }
.agenda .item { display: inline-block; white-space: normal; }
.agenda li.today > strong { color: var(--green); }

/* Телефон */
@media (max-width: 900px) {
  .container { padding: 16px 14px 32px; }
  h1 { font-size: 24px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .menu-button { display: block; margin-left: auto; font-size: 26px; padding: 6px 4px; cursor: pointer; color: var(--text); }
  .nav { display: none; flex-direction: column; align-items: stretch; width: 100%; padding-bottom: 10px; }
  .nav a, .nav .link, .nav button.link { padding: 11px 4px; border-bottom: 1px solid var(--line); }
  .nav a.active { border-bottom-color: var(--line); color: var(--green); }
  .menu-toggle:checked ~ .nav { display: flex; }
  .nav form { margin-left: 0; }
  .hide-sm { display: none; }
  .month .day { min-height: 56px; }
  .month .day .item { display: none; }
  .month .day:has(.item)::after { content: "•"; color: var(--green-mid); text-align: center; font-size: 20px; line-height: 1; }
  .board { grid-auto-columns: 82vw; }
  .props { grid-template-columns: 1fr; }
  .props dt { margin-top: 6px; }
  input, select, textarea { font-size: 16px; } /* без автоувеличения на iPhone */
}
@media (max-width: 420px) { .brand-name { font-size: 16px; } }
@media (min-width: 901px) { .agenda-title, .agenda { display: none; } }
@media print { .topbar, .buttons, .filters, form, details { display: none !important; } body { background: #fff; } }
.text-red { color: var(--red); }

/* ---------- Календарь во весь экран (месяц, неделя, день) ---------- */
.container.wide { max-width: none; padding: 16px 20px 24px; }
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cal-left, .cal-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-title { margin: 0 0 0 10px; font-size: 26px; }
.segmented { display: inline-flex; border: 1.5px solid var(--text); border-radius: 999px; overflow: hidden; }
.segmented a { padding: 8px 16px; color: var(--text); font-weight: 500; font-size: 14.5px; }
.segmented a + a { border-left: 1px solid var(--line); }
.segmented a:hover { background: var(--card); text-decoration: none; }
.segmented a.active { background: var(--sage); }

.month.big { grid-template-rows: auto repeat(var(--weeks), minmax(92px, 1fr)); height: calc(100vh - 196px); min-height: 560px; }
.month.big .day { min-height: 0; overflow: hidden; padding: 6px 6px 4px; }
.month.big .day-head { display: flex; justify-content: space-between; align-items: center; }
.month.big .num { font-size: 15px; font-weight: 500; color: var(--text); padding: 2px 8px; align-self: auto; }
.month.big .day.other .num { color: #b9b7ae; }
.month.big .add { opacity: 0; color: var(--green); font-size: 18px; line-height: 1; padding: 0 4px; }
.month.big .day:hover .add { opacity: 1; text-decoration: none; }
.month.big .item { font-size: 13px; padding: 3px 7px; }
.item b { font-weight: 600; }

.tgrid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.tgrid { display: grid; grid-template-columns: 64px repeat(var(--days), minmax(120px, 1fr)); position: relative; }
.tg-corner, .tg-dayhead { position: sticky; top: 0; z-index: 3; background: #faf9f5; border-bottom: 1px solid var(--line); }
.tg-dayhead { padding: 10px 8px; text-align: center; color: var(--text); border-left: 1px solid var(--line); }
.tg-dayhead span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.tg-dayhead strong { font-family: var(--serif); font-size: 20px; margin-left: 4px; }
.tg-dayhead.today strong { background: var(--sage); border-radius: 999px; padding: 0 9px; }
.tg-dayhead:hover { text-decoration: none; background: var(--soft); color: var(--text); }
.tg-label { font-size: 11px; color: var(--muted); padding: 8px 6px; text-align: right; border-bottom: 2px solid var(--line); }
.tg-allday { border-left: 1px solid var(--line); border-bottom: 2px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-height: 34px; }
.tg-allday .item { font-size: 12.5px; }
.tg-hours { position: relative; }
.tg-hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.tg-hour:first-child { transform: none; }
.tg-col { position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)); }
.tg-col.weekend { background-color: #fcfbf8; }
.tg-col.today { background-color: #f7faf5; }
.tg-slot { position: absolute; left: 0; right: 0; height: var(--hour); }
.tg-slot:hover { background: rgba(163, 198, 163, .14); }
.tg-event { position: absolute; z-index: 2; overflow: hidden; border-radius: 8px; padding: 4px 8px;
  background: var(--green-bg); border-left: 3px solid var(--green-mid); color: var(--text); font-size: 12.5px; line-height: 1.3;
  box-shadow: 0 1px 2px rgba(32, 32, 32, .08); }
.tg-event:hover { text-decoration: none; background: #d8e6d5; color: var(--text); }
.tg-time { display: block; font-weight: 600; color: var(--green); }
.tg-name { display: block; font-weight: 500; }
.tg-sub { display: block; color: var(--muted); font-size: 12px; }
.tg-event.short { padding: 2px 8px; white-space: nowrap; text-overflow: ellipsis; }
.tg-event.short .tg-time, .tg-event.short .tg-name { display: inline; }
.tg-event.short .tg-sub { display: none; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 4; display: none; }
.tg-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

@media (max-width: 900px) {
  .container.wide { padding: 12px 10px 24px; }
  .cal-title { font-size: 20px; margin-left: 4px; width: 100%; order: 5; }
  .month.big { height: auto; min-height: 0; grid-template-rows: auto repeat(var(--weeks), 64px); }
  .month.big .add { display: none; }
  .tgrid { grid-template-columns: 48px repeat(var(--days), minmax(110px, 1fr)); }
}

/* Будущие повторения задач в календаре */
.item.ghost { opacity: .55; background: transparent; border: 1px dashed var(--line); }

/* Выбор месяца и года; фильтр гонораров */
.month-select { display: inline-flex; gap: 6px; }
.month-select select { width: auto; min-width: 0; }
.fee-filter { align-items: center; }
.fee-filter .month-select select { flex: 0 0 auto; }
.fee-filter > select { flex: 0 1 220px; min-width: 160px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }

.sort-link { color: var(--muted); }
.sort-link:hover { color: var(--text); text-decoration: none; }
