/* Демо-CRM бизнес-клуба «Общий стол». Тема: глубокий синий и медь, адаптив от 320px. */

:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ink: #1c2433;
  --ink-2: #4a5568;
  --muted: #4a5568;
  --line: #dbe3ee;
  --line-soft: #e9eef5;
  --line-strong: #c3cede;
  --bg: #eef2f8;
  --bg-soft: #f7f9fc;
  --surface: #ffffff;

  --navy: #23395b;
  --navy-dark: #1a2b45;
  --navy-soft: #e6ecf5;
  --navy-text: #d7e1ef;

  --copper: #b5602a;
  --copper-strong: #b05c26;
  --copper-dark: #8f4a1e;
  --copper-soft: #f7e9de;
  --copper-line: #e3c1a8;
  --copper-light: #f2c7a6;

  --ok: #2f7d4f;
  --ok-bg: #eaf6ef;
  --ok-line: #b9dec7;

  --danger: #b42318;
  --danger-bg: #fdecea;
  --danger-line: #f2c6c1;

  --warn-ink: #7a4b00;
  --warn-bg: #fff4d6;
  --warn-line: #ecd49a;

  --topbar-h: 112px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(28, 36, 51, 0.05);
  --shadow-md: 0 14px 36px rgba(28, 36, 51, 0.11);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--copper-dark);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--copper);
  outline-offset: 2px;
}

.sidebar :focus-visible,
.login-brand :focus-visible,
.toast :focus-visible {
  outline-color: var(--copper-light);
}

/* Экран входа */

.login {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-soft);
}

#login-screen {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  overflow: hidden;
  padding: 40px clamp(28px, 4.6vw, 70px);
  color: #ffffff;
  background: linear-gradient(158deg, var(--navy) 0%, var(--navy-dark) 100%);
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 38px 38px;
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -150px;
  bottom: -190px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(242, 199, 166, 0.32);
  border-radius: 50%;
  box-shadow:
    0 0 0 64px rgba(255, 255, 255, 0.035),
    0 0 0 128px rgba(255, 255, 255, 0.022);
  pointer-events: none;
}

.login-brand > * {
  position: relative;
  z-index: 1;
}

.login-brand-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 11px;
  color: #ffffff;
  background: var(--navy);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.brand-mark .icon {
  width: 23px;
  height: 23px;
  stroke-width: 1.7;
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.brand-slogan {
  margin-top: 1px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.brand-light .brand-name {
  color: #ffffff;
}

.brand-light .brand-slogan {
  color: rgba(255, 255, 255, 0.84);
}

.brand-mark-light {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: none;
}

.login-chip {
  flex: none;
  padding: 4px 10px;
  border: 1px solid rgba(242, 199, 166, 0.66);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--copper-light);
}

.login-copy {
  max-width: 570px;
}

.login-copy h1 {
  margin: 12px 0 16px;
  font-size: clamp(32px, 4vw, 50px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.login-lead {
  max-width: 48ch;
  font-size: 15px;
  line-height: 1.62;
  color: rgba(255, 255, 255, 0.88);
}

.login-features {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 26px 0 0;
  list-style: none;
}

.login-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.92);
}

.login-check {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(47, 125, 79, 0.82);
}

.login-check .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}

.login-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 34px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.login-facts strong {
  display: block;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--copper-light);
}

.login-facts span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.login-address {
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.login-panel {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  padding: 34px;
  background: var(--bg-soft);
}

.login-card {
  width: 100%;
  max-width: 424px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.login-card h2,
#login-title {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.login-sub {
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--muted);
}

.login-card .field {
  margin-bottom: 14px;
}

.login-card .form-error,
#login-error {
  margin: 0 0 12px;
}

.login-hint {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--navy-soft);
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: center;
}

.login-hint b {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.login-note {
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.login-foot {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Верхняя панель */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(28, 36, 51, 0.02);
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 11px 26px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 3px 3px 3px 10px;
  border-left: 1px solid var(--line-soft);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.user-info {
  display: none;
  line-height: 1.25;
  min-width: 0;
}

.user-info b {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.user-info span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.btn-logout {
  margin-left: 2px;
}

#top-deadlines,
.top-deadlines {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.topbar-board {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 26px 11px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line-soft);
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.board-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

#top-deadlines {
  overflow-x: auto;
  padding: 3px 2px;
  scrollbar-width: thin;
}

.strip-empty {
  font-size: 12px;
  color: var(--muted);
}

.dchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  max-width: 290px;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.4;
  white-space: nowrap;
}

.dchip:hover {
  border-color: var(--copper);
  background: var(--copper-soft);
}

.dchip b {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.dchip em {
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: normal;
  color: var(--muted);
}

.dchip.st-overdue {
  border-color: var(--danger-line);
  background: var(--danger-bg);
}

.dchip.st-overdue b {
  color: var(--danger);
}

.dchip.st-soon {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.dchip.st-soon b {
  color: var(--warn-ink);
}

.dchip.st-pending {
  border-color: #c6d4e7;
  background: var(--navy-soft);
}

.dchip.st-pending b {
  color: var(--navy);
}

.dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--ok);
}

.st-overdue .dot {
  background: var(--danger);
}

.st-soon .dot {
  background: var(--copper);
}

.st-pending .dot {
  background: var(--navy);
}

.st-done .dot {
  background: var(--ok);
}

.strip-more {
  flex: none;
  min-height: 36px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  color: var(--copper-dark);
  background: transparent;
  border: 1px dashed var(--copper-line);
  border-radius: 999px;
  white-space: nowrap;
}

.strip-more:hover {
  background: var(--copper-soft);
}

/* Каркас */

.app,
#app {
  min-width: 0;
}

#nav-count-residents,
#nav-count-meetings,
#nav-count-guests,
#nav-count-dues,
#nav-count-referrals,
#nav-count-tasks {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  overflow: auto;
  padding: 18px 12px 26px;
  background: var(--navy);
  border-right: 1px solid var(--navy-dark);
  scrollbar-width: thin;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--navy-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}

.nav-item .icon {
  width: 17px;
  height: 17px;
  color: #b9c8dc;
}

.nav-item:hover {
  background: var(--navy-dark);
  color: #ffffff;
}

.nav-item:hover .icon {
  color: var(--copper-light);
}

.nav-item.is-active {
  background: var(--copper-strong);
  color: #ffffff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #ffffff;
}

.nav-item.is-active .icon {
  color: #ffffff;
}

.nav-count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.nav-count.is-danger,
.is-danger {
  color: var(--danger);
}

.nav-count.is-danger {
  background: var(--danger-bg);
}

.sidebar-foot {
  margin-top: 22px;
  padding: 14px 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-note {
  font-size: 11px;
  line-height: 1.55;
  color: #c3d0e2;
}

.sidebar-note b {
  display: block;
  margin-bottom: 2px;
  color: #ffffff;
  font-size: 11.5px;
}

.sidebar-version {
  margin-top: 10px;
  font-size: 10.5px;
  color: #c3d0e2;
}

.main {
  min-width: 0;
  padding: 26px 30px 60px;
}

#main {
  min-width: 0;
}

/* Заголовок раздела */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin: 2px 0 18px;
}

.page-title {
  margin: 0 0 5px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.page-sub {
  max-width: 78ch;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* Кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  height: 44px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  border-color: var(--copper-strong);
  background: var(--copper-strong);
  color: #ffffff;
}

.btn-primary:hover {
  border-color: var(--copper-dark);
  background: var(--copper-dark);
}

.btn-outline {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--ink-2);
}

.btn-outline:hover {
  border-color: var(--copper);
  background: var(--copper-soft);
  color: var(--copper-dark);
}

.btn-quiet {
  color: var(--muted);
}

.btn-quiet:hover {
  background: var(--navy-soft);
  color: var(--navy);
}

.btn-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  border-color: #8f1b13;
  background: #8f1b13;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  border-color: var(--line);
  background: #eef1f6;
  color: #5b6472;
  cursor: not-allowed;
  transform: none;
}

.btn-sm {
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-sm .icon {
  width: 14px;
  height: 14px;
}

.btn-block {
  width: 100%;
  height: 48px;
}

/* Формы */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.field input,
.field select,
.field textarea,
.control {
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  font-size: 16px;
}

.field textarea {
  height: auto;
  min-height: 76px;
  padding: 9px 10px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.search-box input::placeholder {
  color: #6b7280;
  opacity: 1;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.control:focus,
.search-box input:focus {
  border-color: var(--copper);
  outline: 3px solid rgba(181, 96, 42, 0.3);
  outline-offset: 0;
}

.control-sm {
  min-height: 40px;
  height: 40px;
  padding: 0 8px;
  font-size: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
}

.field-span-2 {
  grid-column: span 2;
}

.field-span-3 {
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
}

.form-error {
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
}

.inline-form {
  padding: 16px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.inline-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.inline-form-head h3 {
  font-size: 17px;
  font-weight: 700;
}

.inline-form-head p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.attend-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.attend-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--copper);
}

/* Карточки метрик */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.kpi-card {
  padding: 13px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  margin: 4px 0 2px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.kpi-note {
  font-size: 11.5px;
  color: var(--muted);
}

.kpi-card.tone-danger .kpi-value {
  color: var(--danger);
}

.kpi-card.tone-warn .kpi-value {
  color: var(--warn-ink);
}

.kpi-card.tone-success .kpi-value {
  color: var(--ok);
}

.kpi-card.tone-copper .kpi-value {
  color: var(--copper-dark);
}

/* Панели */

.panel {
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.panel-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.panel-body {
  padding: 18px;
}

/* Тулбар и фильтры */

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 11px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line-soft);
}

.toolbar-spacer {
  flex: 1;
}

.search-box {
  position: relative;
  flex: 1 1 250px;
  max-width: 340px;
  min-width: 170px;
}

.search-box .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 15px;
  height: 15px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 16px;
}

.control {
  width: auto;
  padding: 0 9px;
}

/* Таблицы */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data thead th {
  padding: 9px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.data tbody tr:last-child td {
  border-bottom: 0;
}

.data tbody tr {
  transition: background 0.14s ease;
}

.data tbody tr:hover {
  background: var(--bg-soft);
}

.data tr.row-late {
  background: #fff6f5;
}

.data tr.row-late:hover {
  background: #ffefed;
}

.data tr.row-soon {
  background: #fffaf0;
}

.data tr.row-soon:hover {
  background: #fff5dc;
}

.data tr.row-late td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

.data tr.row-soon td:first-child {
  box-shadow: inset 3px 0 0 var(--copper);
}

.cell-main {
  display: block;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.cell-sub {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.cell-money {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-date {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-date.is-danger {
  color: var(--danger);
  font-weight: 700;
}

.cell-actions {
  width: 1%;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cell-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--copper-dark);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.cell-link:hover {
  color: var(--navy);
}

/* Бейджи и метки */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.badge .dot {
  width: 5px;
  height: 5px;
}

.badge-ok {
  border-color: var(--ok-line);
  background: var(--ok-bg);
  color: var(--ok);
}

.badge-overdue {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-soon {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.badge-pending {
  border-color: #c6d4e7;
  background: var(--navy-soft);
  color: var(--navy);
}

.badge-neutral {
  border-color: var(--line);
  background: #eef1f6;
  color: var(--ink-2);
}

.badge-copper {
  border-color: var(--copper-line);
  background: var(--copper-soft);
  color: var(--copper-dark);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef1f6;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-navy {
  border-color: #c6d4e7;
  background: var(--navy-soft);
  color: var(--navy);
}

.tag-copper {
  border-color: var(--copper-line);
  background: var(--copper-soft);
  color: var(--copper-dark);
}

.tag-neutral {
  border-color: var(--line);
  background: #eef1f6;
  color: var(--ink-2);
}

/* Календарь встреч */

.calendar-panel .panel-head {
  align-items: flex-start;
}

.month-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.month-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink-2);
}

.month-btn:hover {
  border-color: var(--copper);
  background: var(--copper-soft);
  color: var(--copper-dark);
}

.month-btn .icon {
  width: 15px;
  height: 15px;
}

.month-label {
  min-width: 148px;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  white-space: nowrap;
}

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

.cal-weekday {
  padding: 8px 10px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.cal-weekday.is-weekend {
  color: var(--copper-dark);
}

.cal-day {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 92px;
  padding: 6px 7px 7px;
  background: #ffffff;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.cal-day:nth-child(7n) {
  border-right: 0;
}

.cal-day.is-weekend {
  background: var(--bg-soft);
}

.cal-day.is-empty {
  background: var(--bg-soft);
}

.cal-day.is-today {
  background: #fdf3ec;
  box-shadow: inset 0 0 0 2px var(--copper);
}

.cal-num {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cal-day.is-today .cal-num > span:first-child {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin: -2px 0 0 -3px;
  border-radius: 50%;
  background: var(--copper-strong);
  color: #ffffff;
  font-weight: 700;
}

.cal-day.is-weekend .cal-num > span:first-child {
  color: var(--muted);
}

.cal-day.is-today.is-weekend .cal-num > span:first-child {
  color: #ffffff;
}

.cal-count {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
}

.cal-marks {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cal-mark {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 22px;
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  text-align: left;
}

.cal-mark:hover {
  background: var(--copper-soft);
  color: var(--copper-dark);
}

.cal-mark .dot {
  width: 5px;
  height: 5px;
}

.cal-mark-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-mark.st-overdue {
  background: var(--danger-bg);
  color: var(--danger);
}

.cal-mark.st-soon {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.cal-mark.st-pending {
  background: var(--navy-soft);
  color: var(--navy);
}

.cal-mark.st-done {
  background: var(--ok-bg);
  color: var(--ok);
}

.cal-more {
  padding-left: 4px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
}

/* Пустое состояние, уведомления, подтверждение */

.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--navy-soft);
  color: var(--navy);
}

.empty b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 14px;
}

.empty span {
  font-size: 12.5px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.5;
}

.notice .icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.notice-text {
  flex: 1;
  overflow-wrap: anywhere;
}

.notice-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -3px -5px -3px 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  opacity: 0.8;
}

.notice-close:hover {
  background: rgba(28, 36, 51, 0.08);
  opacity: 1;
}

.notice-close .icon {
  width: 14px;
  height: 14px;
}

.notice-success {
  border-color: var(--ok-line);
  background: var(--ok-bg);
  color: var(--ok);
}

.notice-info {
  border-color: #c6d4e7;
  background: var(--navy-soft);
  color: var(--navy);
}

.notice-danger {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}

.reset-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-md);
  background: var(--warn-bg);
}

.reset-confirm b {
  display: block;
  font-size: 13.5px;
  color: var(--warn-ink);
}

.reset-confirm p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-2);
}

.reset-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast,
#toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--navy-dark);
  color: #ffffff;
  font-size: 12.5px;
  box-shadow: 0 12px 30px rgba(28, 36, 51, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.is-error {
  background: var(--danger);
}

/* Факты и списки */

.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 22px;
}

.facts-grid span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.facts-grid b {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.fact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}

.fact-line > span:first-child {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.fact-line:last-child {
  border-bottom: 0;
}

.fact-line .cell-sub {
  margin-top: 2px;
}

.hint {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Воронка гостей */

.funnel {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.funnel-col {
  min-width: 0;
  padding: 9px;
  background: #e9eef6;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.funnel-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 3px 9px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.funnel-col-head b {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ffffff;
  font-size: 11px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.funnel-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.funnel-empty {
  padding: 12px 4px;
  text-align: center;
}

.guest-card {
  min-width: 0;
  padding: 11px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.guest-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.guest-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
}

.guest-title {
  min-width: 0;
  line-height: 1.3;
}

.guest-title b {
  display: block;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.guest-title span {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.guest-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 9px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.guest-step {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  padding: 6px 7px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.4;
}

.guest-step .icon {
  width: 13px;
  height: 13px;
  flex: none;
}

.guest-step span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.guest-step time {
  flex: none;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.guest-step.is-late {
  background: var(--danger-bg);
  color: var(--danger);
}

.guest-step.is-late time {
  color: var(--danger);
}

.guest-step.is-empty {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.guest-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.guest-actions .control {
  flex: 1 1 110px;
  min-width: 0;
}

.guest-actions .btn {
  flex: 0 0 auto;
}

/* Отчёты */

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

.report-grid .panel {
  margin-bottom: 0;
}

.report-grid .span-2 {
  grid-column: 1 / -1;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 116px;
  align-items: center;
  gap: 12px;
}

.bar-name {
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.bar-name span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 400;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--navy-soft);
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  border-radius: 999px;
  background: var(--navy);
}

.bar-fill.is-ok {
  background: var(--ok);
}

.bar-fill.is-oak {
  background: var(--copper);
}

.bar-fill.is-copper {
  background: var(--copper);
}

.bar-fill.is-danger {
  background: var(--danger);
}

.bar-value {
  color: var(--ink-2);
  font-size: 11.5px;
  text-align: right;
  white-space: nowrap;
}

.bar-value b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.report-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* Адаптив */

@media (min-width: 1200px) {
  .user-info {
    display: block;
  }
}

@media (max-width: 1180px) {
  .funnel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  :root {
    --topbar-h: 109px;
  }

  .topbar-main {
    padding: 10px 18px;
  }

  .topbar-board {
    padding: 0 18px 10px;
    gap: 14px;
  }

  .main {
    padding: 22px 20px 52px;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 8px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--navy-dark);
  }

  .nav {
    flex-direction: row;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .nav::-webkit-scrollbar {
    height: 6px;
  }

  .nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
  }

  .nav::-webkit-scrollbar-track {
    background: transparent;
  }

  #top-deadlines {
    overflow-x: visible;
    flex-wrap: wrap;
  }

  .dchip {
    max-width: 100%;
    white-space: normal;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 12px;
    white-space: nowrap;
  }

  .nav-item.is-active {
    box-shadow: inset 0 -3px 0 #ffffff;
  }

  .sidebar-foot {
    display: none;
  }

  .main {
    padding: 20px 18px 48px;
  }

  .funnel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .login-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  #login-screen {
    align-content: start;
  }

  .login-brand {
    gap: 18px;
    padding: 22px 20px 24px;
  }

  .login-copy h1 {
    max-width: 22ch;
    margin: 8px 0 12px;
    font-size: 28px;
  }

  .login-lead,
  .login-features,
  .login-address {
    display: none;
  }

  .login-facts {
    margin-top: 16px;
    padding-top: 14px;
  }

  .login-facts strong {
    font-size: 22px;
  }

  .login-panel {
    place-items: center;
    padding: 22px 20px 28px;
    gap: 14px;
  }

  .login-card {
    padding: 24px;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
  }

  .topbar-main {
    padding: 10px 14px;
    gap: 8px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .topbar-reset span,
  .btn-logout span {
    display: none;
  }

  .topbar-reset,
  .btn-logout {
    width: 44px;
    padding: 0;
  }

  .user {
    gap: 7px;
    padding-left: 6px;
  }

  .topbar-board {
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    padding: 0 14px 10px;
  }

  .month-nav {
    justify-content: flex-start;
    gap: 12px;
  }

  .month-label {
    min-width: 0;
    font-size: 15px;
  }

  #top-deadlines {
    width: 100%;
    overflow-x: visible;
    flex-wrap: wrap;
    padding: 3px 0;
  }

  .dchip {
    max-width: 100%;
    white-space: normal;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 15px;
  }

  .page-title {
    font-size: 26px;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .toolbar {
    padding: 10px 12px;
  }

  .search-box {
    max-width: none;
    flex-basis: 100%;
  }

  .inline-form {
    padding: 14px;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-span-2,
  .field-span-3 {
    grid-column: 1 / -1;
  }

  .panel-head {
    padding: 12px 14px;
  }

  .panel-body {
    padding: 14px;
  }

  .cal-weekday {
    padding: 6px 2px;
    font-size: 9px;
    text-align: center;
  }

  .cal-day {
    min-height: 64px;
    padding: 4px;
    gap: 3px;
  }

  .cal-num {
    font-size: 10.5px;
  }

  .cal-day.is-today .cal-num > span:first-child {
    min-width: 18px;
    height: 18px;
  }

  .cal-count {
    display: none;
  }

  .cal-marks {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
  }

  .cal-mark {
    width: 9px;
    height: 9px;
    min-height: 9px;
    padding: 0;
    overflow: visible;
    border-radius: 50%;
    background: transparent;
  }

  .cal-mark .dot {
    width: 9px;
    height: 9px;
  }

  .cal-mark-text {
    display: none;
  }

  .cal-mark.st-overdue,
  .cal-mark.st-soon,
  .cal-mark.st-pending,
  .cal-mark.st-done {
    background: transparent;
  }

  .cal-more {
    padding: 0;
    font-size: 8px;
    line-height: 9px;
  }

  .report-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-grid .span-2 {
    grid-column: auto;
  }

  .bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
  }

  .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .bar-value {
    grid-row: 1;
  }
}

@media (max-width: 720px) {
  .table-wrap {
    overflow: visible;
  }

  .data thead {
    display: none;
  }

  .data,
  .data tbody,
  .data tr,
  .data td {
    display: block;
    width: 100%;
  }

  .data tr {
    margin: 0 0 10px;
    padding: 4px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
  }

  .data tbody tr:hover {
    background: #ffffff;
  }

  .data tr.row-late,
  .data tr.row-late:hover {
    background: #fff6f5;
  }

  .data tr.row-soon,
  .data tr.row-soon:hover {
    background: #fffaf0;
  }

  .data tr.row-late td:first-child,
  .data tr.row-soon td:first-child {
    box-shadow: none;
  }

  .data td {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 6px 12px;
    border: 0;
    font-size: 13px;
  }

  .data td::before {
    content: attr(data-label);
    padding-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .data td.cell-actions {
    display: block;
    padding-top: 9px;
    padding-bottom: 8px;
  }

  .data td.cell-actions::before {
    display: none;
  }

  .data td.cell-actions .row-actions {
    width: 100%;
  }

  .data td.cell-actions .btn {
    flex: 1;
  }

  .data td.cell-actions .control {
    width: 100%;
  }

  .data tr.is-empty-row {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .data tr.is-empty-row td {
    display: block;
    padding: 0;
  }

  .data tr.is-empty-row td::before {
    display: none;
  }
}

@media (max-width: 560px) {
  .brand-slogan {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .brand-name {
    font-size: 18px;
  }

  .user-info {
    display: none;
  }

  .main {
    padding: 16px 12px 42px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-sub {
    font-size: 12.5px;
  }

  .kpi-grid,
  .kpi-grid.is-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .kpi-card {
    padding: 11px 12px 12px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .kpi-label {
    font-size: 9.5px;
  }

  .kpi-note {
    font-size: 10.5px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }

  .reset-confirm {
    align-items: stretch;
  }

  .reset-actions {
    width: 100%;
  }

  .reset-actions .btn {
    flex: 1;
  }

  .toolbar {
    gap: 7px;
  }

  .control {
    flex: 1 1 auto;
    min-width: 0;
  }

  .notice {
    font-size: 12px;
  }

  .funnel {
    grid-template-columns: minmax(0, 1fr);
  }

  .funnel-col {
    padding: 10px;
  }

  .facts-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-panel {
    padding: 18px 12px 24px;
  }

  .login-card {
    padding: 20px;
  }
}

@media (max-width: 400px) {
  .topbar-main {
    padding: 9px 12px;
  }

  .brand-name {
    font-size: 16px;
    white-space: nowrap;
  }

  .kpi-grid,
  .kpi-grid.is-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .month-nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-reset,
  .btn-logout {
    width: 40px;
  }

  .data td {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    padding: 6px 10px;
  }

  .cal-day {
    min-height: 54px;
    padding: 3px;
  }

  .cal-weekday {
    font-size: 8px;
    letter-spacing: 0.02em;
  }

  .cal-num {
    font-size: 10px;
  }

  .cal-day.is-today .cal-num > span:first-child {
    min-width: 16px;
    height: 16px;
  }

  .cal-mark,
  .cal-mark .dot {
    width: 7px;
    height: 7px;
  }

  .guest-actions .control {
    flex-basis: 100%;
  }

  .bar-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .bar-value {
    grid-row: auto;
    text-align: left;
  }

  .bar-track {
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
