:root {
  color-scheme: light;
  --bg: #f4f6f7;
  --panel: #ffffff;
  --ink: #18202a;
  --muted: #66727f;
  --line: #dde5ea;
  --navy: #16466d;
  --cyan: #1f8fa3;
  --green: #18815f;
  --amber: #b87316;
  --red: #ba3b35;
  --blue-soft: #e6f3f7;
  --green-soft: #e7f5ee;
  --amber-soft: #fff2da;
  --red-soft: #ffe4e1;
  --shadow: 0 12px 28px rgba(24, 32, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  background: var(--navy);
  color: #fff;
  font-weight: 850;
}
button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
button:disabled {
  cursor: not-allowed;
  background: #d9e1e6;
  color: #7b8791;
}
select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
select { min-height: 42px; padding: 0 12px; }
textarea { min-height: 92px; padding: 12px; resize: vertical; }

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}
.role-card p, .panel-head p, .section-head p, .kpi small, .boat-meta, .task-card p, .timeline p, .stage-card p {
  color: var(--muted);
}
.nav { display: grid; gap: 7px; }
body.master-mode .nav-item:not([data-view="master"]) {
  display: none;
}
body.owner-mode .nav-item[data-view="master"] {
  display: none;
}
.nav-item {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #44505c;
  text-align: left;
  font-weight: 780;
}
.nav-item:hover, .nav-item.active {
  border-color: #b9d9e4;
  background: var(--blue-soft);
  color: var(--navy);
}
.role-card {
  margin-top: auto;
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.role-card label { color: var(--muted); font-size: 13px; font-weight: 850; }
.role-card p { margin: 0; font-size: 13px; line-height: 1.42; }

.workspace {
  position: relative;
  min-width: 0;
  padding: 22px 28px 28px;
}
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.access-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.access-strip span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.access-strip strong { display: block; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.04;
}
h2 { margin-bottom: 6px; font-size: 22px; line-height: 1.18; }
h3 { margin-bottom: 12px; font-size: 18px; }
.view { display: none; }
.view.active { display: block; }

.control-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
  min-height: 128px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid #0f3d61;
  border-radius: 8px;
  background: linear-gradient(135deg, #123b5f 0%, #1f6f8f 100%);
  box-shadow: var(--shadow);
}
.control-hero h1 {
  margin-bottom: 0;
  color: #fff;
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 950;
  text-transform: uppercase;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi, .panel, .phone {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.kpi { min-height: 116px; padding: 17px; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 850; }
.kpi strong { display: block; margin: 8px 0; font-size: clamp(24px, 2.5vw, 32px); line-height: 1; overflow-wrap: anywhere; }
.kpi.warning strong { color: var(--amber); }
.kpi.danger strong { color: var(--red); }
.panel { padding: 18px; min-width: 0; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.panel-head p, .section-head p { margin-bottom: 0; font-size: 14px; line-height: 1.45; }
.section-head { margin-bottom: 16px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2f4;
  color: #44505c;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.badge.live { background: var(--green-soft); color: var(--green); }
.badge.warning { background: var(--amber-soft); color: #8b560f; }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--navy); }

.role-chat {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  min-height: 0;
  pointer-events: none;
}
.chat-trigger,
.chat-panel {
  pointer-events: auto;
}
.chat-trigger {
  display: grid;
  gap: 2px;
  min-width: 142px;
  min-height: 48px;
  padding: 7px 12px;
  border: 1px solid #0f3d61;
  background: #123b5f;
  text-align: left;
  box-shadow: var(--shadow);
}
.chat-trigger span {
  color: #b8d7e5;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.chat-trigger strong {
  color: #fff;
  font-size: 14px;
}
.chat-trigger.active {
  background: #1f6f8f;
}
.chat-panel {
  position: absolute;
  right: 0;
  top: 58px;
  width: min(380px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(24, 32, 42, 0.18);
}
.chat-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.chat-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.chat-messages {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}
.chat-messages article {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}
.chat-messages article.own {
  border-color: #9ed9c3;
  background: var(--green-soft);
}
.chat-messages strong {
  font-size: 13px;
}
.chat-messages p {
  margin: 0;
  color: #33414d;
  line-height: 1.35;
}
.chat-messages time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}
.chat-compose input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.owner-layout, .history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  gap: 18px;
}
.history-layout.single {
  grid-template-columns: 1fr;
}
.owner-layout.single {
  grid-template-columns: 1fr;
}
.boat-table { display: grid; gap: 10px; }
.boat-row {
  display: grid;
  grid-template-columns: 118px minmax(180px, 1.1fr) minmax(180px, 1fr) 160px 122px;
  align-items: center;
  gap: 12px;
  min-height: 104px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.boat-row:hover {
  border-color: #9cc8d6;
  background: #fff;
  box-shadow: 0 14px 28px rgba(24, 32, 42, 0.09);
  transform: translateY(-1px);
}
.boat-thumb {
  min-height: 76px;
  border-radius: 8px;
  background: #dbe9ef center / cover;
}
.boat-title strong { display: block; margin-bottom: 4px; }
.boat-meta { font-size: 13px; line-height: 1.35; }
.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, transparent 0 11.6%, rgba(255,255,255,.9) 11.6% 12.5%),
    #e7edf0;
}
.progress span { display: block; height: 100%; border-radius: inherit; background: currentColor; }
.progress-panel {
  display: grid;
  gap: 6px;
  min-width: 128px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.progress-panel span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.progress-panel strong {
  margin: 0;
  font-size: 24px;
  line-height: 1;
}
.progress-panel.danger {
  border-color: #efb0aa;
  background: var(--red-soft);
  color: var(--red);
}
.progress-panel.warning {
  border-color: #f0cf91;
  background: var(--amber-soft);
  color: var(--amber);
}
.progress-panel.success {
  border-color: #9ed9c3;
  background: var(--green-soft);
  color: var(--green);
}
.progress-info {
  padding: 0;
  background: transparent;
  border: 0;
}
.progress-info .progress-panel {
  min-height: 100%;
}
.progress-info-large {
  grid-column: 1 / -1;
}
.progress-info-large .progress-panel {
  min-height: 136px;
  padding: 18px;
}
.progress-info-large .progress-panel strong {
  font-size: 48px;
}
.progress-info-large .progress-panel span {
  font-size: 13px;
}
.progress-info-large .progress {
  height: 14px;
}
.review-list, .task-list, .timeline { display: grid; gap: 10px; }
.review-item, .task-card, .timeline-item, .stage-card, .notification-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}
.review-item strong, .task-card strong, .timeline-item strong { display: block; margin-bottom: 5px; }
.review-actions, .card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.evidence-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.evidence-block p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.45;
}
.evidence-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.evidence-photos span {
  min-height: 82px;
  border-radius: 8px;
  background: #dbe9ef center / cover;
}
.boat-detail {
  display: grid;
  grid-template-columns: minmax(330px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
}
.boat-hero {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.boat-large-photo {
  min-height: 260px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #dbe9ef center / cover;
}
.customer-line { margin-bottom: 8px; color: var(--muted); }
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.info-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fbfcfd;
}
.info-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 850; }
.info-card strong { display: block; margin-top: 4px; }
.plan-card strong {
  font-size: 30px;
  line-height: 1.08;
}
.materials-layout {
  display: grid;
}
.materials-panel .panel-head {
  align-items: center;
}
.materials-summary-list {
  display: grid;
  gap: 8px;
}
.materials-closed-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
  min-height: 96px;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.materials-closed-card:hover {
  border-color: #9cc8d6;
  background: #fff;
  box-shadow: 0 12px 26px rgba(24, 32, 42, 0.07);
}
.materials-closed-card.has-overrun {
  border-left: 4px solid var(--red);
}
.materials-chevron {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.materials-chevron span {
  width: 11px;
  height: 11px;
  border-top: 2px solid var(--navy);
  border-right: 2px solid var(--navy);
  transform: rotate(45deg);
}
.materials-closed-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  cursor: pointer;
}
.materials-closed-main strong {
  font-size: 20px;
  line-height: 1.1;
}
.materials-closed-main small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.materials-closed-total {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 6px;
}
.materials-closed-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
.materials-closed-total b {
  font-size: 22px;
  line-height: 1;
}
.materials-closed-note {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}
.materials-closed-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
.materials-closed-note strong {
  color: var(--red);
  font-size: 18px;
}
.materials-closed-card:not(.has-overrun) .materials-closed-note strong {
  color: var(--green);
}
.materials-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 12px 12px;
}
.materials-note {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.materials-note span {
  color: var(--muted);
  font-size: 13px;
}
.detail-material-head {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(220px, .45fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}
.detail-boat-photo {
  min-height: 124px;
  border-radius: 8px;
  background: #dbe9ef center / cover;
}
.card-total {
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.materials-note.danger {
  border-color: #efb0aa;
  background: var(--red-soft);
}
.materials-note.success {
  border-color: #9ed9c3;
  background: var(--green-soft);
}
.material-group {
  display: grid;
  gap: 8px;
}
.material-group h3 {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}
.material-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.material-row span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 12px;
  font-weight: 950;
}
.material-row strong {
  line-height: 1.35;
}
.material-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
}
.material-row.over {
  border-color: #efb0aa;
  background: #fff8f7;
}
.materials-total {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.materials-total span {
  color: var(--muted);
  font-weight: 850;
}
.stages-list { display: grid; gap: 10px; }
.stage-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 82px 130px;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.stage-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--navy);
  font-weight: 900;
}
.stage-row.locked { opacity: .62; background: #f5f7f8; }
.stage-row.active { border-color: #8ccddd; background: #f7fcfd; }
.stage-row.done .stage-num { background: var(--green-soft); color: var(--green); }
.stage-row.issue .stage-num { background: var(--red-soft); color: var(--red); }
.stage-row time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}
.stage-row small {
  display: block;
  margin-top: 5px;
  color: #50606c;
  font-size: 12px;
  line-height: 1.35;
}
.gate-banner {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #f0cf91;
  border-radius: 8px;
  background: var(--amber-soft);
}
.gate-banner.compact {
  margin: 4px 0 12px;
}
.gate-banner span {
  color: #704308;
  line-height: 1.4;
}
.danger-text { color: var(--red); }
.success-text { color: var(--green); }

.master-layout {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}
.phone {
  max-width: none;
  padding: 14px;
  background: var(--panel);
}
.phone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  margin-bottom: 12px;
  min-height: 36px;
}
.phone-top span {
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: #d8e4ea;
}
.specialty-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.specialty-tabs button {
  min-height: 38px;
  padding: 0 10px;
}
.specialty-tabs button.active {
  border-color: #8ccddd;
  background: var(--blue-soft);
  color: var(--navy);
}
.phone .task-card {
  background: #f8fbfc;
  margin-bottom: 10px;
  grid-template-columns: minmax(160px, 1.1fr) minmax(160px, 1fr) 150px 122px 140px;
}
.empty-state {
  padding: 16px;
  border: 1px dashed #b9c8d0;
  border-radius: 8px;
  background: #f8fbfc;
}
.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.task-detail label {
  display: block;
  margin: 12px 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.work-order {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #9ed9c3;
  border-radius: 8px;
  background: var(--green-soft);
}
.work-order p {
  margin: 0;
  color: #285946;
  line-height: 1.45;
}
.owner-note {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #efb0aa;
  border-radius: 8px;
  background: var(--red-soft);
}
.owner-note p {
  margin: 5px 0 0;
  color: var(--red);
  line-height: 1.45;
}
.photo-upload {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 12px;
  border: 1px dashed #9cc8d6;
  border-radius: 8px;
  background: #f8fbfc;
}
.photo-upload p {
  margin: 5px 0 10px;
  color: var(--muted);
  line-height: 1.4;
}
.upload-preview {
  min-height: 94px;
  border-radius: 8px;
  background: #dbe9ef center / cover;
}
.stage-card {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.stage-card h3 { margin: 0; font-size: 17px; }
.stage-card p { margin: 0; font-size: 14px; line-height: 1.4; }

.timeline-item p { margin-bottom: 0; line-height: 1.45; }
.journal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.journal-tabs button.active {
  border-color: #8ccddd;
  background: var(--blue-soft);
  color: var(--navy);
}
.journal-group {
  display: grid;
  gap: 10px;
}
.journal-group h3 {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}
.timeline-item p {
  grid-column: 1 / -1;
}
.handover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.handover-grid > div {
  display: grid;
  gap: 8px;
}
.notification-list { display: grid; gap: 10px; }
.notification-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 130px;
  gap: 12px;
  align-items: start;
}
.notification-item time, .notification-item span {
  color: var(--muted);
  font-size: 13px;
}
.notification-item strong { display: block; margin-bottom: 4px; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 14px 16px;
  border-radius: 8px;
  background: #102537;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  font-weight: 800;
}
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .boat-row { grid-template-columns: 92px minmax(160px, 1fr) minmax(150px, 1fr) 132px 112px; }
}
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { padding: 16px; }
  .role-chat {
    top: 10px;
    margin-bottom: 8px;
  }
  .panel-head { display: block; }
  .access-strip { grid-template-columns: 1fr; }
  .top-actions { justify-content: stretch; margin-top: 12px; }
  .top-actions button { flex: 1 1 180px; }
  .owner-layout, .boat-detail, .master-layout, .history-layout {
    grid-template-columns: 1fr;
  }
  .materials-list { grid-template-columns: 1fr; }
  .materials-closed-card,
  .detail-material-head {
    grid-template-columns: 1fr;
  }
  .materials-chevron {
    position: absolute;
    top: 12px;
    right: 12px;
  }
  .materials-closed-main {
    padding-right: 52px;
  }
  .materials-closed-note {
    justify-items: start;
    text-align: left;
  }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .boat-row {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: start;
  }
  .boat-row > :nth-child(n+3) { grid-column: 2; }
  .phone { max-width: none; }
}
@media (max-width: 520px) {
  .nav { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
  .control-hero { min-height: 104px; }
  .chat-compose { grid-template-columns: 1fr; }
  .kpi-grid, .info-grid { grid-template-columns: 1fr; }
  .stage-row { grid-template-columns: 32px minmax(0, 1fr); }
  .stage-row .badge { grid-column: 2; width: max-content; }
  .notification-item { grid-template-columns: 1fr; }
  .handover-grid { grid-template-columns: 1fr; }
  .stage-row time { grid-column: 2; text-align: left; }
}
