:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #14213d;
  --muted: #5b6475;
  --line: #dbe2ea;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --success: #166534;
  --success-soft: #dcfce7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  --neutral-soft: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.16), transparent 28%),
    linear-gradient(180deg, #f8fbfd 0%, var(--bg) 100%);
  color: var(--text);
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.layout {
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(219, 226, 234, 0.7);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.language-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  min-height: 2rem;
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.language-switcher a.is-active {
  background: var(--brand);
  color: #fff;
}

.public-topbar {
  position: static;
}

.brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.subhead,
.muted {
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.nav {
  display: flex;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
}

.nav a {
  background: rgba(255, 255, 255, 0.9);
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.nav a:hover,
.nav a:focus-visible {
  border-color: rgba(15, 118, 110, 0.4);
  background: #fff;
  text-decoration: none;
}

.container {
  padding: 28px 1rem 1rem;
  max-width: 1180px;
  margin: 0 auto 3rem;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(219, 226, 234, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1rem;
}

.panel-intro {
  margin: 0.35rem 0 0;
}

.page-header,
.row-between {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.page-header {
  flex-wrap: wrap;
}

.page-header > .button-row {
  justify-content: flex-end;
}

.page-header h1,
.panel h1,
.panel h2,
.panel h3 {
  margin-top: 0;
}

.summary-grid,
.board-grid,
.detail-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.yacht-detail-layout {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.yacht-detail-main {
  min-width: 0;
}

.yacht-detail-side {
  min-width: 0;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.summary-card,
.yacht-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.summary-card {
  text-align: left;
}

button.summary-card {
  appearance: none;
  width: 100%;
  color: inherit;
  font: inherit;
}

.block-link {
  display: block;
  color: inherit;
}

.block-link:hover {
  text-decoration: none;
}

.summary-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.summary-card strong {
  font-size: 1.7rem;
}

.summary-card.success strong {
  color: var(--success);
}

.summary-card.danger strong,
.critical-text {
  color: var(--danger);
}

.summary-card.warning strong {
  color: var(--warning);
}

.summary-card[data-status],
.dashboard-kpi-card {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.summary-card[data-status]:hover,
.summary-card[data-status]:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  outline: none;
}

.summary-card[data-status].is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2), var(--shadow);
  background: #ecfdf5;
}

.readiness-filter-card {
  display: block;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.readiness-filter-card small {
  display: block;
  margin-top: 0.45rem;
  color: var(--brand-dark);
  font-weight: 700;
}

.readiness-filter-card:hover,
.readiness-filter-card:focus-visible {
  text-decoration: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
  outline: none;
}

.readiness-filter-card.is-active {
  border-color: var(--brand);
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18), var(--shadow);
}

.filter-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.filter-status a {
  color: var(--brand-dark);
}

.turnaround-panel {
  border-color: rgba(15, 118, 110, 0.22);
  min-height: 280px;
}

.turnaround-board {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.turnaround-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 14px;
  background: #fff;
}

.turnaround-ready {
  border-left-color: var(--success);
}

.turnaround-in_progress {
  border-left-color: var(--warning);
}

.turnaround-blocked {
  border-left-color: var(--danger);
}

.turnaround-in_charter {
  border-left-color: #0ea5e9;
}

.turnaround-no_active_charter {
  border-left-color: #94a3b8;
}

.turnaround-card-head {
  margin-bottom: 0;
}

.turnaround-card-head h3,
.turnaround-card-head p {
  margin: 0;
}

.turnaround-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: var(--neutral-soft);
  font-weight: 800;
  white-space: nowrap;
}

.turnaround-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.turnaround-meta span {
  display: grid;
  gap: 0.2rem;
}

.turnaround-meta strong {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.turnaround-meta em {
  color: var(--warning);
  font-style: normal;
  font-weight: 800;
}

.dashboard-hero {
  max-width: 1120px;
  margin: 0 auto 1rem;
  padding: 2rem 1.5rem 1.25rem;
}

.dashboard-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.dashboard-hero-top h1,
.dashboard-hero-top p {
  margin-top: 0;
}

.dashboard-hero-top p {
  margin-bottom: 0;
}

.dashboard-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.dashboard-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.125rem;
}

.dashboard-filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-filter-buttons .button {
  min-height: 40px;
}

.dashboard-filter-buttons .button.is-active {
  border-color: var(--brand);
  background: #ecfdf5;
  color: var(--brand-dark);
}

.dashboard-updated-at {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.page-header > .button-row,
.turnaround-card .button-row {
  align-items: center;
  min-height: 44px;
}

.button-row .button,
.dashboard-filter-buttons .button,
.turnaround-card .button {
  white-space: nowrap;
}

.inline-form {
  display: inline-flex;
  margin-top: 0.55rem;
}

.dashboard-kpi-grid .summary-card {
  min-height: 92px;
}

.dashboard-events-panel {
  min-height: 180px;
}

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

.readiness-board {
  display: grid;
  gap: 1rem;
}

.readiness-card {
  display: grid;
  gap: 0.9rem;
}

.readiness-card-head {
  margin-bottom: 0;
}

.readiness-card-head h3,
.readiness-card-head p {
  margin: 0;
}

.readiness-progress {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.readiness-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.readiness-blocked .readiness-progress span {
  background: var(--danger);
}

.readiness-at_risk .readiness-progress span {
  background: var(--warning);
}

.readiness-no_upcoming_charter .readiness-progress span {
  background: #94a3b8;
}

.readiness-meta {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.readiness-meta span,
.blocker-list {
  display: grid;
  gap: 0.25rem;
}

.readiness-meta strong,
.blocker-list > strong {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.no-charter-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.mini-yacht-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.mini-yacht-card {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.meta-list,
.stacked-list,
.quick-actions,
.stack,
.quick-links {
  display: grid;
  gap: 0.75rem;
}

.form-grid,
.crew-grid {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: white;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button-secondary {
  background: #e7f3f1;
  color: var(--brand-dark);
}

.button-warning {
  background: #ffedd5;
  color: #9a3412;
}

.button-danger {
  background: var(--danger);
  color: white;
}

.button-link {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid transparent;
  padding-left: 0;
  padding-right: 0;
}

.button:hover,
.button:focus-visible {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: #d8ece8;
}

.button-warning:hover,
.button-warning:focus-visible {
  background: #fed7aa;
}

.button-danger:hover,
.button-danger:focus-visible {
  background: #991b1b;
}

.button-small {
  padding: 0.55rem 0.8rem;
  font-size: 0.92rem;
}

.button-link:hover,
.button-link:focus-visible {
  box-shadow: none;
  transform: none;
  text-decoration: underline;
}

.button[disabled],
.button.is-disabled {
  background: #e5e7eb;
  color: #6b7280;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.full {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-success,
.badge-ready,
.badge-no_upcoming_charter,
.badge-done,
.badge-approved,
.badge-exported,
.badge-resolved {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warning,
.badge-at_risk,
.badge-medium,
.badge-cleaning,
.badge-maintenance,
.badge-in_progress,
.badge-high,
.badge-operational,
.badge-submitted {
  background: var(--warning-soft);
  color: #92400e;
}

.badge-info,
.badge-assigned,
.badge-normal,
.badge-on_charter,
.badge-in_review {
  background: var(--info-soft);
  color: var(--info);
}

.badge-danger,
.badge-blocked,
.badge-urgent,
.badge-open,
.badge-safety_critical {
  background: var(--danger-soft);
  color: #991b1b;
}

.badge-neutral,
.badge-new,
.badge-low,
.badge-not_started,
.badge-cancelled,
.badge-cosmetic {
  background: #f3f4f6;
  color: #374151;
}

.table-wrap {
  overflow-x: auto;
}

.filter-grid {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.compact-filters {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

.sort-link.is-active {
  color: var(--brand-dark);
}

.sort-link:hover,
.sort-link:focus-visible {
  text-decoration: none;
  color: var(--brand-dark);
}

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

th,
td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.alert-row {
  background: rgba(254, 226, 226, 0.6);
}

.clickable-row,
.interactive-card {
  cursor: pointer;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.clickable-row:hover,
.clickable-row:focus-visible {
  background: rgba(240, 249, 255, 0.9);
  outline: none;
}

.interactive-card:hover,
.interactive-card:focus-visible {
  text-decoration: none;
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.clickable-row td:last-child,
.clickable-row td:last-child a {
  position: relative;
  z-index: 1;
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  font-weight: 600;
}

.inline-flash {
  margin-top: 0.75rem;
}

.flash-success {
  background: var(--success-soft);
  color: var(--success);
}

.flash-error {
  background: var(--danger-soft);
  color: #991b1b;
}

.narrow {
  max-width: 420px;
  margin: 2rem auto;
}

.qr-box {
  margin-top: 1rem;
  text-align: center;
}

.qr-link {
  word-break: break-word;
}

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

.quick-panel {
  text-align: center;
}

.quick-panel .actions-grid {
  margin-top: 1rem;
}

.guest-shell {
  max-width: 820px;
  margin: 0 auto 2rem;
}

.guest-hero {
  padding: 0.5rem 0 0.25rem;
  text-align: center;
}

.guest-hero h1,
.guest-hero h2 {
  margin: 0.25rem 0;
}

.guest-kicker {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.guest-action-stack,
.guest-task-choice,
.guest-compact-form,
.guest-task-list {
  display: grid;
  gap: 0.75rem;
}

.guest-action-stack {
  margin-top: 0.75rem;
}

.guest-action,
.guest-choice-button {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.guest-action.primary {
  background: var(--success);
}

.guest-action.warning {
  background: var(--warning);
}

.guest-action.is-disabled {
  background: #cbd5e1;
  color: #64748b;
  box-shadow: none;
}

.guest-action-details {
  display: grid;
  gap: 0.75rem;
}

.guest-action-details summary {
  list-style: none;
  cursor: pointer;
}

.guest-action-details summary::-webkit-details-marker {
  display: none;
}

.guest-action-details[open] summary {
  margin-bottom: 0.75rem;
}

.guest-choice-button {
  display: grid;
  gap: 0.35rem;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  text-align: left;
}

.guest-choice-readonly {
  background: #f8fafc;
  border-left: 4px solid #94a3b8;
  box-shadow: none;
}

.guest-choice-button span {
  color: var(--muted);
  font-size: 0.9rem;
}

.details-head {
  margin-top: 1rem;
}

.guest-offline-status {
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.25rem;
  text-align: center;
}

.guest-fallback-link {
  color: var(--muted);
  display: block;
  font-size: 0.95rem;
  padding: 0.75rem;
  text-align: center;
}

.guest-safe-note {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.guest-compact-form {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.guest-task-list {
  margin-top: 1rem;
}

.crew-row {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 0.75rem;
  background: #fbfdff;
}

.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.preset-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.advanced-options,
.share-box {
  grid-column: 1 / -1;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}

.advanced-options summary {
  cursor: pointer;
  font-weight: 800;
}

.advanced-options .form-grid {
  margin-top: 0.9rem;
}

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

.share-box {
  display: grid;
  gap: 0.75rem;
}

.share-box h3 {
  margin: 0;
}

.share-box textarea {
  min-height: 88px;
  font-size: 0.92rem;
}

.actions-grid {
  display: grid;
  gap: 0.75rem;
}

.actions-grid .button,
.actions-grid form {
  margin: 0;
}

.section-heading {
  margin-bottom: 0.35rem;
}

.helper-text {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.2rem 0 0;
}

.helper-text.tight {
  margin-top: 0;
}

.empty-state,
.info-box,
.warning-box,
.danger-box,
.danger-actions {
  border-radius: 16px;
  padding: 0.95rem 1rem;
  margin-top: 0.75rem;
}

.empty-state,
.info-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.warning-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.danger-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.danger-actions {
  background: #fff5f5;
  border: 1px solid #fca5a5;
}

.status-card {
  display: grid;
  gap: 0.85rem;
}

.status-form {
  display: grid;
  gap: 0.75rem;
}

.list-plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-plain li + li {
  margin-top: 0.6rem;
}

.table-action {
  font-weight: 700;
}

.label-stack {
  display: grid;
  gap: 0.2rem;
}

.label-stack .eyebrow {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tight-list {
  display: grid;
  gap: 0.45rem;
}

.split-row {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.attachment-grid {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.attachment-card {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}

.attachment-preview {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid var(--line);
}

.attachment-preview:hover,
.attachment-preview:focus-visible {
  text-decoration: none;
}

.attachment-preview img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

.attachment-meta {
  display: grid;
  gap: 0.2rem;
}

.attachment-meta a {
  font-weight: 700;
  word-break: break-word;
}

.attachment-meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.audit-filters {
  margin-bottom: 1rem;
}

.secondary-metrics {
  box-shadow: none;
}

.compact-summary .summary-card strong {
  font-size: 1.25rem;
}

.admin-tools summary {
  cursor: pointer;
  font-weight: 800;
}

.link-details {
  margin: 0.75rem 0;
}

.link-details summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 800;
}

.public-blockers {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.dashboard-events-panel {
  display: grid;
  gap: 1rem;
  min-height: 180px;
}

.event-log-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-log-list li {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.event-log-list li:first-child {
  border-top: 0;
}

.event-log-time,
.event-log-list small {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ─── Auto-refresh zones: suppress layout-shifting transitions ─── */
/* Buttons inside the board panel are recreated every 5 s; transform */
/* transitions on :hover cause visible jitter during DOM swap.       */
.turnaround-panel .button,
.turnaround-panel .button:hover,
.turnaround-panel .button:focus-visible {
  transform: none;
  transition: background-color 0.12s ease, color 0.12s ease;
  box-sizing: border-box;
  white-space: nowrap;
}

/* KPI counters: prevent hover lift and lock number width during refresh */
.dashboard-kpi-grid .summary-card[data-status]:hover {
  transform: none;
}

.dashboard-kpi-grid .summary-card strong {
  font-variant-numeric: tabular-nums;
  display: block;
}
/* ─────────────────────────────────────────────────────────────── */

.yf-live-updated {
  animation: yf-live-update-pulse 1.8s ease-out;
}

.yf-live-error {
  outline: 2px solid rgba(220, 38, 38, 0.22);
  outline-offset: 2px;
}

@keyframes yf-live-update-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    background-color: rgba(37, 99, 235, 0.08);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    background-color: transparent;
  }
}

@media (min-width: 760px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .crew-row {
    grid-template-columns: 1fr 1fr;
  }

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

  .actions-grid.two-up {
    grid-template-columns: 1fr 1fr;
  }

  .attachment-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (min-width: 901px) {
  .yacht-detail-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    align-items: start;
  }

  .yacht-detail-side {
    position: sticky;
    top: 5rem;
  }
}

@media (max-width: 900px) {
  .yacht-detail-layout {
    grid-template-columns: 1fr;
  }

  .page-header > .button-row {
    justify-content: flex-start;
    width: 100%;
  }
}

/* ── Yacht detail v4 ─────────────────────────────────────────────────────── */

.yd-top-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.yd-qr-wa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 12px;
}

.yd-qr-wa-grid > .panel {
  padding: 20px;
  margin-bottom: 0;
}

.yd-qr-card img {
  max-width: 160px;
  width: 100%;
  display: block;
  margin: 0 auto 12px;
  border-radius: 12px;
}

.yd-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.yd-bottom-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.yd-blocker-card {
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.yd-blocker-item {
  display: flex;
  flex-direction: column;
}

.yd-blocker-item + .yd-blocker-item {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #fecaca;
}

.yd-blocker-item strong {
  font-size: 0.95rem;
}

.yd-blocker-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yd-blocker-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 20px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.yd-blocker-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.yd-blocker-btn-resolve,
.yd-blocker-btn-to {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.yd-blocker-btn-resolve {
  border: 1px solid #1D9E75;
  color: #0F6E56;
  background: white;
}

.yd-blocker-btn-to {
  border: 1px solid #E0DFD9;
  color: #333;
  background: white;
}

.yd-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 0.5rem;
}

.yd-qr-panel {
  text-align: center;
}

.yd-qr-panel img {
  width: 100%;
  max-width: 140px;
  border-radius: 12px;
}

.yd-qr-solo {
  max-width: 260px;
}

.yd-actions {
  margin-bottom: 1rem;
}

.yd-actions .button {
  margin-bottom: 0.5rem;
}

/* Journal */
.yd-journal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.yd-journal-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.875rem;
}

.yd-journal-meta {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.78rem;
  min-width: 5.5rem;
  padding-top: 0.15em;
}

.yd-journal-body {
  flex: 1;
  min-width: 0;
}

.yd-journal-who {
  color: var(--muted);
  font-size: 0.8rem;
}

.yd-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.35em;
}

.yd-dot-red    { background: var(--danger); }
.yd-dot-green  { background: var(--success); }
.yd-dot-yellow { background: var(--warning); }
.yd-dot-blue   { background: var(--info); }

/* Status strip v4 badge separator dots */
.status-strip-sep {
  color: var(--muted);
  user-select: none;
}

/* Live indicator dot */
.yd-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 0.3rem;
  vertical-align: middle;
  animation: yd-pulse 2s infinite;
}

@keyframes yd-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@media (max-width: 680px) {
  .yd-top-grid {
    grid-template-columns: 1fr;
  }

  .yd-bottom-grid {
    grid-template-columns: 1fr;
  }

  .yd-qr-wa-grid {
    grid-template-columns: 1fr;
  }

  .yd-qr-card {
    order: 1;
  }

  .yd-wa-card {
    order: 2;
  }

  .yd-qr-panel {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    text-align: left;
  }

  .yd-qr-panel img {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
  }

  .yd-qr-panel .button-row {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
  }

  .yd-actions .button {
    width: 100%;
  }

  .status-strip {
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .dashboard-hero {
    padding: 1.5rem 1rem 1rem;
  }

  .dashboard-hero-actions {
    justify-content: flex-start;
  }

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

  .dashboard-updated-at {
    white-space: normal;
  }
}

/* ── Period segment control ── */

.period-seg-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.period-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.period-seg-item {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
  border-right: 1px solid var(--line);
  transition: background 120ms, color 120ms;
  user-select: none;
}

.period-seg-item:last-child {
  border-right: none;
}

.period-seg-item input[type="radio"] {
  display: none;
}

.period-seg-item.is-active,
.period-seg-item:has(input:checked) {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.period-seg-item:not(.is-active):hover {
  background: var(--neutral-soft);
  color: var(--text);
}

.empty-state .button {
  margin-top: 0.75rem;
  display: inline-block;
}

/* ── Inline helpers ── */

.null-date {
  color: #aaa;
}

.resolve-link {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.8rem;
  color: var(--danger);
  white-space: nowrap;
}

.resolve-link:hover {
  text-decoration: underline;
}

/* ── Mobile table / filter layout (< 768px) ── */

@media (max-width: 767px) {
  .hide-mobile {
    display: none;
  }

  /* Status + Base/Yacht in one row, search full-width below */
  .compact-filters {
    grid-template-columns: 1fr 1fr;
  }

  .compact-filters label:has(input[type="search"]),
  .compact-filters .filter-actions {
    grid-column: 1 / -1;
  }
}

/* ── Cleaner (CLEANING role) worker screen ── */

.cleaner-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.cleaner-hero {
  text-align: center;
}

.cleaner-role-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.cleaner-yacht-name {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.cleaner-charter-date {
  font-size: 1rem;
  margin: 0;
  color: var(--text);
}

.cleaner-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  font-size: 1.25rem;
  font-weight: 700;
  border: 2.5px solid transparent;
}

.cleaner-status--pending {
  background: var(--warning-soft);
  border-color: var(--warning);
  color: #92400e;
}

.cleaner-status--done {
  background: var(--success-soft);
  border-color: #16a34a;
  color: var(--success);
}

.cleaner-status-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.cleaner-task-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cleaner-task-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.cleaner-task-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.cleaner-task-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.cleaner-task-done-form {
  margin-top: 0.5rem;
}

.cleaner-no-tasks {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

.cleaner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cleaner-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 56px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  padding: 0 1.25rem;
  transition: filter 120ms, transform 120ms;
}

.cleaner-btn:active {
  transform: scale(0.97);
}

.cleaner-btn--primary {
  background: #16a34a;
  color: #fff;
}

.cleaner-btn--primary:hover {
  filter: brightness(1.08);
}

.cleaner-btn--report {
  background: var(--warning-soft);
  color: var(--warning);
  border: 2px solid var(--warning);
}

.cleaner-btn--report:hover {
  background: #fef3c7;
}

.cleaner-btn--task-done {
  background: var(--brand);
  color: #fff;
  min-height: 44px;
  font-size: 0.95rem;
}

.cleaner-btn--submit {
  background: var(--brand);
  color: #fff;
  min-height: 48px;
  font-size: 1rem;
}

.cleaner-report {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
}

.cleaner-report--open {
  display: block;
}

.cleaner-report-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.85rem;
}

.cleaner-input {
  width: 100%;
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
}
