:root {
  color-scheme: dark;
  --bg: #061211;
  --surface: #0a1918;
  --surface-soft: #102624;
  --ink: #ecfff8;
  --muted: #93aaa6;
  --line: rgba(126, 244, 225, 0.18);
  --accent: #27d7c8;
  --accent-strong: #9ffcf0;
  --accent-soft: rgba(39, 215, 200, 0.16);
  --blue: #1fb8ff;
  --violet: #d46bff;
  --amber: #d8f66a;
  --green: #73f2bf;
  --danger: #ff739b;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

.read-only .app-shell {
  grid-template-columns: minmax(318px, 388px) minmax(0, 1fr);
}

.read-only .admin-only {
  display: none !important;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #071513;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 24px;
}

.brand,
.topbar,
.panel-heading,
.section-heading,
.chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  justify-content: flex-start;
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: #03100f;
  font-weight: 900;
  letter-spacing: 0;
}

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

.brand h1 {
  font-size: 1.18rem;
  line-height: 1.18;
}

.brand p,
.chart-heading p,
.section-heading p,
.summary-strip p,
.muted,
.entry-meta,
.daily-meta {
  color: var(--muted);
}

.brand p {
  margin-top: 3px;
  font-size: 0.88rem;
}

.panel,
.summary-strip > div,
.chart-panel,
.floor-panel,
.image-panel,
.image-preview-panel,
.image-editor-panel,
.history-panel,
.reception-panel,
.entries-panel,
.controls-band {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel {
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2,
.section-heading h2,
.chart-heading h2 {
  font-size: 1rem;
  line-height: 1.25;
}

form {
  display: grid;
  gap: 10px;
}

label {
  color: #d8f4ee;
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d211f;
  color: var(--ink);
  outline: none;
  padding: 10px 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #7f9792;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 215, 200, 0.18);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-action,
.secondary-action,
.icon-button,
.text-button {
  border-radius: 6px;
  font-weight: 900;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  padding: 0 16px;
}

.primary-action {
  border: 0;
  background: var(--accent);
  color: #03100f;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.secondary-action.admin-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.secondary-action.compact {
  align-self: end;
  min-height: 38px;
  padding: 0 12px;
}

.text-button,
.icon-button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  text-decoration: none;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  place-items: center;
  font-size: 0.95rem;
  line-height: 1;
}

.danger {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

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

.topbar {
  align-items: flex-start;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(159, 252, 240, 0.12);
  color: #c6f9ef;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mode-badge.admin-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.topbar h2 {
  margin-top: 2px;
  font-size: 2rem;
  line-height: 1.08;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.summary-strip > div {
  min-height: 84px;
  padding: 15px;
}

.summary-strip span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--accent);
  font-size: 1.34rem;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#receivedCount,
#pendingDeliveryCount {
  overflow: visible;
  font-size: 1rem;
  white-space: normal;
}

.summary-strip p {
  margin-top: 4px;
  font-size: 0.86rem;
}

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

.chart-panel {
  min-width: 0;
  padding: 16px;
  box-shadow: var(--shadow);
}

.chart-panel-wide {
  grid-column: 1 / -1;
}

.chart-panel-wide canvas {
  height: 326px;
}

.chart-heading {
  align-items: flex-start;
  margin-bottom: 12px;
}

.chart-heading p,
.section-heading p {
  margin-top: 3px;
  font-size: 0.86rem;
}

canvas {
  display: block;
  width: 100%;
  height: 286px;
}

.controls-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.floor-panel,
.image-panel,
.image-preview-panel,
.image-editor-panel,
.history-panel,
.reception-panel,
.entries-panel {
  padding: 16px;
  box-shadow: var(--shadow);
}

.section-heading {
  align-items: flex-start;
  margin-bottom: 14px;
}

.collapsible-panel {
  overflow: hidden;
}

.collapsible-heading {
  list-style: none;
  margin: -4px -4px 14px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}

.collapsible-heading::-webkit-details-marker {
  display: none;
}

.collapsible-heading h2 {
  flex: 1 1 auto;
  min-width: 0;
}

.collapsible-heading:focus-visible {
  outline: 3px solid rgba(39, 215, 200, 0.24);
  outline-offset: 2px;
}

.collapsible-panel:not([open]) > .collapsible-heading {
  margin-bottom: 0;
}

.collapse-action {
  display: inline-flex;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--accent-strong);
}

.collapse-action::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 160ms ease;
}

.collapsible-heading:hover .collapse-action {
  border-color: rgba(159, 252, 240, 0.36);
  background: rgba(39, 215, 200, 0.12);
}

.collapsible-panel[open] .collapse-action::before {
  transform: rotate(225deg) translate(-1px, -1px);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #c2dad5;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  font-size: 0.9rem;
}

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

.floor-name {
  font-weight: 900;
}

.stacked-number {
  display: grid;
  gap: 3px;
}

.stacked-number strong {
  font-size: 0.96rem;
}

.stacked-number span {
  color: var(--muted);
  font-size: 0.78rem;
}

.dual-cell {
  display: grid;
  gap: 6px;
}

.dual-cell > span {
  display: block;
  color: #d8f4ee;
  font-size: 0.82rem;
  font-weight: 800;
}

.compact-stack {
  gap: 1px;
}

.progress-cell {
  min-width: 160px;
}

.percent-cell {
  min-width: 130px;
}

.percent-cell strong {
  display: block;
  font-size: 0.96rem;
}

.percent-cell span {
  color: var(--muted);
  font-size: 0.78rem;
}

.progress-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.84rem;
  font-weight: 900;
}

.meter {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(159, 252, 240, 0.12);
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #d8f4ee;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.tag.positive {
  background: rgba(115, 242, 191, 0.14);
  color: var(--green);
}

.tag.warning {
  background: rgba(216, 246, 106, 0.14);
  color: var(--amber);
}

.tag.danger {
  background: rgba(255, 115, 155, 0.14);
  color: var(--danger);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}

.sidebar-records {
  grid-template-columns: 1fr;
}

.sidebar-records .entry-card {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
}

.sidebar-records .entry-title-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sidebar-records .entry-title-row h3 {
  font-size: 1rem;
  line-height: 1.25;
}

.sidebar-records .tag {
  width: fit-content;
  max-width: 100%;
}

.sidebar-records .entry-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.sidebar-records .entry-meta span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(126, 244, 225, 0.12);
  border-radius: 6px;
  background: rgba(159, 252, 240, 0.06);
  color: #c7e4df;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sidebar-records .entry-note {
  padding: 9px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: rgba(39, 215, 200, 0.08);
}

.sidebar-records .entry-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar-records .entry-actions .text-button {
  width: 100%;
}

.sidebar-records .daily-row {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.daily-list,
.image-list,
.reception-list,
.entry-list {
  display: grid;
  gap: 10px;
}

.daily-row,
.image-card,
.entry-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d211f;
}

.daily-row {
  display: grid;
  grid-template-columns: minmax(84px, 120px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.daily-date {
  font-weight: 900;
}

.daily-meta {
  margin-top: 3px;
  font-size: 0.82rem;
}

.daily-bars {
  display: grid;
  gap: 8px;
}

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

.image-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.image-card-header {
  display: grid;
  gap: 6px;
}

.image-card img {
  display: block;
  width: 100%;
  height: min(72vh, 820px);
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  object-fit: contain;
}

.image-file-placeholder {
  display: grid;
  width: 100%;
  height: min(72vh, 820px);
  min-height: 460px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.image-card h3 {
  overflow-wrap: anywhere;
  font-size: 0.98rem;
}

.image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.image-preview-body {
  display: grid;
  gap: 10px;
}

.image-preview-body img,
.image-preview-body iframe {
  display: block;
  width: 100%;
  min-height: min(72vh, 720px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.image-preview-body img {
  height: auto;
  max-height: 72vh;
  object-fit: contain;
}

.preview-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.image-editor-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.image-editor-toolbar .compact {
  align-self: end;
}

.checkbox-control {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d211f;
}

.checkbox-control input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.image-editor-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

#imageEditorCanvas {
  display: block;
  width: 100%;
  max-height: 72vh;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

.daily-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #d8f4ee;
  font-size: 0.82rem;
  font-weight: 900;
}

.entry-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px;
}

.entry-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.entry-title-row h3 {
  overflow-wrap: anywhere;
  font-size: 0.98rem;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 7px;
  font-size: 0.86rem;
}

.entry-note {
  margin-top: 8px;
  color: #b5cbc7;
  font-size: 0.88rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.entry-actions {
  display: flex;
  gap: 6px;
}

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

#receptionChart.has-tooltip-target {
  cursor: help;
}

.chart-tooltip {
  position: fixed;
  z-index: 30;
  max-width: min(260px, calc(100vw - 20px));
  min-width: 178px;
  padding: 9px 10px 10px;
  border: 1px solid rgba(205, 228, 255, 0.24);
  border-left: 4px solid #4fa3ff;
  border-radius: 7px;
  background: #071018;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.35;
  pointer-events: none;
}

.chart-tooltip[data-tone="co2"] {
  border-left-color: #f2c94c;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 3px;
  color: #eef6ff;
  font-size: 0.82rem;
}

.chart-tooltip-value {
  margin-bottom: 2px;
  color: #dffefb;
  font-weight: 900;
}

.chart-tooltip span {
  display: block;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(430px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #0d211f;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 980px) {
  .summary-strip {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .dashboard-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .monthly-plan-list {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .sidebar,
  .workspace {
    padding: 16px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .summary-strip,
  .controls-band {
    grid-template-columns: 1fr;
  }

  .monthly-plan-list {
    grid-template-columns: 1fr;
  }

  .daily-row,
  .image-editor-toolbar,
  .entry-card {
    grid-template-columns: 1fr;
  }

  .entry-actions {
    flex-wrap: wrap;
  }
}

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

  .topbar h2 {
    font-size: 1.55rem;
  }

  canvas {
    height: 238px;
  }
}

/* Power BI style dashboard layer */
:root {
  --bg: #0b1118;
  --surface: #111b24;
  --surface-soft: #16222e;
  --surface-strong: #0d1620;
  --ink: #eef6ff;
  --muted: #9fb0c5;
  --line: rgba(205, 228, 255, 0.14);
  --accent: #2ce4d3;
  --accent-strong: #dffefb;
  --accent-soft: rgba(44, 228, 211, 0.14);
  --blue: #4fa3ff;
  --violet: #8f7cff;
  --amber: #f2c94c;
  --green: #42d392;
  --danger: #ff6b6b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

body {
  background:
    linear-gradient(135deg, rgba(44, 228, 211, 0.11), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(79, 163, 255, 0.14), transparent 30%),
    var(--bg);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

.app-shell,
.read-only .app-shell {
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  padding: 22px;
}

.sidebar {
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 22, 31, 0.92);
  box-shadow: var(--shadow);
}

.workspace {
  gap: 16px;
  padding: 0;
}

.brand {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--amber), var(--accent));
  color: #071015;
  font-size: 0.94rem;
}

.brand h1 {
  font-size: 1rem;
  line-height: 1.15;
}

.brand p {
  color: #b9c9dd;
}

.panel,
.summary-strip > div,
.chart-panel,
.floor-panel,
.image-panel,
.image-preview-panel,
.image-editor-panel,
.history-panel,
.reception-panel,
.entries-panel,
.controls-band,
.side-status-panel,
.heatmap-panel,
.alerts-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 27, 36, 0.92);
  box-shadow: var(--shadow);
}

.topbar {
  align-items: center;
  min-height: 92px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 27, 36, 0.86);
  box-shadow: var(--shadow);
}

.topbar h2 {
  margin-top: 4px;
  font-size: 1.58rem;
  line-height: 1.1;
}

.topbar-subtitle {
  margin-top: 6px;
  color: #bcd0e5;
  font-size: 0.92rem;
}

.eyebrow {
  color: #9fd5ff;
  font-size: 0.74rem;
}

.mode-badge,
.metric-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(44, 228, 211, 0.4);
  border-radius: 999px;
  background: rgba(44, 228, 211, 0.1);
  color: #dffefb;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.toolbar {
  max-width: 520px;
}

.primary-action,
.secondary-action,
.icon-button,
.text-button {
  border-radius: 6px;
}

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

.secondary-action,
.text-button,
.icon-button {
  background: var(--surface-soft);
}

.side-filter-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  padding: 16px;
}

.side-panel-heading {
  display: grid;
  gap: 4px;
}

.side-panel-heading h2,
.side-status-panel h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.side-panel-heading p,
.side-status-panel p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.side-filter-panel .compact {
  width: 100%;
}

.side-status-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.status-line {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #d7f9f4;
  font-size: 0.84rem;
  font-weight: 800;
}

.status-line span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 16px rgba(66, 211, 146, 0.78);
}

label {
  color: #b9c9dd;
  font-size: 0.74rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
select,
textarea,
.checkbox-control {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

.summary-strip {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.summary-strip > div {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 16px;
}

.summary-strip > div::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--kpi-accent, var(--accent));
}

.summary-strip > div:nth-child(1) { --kpi-accent: var(--accent); }
.summary-strip > div:nth-child(2) { --kpi-accent: var(--blue); }
.summary-strip > div:nth-child(3) { --kpi-accent: var(--amber); }
.summary-strip > div:nth-child(4) { --kpi-accent: var(--blue); }
.summary-strip > div:nth-child(5) { --kpi-accent: var(--green); }
.summary-strip > div:nth-child(6) { --kpi-accent: var(--amber); }
.summary-strip > div:nth-child(7) { --kpi-accent: #ff9f43; }
.summary-strip > div:nth-child(8) { --kpi-accent: var(--violet); }
.summary-strip > div:nth-child(9) { --kpi-accent: var(--danger); }
.summary-strip > div:nth-child(10) { --kpi-accent: var(--green); }

.summary-strip span {
  color: #f4fbff;
  font-size: 2rem;
  line-height: 1;
}

#receivedCount,
#pendingDeliveryCount,
#lastUpdated {
  font-size: 1rem;
  line-height: 1.3;
}

.summary-strip p {
  margin-top: 10px;
  color: #b7c7d9;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  grid-template-areas:
    "floor hospital"
    "floor reception";
  gap: 14px;
}

.dashboard-grid .chart-panel:nth-child(1) {
  grid-area: hospital;
}

.dashboard-grid .chart-panel:nth-child(2) {
  grid-area: floor;
}

.dashboard-grid .chart-panel:nth-child(3) {
  grid-area: reception;
  grid-column: auto;
}

.chart-panel {
  min-height: 338px;
  padding: 16px;
  overflow: hidden;
}

.dashboard-grid .chart-panel:nth-child(2) {
  min-height: 690px;
}

.chart-heading {
  margin-bottom: 12px;
}

.chart-heading h2,
.section-heading h2,
.panel-heading h2 {
  font-size: 1rem;
}

.chart-heading p,
.section-heading p {
  color: #b7c7d9;
}

canvas {
  height: 258px;
  border-radius: 7px;
  background: var(--surface);
}

.dashboard-grid .chart-panel:nth-child(2) canvas {
  height: 588px;
}

.dashboard-grid .chart-panel:nth-child(3) canvas {
  height: 258px;
}

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

.heatmap-panel,
.alerts-panel {
  padding: 16px;
}

.heatmap-panel {
  min-height: 0;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(86px, 1fr));
  gap: 8px;
}

.heat-tile {
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--heat-border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--heat-bg), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.04);
}

.heat-tile.heat-low {
  --heat-bg: rgba(255, 107, 107, 0.26);
  --heat-border: rgba(255, 107, 107, 0.48);
}

.heat-tile.heat-medium {
  --heat-bg: rgba(255, 159, 67, 0.24);
  --heat-border: rgba(255, 159, 67, 0.48);
}

.heat-tile.heat-high {
  --heat-bg: rgba(44, 228, 211, 0.23);
  --heat-border: rgba(44, 228, 211, 0.42);
}

.heat-tile.heat-complete {
  --heat-bg: rgba(66, 211, 146, 0.28);
  --heat-border: rgba(66, 211, 146, 0.5);
}

.heat-label,
.heat-meta {
  display: block;
  color: #b9c9dd;
  font-size: 0.75rem;
  font-weight: 800;
}

.heat-tile strong {
  display: block;
  margin-top: 8px;
  color: #f4fbff;
  font-size: 1.25rem;
  line-height: 1;
}

.heat-meta {
  margin-top: 6px;
  color: #91e6dd;
}

.action-insights {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 12px;
  margin-top: 14px;
}

.action-insight-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(141, 172, 202, 0.2);
  border-radius: 8px;
  background: rgba(9, 18, 26, 0.46);
}

.action-insight-priority {
  border-color: rgba(44, 228, 211, 0.28);
  box-shadow: inset 0 3px 0 rgba(44, 228, 211, 0.82);
}

.action-insight-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.action-insight-heading h3 {
  margin: 0;
  color: #f4fbff;
  font-size: 0.95rem;
  line-height: 1.2;
}

.action-insight-heading p,
.projection-note {
  margin-top: 3px;
  color: #b9d7fb;
  font-size: 0.8rem;
  line-height: 1.35;
}

.priority-list {
  display: grid;
  gap: 9px;
}

.priority-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 100px;
  gap: 10px;
  align-items: center;
}

.priority-floor,
.priority-value {
  color: #eef6ff;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.priority-value {
  text-align: right;
}

.priority-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(205, 228, 255, 0.1);
}

.priority-fill {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--accent));
}

.priority-row[data-tone="delivery"] .priority-fill {
  background: linear-gradient(90deg, var(--amber), #ff9f43);
}

.priority-row[data-tone="ok"] .priority-fill {
  background: var(--green);
}

.action-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.action-chip {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(141, 172, 202, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
}

.action-chip span,
.projection-stat span {
  display: block;
  color: #9fb0c5;
  font-size: 0.72rem;
  font-weight: 800;
}

.action-chip strong,
.projection-stat strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #f4fbff;
  font-size: 0.92rem;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-chip strong {
  overflow-wrap: anywhere;
  white-space: normal;
}

.projection-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 12px;
  align-items: stretch;
}

.projection-sparkline {
  display: block;
  width: 100%;
  min-height: 128px;
}

.sparkline-guide {
  fill: none;
  stroke: rgba(205, 228, 255, 0.16);
  stroke-width: 1;
}

.sparkline-path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.sparkline-marker {
  fill: var(--accent);
  stroke: #0b1118;
  stroke-width: 2;
}

.sparkline-label,
.sparkline-empty {
  fill: #9fb0c5;
  font-size: 11px;
  font-weight: 800;
}

.projection-stats {
  display: grid;
  gap: 8px;
}

.projection-stat {
  padding: 8px 9px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.projection-stat.warning {
  border-left-color: #ff9f43;
}

.projection-note {
  margin-top: 11px;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.alert-card.warning {
  border-left-color: #ff9f43;
}

.alert-card.positive {
  border-left-color: var(--green);
}

.alert-card h3 {
  margin: 0 0 6px;
  color: #f4fbff;
  font-size: 0.88rem;
}

.alert-card p {
  color: #bcd0e5;
  font-size: 0.82rem;
  line-height: 1.38;
}

.floor-panel,
.image-panel,
.image-preview-panel,
.image-editor-panel,
.history-panel,
.reception-panel,
.entries-panel {
  padding: 16px;
}

.floor-panel .section-heading {
  padding: 0;
}

.table-wrap {
  border-radius: 7px;
}

table {
  min-width: 980px;
}

.floor-summary-table {
  min-width: 1160px;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.floor-summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 10px;
  border-bottom: 0;
  background: #0d1620;
  color: #cfe6ff;
  font-size: 0.72rem;
  letter-spacing: 0;
}

.floor-summary-table tbody tr {
  background: rgba(9, 18, 26, 0.66);
}

.floor-summary-table tbody tr:hover {
  background: rgba(22, 42, 58, 0.82);
}

.floor-summary-table td {
  padding: 9px 10px;
  border-top: 1px solid rgba(141, 172, 202, 0.18);
  border-bottom: 1px solid rgba(141, 172, 202, 0.18);
  color: #eef6ff;
}

.floor-summary-table td:first-child {
  border-left: 1px solid rgba(141, 172, 202, 0.18);
  border-radius: 8px 0 0 8px;
}

.floor-summary-table td:last-child {
  border-right: 1px solid rgba(141, 172, 202, 0.18);
  border-radius: 0 8px 8px 0;
}

.floor-name-cell {
  min-width: 108px;
}

.floor-name-main,
.floor-name-meta,
.summary-line-label,
.summary-line-percent,
.numeric-focus-cell span,
.status-result-cell span,
.over-target-cell small,
.mini-label,
.mini-detail {
  display: block;
}

.floor-name-main {
  color: #f4fbff;
  font-size: 0.95rem;
}

.floor-name-meta,
.summary-line-percent,
.numeric-focus-cell span,
.status-result-cell span,
.over-target-cell small,
.mini-label,
.mini-detail {
  color: #9fb0c5;
  font-size: 0.72rem;
  font-weight: 800;
}

.summary-breakdown {
  display: grid;
  gap: 5px;
  min-width: 170px;
}

.summary-line {
  display: grid;
  grid-template-columns: 58px minmax(66px, 1fr) 44px;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(141, 172, 202, 0.16);
  border-left: 3px solid var(--blue);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.summary-line.co2 {
  border-left-color: var(--amber);
}

.summary-line strong {
  color: #f4fbff;
  font-size: 0.9rem;
  text-align: right;
  white-space: nowrap;
}

.summary-line-percent {
  text-align: right;
}

.progress-cell {
  min-width: 190px;
}

.floor-summary-table .progress-topline {
  align-items: center;
  margin-bottom: 8px;
}

.floor-summary-table .progress-topline > span:first-child {
  color: #f4fbff;
  font-size: 1rem;
}

.progress-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.progress-state.pending {
  background: rgba(255, 159, 67, 0.13);
  color: #ffd58a;
}

.progress-state.complete {
  background: rgba(66, 211, 146, 0.14);
  color: #9ef2cc;
}

.progress-state.neutral {
  background: rgba(205, 228, 255, 0.1);
  color: #b9c9dd;
}

.floor-summary-table .meter {
  height: 8px;
  background: rgba(205, 228, 255, 0.12);
}

.pending-summary-cell {
  display: grid;
  min-width: 190px;
  gap: 6px;
}

.pending-group {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid rgba(141, 172, 202, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.mini-value {
  color: #f4fbff;
  font-size: 0.92rem;
}

.numeric-focus-cell,
.status-result-cell,
.over-target-cell {
  min-width: 86px;
  text-align: center;
}

.numeric-focus-cell strong,
.status-result-cell strong,
.over-target-cell span {
  display: block;
  color: #f4fbff;
  font-size: 1rem;
}

.numeric-focus-cell.muted-value strong {
  color: #9fb0c5;
}

.status-result-cell strong {
  width: fit-content;
  min-width: 58px;
  margin: 0 auto 4px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 159, 67, 0.16);
  color: #ffd58a;
}

.status-result-cell.complete strong {
  min-width: 78px;
  background: rgba(66, 211, 146, 0.15);
  color: #9ef2cc;
}

.over-target-cell span {
  width: fit-content;
  min-width: 28px;
  margin: 0 auto 3px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(205, 228, 255, 0.1);
}

.over-target-cell.warning span {
  background: rgba(255, 107, 107, 0.18);
  color: #ffb3b3;
}

.over-target-cell.ok span {
  color: #cfe6ff;
}

th {
  color: #b5c6db;
  font-size: 0.72rem;
}

td {
  color: #e7f2ff;
}

.daily-row,
.image-card,
.entry-card,
.empty-state {
  background: rgba(255, 255, 255, 0.04);
}

.image-card img,
.image-file-placeholder,
.image-preview-body img,
.image-preview-body iframe,
.image-editor-wrap {
  background: var(--surface-strong);
}

.toast {
  background: var(--surface);
}

@media (max-width: 1280px) {
  .app-shell,
  .read-only .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
    padding: 18px;
  }

  .summary-strip {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .heatmap-grid {
    grid-template-columns: repeat(7, minmax(74px, 1fr));
  }
}

@media (max-width: 1080px) {
  .app-shell,
  .read-only .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 1px solid var(--line);
  }

  .dashboard-grid,
  .insights-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .dashboard-grid .chart-panel:nth-child(1),
  .dashboard-grid .chart-panel:nth-child(2),
  .dashboard-grid .chart-panel:nth-child(3) {
    grid-area: auto;
  }

  .dashboard-grid .chart-panel:nth-child(2) {
    min-height: 390px;
  }

  .dashboard-grid .chart-panel:nth-child(2) canvas {
    height: 300px;
  }

  .heatmap-grid {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell,
  .read-only .app-shell {
    padding: 12px;
  }

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

  .summary-strip {
    grid-template-columns: 1fr 1fr;
  }

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

  .action-insights,
  .projection-body {
    grid-template-columns: 1fr;
  }

  .action-chip-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .summary-strip,
  .heatmap-grid {
    grid-template-columns: 1fr;
  }

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

  .priority-value {
    grid-column: 2;
    text-align: left;
  }

  .summary-strip span {
    font-size: 1.72rem;
  }
}

/* Executive dashboard refresh */
body {
  background:
    linear-gradient(135deg, rgba(44, 228, 211, 0.1), transparent 24%),
    linear-gradient(145deg, #071015, #0b1118 44%, #0d1620);
}

.app-shell,
.read-only .app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 18px;
  padding: 22px;
}

.sidebar {
  gap: 18px;
  min-height: calc(100vh - 44px);
  position: sticky;
  top: 22px;
  align-self: start;
  height: calc(100vh - 44px);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 18px;
  border-color: rgba(121, 154, 184, 0.24);
  background: rgba(8, 16, 23, 0.9);
  box-shadow: none;
}

.brand {
  padding-bottom: 18px;
}

.brand-mark {
  width: 42px;
  height: 42px;
}

.brand h1 {
  max-width: 140px;
  color: #f4fbff;
  font-size: 0.98rem;
  font-weight: 900;
}

.brand p {
  color: #bad2ef;
  font-size: 0.9rem;
}

.side-filter-panel {
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.side-filter-panel label {
  display: block;
  margin-bottom: 7px;
  color: #9fc3f6;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.side-filter-panel select {
  min-height: 40px;
  padding-right: 34px;
  border-color: rgba(141, 172, 202, 0.24);
  background:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%) calc(100% - 17px) 17px / 8px 8px no-repeat,
    linear-gradient(135deg, var(--accent) 50%, transparent 50%) calc(100% - 11px) 17px / 8px 8px no-repeat,
    #0b151e;
  appearance: none;
  color: #f4fbff;
  font-size: 0.86rem;
  font-weight: 800;
}

.view-block {
  display: grid;
}

.view-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.view-switcher button {
  min-height: 33px;
  padding: 0 10px;
  border: 1px solid rgba(141, 172, 202, 0.22);
  border-radius: 6px;
  background: #0b151e;
  color: #eef6ff;
  font-size: 0.79rem;
  font-weight: 900;
}

.view-switcher button.active {
  border-color: rgba(44, 228, 211, 0.7);
  background: rgba(44, 228, 211, 0.2);
  color: #dffefb;
}

.subtle-action {
  display: none;
}

.side-status-panel {
  gap: 8px;
  padding: 18px 16px;
  border-color: rgba(141, 172, 202, 0.24);
  background: rgba(17, 27, 36, 0.72);
  box-shadow: none;
}

.side-status-panel h2 {
  color: #f4fbff;
  font-size: 1.05rem;
}

.side-status-panel p {
  color: #b8d2f1;
  font-size: 0.82rem;
}

.status-line {
  display: none;
}

.mode-badge {
  justify-self: start;
  min-height: 24px;
  margin-top: 4px;
  font-size: 0.68rem;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.read-only .sidebar-actions {
  display: none;
}

.read-only:not(.floor-selected) .sidebar-records {
  display: none;
}

.topbar {
  min-height: 90px;
  padding: 18px 20px;
  border-color: rgba(141, 172, 202, 0.24);
  background: rgba(17, 27, 36, 0.76);
  box-shadow: none;
}

.topbar h2 {
  margin: 0;
  color: #f4fbff;
  font-size: 1.55rem;
  line-height: 1.15;
}

.topbar-subtitle {
  color: #a9d5ff;
  font-size: 0.88rem;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f4fbff;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.live-indicator span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(66, 211, 146, 0.9);
}

.summary-strip {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.summary-strip > div {
  min-height: 118px;
  padding: 16px;
  border-color: rgba(141, 172, 202, 0.24);
  background: rgba(17, 27, 36, 0.8);
  box-shadow: none;
}

.summary-strip .kpi-label {
  margin: 0 0 8px;
  color: #9fc3f6;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-strip span {
  color: #f4fbff;
  font-size: 2.1rem;
  line-height: 1;
}

.summary-strip p:not(.kpi-label) {
  margin-top: 10px;
  color: #b9d7fb;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: none;
}

.summary-strip > div:nth-child(1) { --kpi-accent: var(--accent); }
.summary-strip > div:nth-child(2) { --kpi-accent: var(--blue); }
.summary-strip > div:nth-child(3) { --kpi-accent: var(--amber); }
.summary-strip > div:nth-child(4) { --kpi-accent: #ff9f43; }
.summary-strip > div:nth-child(5) { --kpi-accent: var(--green); }

.dashboard-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.94fr);
  grid-template-areas:
    "floor hospital"
    "floor reception";
  gap: 14px;
}

.chart-panel {
  min-height: 312px;
  padding: 16px;
  border-color: rgba(141, 172, 202, 0.24);
  background: rgba(17, 27, 36, 0.78);
  box-shadow: none;
}

.dashboard-grid .chart-panel:nth-child(2) {
  min-height: 626px;
}

.chart-heading {
  margin-bottom: 8px;
}

.chart-heading h2 {
  color: #f4fbff;
  font-size: 1rem;
}

.chart-heading p {
  color: #b9d7fb;
  font-size: 0.82rem;
}

.metric-badge {
  min-height: 28px;
  border-color: rgba(44, 228, 211, 0.44);
  background: rgba(44, 228, 211, 0.12);
  color: #dffefb;
  font-size: 0.72rem;
  text-transform: none;
}

canvas {
  background: transparent;
}

.dashboard-grid .chart-panel:nth-child(1) canvas,
.dashboard-grid .chart-panel:nth-child(3) canvas {
  height: 250px;
}

.dashboard-grid .chart-panel:nth-child(2) canvas {
  height: 552px;
}

.insights-grid {
  margin-top: 0;
}

.heatmap-panel,
.alerts-panel,
.floor-panel,
.image-panel,
.image-preview-panel,
.image-editor-panel,
.history-panel,
.reception-panel,
.entries-panel {
  border-color: rgba(141, 172, 202, 0.24);
  background: rgba(17, 27, 36, 0.76);
  box-shadow: none;
}

@media (max-width: 1280px) {
  .summary-strip {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 1080px) {
  .app-shell,
  .read-only .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: 0;
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .dashboard-grid .chart-panel:nth-child(1),
  .dashboard-grid .chart-panel:nth-child(2),
  .dashboard-grid .chart-panel:nth-child(3) {
    grid-area: auto;
  }

  .dashboard-grid .chart-panel:nth-child(2) {
    min-height: 420px;
  }

  .dashboard-grid .chart-panel:nth-child(2) canvas {
    height: 330px;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .read-only .app-shell {
    padding: 12px;
  }

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

  .summary-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .summary-strip {
    grid-template-columns: 1fr;
  }
}

/* Edition sidebar polish */
@media (min-width: 1081px) {
  body:not(.read-only) .app-shell {
    grid-template-columns: 328px minmax(0, 1fr);
  }

  body:not(.read-only) .sidebar {
    position: sticky;
    top: 22px;
    align-self: start;
    height: calc(100vh - 44px);
    max-height: calc(100vh - 44px);
    overflow-y: auto;
  }
}

body:not(.read-only) .sidebar {
  gap: 14px;
  padding: 16px;
  background: rgba(9, 17, 25, 0.96);
  scrollbar-gutter: stable;
}

body:not(.read-only) .brand {
  padding-bottom: 14px;
}

body:not(.read-only) .brand h1 {
  max-width: none;
}

body:not(.read-only) .side-filter-panel {
  gap: 12px;
}

body:not(.read-only) .side-status-panel {
  padding: 15px;
}

body:not(.read-only) .side-status-panel p {
  line-height: 1.42;
}

body:not(.read-only) .sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

body:not(.read-only) .sidebar-actions .secondary-action {
  align-self: stretch;
  min-height: 42px;
  padding: 8px 10px;
  line-height: 1.18;
  white-space: normal;
}

body:not(.read-only) #adminUnlockBtn,
body:not(.read-only) #sharePublicBtn {
  grid-column: 1 / -1;
}

body:not(.read-only) #adminUnlockBtn {
  border-color: rgba(44, 228, 211, 0.72);
  background: rgba(44, 228, 211, 0.18);
  color: #dffefb;
}

body:not(.read-only) .sidebar-panel,
body:not(.read-only) .sidebar-records > .collapsible-panel {
  padding: 0;
  overflow: hidden;
  border-color: rgba(141, 172, 202, 0.24);
  background: rgba(17, 27, 36, 0.74);
  box-shadow: none;
}

body:not(.read-only) .sidebar-panel[open] {
  flex-shrink: 0;
}

body:not(.read-only) .sidebar-panel:not([open]),
body:not(.read-only) .sidebar-records > .collapsible-panel:not([open]) {
  min-height: 50px;
}

body:not(.read-only) .sidebar-panel > .collapsible-heading,
body:not(.read-only) .sidebar-records .collapsible-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 11px 13px;
  border-radius: 0;
}

body:not(.read-only) .sidebar-panel[open] > .collapsible-heading,
body:not(.read-only) .sidebar-records .collapsible-panel[open] > .collapsible-heading {
  border-bottom: 1px solid rgba(141, 172, 202, 0.16);
}

body:not(.read-only) .sidebar-panel .collapsible-heading h2,
body:not(.read-only) .sidebar-records .collapsible-heading h2 {
  color: #f4fbff;
  font-size: 0.94rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

body:not(.read-only) .sidebar-records .section-heading p {
  max-width: 210px;
  color: #9fb8d5;
  font-size: 0.76rem;
  line-height: 1.32;
}

body:not(.read-only) .sidebar-panel form {
  padding: 13px;
  gap: 8px;
}

body:not(.read-only) .sidebar-panel label {
  color: #9fc3f6;
  font-size: 0.72rem;
  text-transform: uppercase;
}

body:not(.read-only) .sidebar-panel input,
body:not(.read-only) .sidebar-panel select,
body:not(.read-only) .sidebar-panel textarea {
  min-height: 38px;
  border-color: rgba(141, 172, 202, 0.24);
  background: #0b151e;
  color: #f4fbff;
}

body:not(.read-only) .sidebar-panel textarea {
  min-height: 74px;
}

body:not(.read-only) .sidebar-panel .primary-action,
body:not(.read-only) .sidebar-panel .secondary-action {
  min-height: 40px;
  margin-top: 4px;
}

body:not(.read-only) .sidebar-records {
  display: grid;
  gap: 10px;
}

body:not(.read-only) .sidebar-records .daily-list,
body:not(.read-only) .sidebar-records .reception-list,
body:not(.read-only) .sidebar-records .entry-list {
  padding: 12px;
}

body:not(.read-only) .collapse-action {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  border-color: rgba(141, 172, 202, 0.26);
  background: rgba(11, 21, 30, 0.95);
}
