:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --line: #d5deeb;
  --text: #142033;
  --muted: #64748b;
  --blue: #1769e0;
  --blue-soft: #eaf2ff;
  --green: #15803d;
  --green-soft: #e9f8ef;
  --yellow: #a16207;
  --yellow-soft: #fff7d6;
  --red: #b91c1c;
  --red-soft: #feecec;
  --gray-soft: #f1f5f9;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f9fbfd 0%, var(--bg) 46%, #e9eff6 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: linear-gradient(180deg, #101827 0%, #172235 100%);
  color: #e5edf7;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1769e0, #14b8a6);
  border-radius: 8px;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav button {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  color: #cbd5e1;
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
}

.nav button:hover,
.nav button.active {
  color: #fff;
  background: rgba(37, 99, 235, 0.22);
}

.nav button.active {
  box-shadow: inset 3px 0 0 #60a5fa;
}

.nav small {
  color: #93c5fd;
}

.role-card {
  margin-top: auto;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.role-card span {
  display: block;
  margin-bottom: 8px;
  color: #94a3b8;
  font-size: 12px;
}

.role-card select {
  width: 100%;
  padding: 9px;
  color: #e5edf7;
  background: #172033;
  border: 1px solid #334155;
  border-radius: 7px;
}

.workspace {
  min-width: 0;
  padding: 20px 24px 96px;
  max-width: 1680px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(215, 225, 238, 0.9);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 14px;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

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

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 310px;
  padding: 8px 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search input {
  width: 100%;
  border: 0;
  outline: none;
}

.btn,
.icon-btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  transition: 0.15s ease;
}

.btn {
  padding: 8px 13px;
  font-weight: 700;
}

.btn:hover,
.icon-btn:hover {
  border-color: #9fb5d0;
  transform: translateY(-1px);
}

.btn.primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), #0f766e);
  border-color: var(--blue);
  box-shadow: 0 10px 22px rgba(23, 105, 224, 0.20);
}

.btn.ghost {
  background: #fff;
}

.btn.danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #fecaca;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.panel-head,
.report-top,
.request-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.grid {
  display: grid;
  gap: 14px;
}

.cols-2 {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

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

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

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

.panel,
.card,
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.045);
}

.panel {
  padding: 16px;
}

.kpi {
  min-height: 108px;
  padding: 15px;
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto 14px 0 14px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), #14b8a6);
  border-radius: 999px 999px 0 0;
}

.kpi-strip {
  margin-bottom: 14px;
}

.kpi span,
.muted {
  color: var(--muted);
}

.kpi strong {
  display: block;
  margin: 8px 0 7px;
  font-size: 32px;
  line-height: 1;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
}

.delta.good {
  color: var(--green);
}

.delta.warn {
  color: var(--yellow);
}

.delta.bad {
  color: var(--red);
}

.attention-item,
.event-row,
.master-row,
.material-row,
.change-row,
.offer-row {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.attention-item:first-child,
.event-row:first-child,
.master-row:first-child,
.material-row:first-child,
.change-row:first-child,
.offer-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.attention-item {
  grid-template-columns: 100px minmax(0, 1fr) auto;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.blue {
  color: #1d4ed8;
  background: var(--blue-soft);
}

.badge.green {
  color: var(--green);
  background: var(--green-soft);
}

.badge.yellow {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.badge.red {
  color: var(--red);
  background: var(--red-soft);
}

.badge.gray {
  color: #475569;
  background: var(--gray-soft);
}

.object-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 178px;
  gap: 12px;
  min-height: 178px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.object-card:hover {
  border-color: #9fb5d0;
}

.object-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 999px;
}

.progress div {
  height: 100%;
  background: var(--blue);
}

.segments {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.segments span {
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
}

.segments span.done {
  background: #2563eb;
}

.object-photo {
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(21, 128, 61, 0.1)),
    repeating-linear-gradient(45deg, #d9e2ef 0, #d9e2ef 8px, #edf2f7 8px, #edf2f7 16px);
  position: relative;
  overflow: hidden;
}

.object-photo::before,
.object-photo::after {
  content: "";
  position: absolute;
  border-radius: 3px;
  background: rgba(30, 41, 59, 0.16);
}

.object-photo::before {
  width: 75%;
  height: 42px;
  left: 18px;
  bottom: 30px;
  transform: skewX(-12deg);
}

.object-photo::after {
  width: 44%;
  height: 66px;
  right: 18px;
  bottom: 58px;
}

.object-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
}

.filters,
.tabs,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip,
.tab {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.chip.active,
.tab.active {
  color: #1d4ed8;
  background: var(--blue-soft);
  border-color: #bfdbfe;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.master-row {
  grid-template-columns: 48px minmax(0, 1fr) 120px 130px auto;
  align-items: center;
}

.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-weight: 900;
}

.score {
  font-size: 24px;
  font-weight: 900;
}

.split-calc {
  display: grid;
  grid-template-columns: minmax(330px, 0.78fr) minmax(0, 1.22fr);
  gap: 14px;
}

.money-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.offers-panel {
  margin-top: 14px;
}

.money-card strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.map-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 310px;
  gap: 14px;
}

.map-canvas {
  min-height: 520px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.13) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, 0.13) 1px, transparent 1px),
    #eef4fb;
  background-size: 42px 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.location-pin {
  position: absolute;
  width: 138px;
  min-height: 74px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: left;
}

.location-pin.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14), var(--shadow);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.kanban-col {
  min-height: 420px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kanban-card {
  margin-top: 10px;
  padding: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.ai-output {
  padding: 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
}

.ai-output li {
  margin-bottom: 8px;
}

.drawer {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(15, 23, 42, 0.42);
  z-index: 60;
}

.drawer.open {
  display: block;
}

.drawer-panel {
  width: min(760px, calc(100vw - 32px));
  height: calc(100vh - 32px);
  margin: 16px 16px 16px auto;
  padding: 18px;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  position: relative;
}

.drawer[data-mode="report"] .drawer-panel {
  width: min(1180px, calc(100vw - 32px));
}

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
}

.mobile-preview {
  max-width: 410px;
  margin: 0 auto;
  padding: 14px;
  background: #111827;
  border-radius: 24px;
}

.mobile-preview .panel {
  box-shadow: none;
}

.journal-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
}

.object-overview {
  margin-bottom: 14px;
}

.object-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.object-status-card {
  min-height: 168px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.object-status-card h3 {
  margin: 0;
  line-height: 1.25;
}

.role-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 22px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(23, 105, 224, 0.86)),
    linear-gradient(90deg, rgba(20, 184, 166, 0.28), transparent);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.role-hero.foreman {
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.96), rgba(15, 118, 110, 0.88)),
    linear-gradient(90deg, rgba(23, 105, 224, 0.28), transparent);
}

.role-hero.compact {
  margin-bottom: 14px;
  padding: 18px;
}

.role-hero h2 {
  margin: 8px 0;
  font-size: 28px;
  line-height: 1.1;
}

.role-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
}

.role-tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.hero-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.role-hero .btn.ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.20);
}

.side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.manager-summary {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.report-card {
  margin-top: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  transition: 0.16s ease;
}

.report-card:first-of-type {
  margin-top: 0;
}

.report-card:hover {
  background: #fbfdff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.report-facts,
.compact-facts {
  display: grid;
  gap: 9px;
  margin: 10px 0 0;
}

.report-facts div,
.compact-facts div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
}

.report-facts dt,
.compact-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-facts dd,
.compact-facts dd {
  margin: 0;
}

.photo-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 11px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.photo-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.photo-thumb {
  height: 54px;
  display: grid;
  place-items: end start;
  padding: 8px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(31, 95, 191, 0.12), rgba(21, 128, 61, 0.1)),
    repeating-linear-gradient(45deg, #dbe4ef 0, #dbe4ef 8px, #eef3f8 8px, #eef3f8 16px);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.registry-head,
.registry-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) 130px 130px minmax(170px, 1fr) 130px 120px 112px;
  gap: 12px;
  align-items: center;
}

.registry-head {
  padding: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.registry-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.person {
  display: flex;
  gap: 10px;
  align-items: center;
}

.quality {
  display: grid;
  gap: 7px;
}

.quality strong {
  font-size: 20px;
}

.quality i {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: var(--blue);
}

.knowledge-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.4fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.knowledge-row:first-of-type {
  border-top: 0;
}

.knowledge-button {
  cursor: pointer;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 8px;
}

.knowledge-button:hover {
  background: #f8fbff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.pdf-frame {
  width: 100%;
  height: min(620px, 62vh);
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.report-photo-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.report-photo {
  min-height: 112px;
  display: grid;
  align-items: end;
  margin: 0;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.05), rgba(23, 105, 224, 0.14)),
    repeating-linear-gradient(45deg, #cbd5e1 0, #cbd5e1 11px, #e7edf5 11px, #e7edf5 22px);
}

.report-photo span {
  width: max-content;
  max-width: 100%;
  padding: 4px 7px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(215, 225, 238, 0.9);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.report-photo.shot-2 {
  background:
    linear-gradient(145deg, rgba(21, 128, 61, 0.08), rgba(15, 23, 42, 0.08)),
    repeating-linear-gradient(-35deg, #d9e2ef 0, #d9e2ef 12px, #eef3f8 12px, #eef3f8 24px);
}

.report-photo.shot-3 {
  background:
    linear-gradient(145deg, rgba(161, 98, 7, 0.10), rgba(23, 105, 224, 0.10)),
    repeating-linear-gradient(90deg, #d6dee9 0, #d6dee9 9px, #eef3f8 9px, #eef3f8 18px);
}

.report-photo.shot-4 {
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.10), rgba(15, 23, 42, 0.08)),
    repeating-linear-gradient(0deg, #dbe4ef 0, #dbe4ef 10px, #edf2f7 10px, #edf2f7 20px);
}

.doc-link {
  display: inline-flex;
  text-decoration: none;
}

.report-drawer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

.report-drawer-layout .report-document,
.report-side-chat {
  min-width: 0;
}

.report-side-chat {
  position: sticky;
  top: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.045);
}

.inline-chat-list {
  min-height: 390px;
  max-height: calc(100vh - 190px);
}

.inline-chat-compose {
  background: #fff;
}

.supply-board {
  grid-template-columns: repeat(4, minmax(230px, 1fr));
}

.request-card {
  display: grid;
  gap: 8px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.action-row .btn {
  min-height: 34px;
  padding: 7px 10px;
}

.request-head {
  align-items: center;
}

.compact-facts {
  gap: 6px;
}

.compact-facts div {
  grid-template-columns: 92px 1fr;
}

.scenario-list,
.concept-flow {
  display: grid;
  gap: 8px;
}

.scenario-list article {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.scenario-list b,
.scenario-list span {
  display: block;
}

.scenario-list span {
  color: var(--muted);
  line-height: 1.4;
}

.playbook-panel {
  border-color: #c7d7ec;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.playbook-steps {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.playbook-step {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  transition: 0.15s ease;
}

.playbook-step:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 22px rgba(23, 105, 224, 0.09);
  transform: translateY(-1px);
}

.playbook-step > b,
.next-steps b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #0f766e);
  border-radius: 8px;
}

.playbook-step strong,
.playbook-step small {
  display: block;
}

.playbook-step small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.concept-flow div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.concept-flow b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #1d4ed8;
  background: var(--blue-soft);
  border-radius: 50%;
}

.event-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.event-line:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.event-line > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.foreman-layout {
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr) minmax(300px, 0.75fr);
}

.foreman-object-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.foreman-object-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.foreman-object-list b,
.foreman-object-list span {
  display: block;
}

.foreman-object-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.timeline article {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
}

.timeline article.готово {
  border-left-color: var(--green);
}

.timeline b {
  font-size: 13px;
}

.timeline span {
  line-height: 1.35;
}

.report-studio {
  display: grid;
  align-content: start;
}

.draft-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.draft-photo {
  min-height: 112px;
  display: grid;
  place-items: end start;
  padding: 12px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(17, 24, 39, 0.12), rgba(23, 105, 224, 0.18)),
    repeating-linear-gradient(45deg, #cbd5e1 0, #cbd5e1 10px, #e2e8f0 10px, #e2e8f0 20px);
  border-radius: 8px;
  font-weight: 900;
}

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

.checklist label {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.checklist input {
  accent-color: var(--blue);
}

.phone-shell {
  width: min(100%, 270px);
  margin: 12px auto 0;
  padding: 14px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.phone-bar {
  width: 72px;
  height: 5px;
  margin: 0 auto 14px;
  background: #475569;
  border-radius: 999px;
}

.phone-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  color: #e5edf7;
  background: #172033;
  border: 1px solid #334155;
  border-radius: 16px;
}

.phone-card span,
.phone-card small {
  color: #94a3b8;
}

.phone-action {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  color: #e5edf7;
  background: #1f2937;
  border: 1px solid #334155;
  border-radius: 14px;
  font-weight: 900;
}

.phone-action.primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.source-panel {
  margin-top: 14px;
}

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

.source-grid div,
.detail-block {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.source-grid b,
.source-grid span {
  display: block;
}

.source-grid span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.link-btn {
  display: inline-flex;
  min-height: 26px;
  margin: 0 4px 4px 0;
  padding: 4px 7px;
  color: #1d4ed8;
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-weight: 900;
}

.detail-block {
  margin-top: 12px;
}

.response-drawer {
  padding-top: 6px;
}

.role-tag.dark {
  color: #dbeafe;
  background: #172033;
  border-color: #334155;
}

.next-steps {
  display: grid;
  gap: 10px;
}

.next-steps div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
}

.toast {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  color: #172033;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: toastIn 0.18s ease-out;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.warning {
  border-left-color: var(--yellow);
}

.toast b,
.toast span {
  display: block;
}

.toast span {
  color: var(--muted);
  line-height: 1.35;
}

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

.detail-block ul {
  margin: 0;
  padding-left: 18px;
}

.detail-block li {
  margin-bottom: 7px;
}

.good-list {
  border-color: #bbf7d0;
  background: var(--green-soft);
}

.bad-list {
  border-color: #fed7aa;
  background: #fff7ed;
}

.drawer-submit {
  margin-top: 14px;
}

.chat-widget {
  position: relative;
  z-index: 30;
  display: grid;
  justify-items: end;
  flex: 0 0 auto;
}

.drawer-open .chat-widget {
  z-index: 30;
}

.chat-toggle {
  min-height: 38px;
  padding: 8px 12px;
  color: white;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 900;
}

.chat-toggle b {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  place-items: center;
  color: #0f172a;
  background: #bfdbfe;
  border-radius: 999px;
}

.chat-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 150px));
  display: none;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.chat-panel.open {
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
}

.chat-head,
.chat-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.chat-head {
  justify-content: space-between;
}

.chat-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.chat-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  background: #f8fafc;
}

.chat-groups {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.chat-group {
  min-height: 30px;
  padding: 5px 9px;
  white-space: nowrap;
  color: #475569;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.chat-group.active {
  color: #1d4ed8;
  background: var(--blue-soft);
  border-color: #bfdbfe;
}

.chat-message {
  max-width: 86%;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.chat-message.mine {
  justify-self: end;
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.chat-message span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.chat-message.mine span {
  color: #dbeafe;
}

.chat-message p {
  margin: 0;
  overflow-wrap: anywhere;
}

.chat-compose {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.chat-compose input {
  min-width: 0;
  flex: 1;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.doc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.report-frame {
  height: min(720px, 72vh);
}

.search-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.search-result {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-result p {
  margin: 6px 0 0;
}

@media (max-width: 1280px) {
  .registry-head,
  .registry-row {
    grid-template-columns: minmax(190px, 1fr) 120px 120px minmax(150px, 1fr);
  }

  .registry-head span:nth-child(5),
  .registry-head span:nth-child(6),
  .registry-row > .badge,
  .registry-row > .quality,
  .registry-row > .btn {
    display: none;
  }
}

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

  .brand div:not(.brand-mark),
  .nav button span.label,
  .nav small,
  .role-card {
    display: none;
  }

  .nav button {
    grid-template-columns: 1fr;
    place-items: center;
  }

  .cols-6,
  .cols-4,
  .cols-3,
  .cols-2,
  .source-grid,
  .report-photo-strip,
  .report-drawer-layout,
  .split-calc,
  .map-layout,
  .journal-layout,
  .object-status-grid,
  .foreman-layout,
  .role-hero {
    grid-template-columns: 1fr;
  }

  .topbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-widget {
    width: 100%;
    justify-items: stretch;
  }

  .chat-toggle {
    width: 100%;
  }

  .chat-panel {
    left: 0;
    right: auto;
    width: 100%;
  }

  .search {
    min-width: 0;
  }

  .registry-head {
    display: none;
  }

  .registry-row,
  .knowledge-row {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .report-top,
  .doc-toolbar {
    flex-direction: column;
  }

  .hero-actions {
    justify-content: stretch;
  }

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

  .draft-card,
  .checklist {
    grid-template-columns: 1fr;
  }

  .report-side-chat {
    position: static;
  }
}

@media (max-width: 760px) {
  .report-photo-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .chat-panel {
    width: 100%;
    max-height: calc(100vh - 190px);
  }
}
