/*
  Light mode token palette keeps the bright blue branding for primary actions
  but shifts most surfaces to muted blue-greys so the interface feels calmer.
*/
:root {
  --color-brand-primary: #1f66e5;
  --color-brand-primary-strong: #164cad;
  --color-brand-muted: #3c4e78;
  --color-focus: #2f81f7;
  --color-surface: #fdfdfb;
  --color-surface-alt: #f4f7fb;
  --color-panel: #e8edf5;
  --color-panel-alt: #dfe6f0;
  --color-content-bg: #f7f6f2;
  --color-content-alt: #f3f2ed;
  --color-panel-line: rgba(31, 50, 83, 0.12);
  --color-border: rgba(31, 50, 83, 0.18);
  --color-border-soft: rgba(31, 50, 83, 0.08);
  --color-text: #1f2328;
  --color-text-muted: #4b5464;
  --color-heading: #2a3448;
  --shadow-strong: 0 38px 75px rgba(16, 24, 40, 0.35);
  --shadow-soft: 0 12px 30px rgba(21, 35, 58, 0.15);
}

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-x: contain;
  font-family: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  background: radial-gradient(circle at top, #e8f0ff 0%, #d9e5f7 45%, #cfd7eb 100%);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.55;
}


/* Flexbox container */
.flex-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: transparent;
  overflow: hidden;
}

/* Grid container */
.grid-container {
  display: grid;
  grid-template-rows: auto auto 1fr;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 10px;
  background-color: var(--color-surface);
  width: min(1200px, 100%);
  height: 100vh;
  padding: 28px 32px 32px;
  box-sizing: border-box;
  overflow: auto;
  border-radius: 32px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-strong);
}

.page-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 32px;
  padding: 28px 32px 32px;
  background-color: var(--color-surface);
  border-radius: 32px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
  box-sizing: border-box;
}

.flash-message {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2000;
  width: min(420px, calc(100vw - 36px));
  padding: 16px 18px;
  border: 1px solid rgba(31, 50, 83, 0.14);
  border-left: 5px solid var(--color-focus, #2f81f7);
  border-radius: 10px;
  background-color: var(--color-surface, #fdfdfb);
  color: var(--color-text, #1f2328);
  box-shadow: 0 18px 45px rgba(18, 38, 74, 0.22);
  opacity: 1;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.flash-message--error {
  border-left-color: #c0392b;
}

.flash-message--warning {
  border-left-color: #d19a00;
}

.flash-message.fade-out {
  opacity: 0;
  transform: translateY(-6px);
}

.flash-message__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.flash-message__title {
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
}

.flash-message__dismiss {
  border: none;
  background: transparent;
  color: var(--color-text-muted, #4b5464);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 2px;
}

.flash-message__detail {
  margin: 0;
  color: var(--color-text-muted, #4b5464);
  line-height: 1.45;
}

.flash-reset-link {
  margin-top: 12px;
}

.flash-reset-link label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-heading, #2a3448);
}

.flash-reset-link__row {
  display: flex;
  gap: 8px;
}

.flash-reset-link input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border, rgba(31, 50, 83, 0.18));
  border-radius: 6px;
  color: var(--color-text, #1f2328);
  font-size: 0.9rem;
}

.flash-reset-link button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: var(--color-brand-primary, #1f66e5);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 640px) {
  .flash-message {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .flash-reset-link__row {
    flex-direction: column;
  }
}

@media (min-width: 1536px) and (max-width: 1799px) {
  .grid-container {
    width: min(1320px, 100%);
  }

  .page-shell {
    max-width: 1320px;
  }

  .outreach-grid-container {
    width: min(1180px, 100%);
  }
}

@media (min-width: 1800px) {
  .grid-container {
    width: min(1400px, 100%);
  }

  .page-shell {
    max-width: 1400px;
  }

  .outreach-grid-container {
    width: min(1260px, 100%);
  }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  .grid-container {
    width: min(1280px, 100%);
  }

  .page-shell {
    max-width: 1280px;
  }

  .outreach-grid-container {
    width: min(1180px, 100%);
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: 100%;
    margin: 0;
    padding: 20px 16px 24px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }
}

.page-shell > .header {
  margin-bottom: 20px;
}

/* Header */
.header {
  grid-column: 1 / -1;
  background-color: transparent;
  color: var(--color-text-muted);
  padding: 0;
  text-align: right;
  font-weight: 600;
}

/* Title bar */
.title-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-panel);
  color: var(--color-heading);
  padding: 20px;
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--color-panel-line);
}

/* Center title text */
.title {
  flex-grow: 1;
  text-align: center;
  font-weight: 300;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--color-text-muted);
  letter-spacing: 0.015em;
}

/* Menu button */
.menu-button {
  position: absolute;
  left: 4px;
  padding: 8px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-brand-primary-strong);
  border-radius: 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  display: none;
}

.menu-button.back-link {
  position: static;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 4px 9px;
  background-color: transparent;
  border: none;
  box-shadow: none;
  color: var(--color-brand-primary-strong);
  text-decoration: none;
  display: none;
  align-items: center;
  gap: 4px;
}

.menu-button .icon,
.menu-button.back-link .icon {
  width: 18px;
  height: 18px;
  display: block;
}

.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;
}

/* Grid items */
.grid-item {
  background-color: var(--color-surface-alt);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--color-border-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.left-side {
  background-color: var(--color-panel);
  border-right: 1px solid var(--color-panel-line);
  box-shadow: inset -2px 0 10px rgba(20, 32, 50, 0.09);
}

.right-side {
  background-color: var(--color-surface);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Sidebar button */
.sidebar-button {
  padding: 10px;
  margin: 8px auto;
  background: linear-gradient(180deg, #eef2fb 0%, #e0e7f4 100%);
  border: 1px solid var(--color-border-soft);
  color: var(--color-brand-primary-strong);
  cursor: pointer;
  width: 80%;
  text-align: center;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: block;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 25px rgba(22, 33, 52, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sidebar-button:hover {
  transform: translateY(-1px);
  border-color: var(--color-border);
  box-shadow: 0 16px 30px rgba(22, 33, 52, 0.14);
}

.sidebar-button a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.sidebar-button.back-link {
  width: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sidebar-button .icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* Tabs */
.tabs {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.tab-buttons {
  display: flex;
  background-color: transparent;
  gap: 6px;
  margin-bottom: 8px;
  min-width: 0;
}

.tab-button {
  flex: 1;
  min-width: 0;
  padding: 10px;
  cursor: pointer;
  background-color: var(--color-panel);
  border: 1px solid var(--color-panel-line);
  color: var(--color-heading);
  text-align: center;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-button.active {
  background-color: var(--color-brand-primary);
  color: #fff;
  border-color: var(--color-brand-primary);
  box-shadow: 0 10px 22px rgba(31, 102, 229, 0.38);
}

.tab-content {
  display: none;
  flex-grow: 1;
  min-width: 0;
  padding: 0;
  background-color: var(--color-panel);
  overflow-y: scroll;
  border-radius: 12px;
  border: 1px solid var(--color-panel-line);
  box-shadow: inset 0 1px 10px rgba(17, 34, 58, 0.12);
}

.tab-content.active {
  display: block;
  height: 100%;
}

/* Full page text box with sticky footer */
#Tab1 {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#Tab2 {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#Tab2 #daily-checks-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-content.reports-tab {
  background-color: var(--color-content-bg);
  padding: 24px;
  box-sizing: border-box;
}

.text-box-container {
  flex-grow: 0;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  display: block;
}

.text-box-container textarea {
  flex-grow: 0;
  width: 100%;
  height: 60px;
  overflow-y: auto;
  resize: none;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px;
  background-color: var(--color-content-alt);
  box-sizing: border-box;
}

.text-box-container textarea:focus,
.note-textarea:focus,
.new-message-textarea:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: inset 0 0 0 1px var(--color-focus);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: inset 0 0 0 1px var(--color-focus);
}

.note-textarea {
  width: 100%;
  height: 160px;
  border: 1px solid var(--color-border-soft);
  resize: none;
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.5;
  padding: 1em;
  margin-bottom: 0em;
  border-radius: 0 0 6px 6px;
  background-color: #fff;
  box-sizing: border-box;
}

.sticky-footer {
  display: flex;
  justify-content: flex-end;
  background-color: var(--color-panel-alt);
  padding: 10px;
  position: sticky;
  bottom: 0;
  border-top: 1px solid var(--color-border);
  margin: 0em;
}

.sticky-footer button {
  margin-left: 10px;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  background-color: var(--color-brand-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(31, 102, 229, 0.35);
}

/* Checklist container */
#Tab2 .checklist-container {
  flex: 1;
  min-height: 82vh;
  overflow-y: auto;
  padding: 10px;
  background-color: var(--color-content-bg);
  box-sizing: border-box;
  padding-bottom: 50px;
}

/* Area styles */
.diary-area,
.message-area,
.daily-notes {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.daily-notes {
  height: 100%;
  min-height: 0;
}

.daily-notes > .scrollable-content {
  flex: 1 1 auto;
  min-height: 0;
}

.daily-notes-form {
  flex: 0 0 auto;
  padding-bottom: 10px;
}

.daily-note-time-label {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.daily-note-time-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 0;
  padding-left: 10px;
}

.daily-note-actions {
  margin-top: 10px;
  text-align: center;
}

.daily-note-save-button--saved,
.daily-note-save-button--saved:disabled {
  background-color: #f59e0b;
  color: #fff;
  border: 1px solid #f59e0b;
  border-radius: inherit;
  opacity: 1;
  box-shadow: none;
  cursor: default;
}

.daily-note-entry {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border-soft);
  padding: 0 0 10px;
}

.daily-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 6px;
}

.note-interval {
  font-size: 15px;
}

.note-interval .note-date {
  font-size: 15px;
  font-style: normal;
  font-weight: 600;
  margin-left: 6px;
  color: var(--color-text-muted);
}

.note-meta {
  font-size: 12px;
  font-style: italic;
  color: var(--color-text-muted);
  text-align: right;
  margin-left: auto;
}

@media (max-width: 768px) {
  .daily-note-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .daily-note-header .right,
  .note-meta {
    margin-left: 0;
    text-align: left;
    font-weight: 400;
  }

  .daily-note-time-inputs {
    flex-direction: column;
    gap: 8px;
  }

  .daily-note-time-inputs label {
    display: grid;
    grid-template-columns: 92px max-content max-content;
    column-gap: 6px;
    row-gap: 4px;
  }

  .message-area #messages-container,
  .diary-area #messages-container {
    height: clamp(440px, 56vh, 560px);
  }

  .message-area .new-message-textarea,
  .diary-area .new-message-textarea {
    height: 120px;
    min-height: 120px;
    max-height: 220px;
  }
}

.daily-note-time-inputs label {
  font-size: 13px;
  color: var(--color-heading);
  display: flex;
  align-items: center;
  gap: 6px;
}

.diary-area h2, .message-area h2 {
  background-color: var(--color-brand-muted);
  color: #f5f7ff;
  padding: 10px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 12px 12px 0 0;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  font-weight: 600;
}

.diary-scroll-today {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.diary-scroll-today:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.add-button {
  background-color: var(--color-brand-primary-strong);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
}

/* Scrollable content */
.scrollable-content {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background-color: var(--color-content-alt);
  padding: 14px;
  display: flex;
  flex-direction: column-reverse;
  text-align: left;
  border: 1px solid var(--color-border-soft);
  border-top: none;
}

.scrollable-content-diary {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    background-color: var(--color-content-alt);
    padding: 14px;
    display: block;
    text-align: left;
    border: 1px solid var(--color-border-soft);
    border-top: none;
  }

@media (min-width: 1024px) {
  .message-area .scrollable-content {
    max-height: 48vh;
  }

  .diary-area .scrollable-content-diary {
    max-height: 48vh;
  }
}

@media (min-width: 1536px) {
    
  .message-area .scrollable-content {
    min-height: 435px;
    max-height: 56vh;
  }

  .diary-area .scrollable-content-diary {
    min-height: 435;
    max-height: 56vh;
  }
}

.message-container {
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border-soft);
  background-color: var(--color-content-bg);
  display: flex;
  flex-direction: column;
}

.new-message-textarea {
  width: 100%;
  height: 90px;
  min-height: 90px;
  max-height: 180px;
  resize: vertical;
  margin-bottom: 10px;
  box-sizing: border-box;
  border-radius: 0 0 6px 6px;
  border: 1px solid var(--color-border-soft);
}

/* Container for the buttons */
.button-group {
  display: flex;
  justify-content: flex-end; /* Align buttons to the right */
  gap: 5px; /* Space between buttons */
  margin-bottom: 0px;
}

.save-button, .submit-button, .cancel-button {
  padding: 3px 8px; /* Smaller padding for smaller buttons */
  font-size: 12px; /* Smaller text */
  cursor: pointer;
}

.save-button {
  background-color: #2fa26b;
  color: white;
  border: none;
  border-radius: 3px;
}

.submit-button {
  background-color: var(--color-brand-primary);
  color: white;
  border: none;
  border-radius: 3px;
}

.message-form .submit-button {
  margin-bottom: 6px;
}

.cancel-button {
  background-color: #e4584f;
  color: white;
  border: none;
  border-radius: 3px;
}

.message-tag {
  color: var(--color-brand-primary);
  font-size: 12px;
}

/* Diary area */

.diary-area .message {
    border-bottom: 1px solid var(--color-border-soft);
    min-height: 80px;
    padding: 10px;
    margin: 0;
    background-color: var(--color-content-alt);
    position: relative;
    z-index: 0;
}

.diary-area .no-entry {
    color: var(--color-text-muted);
    font-style: italic;
    background-color: var(--color-content-bg);
}

.diary-area .message-tag {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.message.weekend {
    background-color: #ededed;
}

.diary-area .message.today {
    border-left: 4px solid var(--color-brand-primary);
    padding-left: 10px;
    background-color: rgba(31, 102, 229, 0.06);
}

.diary-area .message.today .message-tag {
    color: var(--color-brand-primary-strong);
    font-weight: 600;
}

.message-area .board-message {
  border-bottom: 1px solid var(--color-border-soft);
  padding: 10px 0 14px;
}

.message-area .board-message:last-child {
  border-bottom: none;
}

.diary-area .diary-day-card {
  padding: 14px 18px 18px;
  margin-bottom: 14px;
  border-radius: 14px;
  background-color: var(--color-content-alt);
  border: 1px solid var(--color-border-soft);
  box-shadow: inset 0 0 8px rgba(20, 24, 30, 0.04);
  position: relative;
  z-index: 1;
}

.diary-area .diary-day-card:last-child {
  margin-bottom: 0;
}

.diary-area .diary-day-card.weekend {
  background-color: #ededed;
}

.diary-area .diary-day-card.today {
  border-left: 4px solid var(--color-brand-primary);
  padding-left: 14px;
  background-color: rgba(31, 102, 229, 0.06);
}

.diary-area .diary-day-card.today .day-label {
  color: var(--color-brand-primary-strong);
  font-weight: 600;
}

.diary-area .diary-day-card .day-card-header {
  margin-bottom: 12px;
}

.day-label {
  margin-bottom: 0;
}

.diary-area .diary-day-card .day-entries {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diary-area .board-message {
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
}

.diary-area .board-message + .board-message {
  padding-top: 12px;
}

.diary-entry-placeholder {
  height: 3px;
  background-color: var(--color-brand-primary);
  border-radius: 999px;
  opacity: 0.5;
  width: 100%;
  margin: 4px 0;
  pointer-events: none;
}

.board-message .message-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.entry-details-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.entry-details {
  color: var(--color-text-muted);
  font-size: 14px;
  text-align: right;
}

.message-actions-toggle {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.diary-area .message-actions-toggle {
  cursor: grab;
}

.diary-area .message-actions-toggle:active {
  cursor: grabbing;
}

.diary-area .board-message.dragging {
  opacity: 0.7;
}

.message-actions-toggle:hover,
.board-message.actions-active .message-actions-toggle {
  background-color: rgba(31, 50, 83, 0.08);
  color: var(--color-heading);
}

.board-message .message-actions {
  display: none;
  gap: 8px;
  margin: 6px 0;
  flex-wrap: wrap;
}

.board-message.actions-active .message-actions {
  display: flex;
}

.board-message.comment-active .message-actions {
  display: none;
}

.message-delete-button {
  background-color: #c44343;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
}

.message-delete-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.message-comment-button {
  background-color: var(--color-brand-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
}

.message-comment-form {
  display: none;
  margin-top: 8px;
  margin-left: 18px;
  padding: 10px 12px 12px;
  background-color: var(--color-content-bg);
  border-radius: 10px;
  border: 1px solid var(--color-border-soft);
  z-index: 2;
  position: relative;
}
.message-comment-form.visible {
  display: block;
}

.message-comment-form textarea {
  width: 100%;
  min-height: 60px;
  margin-bottom: 6px;
  resize: vertical;
}

.message-comment-form.visible {
  display: block;
}

.message-comments {
  margin-top: 8px;
  padding-left: 18px;
  border-left: 2px solid var(--color-border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message-comment {
  background-color: var(--color-content-bg);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.92rem;
}

.message-comment.deletion-note {
  background-color: transparent;
  font-style: italic;
  color: var(--color-text-muted);
}

.board-message.message-deleted > p {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-skip-ink: none;
  color: var(--color-text-muted);
}


/* Nested tabs */
.nested-tabs {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.nested-tab-buttons {
  display: flex;
  background-color: transparent;
  gap: 4px;
}

.nested-tab-button {
  flex: 1;
  padding: 5px;
  cursor: pointer;
  background-color: var(--color-panel);
  border: 1px solid var(--color-panel-line);
  color: var(--color-heading);
  text-align: center;
  position: relative;
  border-radius: 8px;
}

.nested-tab-button.active {
  background-color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
  color: #fff;
  box-shadow: 0 10px 18px rgba(31, 102, 229, 0.32);
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: white;
  cursor: pointer;
}

.left-arrow {
  left: 10px;
}

.right-arrow {
  right: 10px;
}

.nested-tab-content {
  display: none;
  flex-grow: 1;
  padding: 0px;
  overflow: auto;
  background-color: var(--color-panel);
  border: 1px solid var(--color-border-soft);
  border-radius: 10px;
}

.nested-tab-content.active {
  display: block;
}

/* Dropdown menu */
/* Button styling */
.menu-button {
  position: relative; /* Makes this button the reference point for the dropdown */
  padding: 10px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-brand-primary-strong);
  border-radius: 8px;
}

/* Dropdown menu styling */
.dropdown-menu {
  display: none;
  position: absolute; /* Positions relative to the button */
  top: 100%; /* Places the dropdown directly below the button */
  left: 0; /* Aligns the left edge of the dropdown with the button */
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  z-index: 1000;
  width: 50%; /* Ensure it matches the button width */
}

.menu-item {
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-soft);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item a,
.menu-item a:visited {
  display: block;
  padding: 10px;
  color: var(--color-brand-primary);
  text-decoration: none;
}

.menu-item a:hover {
  background-color: var(--color-panel);
  color: var(--color-brand-primary);
}

.header {
  position: relative;
  width: 100%;
}

.header-inner {
  max-width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-right {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
}

.header-left {
  flex: 1;
  display: flex;
  align-items: center;
}

.home-link {
  display: inline-flex;
  align-items: center;
  color: var(--color-brand-primary-strong);
}

.home-icon {
    width: 22px;
    height: 22px;
    position: static;
    left: auto;
}

.grid-container {
    position: relative;
}
.user-dropdown-button {
    position: relative;
    cursor: pointer;
    border: none;
    background-color: transparent;
    color: var(--color-brand-primary-strong);
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.1;
}

.user-dropdown-container {
    position: relative;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    background-color: var(--color-surface);
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.15);
    z-index: 1;
    right: 0;
    top: calc(100% + 6px);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 6px 0;
}

.user-menu-item {
  margin: 0;
}

.user-menu-item a {
  display: block;
  position: relative;
  padding: 8px 16px;
  color: var(--color-brand-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-top: 1px solid var(--color-border-soft);
}

.user-menu-item a.menu-link--has-warning {
  padding-right: 42px;
}

.user-menu-item a:hover {
  background-color: var(--color-panel);
  color: var(--color-brand-primary);
}

.menu-warning-marker {
  display: inline-flex;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background-color: #f59e0b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.user-menu-item:first-child a {
  border-top: none;
}

/* Login page */
/* Specific to the login page */
.login-grid-container {
  display: grid;
  grid-template-rows: auto 1fr auto; /* Header, main content, and footer */
  justify-content: center; /* Center content horizontally */
  align-content: start; /* Avoid top/bottom clipping */
  width: calc(100% - 20px);
  min-height: calc(100vh - 20px);
  height: auto;
  box-sizing: border-box;
  padding: 0 20px 32px;
  margin: 0 auto;
  background: linear-gradient(180deg, #cfe2fb 0%, #dae9ff 50%, #e6f0ff 100%);
  overflow-y: auto;
}

/* Specific grid item for the login page */
.login-grid-item {
  display: grid; 
  place-items: center; 
  width: min(960px, 100%);
  height: 100%; 
  box-sizing: border-box;
}

/* Footer styling for the login page */
.login-footer {
  text-align: center; 
  width: 100%;
  padding: 0px;
  font-size: 12px;
  color: var(--color-text-muted);
  grid-row: 3; /* Place the footer in the last row */
  align-self: end; /* Align the footer at the bottom of the grid container */
}

/* Login container styling */
.login-container {
  text-align: center;
  max-width: none;
  width: 100%;
  padding: 20px; /* Optional padding for content spacing */
  box-shadow: 0 35px 60px rgba(18, 38, 74, 0.25);
  background-color: var(--color-surface);
  border-radius: 18px;
  box-sizing: border-box; /* Prevent overflow issues by including padding in width */
}

.login-container--auth {
  max-width: 400px;
}

.login-container--onboard {
  max-width: 880px;
  padding-left: 28px;
  padding-right: 28px;
}

.login-container--legal {
  max-width: 760px;
  text-align: left;
}

.legal-content {
  margin: 32px 0;
}

.legal-content h1 {
  color: var(--color-brand-primary);
  font-size: 1.8rem;
  line-height: 1.2;
  margin: 0 0 18px;
  text-align: center;
}

.legal-content h1:not(:first-child) {
  margin-top: 36px;
}

.legal-content p {
  color: var(--color-text);
  line-height: 1.65;
  margin: 0 0 16px;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.login-field {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 5px;
  border: 1px solid var(--color-border);
  box-sizing: border-box;
}

.onboard-form .login-field {
  width: 100%;
  max-width: 420px;
}

.onboard-form .onboard-url-row .login-field {
  width: 100%;
  max-width: 420px;
}

.onboard-form .onboard-label {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--color-text);
  align-items: flex-start;
}

.onboard-form {
  text-align: left;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.onboard-form .login-btn {
  align-self: center;
  min-width: 190px;
  margin: 7px 0 11px;
  padding: 12px 28px;
}

.onboard-form .onboard-url-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.onboard-form .onboard-url-row .login-field {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.onboard-form .onboard-url-suffix {
  font-size: 0.95rem;
  color: #5b6472;
  white-space: nowrap;
}

.onboard-form .onboard-help {
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.35;
  color: #5b6472;
}

.onboard-form .onboard-section-title {
  width: 100%;
  margin: 17px 0 5px;
  color: var(--color-brand-primary);
  font-size: 1.12rem;
  text-align: left;
}

.login-btn {
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  background-color: var(--color-brand-primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(31, 102, 229, 0.32);
}

.login-btn:hover {
  background-color: var(--color-brand-primary-strong);
}

.onboard-title {
  color: var(--color-brand-primary);
  padding-left: 4px;
}

.gdpr-text {
  font-size: 12px;
  text-align: center;
  margin-bottom: 20px;
  color: var(--color-text-muted);
}

/* Navigation page */

/* Grid container specific to the navigation page */
.navigation-grid-container {
  display: grid;
  grid-template-rows: auto 1fr;
  width: calc(100% - 20px);
  max-width: 100%;
  height: calc(100vh - 20px);
  box-sizing: border-box;
  padding: 24px 24px 60px;
  margin: 0 auto;
  background: linear-gradient(180deg, #cfe2fb 0%, #dae9ff 50%, #e6f0ff 100%);
}

/* Header specific to the navigation page */
.navigation-header {
  grid-row: 1;
  width: 100%;
  font-size: 18px;
  padding: 0 0 24px;
  background-color: transparent;
  color: var(--color-heading);
  text-align: right;
  box-sizing: border-box;
}

/* Center content within grid item */
.navigation-grid-item {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* Style for the button container in the navigation page */
.navigation-button-container {
  display: flex;
  gap: 24px;
}

.navigation-dropdown-wrapper {
  position: relative;
}

/* Navigation button styling */
.navigation-button {
  position: relative;
  padding: 16px 36px;
  font-size: 18px;
  cursor: pointer;
  background: linear-gradient(180deg, #3b73e5 0%, #2559c4 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 30px rgba(37, 92, 196, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.navigation-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 36px rgba(37, 92, 196, 0.35);
}

/* Dropdown menu styling specific to navigation */
.navigation-dropdown-menu {
  position: absolute;
  background-color: var(--color-surface);
  box-shadow: 0 20px 35px rgba(15, 30, 50, 0.2);
  border-radius: 12px;
  margin-top: 14px;
  z-index: 1000;
  display: inline-block;
  flex-direction: column;
  padding: 12px;
  width: auto; /* Adjust width as necessary */
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.navigation-dropdown-menu::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Edge */
}

/* Navigation menu item styling */
.navigation-menu-item {
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-soft);
}

.navigation-menu-item a {
  display: block;
  padding: 12px 18px;
  color: var(--color-brand-primary);
  text-decoration: none;
}

.navigation-menu-item a:visited {
  color: var(--color-brand-primary);
}

.navigation-menu-item a:hover {
  background-color: var(--color-panel);
}

.navigation-menu-item--empty {
  padding: 12px 18px;
}

.navigation-menu-item:last-child {
  border-bottom: none;
}

/* Hover effect for menu items */
.navigation-menu-item:hover {
  background-color: var(--color-panel);
}

/* Media query for small viewports */
@media (max-width: 768px) {
  .flex-container {
    height: auto;
    align-items: flex-start;
    padding: 0 0 32px;
  }

  .daily-checks-page .flex-container,
  .project-flow-page .flex-container,
  .client-flow-page .flex-container,
  .outreach-flow-page .flex-container {
    padding-bottom: 0;
  }

  .navigation-dropdown-menu {
    max-height: 260px;
  }

  .grid-container {
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0;
    padding: 12px;
    height: calc(100vh - 48px);
    min-height: calc(100vh - 48px);
    overflow: hidden;
    border-radius: 0;
  }

  .daily-checks-page .grid-container {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .project-flow-page .grid-container {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .client-flow-page .grid-container {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .grid-item {
    padding: 0;
  }

  .tab-content {
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .daily-checks-page .tab-content {
    overflow: visible;
  }

  .project-flow-page .tab-content {
    overflow: visible;
  }

  .client-flow-page .tab-content {
    overflow: visible;
  }

  #Tab1,
  .outreach-grid-container #Tab2 {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .project-flow-page #Tab1 {
    overflow: visible;
  }

  .client-flow-page #Tab1 {
    overflow: visible;
  }

  .daily-notes {
    overflow: visible;
  }

  .left-side {
      display: none;
  }

  .menu-button {
      display: block;
      padding: 6px;
  }

  .menu-button.back-link {
      display: inline-flex;
      padding: 6px;
  }

  .title-bar {
      justify-content: flex-start;
      padding: 14px;
  }

  .title {
      flex-grow: 1;
      text-align: center;
      padding-left: 0;
      transform: translateX(-10px);
  }

  .tab-buttons {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 6px;
  }

  .tab-button {
    flex: 1;
    min-width: auto;
    padding: 8px;
    font-size: 0.92rem;
  }

  .grid-container .right-side > .tabs > .tab-buttons {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .grid-container .right-side > .tabs > .tab-buttons::-webkit-scrollbar {
    display: none;
  }

  .grid-container .right-side > .tabs > .tab-buttons .tab-button {
    flex: 0 0 auto;
    min-width: 130px;
    white-space: nowrap;
  }

  .outreach-grid-container .tab-buttons {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .outreach-grid-container .tab-buttons::-webkit-scrollbar {
    display: none;
  }

  .outreach-grid-container .tab-button {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 130px;
  }

  .columns-container {
    display: flex;
    flex-direction: column-reverse; /* Stack the right column above the left column */
    gap: 16px;
  }

  .left-column, .right-column {
    flex: 0 0 auto; /* Allow the columns to take full width */
    max-width: 100%; /* Ensure full width in the stack */
  }

  .right-column {
    max-width: 100% !important;
    margin-bottom: 0;
    align-self: stretch;
  }

  .right-side {
    background-color: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    width: 100%;
  }

  #Tab2,
  #Tab2 #daily-checks-content,
  #Tab2 .checklist-container {
    height: auto;
  }

  #Tab2 #daily-checks-content {
    overflow: visible;
  }

  #daily-checks-content {
    overflow: visible;
  }

  .project-flow-page .tab3-container {
    height: auto;
    overflow: visible;
  }

  .client-flow-page .tab3-container {
    height: auto;
    overflow: visible;
  }

  .tab-content.reports-tab {
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .daily-notes #messages-container {
    height: clamp(500px, 62vh, 620px);
  }

}

/* Daily Checks tab */
.daily-checks-header {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-brand-muted);
  color: #fff;
  padding: 10px;
  margin-bottom: 20px;
}

.date-title {
  font-size: 18px;
  margin: 0 20px;
}

.nav-arrow {
  background-color: var(--color-brand-primary-strong);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
}

.nav-arrow:hover {
  background-color: var(--color-brand-primary);
}

/* Universal checklist section */
.checklist-section {
  background-color: var(--color-content-alt);
  border: 1px solid var(--color-panel-line);
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

.due-label {
  font-size: 0.92rem;
  margin-bottom: 10px;
  color: #555;
}


/* Adjust form-row to align items center */
.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    margin-left: 15px;
}

.daily-check-form textarea {
  resize: vertical;
  min-height: 72px;
  max-height: 260px;
  box-sizing: border-box;
}

.daily-check-radio-options + textarea {
  margin-left: 5px;
}

#fridge-freezer-checks input[type="text"],
.water-reading input[type="text"] {
  width: 76px;
  max-width: 100%;
  box-sizing: border-box;
}

#fridge-freezer-checks #out-of-date-items {
  min-height: 96px;
}

#weekly-checks textarea,
#water-checks textarea {
  max-height: 200px;
}

#monthly-checks-1 textarea,
#monthly-checks-2 textarea {
  min-height: 120px;
  max-height: 320px;
}

/* Ensure input-group displays elements inline */
.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

#fire-alarm-container,
#fire-alarm-text {
  display: flex;
  align-items: center;
}

#fire-alarm-details {
  width: 200px;
  height: 40px;
}

#fire-alarm-output {
  margin-right: 10px;
}

.temp-input {
  width: 4ch;
  padding: 5px;
  box-sizing: border-box;
  margin-right: 10px;
}

.monthly-check-submit,
.submit-button {
  margin-left: 10px;
}

/* Style for the edit link */
.edit-link {
    margin-left: 10px;
    cursor: pointer;
    color: var(--color-brand-primary);
    text-decoration: underline;
}

/* Hide the output text initially */
#out-of-date-text {
    display: none;
}

textarea {
  vertical-align: top;
  line-height: 1.5;
  padding-top: 5px;
}

/* Monthly Check Rows */
.monthly-check-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.monthly-check-text {
  flex: 1;
  line-height: 1.5;
  height: 90px;
  overflow: hidden;
  text-align: left;
  margin-top: 0;
}

.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-sizing: border-box;
  width: 100%;
}

.monthly-check-input {
  width: 100%;
  height: 80px;
  padding: 5px;
  margin-bottom: 5px;
  box-sizing: border-box;
}

textarea {
  vertical-align: top;
  line-height: 1.5;
  padding-top: 5px;
}

/* Styles for Tab 2 */
#daily-checks-content {
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;  
}

/* Styles for Tab 3 */
.tab3-container, .tab4-container {
  background-color: var(--color-content-bg);
  padding: 20px;
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--color-panel-line);
}

/* Ensure correct column widths with consistent spacing */
.columns-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.left-column {
  flex: 0 0 60%;
  background-color: var(--color-content-alt);
  padding: 20px;
  border: 1px solid var(--color-border-soft);
  box-sizing: border-box;
  text-align: left;
}

.right-column {
  flex: 0 0 40%;
  background-color: var(--color-content-alt);
  padding: 20px;
  border: 1px solid var(--color-border-soft);
  box-sizing: border-box;
  text-align: left;
  overflow: hidden;
  max-width: calc(40% - 20px);
}

/* Full-width rows section */
.full-width-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.full-width-rows .row {
  background-color: var(--color-content-alt);
  padding: 15px;
  border: 1px solid var(--color-border-soft);
  box-sizing: border-box;
  font-size: 14px;
}

.full-width-rows .editable-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.full-width-rows .editable-row > strong,
.full-width-rows .editable-row .field-label {
  margin: 0;
  display: inline-flex;
}

.full-width-rows .editable-row .display-value {
  display: inline;
}

.full-width-rows .editable-row .edit-input {
  flex: 1 1 100%;
}

.full-width-rows .editable-row .edit-controls-row {
  margin-left: auto;
}

/* Align text to the left for all sections */
.left-column,
.right-column,
.full-width-rows .row {
  text-align: left;
}

/* Outreach-specific Flexbox container */
.outreach-flex-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: transparent;
  overflow: hidden;
}

/* Outreach-specific Grid container */
.outreach-grid-container {
  display: grid;
  grid-template-rows: auto auto 1fr;
  grid-template-columns: 1fr; /* Single column */
  gap: 10px;
  background-color: var(--color-surface);
  width: min(1040px, 100%);
  height: min(94vh, 960px);
  padding: 28px;
  overflow: auto;
  border-radius: 32px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-strong);
}

/* Outreach-specific Header */
.outreach-header {
  grid-column: 1 / -1;
  background-color: transparent;
  color: var(--color-text-muted);
  padding: 0;
  text-align: right;
}

/* Outreach-specific Title bar */
.outreach-title-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-panel);
  color: var(--color-heading);
  padding: 20px;
  position: relative;
  border-radius: 16px;
}

/* Outreach-specific Title */
.outreach-title {
  flex-grow: 1;
  text-align: center;
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 300;
  margin: 0 auto;
  color: var(--color-text-muted);
  letter-spacing: 0.015em;
}

/* Outreach-specific Menu button */
.outreach-menu-button {
  display: none;
  position: absolute;
  left: 10px;
  padding: 10px;
  background-color: var(--color-brand-muted);
  border: none;
  cursor: pointer;
  color: #fff;
  border-radius: 8px;
}

/* Outreach-specific Grid items */
.outreach-grid-item {
  background-color: var(--color-surface-alt);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--color-border-soft);
  border-radius: 14px;
}

.outreach-right-side {
  background-color: var(--color-surface);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Outreach-specific Tabs */
.outreach-tabs {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.outreach-grid-container #Tab1 .message-area,
.outreach-grid-container #Tab1 .diary-area {
  min-height: 560px;
}

@media (min-width: 769px) {
  .client-flow-page #Tab1 {
    display: block;
    overflow-y: auto;
  }

  .client-flow-page #Tab1 .daily-notes {
    height: auto;
    min-height: 100%;
    overflow: visible;
  }

  .client-flow-page #Tab1 .daily-notes > .scrollable-content {
    min-height: 360px;
    overflow-y: auto;
  }

  .client-flow-page #Tab1 #messages-container {
    height: clamp(395px, 58vh, 620px);
    min-height: 360px;
    overflow-y: auto;
  }

  .outreach-flow-page #Tab1 {
    display: block;
    overflow-y: auto;
  }

  .outreach-flow-page #Tab2 {
    display: block;
    overflow-y: auto;
  }

  .outreach-flow-page #Tab2 .daily-notes {
    height: auto;
    min-height: 100%;
    overflow: visible;
  }

  .outreach-flow-page #Tab2 .daily-notes > .scrollable-content {
    min-height: 360px;
    overflow-y: auto;
  }

  .outreach-flow-page #Tab2 #messages-container {
    height: clamp(395px, 58vh, 620px);
    min-height: 360px;
    overflow-y: auto;
  }

  .outreach-flow-page #Tab1 .message-area,
  .outreach-flow-page #Tab1 .diary-area {
    overflow: visible;
  }
}

@media (min-width: 1536px) {
  .outreach-grid-container #Tab1 .message-area,
  .outreach-grid-container #Tab1 .diary-area {
    min-height: 640px;
  }
}

.outreach-tab-buttons {
  display: flex;
  background-color: transparent;
  gap: 6px;
}

.outreach-tab-button {
  flex: 1;
  padding: 10px;
  cursor: pointer;
  background-color: var(--color-panel);
  border: 1px solid var(--color-panel-line);
  color: var(--color-heading);
  text-align: center;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}

.outreach-tab-button.active {
  background-color: var(--color-brand-primary);
  color: #fff;
  border-color: var(--color-brand-primary);
  box-shadow: 0 10px 20px rgba(31, 102, 229, 0.35);
}

.outreach-tab-content {
  display: none;
  flex-grow: 1;
  padding: 0;
  background-color: var(--color-content-bg);
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--color-panel-line);
  box-shadow: inset 0 1px 10px rgba(17, 34, 58, 0.12);
}

.outreach-tab-content.active {
  display: block;
  height: 100%;
}

/* Full page text box with sticky footer */
.outreach-text-box-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.outreach-text-box-container textarea {
  flex-grow: 1;
  width: 100%;
  height: 100%;
  border: none;
  resize: none;
}

.outreach-sticky-footer {
  display: flex;
  justify-content: flex-end;
  background-color: var(--color-panel-alt);
  padding: 10px;
  position: sticky;
  bottom: 0;
  border-top: 1px solid var(--color-border);
}

.outreach-sticky-footer button {
  margin-left: 10px;
  padding: 10px 20px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background-color: var(--color-brand-primary);
  color: #fff;
  font-weight: 600;
}

/* Outreach-specific Area styles */
.outreach-area {
  height: calc(50% - 20px);
  margin: 10px 0;
  display: flex;
  flex-direction: column;
}

.outreach-area h2 {
  background-color: var(--color-brand-muted);
  color: #f6f4ef;
  padding: 10px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 10px 10px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.outreach-add-button {
  background-color: var(--color-brand-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
}

/* Scrollable content */
.outreach-scrollable-content {
  flex-grow: 1;
  overflow-y: auto;
  background-color: var(--color-content-alt);
  padding: 12px;
  display: flex;
  flex-direction: column-reverse;
  border: 1px solid var(--color-border-soft);
  border-top: none;
}

/* Nested tabs */
.outreach-nested-tabs {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.outreach-nested-tab-buttons {
  display: flex;
  background-color: transparent;
  gap: 4px;
}

.outreach-nested-tab-button {
  flex: 1;
  padding: 5px;
  cursor: pointer;
  background-color: var(--color-panel);
  border: 1px solid var(--color-panel-line);
  color: var(--color-heading);
  text-align: center;
  position: relative;
  border-radius: 8px;
}

.outreach-nested-tab-button.active {
  background-color: var(--color-brand-primary);
  color: #fff;
  border-color: var(--color-brand-primary);
  box-shadow: 0 8px 18px rgba(31, 102, 229, 0.32);
}

.outreach-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: white;
  cursor: pointer;
}

.outreach-arrow.left-arrow {
  left: 10px;
}

.outreach-arrow.right-arrow {
  right: 10px;
}

.outreach-nested-tab-content {
  display: none;
  flex-grow: 1;
  padding: 12px;
  overflow: auto;
  background-color: var(--color-panel);
  border-radius: 10px;
  border: 1px solid var(--color-panel-line);
  box-shadow: inset 0 1px 10px rgba(17, 34, 58, 0.12);
}

.outreach-nested-tab-content.active {
  display: block;
}

/* Dropdown menu */
.outreach-dropdown-menu {
  display: none;
  position: absolute;
  top: 50px;
  left: 10px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  z-index: 1000;
}

.outreach-menu-item {
  padding: 10px;
  border-bottom: 1px solid var(--color-border-soft);
}

.outreach-menu-item:last-child {
  border-bottom: none;
}

/* Client Info (formerly Project Info) */
.outreach-tab3-container {
  background-color: var(--color-content-bg);
  padding: 20px;
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--color-panel-line);
}

.outreach-columns-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.outreach-left-column {
  flex: 0 0 60%;
  background-color: var(--color-content-alt);
  padding: 20px;
  border: 1px solid var(--color-border-soft);
  box-sizing: border-box;
  text-align: left;
}

.outreach-right-column {
  flex: 0 0 40%;
  background-color: var(--color-content-alt);
  padding: 20px;
  border: 1px solid var(--color-border-soft);
  box-sizing: border-box;
  text-align: left;
  overflow: hidden;
  max-width: calc(40% - 20px);
}

.outreach-full-width-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.outreach-row {
  background-color: var(--color-content-alt);
  padding: 15px;
  border: 1px solid var(--color-border-soft);
  box-sizing: border-box;
  font-size: 14px;
}

@media (max-width: 768px) {
  .outreach-grid-container {
    width: 100%;
    margin: 0;
    padding: 10px 10px 16px;
    height: auto;
    min-height: calc(100vh - 48px);
    border-radius: 0;
  }

  .outreach-grid-item {
    padding: 10px;
  }

  .outreach-tab-buttons {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .outreach-tab-button {
    padding: 8px;
    font-size: 0.92rem;
  }
}

.outreach-left-column,
.outreach-right-column,
.outreach-row {
  text-align: left;
}

.profile-image {
  max-width: 100%; /* This ensures the image doesn't overflow its container */
  height: auto; /* Maintains the image's aspect ratio */
}

/* Styles for the message input overlay */
.message-input-overlay {
  position: absolute; /* Position relative to the .message-area */
  bottom: 0;          /* Stick it to the bottom of the .message-area */
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent background */
  padding: 10px;
  z-index: 1000; /* Ensure it's on top of other elements */
  display: flex;
  justify-content: center;
  align-items: center;
  height: 150px;  /* Adjust height as needed */
  box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.2); /* Add a slight shadow to distinguish it */
}

/* Ensure the message-area is positioned relative so the overlay stays within it */
.message-area {
  position: relative;  /* This allows the overlay to be positioned relative to it */
}

/* Make sure the messages container is scrollable */
#messages-container {
  position: relative;
  height: 400px; /* Adjust this to fit your needs */
  overflow-y: scroll;
}

@media (min-width: 1024px) {
  .daily-notes {
    overflow: hidden;
  }

  .daily-notes .scrollable-content {
    max-height: none;
  }
}

/* UI admin area */

/* Ensure edit/save icons appear at the end of the line */
.edit-controls-row {
    display: inline-block; /* Keep this to allow icons to sit on the same line */
    float: right;          /* This will push the element to the far right */
    margin-left: 10px;     /* Keep a small margin for spacing if needed after the float */
}

/* IMPORTANT: Add this to the parent .row for layout stability */
/* This is crucial when using floats to ensure the parent element correctly contains its floated children */
.row {
    overflow: auto; /* Clears the float within the row, preventing layout issues */
    /* If you have specific heights or paddings on .row, adjust as necessary */
}

/* Optional: Adjust spacing for input fields within multi-field rows */
.row .field-label {
    margin-left: 5px; /* Adds a bit of space after the label */
}

/* Add these new styles to handle the <button> elements and their img children */

/* Style for buttons containing edit and save icons */
.edit-btn,
.save-btn {
    /* Basic button reset to remove default browser button styles */
    background: none; /* No background color */
    border: none;     /* No border */
    padding: 0;       /* No default padding */
    margin: 0;        /* No default margin */
    font: inherit;    /* Inherit font properties from parent */
    color: inherit;   /* Inherit color properties from parent */
    cursor: pointer;  /* Explicitly set cursor, although buttons usually have it */
    outline: none;    /* Remove focus outline (consider accessibility, may want to re-add custom focus styles) */
    vertical-align: middle; /* Aligns the button vertically with surrounding inline content */
    
    /* Smooth transition for hover effects */
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out; 
}

/* Style for the image inside the button */
.edit-btn img,
.save-btn img {
    width: 16px; /* Ensure image size is consistent */
    height: 16px;
    display: block; /* Helps prevent extra space below image inside button due to baseline alignment */
}

/* Primary submit buttons in admin forms */
.primary-submit {
    background: #297bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 18px;
    font-size: 18px;
    cursor: pointer;
}
.primary-submit:hover {
    background: #1f64d4;
}

/* Hover effect for edit and save buttons (applies to the button, affecting the image) */
/* .edit-btn:hover,
.save-btn:hover {
    opacity: 0.7; /* Makes the button/icon slightly transparent on hover */
    /* transform: scale(1.1); /* Makes the button/icon slightly larger on hover */
/*} */

.admin-container {
    margin-left: 40px;
    background-color: var(--color-panel);
}
.admin-header-div {
    margin-top: 10px;
}


/* Media Query for Large Screens */
@media (min-width: 1536px) {
  .outreach-monthly-check-row {
      gap: 40px;
  }
  .outreach-grid-container {
    width: min(1140px, 100%);
    margin: 0 auto;
  }
}

/* Media Query for Large Screens */
@media (min-width: 1024px) {
  .monthly-check-row {
      gap: 40px;
  }
}

textarea,
input[type="text"],
input[type="email"],
input[type="password"] {
  font-size: 16px;
}

.text-box-container {
  height: 100px;
  overflow-y: auto;
}

form {
  margin: 0;
  padding: 0;
}

/* Bebugging Tools */

/*

 * {
  outline: 1px solid red;
} 

*/


/*
form, .text-box-container, textarea, .sticky-footer {
  background: rgba(255,0,0,0.1); 
}
*/
.reports-wrapper {
  background-color: var(--color-content-bg);
  border: 1px solid var(--color-panel-line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: inset 0 0 12px rgba(35, 40, 45, 0.04);
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  box-sizing: border-box;
}

.reports-wrapper h2 {
  margin-top: 0;
  text-align: center;
  color: var(--color-heading);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
}

.reports-wrapper form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 0;
  background-color: transparent;
  border: none;
  padding: 0 0 16px;
}

.reports-wrapper select,
.reports-wrapper button {
  font-size: 14px;
}

.reports-wrapper .add-report-label {
  font-weight: 600;
}

.reports-list {
  margin-top: 8px;
  background-color: transparent;
  border: none;
  padding: 0;
  width: 100%;
}

.reports-wrapper.report-form-wrapper {
  background-color: transparent;
  border: none;
  box-shadow: none;
  padding: 12px 0 0;
}

.report-view-wrapper {
  background-color: transparent;
  border: none;
  box-shadow: none;
  max-width: none;
  padding: 0;
}

.owner-page h1 {
  color: #0056b3;
  border-bottom: 1px solid #ebebeb;
  padding-bottom: 12px;
  margin-top: 0;
  margin-bottom: 25px;
  font-size: 2em;
}

.owner-page h2 {
  color: #4a4a4a;
  font-size: 1.4em;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 8px;
  margin-top: 0;
  margin-bottom: 12px;
}

.owner-card {
  background-color: var(--color-panel);
  border: none;
  border-radius: 14px;
  box-shadow: none;
}

.owner-section {
  background-color: #ffffff;
  border: 1px solid rgba(31, 50, 83, 0.12);
  border-radius: 5px;
  padding: 18px;
  box-shadow: none;
  background-clip: padding-box;
}

.owner-warning {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.owner-warning p {
  margin: 0;
}

.owner-warning p + p {
  margin-top: 6px;
}

.owner-warning-title {
  font-weight: 700;
}

.owner-warning--warning {
  background-color: #fff7e6;
  border-color: #f3d08f;
  color: #7a4b00;
}

.owner-warning--danger {
  background-color: #fff1f2;
  border-color: #f3b5bc;
  color: #9f1239;
}

.reports-wrapper.report-form-wrapper h2 {
  margin-bottom: 18px;
}

.report-form-wrapper {
  padding: 0;
}

.report-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background-color: #fff;
  padding: clamp(18px, 4vw, 24px);
  border-radius: 12px;
  border: 1px solid var(--color-panel-line);
  box-shadow: inset 0 1px 8px rgba(17, 34, 58, 0.08);
  width: min(720px, 100%);
  margin: 0 auto;
  box-sizing: border-box;
  text-align: left;
  align-items: flex-start;
}

@media (min-width: 769px) {
  .report-form {
    padding: 26px 24px;
  }

  .reports-wrapper.report-form-wrapper #report_content {
    min-height: 380px;
    max-height: 380px;
  }
}

.report-form label {
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  color: var(--color-heading);
  display: block;
  margin-bottom: 6px;
  text-align: left;
  align-self: flex-start;
}

.report-form input[type="date"],
.report-form input[type="text"],
.report-form textarea,
.report-form input[type="time"] {
  width: 100%;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border-soft);
  background-color: #fff;
  box-sizing: border-box;
  align-self: stretch;
  text-align: left;
}

.report-form input[type="date"]:focus,
.report-form input[type="text"]:focus,
.report-form textarea:focus,
.report-form input[type="time"]:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: inset 0 0 0 1px var(--color-focus);
}

.report-form input[type="date"],
.report-form input[type="time"] {
  height: 30px;
  line-height: 1;
}

.report-form textarea {
  min-height: 320px;
  max-height: 320px;
  overflow-y: auto;
  resize: none;
}

.report-form textarea.report-textarea-short {
  min-height: 160px;
  max-height: 160px;
}

.report-form .form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.report-form .date-time-row {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: baseline;
  width: 100%;
  justify-content: flex-start;
}

.report-form .date-time-row .form-control {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 0 auto;
}

.report-form .date-time-row .form-control label {
  white-space: nowrap;
  margin: 0;
  display: inline-flex;
  align-items: center;
  line-height: 1.1;
}

.report-form .date-time-row .form-control input {
  margin: 0;
  position: relative;
  top: -7px;
}

.report-form .date-time-row .form-control.date-control {
  flex: 0 0 auto;
}

.report-form .date-time-row .form-control.date-control input {
  width: 170px;
  padding: 6px 16px 6px 10px;
}

.report-form .date-time-row .form-control.time-control {
  flex: 0 0 auto;
}

.report-form .date-time-row .form-control.time-control input {
  width: 90px;
  padding: 6px 6px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .report-form .date-time-row {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .report-form .date-time-row .form-control.time-control {
    flex: 0 0 auto;
    width: 100%;
  }

  .report-form .date-time-row .form-control {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
  }

  .report-form .date-time-row .form-control input {
    width: 100%;
  }

  .report-form .date-time-row .form-control.date-control input,
  .report-form .date-time-row .form-control.time-control input {
    text-align: left;
  }

  .report-form .date-time-row .form-control.time-control input {
    padding: 6px 10px;
  }

  .report-form {
    width: 100%;
    margin: 0;
    border-radius: 10px;
  }

  .reports-wrapper.report-form-wrapper {
    padding-left: 0;
    padding-right: 0;
  }

  .tab-content.reports-tab > .reports-wrapper.report-form-wrapper {
    min-height: 82vh;
    display: flex;
    flex-direction: column;
  }

  .reports-wrapper.report-form-wrapper .report-form {
    flex: 1 1 auto;
  }

  .reports-wrapper.report-form-wrapper #report_content {
    min-height: 380px;
    max-height: 380px;
  }

  .reports-wrapper {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .tab-content.reports-tab > .reports-wrapper:not(.report-form-wrapper) {
    min-height: 82vh;
  }

  .tab-content.reports-tab > .report-view-wrapper {
    background-color: var(--color-content-bg);
    border: 1px solid var(--color-panel-line);
    border-radius: 0 0 14px 14px;
    box-shadow: inset 0 0 12px rgba(35, 40, 45, 0.04);
    min-height: 82vh;
    padding: 24px 12px;
  }

  .report-view-wrapper .report-back-link {
    margin-top: 72px;
  }

  .reports-wrapper form {
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
  }

  #Tab2 .daily-check-form .form-row {
    flex-wrap: wrap;
    align-items: flex-start;
    margin-left: 0;
  }

  #Tab2 .daily-check-form .form-row textarea {
    flex: 1 0 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  #Tab2 .daily-check-radio-options {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 10px;
    white-space: nowrap;
  }

  #fridge-freezer-checks .form-row textarea,
  #weekly-checks .form-row textarea {
    min-height: 86px;
  }

  #fridge-freezer-checks #out-of-date-items {
    min-height: 104px;
  }

  #monthly-checks-1 .form-row textarea,
  #monthly-checks-2 .form-row textarea {
    min-height: 210px;
  }

  #fridge-freezer-checks input[type="text"],
  .water-reading input[type="text"] {
    width: 72px;
    max-width: 100%;
  }

  .reports-wrapper.report-form-wrapper h2 {
    padding-left: 4px;
    padding-right: 4px;
  }

  .reports-wrapper .report-form {
    padding: 18px 12px;
  }

  #Tab2 {
    height: auto;
  }

  #Tab2 #daily-checks-content {
    height: auto;
    overflow: visible;
  }

  #Tab2 .checklist-container {
    height: auto;
  }
}

@media (min-width: 769px) {
  .outreach-flow-page .tab-content.reports-tab > .reports-wrapper {
    max-width: 980px;
  }

  .outreach-flow-page .reports-wrapper.report-form-wrapper .report-form {
    width: min(900px, 100%);
    margin: 0 auto;
  }

  .outreach-flow-page .reports-wrapper.report-form-wrapper #report_content {
    min-height: 440px;
    max-height: 440px;
  }

  .report-form input.report-input-half {
    width: 50%;
  }
}

.reports-list a {
  display: block;
  color: var(--color-brand-primary-strong);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.reports-list a:last-child {
  border-bottom: none;
}

.reports-list p {
  margin: 0 0 6px;
  color: var(--color-text-muted);
}

.report-back-link {
  display: inline-block;
  margin-top: 24px;
}

.report-view {
  padding-left: 6px;
  text-align: left;
}

.report-view__title {
  text-align: center;
  margin-bottom: 18px;
}

.report-view p strong {
  display: inline-block;
  margin-bottom: 4px;
}

.report-view p {
  margin: 0 0 14px;
}

.report-view__meta {
  margin: 0 !important;
}

.report-view__audit-end {
  margin-bottom: 20px !important;
}

.report-view__narrative {
  margin: 12px 0 0;
}

.report-view__meta + .report-view__narrative {
  margin-top: 16px;
}

.report-view__narrative strong {
  display: block;
  margin-bottom: 0;
}

.report-view__narrative-text {
  display: block;
  margin-top: 8px;
  white-space: pre-wrap;
}

.report-view__content {
  white-space: pre-wrap;
  border: 1px solid #ccc;
  padding: 1em;
}

.report-label {
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
}
