:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --text: #16202a;
  --muted: #75808b;
  --line: #e5e9ee;
  --blue: #1769e0;
  --blue-soft: #e9f2ff;
  --green: #31a965;
  --orange: #ef941f;
  --purple: #8058c7;
  --yellow: #eabf36;
  --sk-blue: #2c84d8;
  --red: #de4d58;
  --shadow: 0 12px 32px rgba(23, 34, 45, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 18px 14px;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

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

.avatar-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--text);
  color: white;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.page {
  padding: 0 14px 22px;
}

.section-title {
  margin: 22px 4px 11px;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.card {
  border: 1px solid rgba(222, 227, 233, 0.9);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-header {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  margin-bottom: 10px;
}

.month-title {
  text-align: center;
}

.month-title h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.month-title button {
  margin-top: 3px;
  padding: 3px 8px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.view-switch {
  display: flex;
  width: fit-content;
  margin: 0 auto 12px;
  padding: 3px;
  border-radius: 12px;
  background: #e8ebef;
}

.view-switch button {
  min-height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.view-switch button.active {
  background: white;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(30, 41, 53, 0.1);
}

.toolbar-wrap {
  position: sticky;
  z-index: 8;
  top: 0;
  margin: 0 -14px 12px;
  padding: 8px 14px 10px;
  overflow: hidden;
  background: rgba(244, 246, 248, 0.96);
  backdrop-filter: blur(14px);
}

.toolbar {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px;
  scrollbar-width: none;
}

.toolbar::-webkit-scrollbar {
  display: none;
}

.tool {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.015em;
  cursor: pointer;
}

.tool.active {
  border-color: transparent;
  color: white;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--tool-color) 32%, transparent);
  background: var(--tool-color);
}

.tool.done {
  border-color: var(--text);
  background: var(--text);
  color: white;
}

.banner-carousel {
  margin-bottom: 12px;
  touch-action: pan-y;
  user-select: none;
}

.turnus-banner {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 15px;
  border: 0;
  color: white;
  text-align: left;
  background: linear-gradient(135deg, #202c38, #35475a);
  cursor: grab;
}

.turnus-banner:active {
  cursor: grabbing;
}

.turnus-banner.banner-active {
  background: linear-gradient(135deg, #176d48, #258f61);
}

.turnus-banner.banner-planned {
  background: var(--tt-surface-elevated, #4a5662);
}

.turnus-banner.banner-empty {
  min-height: 102px;
  grid-template-columns: 1fr;
  background: linear-gradient(135deg, #4a5662, #697581);
}

.turnus-banner .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: #b9d0e5;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55d98d;
}

.turnus-banner h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.turnus-banner p {
  margin: 0;
  color: #cbd7e2;
  font-size: 12px;
}

.banner-money {
  align-self: center;
  text-align: right;
}

.banner-money strong {
  display: block;
  font-size: 20px;
}

.banner-money span {
  color: #cbd7e2;
  font-size: 10px;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-top: 7px;
}

.banner-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c5ccd3;
  cursor: pointer;
}

.banner-dot.active {
  width: 18px;
  border-radius: 99px;
  background: var(--blue);
}

.calendar-swipe-stage {
  position: relative;
  overflow: hidden;
  margin-top: 0;
  touch-action: pan-y;
  --calendar-drag-x: 0px;
}

.calendar-swipe-track {
  display: flex;
  width: 300%;
  transform: translateX(calc(-33.333333% + var(--calendar-drag-x)));
  transition: transform 0.24s ease;
  will-change: transform;
}

.calendar-swipe-stage.dragging .calendar-swipe-track {
  transition: none;
}

.calendar-swipe-panel {
  flex: 0 0 33.333333%;
  padding: 0 1px;
}

.calendar-swipe-arrows {
  position: absolute;
  z-index: 3;
  top: 13px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.calendar-swipe-arrows span {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: rgba(23, 105, 224, 0.08);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  box-shadow: none;
  opacity: 0.75;
}

.calendar-card {
  padding: 7px 6px;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}

.calendar-card.paint-mode {
  touch-action: none;
}

.calendar-card-title {
  padding: 2px 0 1px;
  color: #6f7a85;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday {
  padding: 5px 0 7px;
  color: #8b949d;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.day-cell {
  position: relative;
  min-width: 0;
  min-height: 66px;
  padding: 4px 2px;
  border: 0;
  border-top: 1px solid #eef1f4;
  border-left: 1px solid #eef1f4;
  background: white;
  cursor: pointer;
}

.day-cell:nth-child(7n + 1) {
  border-left: 0;
}

.day-cell.overflow {
  opacity: 0.18;
}

.day-cell.future .segments {
  opacity: 0.58;
}

.day-number {
  position: relative;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  margin-bottom: 2px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.day-cell.today .day-number {
  outline: 2px solid var(--blue);
  outline-offset: -1px;
  color: var(--blue);
  background: white;
}

.calendar-card.turnus-highlight-mode .day-cell.dimmed-by-turnus {
  opacity: 0.22;
}

.calendar-card.turnus-highlight-mode .day-cell.highlighted-turnus-day {
  z-index: 1;
  background: #f3fbf7;
  box-shadow: inset 0 0 0 2px rgba(49, 169, 101, 0.38);
}

.calendar-card.turnus-highlight-mode .day-cell.highlighted-turnus-day .day-number {
  color: white;
  background: var(--green);
}

.segments {
  display: flex;
  width: 100%;
  min-height: 31px;
  overflow: hidden;
  border-radius: 6px;
}

.segment {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  color: white;
  font-size: 7px;
  font-weight: 850;
  line-height: 1.15;
}

.segment small {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  font-size: 7px;
  font-weight: 700;
  text-overflow: clip;
  white-space: nowrap;
}

.type-roadOut,
.type-roadBack {
  background: var(--purple);
}

.type-workDE {
  background: var(--green);
}

.type-sun {
  background: var(--orange);
}

.type-home {
  color: #3d3515;
  background: var(--yellow);
}

.type-workSK {
  background: var(--sk-blue);
}

.type-holiday {
  background: var(--red);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  padding: 13px 8px 2px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  touch-action: pan-y;
  user-select: none;
}

.mini-month {
  min-width: 0;
  padding: 7px 4px 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.mini-month:active {
  transform: scale(0.98);
}

.mini-month:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.mini-month h3 {
  margin: 0 0 5px;
  text-align: center;
  font-size: 10px;
  text-transform: uppercase;
}

.mini-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px 0;
}

.mini-day {
  display: grid;
  place-items: center;
  width: min(100%, 15px);
  height: 15px;
  min-width: 0;
  margin: 0 auto;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 5.5px;
  line-height: 1;
}

.mini-day.has-data {
  color: white;
  background: var(--mini-color);
}

.mini-day.future {
  opacity: 0.55;
}

.mini-day.overflow {
  opacity: 0;
  pointer-events: none;
}

.mini-day.today {
  outline: 1.5px solid var(--blue);
  outline-offset: 1px;
}

.list-stack {
  display: grid;
  gap: 11px;
}

.turnus-card {
  width: 100%;
  padding: 17px;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.turnus-card.active-card {
  border-color: #9eddbb;
  background: linear-gradient(135deg, #f5fff9, white);
}

.turnus-card.planned-card {
  border-color: var(--tt-border-strong, #d4d4d4);
  background: var(--tt-surface-elevated, #f8f8f8);
}

.turnus-card.planned-card .pill {
  border-color: var(--tt-border-strong, #d4d4d4);
  background: transparent;
  color: var(--tt-text-primary, #26313a);
}

.card-topline,
.card-metrics,
.setting-row,
.detail-row,
.sheet-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.turnus-card h3 {
  margin: 5px 0 4px;
  font-size: 18px;
}

.turnus-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.turnus-card .turnus-rate-summary {
  margin-top: 5px;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
}

.turnus-finance-badge {
  display: inline-flex;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 5px 9px 5px 6px;
  border-radius: 999px;
  align-items: center;
  background: #eef1f4;
  color: #63717e;
}

.turnus-finance-badge-icon {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  place-items: center;
  background: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  font-weight: 900;
}

.turnus-finance-badge strong {
  overflow: hidden;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.turnus-finance-badge.paid {
  background: #def6e8;
  color: #18824b;
}

.turnus-finance-badge.partly-paid {
  background: #eaf8ef;
  color: #2b8052;
}

.turnus-finance-badge.waiting {
  background: #fff0d7;
  color: #925e08;
}

.turnus-finance-badge.invoice {
  background: #edf4ff;
  color: #315fba;
}

.turnus-hero {
  padding: 18px;
  border-radius: 24px;
  color: white;
  background: linear-gradient(135deg, #1f3144, #132232);
}

.turnus-hero .card-topline {
  color: #bfd0df;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.turnus-hero .pill {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.turnus-hero > strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(34px, 10vw, 48px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.turnus-hero p {
  margin: 8px 0 0;
  color: #c8d5df;
  font-size: 13px;
}

.turnus-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.turnus-finance-grid > div {
  min-width: 0;
  padding: 11px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
}

.turnus-finance-grid span {
  display: block;
  min-height: 22px;
  color: #b8c7d4;
  font-size: 8.5px;
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
}

.turnus-finance-grid strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: white;
  font-size: clamp(15px, 4.3vw, 20px);
  line-height: 1.05;
  text-overflow: ellipsis;
}

.turnus-finance-grid small {
  display: block;
  margin-top: 5px;
  color: #d9e4ec;
  font-size: 9px;
  font-weight: 800;
}

.turnus-finance-status {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  color: #c8d5df;
  font-size: 10px;
}

.turnus-finance-status strong {
  color: white;
}

.turnus-finance-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.turnus-finance-actions button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.13);
  color: white;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.turnus-finance-actions button:active {
  background: rgba(255, 255, 255, 0.22);
}

.turnus-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.turnus-hero-grid.completed,
.turnus-hero-grid.status-active,
.turnus-hero-grid.status-completed,
.turnus-hero-grid.status-planned {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.turnus-hero-grid div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.turnus-hero-grid span {
  display: block;
  color: #b8c7d4;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.turnus-hero-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.turnus-hero-grid small {
  display: block;
  margin-top: 5px;
  color: #d9e4ec;
  font-size: 11px;
  font-weight: 850;
}

.turnus-countdown {
  font-weight: 800;
}

.turnus-mini-calendar {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #cfeedd;
  border-radius: 24px;
  background: linear-gradient(180deg, #f2fff7, #ffffff);
}

.turnus-mini-calendar h3 {
  margin: 0 0 9px;
  font-size: 14px;
}

.turnus-month-block + .turnus-month-block {
  margin-top: 16px;
}

.turnus-month-title {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.turnus-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 5px;
  color: #7c8a95;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.turnus-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.turnus-day-spacer {
  min-height: 42px;
}

.turnus-day-chip {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 4px 2px;
  border: 1px solid #d8e7df;
  border-radius: 12px;
  background: white;
  color: var(--text);
  box-shadow: 0 4px 10px rgba(18, 34, 50, 0.05);
}

.turnus-day-states {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: flex;
}

.turnus-day-states > span {
  flex: 1 1 0;
  min-width: 0;
}

.turnus-day-number,
.turnus-day-type {
  position: relative;
  z-index: 1;
  display: block;
  color: inherit;
  line-height: 1.05;
  text-align: center;
}

.turnus-day-number {
  font-size: 16px;
  font-weight: 950;
  color: var(--text);
}

.turnus-day-type {
  margin-top: 3px;
  color: #6f7c87;
  font-size: 8px;
  font-weight: 900;
}

.turnus-day-chip.has-state {
  color: white;
  border-color: transparent;
}

.turnus-day-chip.has-state .turnus-day-number {
  color: white;
}

.turnus-day-chip.has-state .turnus-day-type {
  color: rgba(255, 255, 255, 0.82);
}

.turnus-day-chip.light-state,
.turnus-day-chip.light-state .turnus-day-number,
.turnus-day-chip.light-state .turnus-day-type {
  color: #3d3515;
}

.turnus-day-chip.today {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.highlight-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-color: #cfeedd;
  background: #f2fff7;
}

.highlight-notice span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.highlight-notice strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.highlight-notice button {
  width: auto;
  min-width: 76px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf1f5;
  color: #66727d;
  font-size: 10px;
  font-weight: 800;
}

.pill.active {
  background: #dff7e9;
  color: #18824b;
}

.money {
  color: #15804a;
  font-size: 19px;
  font-weight: 850;
}

.card-metrics {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid #edf0f3;
}

.metric-mini {
  flex: 1;
}

.metric-mini strong {
  display: block;
  font-size: 14px;
}

.metric-mini span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.overview-page {
  display: grid;
  gap: 12px;
}

.overview-page .section-title {
  margin-bottom: 0;
}

.overview-hero {
  padding: 20px;
  color: white;
  background: linear-gradient(135deg, #1769e0, #2f91ee);
}

.overview-hero > span,
.overview-card-head span,
.motivation-card span {
  color: inherit;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-hero p {
  margin: 16px 0 3px;
  color: #dbeaff;
  font-size: 13px;
}

.overview-hero strong {
  display: block;
  font-size: clamp(42px, 13vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.overview-hero-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-top: 15px;
  color: #e5f0ff;
  font-size: 12px;
  font-weight: 750;
}

.overview-payment-alert,
.overview-payment-ok {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
}

.overview-payment-alert {
  background: rgba(255, 224, 174, 0.18);
  color: #fff1d7;
}

.overview-payment-ok {
  background: rgba(202, 255, 222, 0.17);
  color: #d9ffe7;
}

.overview-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-color: var(--tt-border-strong, #d4d4d4);
  background: var(--tt-surface, #f8f8f8);
}

.overview-plan-card div {
  display: grid;
  gap: 3px;
}

.overview-plan-card span {
  color: var(--tt-text-secondary, #65707a);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.overview-plan-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.overview-plan-card strong {
  flex: 0 0 auto;
  color: var(--tt-text-primary, #26313a);
  font-size: 22px;
  letter-spacing: -0.04em;
}

.overview-card,
.motivation-card {
  padding: 16px;
}

.overview-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #70808f;
}

.overview-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.overview-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.mini-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.progress-head strong {
  color: var(--text);
}

.progress-bar {
  height: 9px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8edf2;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #31a965, #73d39a);
}

.overview-inline-motivation {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 13px;
  background: #effbf4;
  color: #208151;
}

.overview-inline-motivation span {
  font-size: 14px;
}

.overview-inline-motivation strong {
  font-size: 12px;
  line-height: 1.3;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.overview-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-metric {
  padding: 12px;
  border-radius: 16px;
  box-shadow: none;
}

.overview-metric span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.overview-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.overview-metric small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.overview-note {
  margin-top: 12px !important;
  font-weight: 850;
}

.overview-travel-note {
  margin-top: 11px !important;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f5f1ff;
  color: #6f52aa !important;
  font-weight: 800;
  line-height: 1.35;
}

.record-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.record-row strong {
  color: var(--text);
  text-align: right;
}

.motivation-card {
  border-color: #cfeedd;
  background: linear-gradient(135deg, #f1fff6, #ffffff);
}

.motivation-card span {
  color: var(--green);
}

.motivation-card strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.period-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 1px 12px;
  scrollbar-width: none;
}

.period-tabs button {
  flex: 0 0 auto;
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.period-tabs button.active {
  border-color: var(--text);
  background: var(--text);
  color: white;
}

.stats-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 11px;
  padding: 14px;
}

.stats-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.stats-controls select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.quarter-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.quarter-picker button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--muted);
  font-weight: 900;
}

.quarter-picker button.active {
  border-color: var(--blue);
  background: #edf4ff;
  color: var(--blue);
}

.stats-hero {
  padding: 20px;
  color: white;
  background: linear-gradient(135deg, #1769e0, #318ee9);
}

.stats-hero p {
  margin: 0;
  color: #d9eaff;
  font-size: 12px;
}

.stats-hero strong {
  display: block;
  margin: 5px 0 12px;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.stats-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.stats-finance-grid > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.stats-finance-grid small {
  color: #d9eaff;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.stats-finance-grid b {
  overflow: hidden;
  color: white;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-finance-grid .needs-payment {
  background: rgba(255, 198, 107, 0.2);
}

.stats-finance-grid .is-paid {
  background: rgba(178, 248, 204, 0.18);
}

.stats-status-line {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.11);
  color: #e7f2ff;
  font-size: 10px;
  font-weight: 750;
}

.stats-status-line strong {
  display: inline;
  margin: 0;
  font-size: inherit;
  letter-spacing: normal;
}

.stats-status-line.planned {
  color: #fff0cd;
}

.stats-status-line.paid {
  color: #d9ffe7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 11px;
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.stats-chart {
  margin-top: 11px;
  padding: 16px;
}

.stats-chart h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  height: 150px;
  gap: 5px;
}

.bar-item {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
}

.bar {
  display: block;
  width: 100%;
  min-height: 6px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #36aa6b, #1769e0);
}

.bar-item small {
  margin-top: 5px;
  font-size: 7px;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.quarter-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 11px;
}

.quarter-card {
  padding: 14px;
  border: 1px solid var(--line);
  text-align: left;
}

.quarter-card.active {
  border-color: var(--blue);
  background: #f3f8ff;
}

.quarter-card span,
.quarter-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.quarter-card strong {
  display: block;
  margin: 5px 0;
  font-size: 18px;
}

.settings-group {
  margin-bottom: 14px;
  overflow: hidden;
}

.setting-row {
  min-height: 61px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.account-row {
  align-items: flex-start;
  padding-top: 14px;
  padding-bottom: 14px;
}

.account-main strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.account-actions {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.account-actions .pill {
  margin: 0;
}

.account-actions .cloud-syncing {
  color: #1967d2;
  background: #e8f1ff;
}

.account-actions .cloud-offline {
  color: #87620a;
  background: #fff2c7;
}

.account-actions .cloud-error {
  color: #b4232d;
  background: #ffe7e9;
}

.account-actions .secondary-button,
.account-actions .primary-button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 12px;
  font-size: 12px;
}

.setting-row label,
.setting-row .label {
  font-size: 13px;
  font-weight: 750;
}

.setting-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.setting-row input,
.setting-row select {
  width: 98px;
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  text-align: right;
}

.label-custom-head,
.label-custom-row {
  display: grid;
  grid-template-columns: 1fr 84px 64px;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
}

.label-custom-head {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.label-custom-row {
  border-top: 1px solid var(--line);
}

.label-custom-row strong {
  display: block;
  font-size: 12px;
}

.label-custom-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.label-custom-row input {
  width: 100%;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  text-align: center;
  font-weight: 800;
}

.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  border: 0;
  border-radius: 99px;
  background: #cbd2d9;
  cursor: pointer;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  content: "";
  transition: transform 0.18s;
}

.toggle.on {
  background: var(--green);
}

.toggle.on::after {
  transform: translateX(20px);
}

.danger-button,
.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 13px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border: 0;
  background: var(--blue);
  color: white;
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
}

.danger-button {
  width: 100%;
  border: 1px solid #f1bdc1;
  background: #fff5f5;
  color: #c83742;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 760px);
  min-height: calc(70px + env(safe-area-inset-bottom));
  margin: auto;
  padding: 7px 8px env(safe-area-inset-bottom);
  border-top: 1px solid rgba(218, 224, 230, 0.9);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: flex;
  min-height: 55px;
  border: 0;
  background: transparent;
  color: #8b949d;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 8.5px;
  font-weight: 750;
  cursor: pointer;
}

.nav-item.active {
  color: var(--blue);
}

.nav-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
}

.calendar-icon {
  border: 2px solid currentColor;
  border-radius: 5px;
}

.calendar-icon::before {
  position: absolute;
  top: 4px;
  right: 2px;
  left: 2px;
  border-top: 2px solid currentColor;
  content: "";
}

.suitcase-icon {
  top: 3px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.suitcase-icon::before {
  position: absolute;
  top: -6px;
  left: 5px;
  width: 6px;
  height: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  content: "";
}

.chart-icon {
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.chart-icon::before {
  position: absolute;
  right: 2px;
  bottom: 3px;
  left: 3px;
  height: 11px;
  border-bottom: 2px solid currentColor;
  transform: skewY(-38deg);
  content: "";
}

.settings-icon {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.settings-icon::after {
  position: absolute;
  inset: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
  content: "";
}

.toast {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 92px;
  left: 18px;
  max-width: 500px;
  margin: auto;
  padding: 13px 16px;
  border-radius: 13px;
  background: #1c2732;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.has-action.visible {
  pointer-events: auto;
}

.toast.has-action > span {
  flex: 1;
  text-align: left;
}

.toast-action {
  flex: none;
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: white;
  color: #172535;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.modal-root.open {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(17, 25, 33, 0.42);
  backdrop-filter: blur(3px);
}

.sheet {
  width: min(100%, 760px);
  max-height: 90vh;
  padding: 9px 18px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  background: white;
  box-shadow: 0 -14px 40px rgba(14, 25, 36, 0.16);
  animation: sheet-in 0.22s ease-out;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 18px;
  border-radius: 10px;
  background: #d8dde2;
}

.sheet h2 {
  margin: 0 0 5px;
  font-size: 23px;
}

.sheet .subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.detail-block {
  margin: 12px 0;
  padding: 14px;
  border-radius: 15px;
  background: var(--surface-soft);
}

.finance-history {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #d8e3ef;
  border-radius: 17px;
  background: #f7faff;
}

.finance-history h3 {
  margin: 0 0 2px;
  font-size: 13px;
}

.finance-record-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 12px;
  background: white;
}

.finance-kind {
  min-width: 58px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #315fba;
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.finance-record-row.is-paid {
  box-shadow: inset 0 0 0 1px #cbead7;
  background: #fbfffc;
}

.finance-record-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.invoice-payment-status {
  display: block;
  width: fit-content;
  margin-top: 6px;
  padding: 4px 7px;
  border-radius: 8px;
  background: #fff2d4;
  color: #79500a;
  font-size: 10px;
  font-weight: 800;
}

.invoice-payment-status.paid {
  background: #def6e8;
  color: #18824b;
}

.finance-record-actions {
  grid-column: 2 / -1;
}

.invoice-payment-button {
  min-height: 44px;
  padding: 8px 13px;
  border: 0;
  border-radius: 10px;
  background: #18824b;
  color: white;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.invoice-payment-button.undo {
  border: 1px solid #cdd9e5;
  background: white;
  color: #536473;
}

.finance-legacy-help {
  margin: 0 0 5px;
  color: #79500a;
  font-size: 11px;
  line-height: 1.5;
}

.finance-kind.payment {
  background: #def6e8;
  color: #18824b;
}

.finance-record-row strong,
.finance-record-row small {
  display: block;
}

.finance-record-row strong {
  font-size: 13px;
}

.finance-record-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.finance-delete-button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  place-items: center;
  background: #fff0f1;
  color: #c83742;
  font-size: 18px;
  cursor: pointer;
}

.detail-row {
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row span {
  color: var(--muted);
}

.form-field {
  display: grid;
  gap: 6px;
  margin: 13px 0;
}

.form-field label {
  font-size: 11px;
  font-weight: 800;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.form-section {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.form-section .form-field:first-child {
  margin-top: 0;
}

.form-section .form-field:last-of-type {
  margin-bottom: 12px;
}

.finance-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.finance-form-grid .form-field {
  min-width: 0;
}

.finance-calendar-card {
  margin: 12px 0 16px;
  padding: 13px;
  border: 1px solid #d7e5f2;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.finance-calendar-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.finance-calendar-heading strong,
.finance-calendar-heading small {
  display: block;
}

.finance-calendar-heading strong {
  font-size: 14px;
}

.finance-calendar-heading small {
  max-width: 260px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.finance-period-state:not(:empty) {
  flex: none;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e5f7ed;
  color: #18824b;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.finance-range-actions {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}

.finance-range-actions button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #d8e2ec;
  border-radius: 10px;
  background: white;
  color: #526273;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.finance-range-actions button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.finance-selection-actions {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.finance-selection-actions > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.finance-selection-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

.finance-period-summary {
  display: grid;
  gap: 2px;
  margin: 10px 0;
  padding: 10px 11px;
  border-radius: 12px;
  background: #162b3f;
  color: white;
}

.finance-period-summary span {
  color: #b9cad9;
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.finance-period-summary strong {
  font-size: 12px;
}

.finance-turnus-calendar {
  padding: 10px;
  border: 1px solid #dbe4ec;
  border-radius: 15px;
  background: white;
}

.finance-turnus-calendar.origin {
  border-color: #a9dfc1;
  background: #f6fff9;
}

.finance-multi-turnus-list {
  display: grid;
  gap: 10px;
}

.finance-turnus-calendar-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.finance-turnus-calendar-title strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-turnus-calendar-title span {
  flex: none;
  color: var(--muted);
  font-size: 8px;
}

.finance-month-block + .finance-month-block {
  margin-top: 13px;
}

.finance-month-title {
  margin-bottom: 6px;
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.finance-weekdays,
.finance-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.finance-weekdays {
  margin-bottom: 4px;
  color: #87929c;
  font-size: 7px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.finance-day-spacer {
  min-height: 39px;
}

.finance-day {
  display: grid;
  min-width: 0;
  min-height: 39px;
  padding: 3px 1px;
  border: 1px solid #dfe6ec;
  border-radius: 9px;
  place-content: center;
  background: #f7f9fb;
  color: var(--text);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.finance-day-number,
.finance-day-type {
  display: block;
  line-height: 1;
}

.finance-day-number {
  font-size: 11px;
  font-weight: 950;
}

.finance-day-type {
  margin-top: 3px;
  overflow: hidden;
  font-size: 6px;
  font-weight: 900;
  text-overflow: ellipsis;
}

.finance-day.turnus-type-roadOut,
.finance-day.turnus-type-roadBack {
  border-color: #d8c9f1;
  background: #eee8fa;
  color: #6840ac;
}

.finance-day.turnus-type-workDE {
  border-color: #bde7cf;
  background: #e7f8ee;
  color: #187f49;
}

.finance-day.turnus-type-sun {
  border-color: #f5d3a6;
  background: #fff1de;
  color: #a85d08;
}

.finance-day.turnus-type-home {
  border-color: #eedc9d;
  background: #fff7d8;
  color: #83630a;
}

.finance-day.turnus-type-workSK {
  border-color: #bfd9f3;
  background: #e7f2fd;
  color: #2169ae;
}

.finance-day.turnus-type-holiday {
  border-color: #f2c3c8;
  background: #fdebed;
  color: #b8323e;
}

.finance-day.already-invoiced,
.finance-day.already-invoiced:disabled {
  border-color: #9fcdb3;
  background: repeating-linear-gradient(135deg, #dff3e7 0, #dff3e7 7px, #d5eddf 7px, #d5eddf 14px);
  color: #1c7447;
  box-shadow: inset 0 0 0 1px rgba(28, 116, 71, 0.08);
}

.finance-day.not-worked-yet,
.finance-day.not-worked-yet:disabled {
  border-color: #e0e5ea;
  background: #f1f3f5;
  color: #9aa3ac;
}

.finance-day.not-invoiceable:not(.already-invoiced):not(.not-worked-yet) {
  filter: saturate(0.45);
  opacity: 0.5;
}

.finance-day:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.finance-day.selected {
  border-color: #1769e0;
  background: #1769e0;
  color: white;
  box-shadow: 0 4px 9px rgba(23, 105, 224, 0.22);
}

.finance-day.range-start,
.finance-day.range-end {
  outline: 2px solid #0e417f;
  outline-offset: 1px;
}

.finance-day.today:not(.selected) {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.finance-adjacent-turnuses {
  margin-top: 10px;
  border-top: 1px solid #e1e8ef;
}

.finance-adjacent-turnuses summary {
  padding-top: 10px;
  color: #496173;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
}

.finance-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  margin-top: 9px;
  color: #64717d;
  font-size: 8px;
  font-weight: 800;
}

.finance-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.finance-calendar-legend i {
  width: 9px;
  height: 9px;
  border: 1px solid #d5dce2;
  border-radius: 3px;
}

.finance-calendar-legend i.already-invoiced {
  border-color: #9fcdb3;
  background: #dff3e7;
}

.finance-calendar-legend i.selected-day {
  border-color: #1769e0;
  background: #1769e0;
}

.finance-calendar-legend i.not-worked-yet {
  background: #f1f3f5;
}

.finance-lock-message {
  margin: 9px 0 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: #fff5df;
  color: #8b5c04;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
}

.finance-lock-message.hidden {
  display: none;
}

.finance-adjacent-list {
  display: grid;
  gap: 9px;
  margin-top: 9px;
}

.finance-turnus-calendar.adjacent {
  background: #fafbfc;
}

.finance-turnus-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #e3e9ef;
}

.finance-turnus-select-row > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.finance-turnus-select-row button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #b9cce0;
  border-radius: 9px;
  background: #fff;
  color: #355873;
  font-size: 8px;
  font-weight: 900;
  cursor: pointer;
}

.finance-turnus-select-row button.selected {
  border-color: #1769e0;
  background: #e7f0ff;
  color: #1769e0;
}

.finance-allocation-preview {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #cfe4d8;
  border-radius: 15px;
  background: #f5fcf8;
}

.finance-allocation-preview h3 {
  margin: 0 0 8px;
  color: #276c49;
  font-size: 11px;
}

.finance-allocation-preview > div {
  display: grid;
  gap: 6px;
}

.finance-allocation-preview > div > p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.finance-allocation-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 10px;
  background: white;
}

.finance-allocation-preview-row strong,
.finance-allocation-preview-row small {
  display: block;
}

.finance-allocation-preview-row strong {
  font-size: 10px;
}

.finance-allocation-preview-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.finance-auto-help {
  margin-top: -7px;
}

.finance-calculation {
  margin: 7px 0 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: #edf7f1;
  color: #1f7047;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
}

.finance-more {
  margin-top: 13px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.finance-more summary {
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.trash-entry {
  display: flex;
  width: 100%;
  min-height: 68px;
  padding: 14px 16px;
  border: 1px dashed #cfd7df;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.trash-entry strong,
.trash-entry small {
  display: block;
}

.trash-entry strong {
  font-size: 13px;
}

.trash-entry small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.trash-count {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  place-items: center;
  background: #edf1f5;
  color: #66727d;
  font-size: 11px;
  font-weight: 900;
}

.trash-list {
  display: grid;
  gap: 9px;
}

.trash-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  align-items: center;
  background: var(--surface-soft);
}

.trash-record strong,
.trash-record span,
.trash-record small {
  display: block;
}

.trash-record span,
.trash-record small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.trash-record button {
  width: auto;
}

.trash-record-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.trash-permanent-button {
  min-height: 32px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--tt-error, #c83f48);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

@media (max-width: 420px) {
  .trash-record {
    grid-template-columns: 1fr;
  }

  .trash-record-actions {
    grid-template-columns: 1fr 1fr;
    justify-items: stretch;
  }

  .trash-record-actions button {
    width: 100%;
  }
}

.compact-empty {
  padding: 24px 16px;
}

.turnus-edit-section {
  border-color: #d6e2f6;
  background: linear-gradient(135deg, #f7faff, #ffffff);
}

.day-turnus-link {
  margin-top: 14px;
}

.confirmation-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 13px;
  border-radius: 15px;
  place-items: center;
  font-size: 23px;
  font-weight: 900;
}

.road-confirmation-icon {
  background: #eee8ff;
  color: #7352c5;
}

.danger-confirmation-icon {
  background: #fff0f1;
  color: #c83742;
}

.payment-confirmation-icon {
  background: #def6e8;
  color: #18824b;
}

.confirmation-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.delete-turnus-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}

.delete-turnus-summary div {
  display: grid;
  min-width: 0;
  min-height: 70px;
  padding: 10px;
  border-radius: 13px;
  align-content: center;
  background: var(--surface-soft);
}

.delete-turnus-summary strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
}

.delete-turnus-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.conditional-field {
  display: none;
}

.conditional-field.visible {
  display: grid;
}

.delete-help {
  margin: -5px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.delete-options {
  display: grid;
  gap: 9px;
}

.delete-option {
  display: flex;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  align-items: center;
  justify-content: space-between;
  color: white;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.delete-option small {
  font-size: 11px;
  opacity: 0.8;
}

.form-field input,
.form-field select,
.form-field textarea {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.form-field textarea {
  min-height: 118px;
  padding-top: 12px;
  font: inherit;
  resize: vertical;
}

.sheet-actions {
  margin-top: 18px;
}

.sheet-actions button {
  flex: 1;
}

.sheet-actions.stacked-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.sheet-actions.stacked-actions button {
  width: 100%;
}

.auth-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--red);
  font-size: 12px;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.full-button {
  width: 100%;
}

.empty-state {
  padding: 38px 22px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 7px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@keyframes sheet-in {
  from {
    transform: translateY(30px);
    opacity: 0.6;
  }
}

@media (min-width: 600px) {
  .page {
    padding-right: 22px;
    padding-left: 22px;
  }

  .toolbar-wrap {
    margin-right: -22px;
    margin-left: -22px;
    padding-right: 22px;
    padding-left: 22px;
  }

  .day-cell {
    min-height: 78px;
  }

  .segment,
  .segment small {
    font-size: 8px;
  }

  .year-grid {
    gap: 11px;
  }

  .mini-month {
    padding: 10px 8px;
  }

  .mini-day {
    width: min(100%, 22px);
    height: 22px;
    font-size: 7px;
  }
}
