:root {
  --page: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f0f1f4;
  --surface-hover: #e9ebef;
  --sidebar: #111217;
  --sidebar-hover: #1b1d24;
  --sidebar-active: #252832;
  --text: #17181d;
  --text-soft: #62656f;
  --text-faint: #91949d;
  --inverse: #f7f7f8;
  --accent: #5e6ad2;
  --accent-hover: #4f5bc4;
  --accent-soft: #eceefe;
  --success: #2f8a58;
  --warning: #b96a18;
  --danger: #c24646;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-float: 0 8px 24px rgba(24, 25, 31, 0.08);
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

body.is-app {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(94, 106, 210, 0.32);
  outline-offset: 2px;
}

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

h1,
h2,
h3 {
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p {
  color: var(--text-soft);
  text-wrap: pretty;
}

.is-hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.bg-grid {
  display: none;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  height: 68px;
  margin: 0 auto;
}

body.is-app .topbar {
  display: none;
}

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

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--text);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

.brand-name {
  color: inherit;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.brand-subtitle {
  margin-top: 1px;
  color: var(--text-faint);
  font-size: 11px;
}

.topbar-actions,
.hero-actions,
.header-actions,
.role-switch,
.filter-row,
.legend,
.chip-cloud {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-link {
  padding: 8px 12px;
  color: var(--text-soft);
  text-decoration: none;
}

.ghost-link:hover {
  color: var(--text);
}

.login-button,
.secondary-button {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 140ms ease, transform 140ms ease;
}

.login-button:hover,
.secondary-button:hover {
  background: #2b2d35;
}

.login-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.login-button.large {
  min-height: 42px;
  padding-inline: 18px;
}

.landing {
  min-height: calc(100vh - 68px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  padding: 56px 0 84px;
  gap: clamp(40px, 7vw, 96px);
}

.hero-copy {
  max-width: 650px;
}

.eyebrow {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(48px, 6.4vw, 82px);
  font-weight: 650;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 60ch;
  margin-top: 28px;
  font-size: 17px;
  line-height: 1.65;
}

.hero-actions {
  align-items: flex-start;
  margin-top: 30px;
}

.hero-meta {
  display: grid;
  gap: 3px;
  padding: 2px 0 0 8px;
  color: var(--text-faint);
  font-size: 11px;
}

.hero-panel {
  position: relative;
  padding: 14px;
  border-radius: 16px;
  background: #e9ebf1;
  box-shadow: 0 30px 70px rgba(24, 25, 31, 0.12);
}

.panel-panel,
.mini-card {
  background: rgba(255, 255, 255, 0.88);
}

.panel-panel {
  min-height: 370px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

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

.mini-card {
  min-height: 110px;
  padding: 16px;
  border-radius: var(--radius-lg);
}

.mini-card.accent {
  background: var(--accent);
  color: #fff;
}

.mini-card p,
.mini-card.accent p {
  margin-top: 4px;
  color: inherit;
  opacity: 0.66;
  font-size: 12px;
}

.mini-label {
  margin-bottom: 20px;
  color: var(--text-faint);
  font-size: 11px;
}

.mini-card.accent .mini-label {
  color: rgba(255, 255, 255, 0.6);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.blueprint-figure {
  position: relative;
  height: 220px;
  margin: 26px 0 20px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #f0f1f4;
}

.wireframe {
  position: absolute;
  background: #dadde5;
}

.tower-a { left: 14%; top: 22%; width: 24%; height: 58%; }
.tower-b { left: 43%; top: 10%; width: 20%; height: 70%; }
.tower-c { right: 13%; top: 34%; width: 18%; height: 46%; }
.line { left: 9%; right: 9%; height: 2px; background: #c6cad5; }
.line-a { top: 80%; }
.line-b { top: 88%; }

.blueprint-notes {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-faint);
  font-size: 10px;
}

.chip,
.chip-soft,
.pill,
.role-pill,
.document-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 550;
}

.chip,
.chip-soft,
.pill,
.document-tag {
  padding: 5px 9px;
}

/* Полноэкранная рабочая область */
.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  min-height: 600px;
  overflow: hidden;
  background: var(--page);
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 600px;
  padding: 14px 10px 12px;
  overflow: hidden;
  background: var(--sidebar);
  color: var(--inverse);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 2px 6px 12px;
}

.sidebar .brand-mark,
.sidebar .brand-name {
  color: var(--inverse);
}

.sidebar .brand-subtitle {
  color: #777b87;
}

.collapse-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: var(--sidebar-hover);
  color: #a9acb6;
  cursor: pointer;
}

.collapse-button:hover {
  background: var(--sidebar-active);
  color: #fff;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  padding-top: 8px;
  scrollbar-width: thin;
  scrollbar-color: #343741 transparent;
}

.nav-item {
  display: grid;
  width: 100%;
  padding: 9px 10px;
  border-radius: 7px;
  background: transparent;
  color: #b2b5bf;
  cursor: pointer;
  text-align: left;
  transition: background-color 120ms ease, color 120ms ease;
}

.nav-item span {
  font-size: 13px;
  font-weight: 550;
}

.nav-item small {
  display: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ededf0;
}

.nav-item.is-active {
  background: var(--sidebar-active);
  color: #fff;
}

.sidebar-footer {
  display: grid;
  gap: 9px;
  margin-top: auto;
  padding: 12px 8px 4px;
  color: #8d909a;
}

.sidebar-label {
  margin-bottom: 5px;
  font-size: 10px;
}

.role-pill {
  padding: 5px 8px;
  background: var(--sidebar-hover);
  color: #d9dbe1;
}

.small-note {
  font-size: 10px;
  line-height: 1.4;
}

.content {
  min-width: 0;
  height: 100dvh;
  overflow-y: auto;
  background: var(--surface);
}

.content-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(12px);
}

.content-kicker {
  margin-bottom: 2px;
  color: var(--text-faint);
  font-size: 11px;
}

.content-header h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 620;
}

.header-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.role-switch,
.filter-row,
.legend,
.chip-cloud {
  flex-wrap: wrap;
}

.role-switch {
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-soft);
}

.role-chip,
.filter-chip {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
}

.role-chip:hover,
.filter-chip:hover {
  color: var(--text);
}

.role-chip.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 21, 26, 0.1);
}

.filter-chip.is-active {
  background: var(--text);
  color: #fff;
}

.secondary-button {
  background: var(--accent);
}

.secondary-button:hover {
  background: var(--accent-hover);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#contentBody {
  display: grid;
  gap: 22px;
  padding: 20px 28px 40px;
}

.panel {
  min-width: 0;
}

.panel > .panel-header {
  margin-bottom: 16px;
}

.panel h3,
.panel-card h3 {
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.015em;
}

.panel-header p {
  max-width: 65ch;
  margin-top: 3px;
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stat-card,
.role-card,
.report-card,
.panel-card {
  border-radius: var(--radius-lg);
  background: var(--page);
}

.stat-card {
  min-height: 112px;
  padding: 15px;
}

.stat-label,
.mini-label {
  color: var(--text-faint);
  font-size: 11px;
}

.stat-value {
  margin-top: 12px;
  font-size: 26px;
  font-weight: 620;
  letter-spacing: -0.04em;
}

.stat-value.warning {
  color: var(--warning);
}

.stat-sub {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 10px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: var(--radius-lg);
  background: var(--page);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 2px;
  min-width: 760px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 550;
}

td {
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
}

td:first-child {
  border-radius: 7px 0 0 7px;
  color: var(--text);
  font-weight: 550;
}

td:last-child {
  border-radius: 0 7px 7px 0;
  color: var(--text-faint);
}

tbody tr:hover td {
  background: var(--surface-hover);
}

.pill {
  background: #eceef2;
  color: #565a64;
  font-size: 10px;
}

.status-dot,
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.status-dot.warning,
.dot.amber { background: var(--warning); }
.status-dot.danger,
.dot.orange { background: var(--danger); }
.status-dot.muted,
.dot.gray { background: #9a9da5; }
.dot.green { background: var(--success); }

.split-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 24px;
}

.stack,
.timeline,
.metric-list,
.document-list,
.role-grid,
.report-cards {
  display: grid;
  gap: 6px;
}

.step-card,
.timeline-item,
.document-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius);
  background: var(--page);
}

.step-card:hover,
.timeline-item:hover,
.document-item:hover {
  background: var(--surface-hover);
}

.step-card span,
.timeline-item > span {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.step-card p,
.timeline-item p,
.document-item p {
  margin-top: 2px;
  font-size: 11px;
}

.panel-card,
.role-card,
.report-card {
  padding: 16px;
}

.progress-track {
  height: 6px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe1e7;
}

.progress-fill {
  width: 74%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.progress-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
  color: var(--text-faint);
  font-size: 10px;
}

.mini-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: var(--radius);
}

.mini-table div {
  padding: 10px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 11px;
}

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

.document-item {
  justify-content: space-between;
}

.document-tag {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
}

.checklist {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 12px;
}

.metric-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 4px;
  box-shadow: inset 0 -1px 0 #e2e4e9;
}

.metric-list div:last-child {
  box-shadow: none;
}

.metric-list span {
  color: var(--text-soft);
  font-size: 12px;
}

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

.role-card strong,
.report-card strong,
.timeline-item strong {
  font-size: 14px;
}

.filter-row {
  justify-content: flex-end;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-soft);
}

.accent-text {
  color: var(--accent);
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 780px;
  }

  .hero h1 {
    max-width: 14ch;
  }

  .app-shell {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .content-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .dashboard-grid,
  .role-grid,
  .report-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  body.is-app {
    overflow: auto;
  }

  .topbar,
  .hero {
    width: min(100% - 28px, 1180px);
  }

  .brand-subtitle,
  .ghost-link {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 52px 0 48px;
  }

  .hero h1 {
    font-size: clamp(44px, 14vw, 64px);
  }

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

  .hero-meta {
    padding-left: 0;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 8px;
  }

  .sidebar-top {
    min-height: 44px;
    padding: 0 2px 7px;
  }

  .sidebar-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 0;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 10px;
  }

  .sidebar-footer {
    display: none;
  }

  .content {
    height: auto;
    min-height: calc(100dvh - 96px);
    overflow: visible;
  }

  .content-header {
    position: static;
    min-height: 0;
    padding: 18px 14px 14px;
  }

  #contentBody {
    padding: 12px 14px 32px;
  }

  .dashboard-grid,
  .role-grid,
  .report-cards,
  .split-panel,
  .progress-meta,
  .mini-table {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .filter-row {
    justify-content: flex-start;
  }

  .table-wrap {
    margin-inline: -14px;
    width: calc(100% + 28px);
    border-radius: 0;
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .hero-panel,
  #contentBody > * {
    animation: appear 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .hero-panel {
    animation-delay: 60ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes appear {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Рабочая система CRM */
.app-shell { grid-template-columns: 196px minmax(0, 1fr); }
.app-shell { transition: grid-template-columns 180ms cubic-bezier(.22,1,.36,1); }
.app-shell.sidebar-collapsed { grid-template-columns: 52px minmax(0, 1fr); }
.sidebar { padding: 10px 8px; }
.sidebar-top { padding-inline: 4px; }
.sidebar .brand-subtitle { display: none; }
.project-context { display: grid; gap: 2px; margin: 2px 0 7px; padding: 9px; border-radius: 8px; background: var(--sidebar-hover); }
.project-context span, .project-context small { color: #777b87; font-size: 8px; }
.project-context strong { color: #eeeef1; font-size: 11px; font-weight: 600; }
.nav-group-label { padding: 10px 9px 3px; color: #626671; font-size: 8px; }
.nav-item { grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 7px 9px; }
.nav-item span { grid-column: 2; grid-row: 1; }
.nav-item b { grid-column: 3; grid-row: 1; min-width: 19px; padding: 1px 5px; border-radius: 999px; background: #252832; color: #8f939d; font-size: 8px; text-align: center; }
.nav-item.is-active b { background: #393d49; color: #e2e3e7; }
.nav-icon { display: grid; grid-column: 1; grid-row: 1; width: 18px; height: 18px; place-items: center; color: #8f939d; font-size: 13px; font-style: normal; font-weight: 600; }
.nav-icon.text-icon { font-size: 8px; }
.nav-item:hover .nav-icon, .nav-item.is-active .nav-icon { color: #fff; }
.sidebar-collapsed .sidebar { padding-inline: 7px; }
.sidebar-collapsed .sidebar-top { justify-content: center; }
.sidebar-collapsed .sidebar-top .brand, .sidebar-collapsed .project-context, .sidebar-collapsed .nav-group-label, .sidebar-collapsed .nav-item span, .sidebar-collapsed .nav-item b, .sidebar-collapsed .sidebar-footer { display: none; }
.sidebar-collapsed .nav-item { display: grid; grid-template-columns: 1fr; width: 38px; height: 38px; padding: 0; place-items: center; }
.sidebar-collapsed .nav-icon { grid-column: 1; justify-self: center; }
.exit-button { min-height: 32px; padding: 6px 10px; border-radius: 7px; background: var(--surface-soft); color: var(--text-soft); cursor: pointer; font-size: 10px; font-weight: 600; }
.exit-button:hover { background: var(--surface-hover); color: var(--text); }
.content-header { min-height: 70px; padding: 12px 18px; }
.content-header h2 { font-size: clamp(21px, 2.2vw, 28px); }
#contentBody { gap: 16px; padding: 14px 18px 30px; }
.role-select-label { display: flex; align-items: center; gap: 6px; color: var(--text-faint); font-size: 9px; }
.role-select, .plain-select, .report-filters button, .report-filters input { min-height: 32px; padding: 6px 9px; border: 0; border-radius: 7px; background: var(--surface-soft); color: var(--text); font: inherit; font-size: 10px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, .65fr); gap: 16px; }
.text-button, .link-button, .name-button, .plain-select { border: 0; background: transparent; color: var(--text-soft); cursor: pointer; }
.text-button { padding: 4px 0; color: var(--accent); font-size: 10px; font-weight: 600; }
.attention-list, .compact-list { display: grid; gap: 4px; }
.attention-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 54px; padding: 8px 9px; border-radius: 8px; background: var(--page); color: var(--text); cursor: pointer; text-align: left; }
.attention-row:hover { background: var(--surface-hover); }
.attention-row strong, .attention-row small, .compact-list strong, .compact-list small { display: block; }
.attention-row strong, .compact-list strong { font-size: 10px; }
.attention-row small, .compact-list small { margin-top: 2px; color: var(--text-faint); font-size: 8px; }
.risk-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.risk-mark.high { background: var(--warning); }
.risk-mark.overdue { background: var(--danger); }
.status-text { font-size: 9px; font-weight: 600; }
.status-text.high, .deadline.high { color: var(--warning); }
.status-text.overdue, .deadline.overdue { color: var(--danger); }
.compact-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 7px 3px; box-shadow: inset 0 -1px 0 #e2e4e9; }
.compact-list > div:last-child { box-shadow: none; }
.compact-list time { color: var(--text-faint); font-size: 8px; white-space: nowrap; }
.view-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.search-field { display: flex; flex: 1 1 220px; align-items: center; gap: 6px; min-height: 32px; padding: 5px 9px; border-radius: 7px; background: var(--surface-soft); color: var(--text-faint); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 10px; }
.stage-legend { display: flex; justify-content: flex-end; gap: 10px; margin: 0 2px 7px; color: var(--text-faint); font-size: 8px; }
.stage-legend span { display: inline-flex; align-items: center; gap: 4px; }
.ks-table-wrap { overflow: visible; }
.ks-table { min-width: 0; table-layout: fixed; border-spacing: 0 3px; }
.ks-table .c-id { width: 6%; }
.ks-table .c-name { width: 25%; }
.ks-table .c-building { width: 7%; }
.ks-table .c-price { width: 11%; }
.ks-table .c-stage { width: 5%; }
.ks-table .c-date { width: 11%; }
.ks-table th, .ks-table td { padding: 7px 4px; overflow: hidden; text-overflow: ellipsis; }
.ks-table th { font-size: 12px; text-align: center; white-space: normal; line-height: 1.1; }
.ks-table th:nth-child(-n+4), .ks-table th:last-child { text-align: left; }
.ks-table td { font-size: 11px; }
.link-button, .name-button { padding: 0; color: var(--text); font-size: 11px; font-weight: 600; text-align: left; }
.name-button { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ks-table td small { display: block; margin-top: 2px; overflow: hidden; color: var(--text-faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap .pill { font-size: 11px; }
.stage-cell { text-align: center; }
.stage-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.stage-dot.green { background: var(--success); }
.stage-dot.amber { background: #d69326; }
.stage-dot.orange { background: var(--danger); }
.stage-dot.gray { background: #a3a6ae; }
.abbr { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
.abbr > i { display: inline-grid; width: 11px; height: 11px; place-items: center; border-radius: 50%; background: #dfe1e7; color: #6f737d; font-size: 7px; font-style: normal; font-weight: 700; cursor: help; }
.abbr-tip { position: absolute; z-index: 90; left: 50%; bottom: calc(100% + 7px); width: max-content; max-width: 230px; padding: 6px 8px; border-radius: 6px; background: var(--sidebar); color: #fff; font-size: 9px; font-weight: 500; line-height: 1.35; opacity: 0; pointer-events: none; transform: translate(-50%, 3px); transition: opacity 120ms ease, transform 120ms ease; white-space: normal; }
.abbr:hover .abbr-tip { opacity: 1; transform: translate(-50%, 0); }
.abbr .abbr-tip { display: none; }
.global-tooltip { position: fixed; z-index: 1000; width: max-content; max-width: min(360px, calc(100vw - 20px)); padding: 6px 8px; border-radius: 2px; background: #fff3a6; color: #111; box-shadow: 0 2px 8px rgba(0,0,0,.22); font-size: 11px; font-weight: 500; line-height: 1.35; pointer-events: none; }
.directory-layout .table-wrap { overflow: visible; }
.fit-table, .report-table { min-width: 0; table-layout: fixed; }
.fit-table th, .fit-table td { overflow: hidden; text-overflow: ellipsis; }
.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.document-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) 26px; gap: 9px; padding: 11px; border-radius: 9px; background: var(--page); }
.file-mark { display: grid; width: 36px; height: 42px; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 8px; font-weight: 700; }
.document-card strong { font-size: 10px; }
.document-card p { margin-top: 3px; font-size: 9px; }
.document-card small { color: var(--text-faint); font-size: 8px; }
.icon-button { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 7px; background: var(--surface-soft); color: var(--text-soft); cursor: pointer; }
.report-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-bottom: 9px; }
.report-filters label { display: grid; gap: 3px; color: var(--text-faint); font-size: 8px; }
.report-filters button, .report-filters input { width: 100%; text-align: left; }
.report-summary { display: flex; gap: 18px; margin-bottom: 9px; padding: 9px 11px; border-radius: 8px; background: var(--page); color: var(--text-soft); font-size: 9px; }
.report-summary strong { margin-left: 3px; color: var(--text); }
.report-table th:first-child { width: 40%; }
.report-table td, .report-table th { padding-block: 6px; white-space: normal; }
.directory-layout { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 16px; }
.directory-nav { display: grid; align-content: start; gap: 2px; padding: 4px; border-radius: 9px; background: var(--page); }
.directory-nav button { padding: 8px 9px; border-radius: 7px; background: transparent; color: var(--text-soft); cursor: pointer; font-size: 10px; text-align: left; }
.directory-nav button:hover, .directory-nav button.is-active { background: var(--surface); color: var(--text); }
.role-note { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 12px; border-radius: 9px; background: var(--accent-soft); }
.role-note p { color: #545d9e; font-size: 10px; }
.detail-drawer { position: fixed; z-index: 60; top: 0; right: 0; width: min(460px, 100vw); height: 100dvh; overflow-y: auto; background: var(--surface); box-shadow: -12px 0 32px rgba(19,20,26,.14); }
body.drawer-open::after { position: fixed; z-index: 50; inset: 0; content: ""; background: rgba(15,16,20,.24); }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; padding: 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.drawer-head h3 { max-width: 350px; font-size: 17px; }
.drawer-section { padding: 14px 16px; box-shadow: inset 0 1px 0 #e8e9ed; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-grid div { display: grid; gap: 3px; }
.detail-grid span, .drawer-section-head > span { color: var(--text-faint); font-size: 8px; }
.detail-grid strong { font-size: 10px; }
.drawer-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.drawer-section h4 { margin: 0; font-size: 11px; }
.stage-list { display: grid; gap: 3px; }
.stage-list button { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px; border-radius: 7px; background: var(--page); color: var(--text); text-align: left; }
.stage-list button:not(:disabled) { cursor: pointer; }
.stage-list button:not(:disabled):hover { background: var(--surface-hover); }
.stage-list strong, .stage-list small { display: block; }
.stage-list strong { font-size: 9px; }
.stage-list small, .stage-list time { color: var(--text-faint); font-size: 8px; }
.toast { position: fixed; z-index: 80; right: 16px; bottom: 16px; max-width: 340px; padding: 10px 13px; border-radius: 8px; background: var(--sidebar); color: #fff; box-shadow: var(--shadow-float); font-size: 10px; }

.login-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 12px; background: var(--surface); box-shadow: 0 24px 70px rgba(16,17,22,.24); }
.login-dialog::backdrop { background: rgba(15,16,20,.42); backdrop-filter: blur(3px); }
.login-form { display: grid; gap: 12px; padding: 20px; }
.login-form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 2px; }
.login-form-head h2 { font-size: 23px; }
.login-form-head p { margin-top: 4px; font-size: 11px; }
.login-form > label { display: grid; gap: 5px; color: var(--text-soft); font-size: 10px; }
.login-form > label input { min-height: 38px; padding: 8px 10px; border: 0; outline: 0; border-radius: 7px; background: var(--surface-soft); color: var(--text); font: inherit; }
.login-submit { width: 100%; }
.temporary-login { display: grid; gap: 7px; padding-top: 4px; }
.temporary-login > span { color: var(--text-faint); font-size: 9px; }
.login-role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.login-role-grid button { display: grid; gap: 2px; padding: 9px 10px; border-radius: 7px; background: var(--page); color: var(--text); cursor: pointer; text-align: left; }
.login-role-grid button:hover { background: var(--accent-soft); }
.login-role-grid button:last-child { grid-column: 1 / -1; }
.login-role-grid strong { font-size: 10px; }
.login-role-grid small { color: var(--text-faint); font-size: 8px; }

@media (min-width: 1121px) and (max-width: 1280px) {
  .dashboard-grid { gap: 6px; }
  .stat-card { min-height: 102px; padding: 12px; }
  .stat-value { font-size: 23px; }
}

@media (max-width: 780px) {
  .app-shell { display: block; }
  .app-shell.sidebar-collapsed { display: block; }
  .sidebar-collapsed .sidebar { padding: 8px; }
  .sidebar-collapsed .sidebar-top { justify-content: space-between; }
  .sidebar-collapsed .sidebar-top .brand { display: flex; }
  .sidebar-collapsed .nav-item span { display: block; }
  .sidebar-collapsed .nav-item b { display: block; }
  .sidebar-collapsed .nav-item { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; width: auto; height: auto; padding: 8px 10px; }
  #sidebarToggle { display: none; }
  .project-context, .nav-group-label { display: none; }
  .workspace-grid, .directory-layout, .document-grid, .report-filters, .role-note { grid-template-columns: 1fr; }
  .view-toolbar, .report-summary { align-items: stretch; flex-direction: column; }
  .stage-legend { justify-content: flex-start; flex-wrap: wrap; }
  .ks-table-wrap { overflow-x: auto; }
  .ks-table { min-width: 800px; }
}
