/* ================================
   Base / Document
   ================================ */

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: Arial, sans-serif;
  background: #f5f8fc;
  color: #333;
}

/* ================================
   App Shell Layout
   ================================ */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.app-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 20px 20px 20px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f5f8fc;
}

/* ================================
   Top Bar
   ================================ */

.topbar {
  background: #f7f7f7;
  border-bottom: 1px solid #ddd;
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  padding: 6px 18px 0 6px;
  box-sizing: border-box;
  flex: 0 0 72px;
  position: relative;
  overflow: visible;
  z-index: 50;
}

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

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

.app-logo-placeholder {
  width: 48px;
  height: 48px;
  border: 2px solid #5b6f8f;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #2f4f6f;
  background: #eef4fb;
  box-sizing: border-box;
  margin-top: 4px;
  margin-left: 4px;
}

.app-name {
  font-weight: 600;
  font-size: 20px;
  color: #2f4f6f;
  line-height: 42px;
}

.topbar-page-block {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  width: calc(100% - 180px);
  column-gap: 18px;
  padding-top: 1px;
  overflow: visible;
}

.topbar-page {
  display: flex;
  align-items: center;
  height: 48px;
  font-size: 28px;
  font-weight: 700;
  color: #2f4f6f;
  margin-left: 24px;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  height: 42px;
}

.topbar-user {
  position: absolute;
  top: 10px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  padding-top: 0;
  text-align: right;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

    .admin-domain-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid #b9cce6;
    background: #e2ecfb;
    color: #2f4f6f;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
    }

    .admin-domain-link:hover {
    background: #cfe0f7;
    border-color: #9fb6da;
    }

    .admin-domain-link.active {
    background: #dce9f8;
    border-color: #5b6f8f;
    }

    .admin-domain-link.disabled {
    background: #f2f4f7;
    border-color: #d7dde6;
    color: #7b8794;
    pointer-events: none;
    cursor: default;
    }

    .admin-topbar-institution {
    font-size: 24px;
    font-weight: 600;
    color: #2f3f52;
    margin-top: 10px;
    padding-left: 25px;
    }

.topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.admin-page .topbar .topbar-actions {
  position: absolute;
  top: 20px;
  right: 200px;
  height: 32px;
  z-index: 20;
}

    .topbar .topbar-actions .admin-domain-link {
    min-width: 78px;
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    white-space: nowrap;
    }

.logout-link {
  margin-top: 8px;
  font-size: 11px;
  text-decoration: none;
  color: white;
  background: #5b6f8f;
  padding: 5px 12px;
  border-radius: 5px;
  font-weight: 600;
}

.logout-link:hover {
  background: #4a5c78;
}

/* ================================
   Top Bar - Session Compact Header
   ================================ */

.session-topbar-details {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  padding-top: 2px;
  padding-left: 8.5%;
  color: #2f3f52;
  box-sizing: border-box;
  overflow: visible;
  position: relative;
  z-index: 60;
}

.session-topbar-compact {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  min-width: 0;
}

.session-topbar-hover-wrap {
  position: relative;
  display: inline-flex;
  z-index: 70;
}

.session-topbar-compact-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 250px;
  margin-top: 4px;
}

.session-topbar-compact-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 140px;
  padding-top: 6px;
}

.session-topbar-institution {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #5b6f8f;
  text-transform: uppercase;
  line-height: 1.15;
}

.session-topbar-mdt {
  font-size: 24px;
  font-weight: 700;
  color: #2f4f6f;
  line-height: 1.1;
  margin-top: -1px;
}

.session-topbar-date {
  font-size: 15px;
  font-weight: 700;
  color: #2f4f6f;
  line-height: 1.15;
  margin-top: -1px;
}

.session-topbar-status-wrap {
  margin-bottom: 1px;
  margin-top: -3px;
  margin-left: 0;
}

.session-topbar-status {
  align-self: flex-start;
  font-size: 11px;
  padding: 3px 8px;
  line-height: 1.05;
}

/* ================================
   Top Bar - Session Hover Panel
   ================================ */

.session-topbar-hover-panel {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: #ffffff;
  border: 1.5px solid rgba(47, 79, 111, 0.35);
  border-radius: 6px;
  padding: 10px 12px;
  display: none;
  flex-direction: column;
  gap: 6px;
  min-width: 260px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.session-topbar-hover-wrap:hover .session-topbar-hover-panel {
  display: flex;
}

.session-topbar-hover-line {
  font-size: 13px;
  color: #4f5f73;
  font-weight: 600;
}

.session-topbar-hover-person-row {
  display: flex;
  gap: 8px;
}

.session-topbar-hover-label {
  width: 50px;
  font-size: 13px;
  color: #6d7b8a;
  font-weight: 500;
}

.session-topbar-hover-value {
  font-size: 13px;
  color: #2f4f6f;
  font-weight: 600;
}

/* ================================
   Sidebar
   ================================ */

.sidebar {
  width: 64px;
  flex: 0 0 64px;
  background: #ffffff;
  border-right: 1px solid #ddd;
  padding: 18px 0 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  overflow: hidden;
  box-sizing: border-box;
}

.sidebar-button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #2f4f6f;
  border: 2px solid #5b6f8f;
  border-radius: 6px;
  background: #eef4fb;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  box-sizing: border-box;
}

.sidebar-button:hover {
  background: #e3edf9;
}

.sidebar-button.active {
  background: #dce9f8;
  border-color: #5b6f8f;
  color: #2f4f6f;
}

/* ================================
   Shared Panels / Helpers
   ================================ */

.panel {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  font-weight: 600;
}

.panel-body {
  padding: 16px;
}

/* ================================
   Workspace Layout
   ================================ */

.workspace {
  display: grid;
  grid-template-columns: 33% 67%;
  gap: 0;
  height: 100%;
  min-height: 0;
}

.workspace-left {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  background: #f5f8fc;
}

.workspace-right {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  background: #f5f8fc;
}

/* ================================
   Dashboard
   ================================ */

.dashboard-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  align-items: stretch;
  height: calc(100vh - 72px - 40px);
  min-height: 500px;
}

.mdt-column {
  min-width: 0;
  min-height: 0;
  padding: 0 16px;
  border-right: 1px solid #d9d9d9;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mdt-column:last-child {
  border-right: none;
}

.mdt-column-header {
  flex: 0 0 auto;
  padding: 0 0 14px 0;
  border-bottom: 1px solid #ddd;
  margin-bottom: 16px;
}

.mdt-institution {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #5b6f8f;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.mdt-name {
  font-size: 22px;
  font-weight: 700;
  color: #2f4f6f;
  margin-bottom: 8px;
}

.mdt-schedule {
  font-size: 14px;
  color: #4f5f73;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.mdt-location {
  font-size: 14px;
  color: #555;
  margin-bottom: 8px;
}

.mdt-meeting-link a {
  display: inline-block;
  font-size: 12px;
  text-decoration: none;
  color: white;
  background: #5b6f8f;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: 600;
}

.mdt-meeting-link a:hover {
  background: #4a5c78;
}

.mdt-column-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.session-card {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.session-card.session-card-relevant {
  background: #eef;
}

/* ===== Session Card Layout ===== */

.session-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.session-card-date {
  width: 150px;
  font-size: 19px;
  font-weight: 700;
  color: #2f4f6f;
  flex: 0 0 150px;
}

.session-card-status-slot {
  width: 132px;
  flex: 0 0 132px;
  margin-left: 12px;
}

.session-card-count-slot {
  width: 40px;
  flex: 0 0 40px;
  margin-left: 6px;
}

.session-card-divider {
  height: 2px;
  background: #e6e6e6;
  margin: 10px 0 12px 0;
}

.session-card-meta {
  display: flex;
  font-size: 14px;
  margin-bottom: 4px;
}

.session-meta-label {
  width: 60px;
  color: #7a8899;
  font-weight: 600;
}

.session-meta-value {
  color: #2f3f52;
  font-weight: 600;
}

.session-card-buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.session-card-buttons button {
  padding: 7px 12px;
  border: 1px solid #b9cce6;
  background: #e2ecfb;
  color: #2f4f6f;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.session-card-buttons button:hover {
  background: #cfe0f7;
  border-color: #9fb6da;
  transform: translateY(-1px);
}

/* ================================
   Shared Status Badges
   ================================ */

.session-status-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

/* Topbar-specific override */
.session-topbar-status.session-status-badge {
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: 0.2px;
  line-height: 1;
  border: 1.5px solid rgba(47, 79, 111, 0.45);
}

.session-case-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #eef4fb;
  border: 1px solid #c9d7ea;
  color: #2f4f6f;
  font-size: 15px;
  font-weight: 800;
  box-sizing: border-box;
  position: relative;
  top: -1px;
}

.session-status-scheduled {
  background: #eef1f4;
  border: 1px solid #d5dce3;
  color: #5b6978;
}

.session-status-live {
  background: #e8f6ec;
  border: 1px solid #b9d8c1;
  color: #1f6a35;
}

.session-status-completed {
  background: #eaf2fb;
  border: 1px solid #c8d9ee;
  color: #2f5f95;
}

.session-status-issued {
  background: #edf8ef;
  border: 1px solid #bfdcc6;
  color: #256b3f;
}

.session-status-cancelled {
  background: #f8ecec;
  border: 1px solid #e2c2c2;
  color: #9a3d3d;
}

.badge-grey {
  background: #e0e0e0;
  color: #444;
}

.badge-yellow {
  background: #fff3cd;
  color: #7a5c00;
}

.badge-green {
  background: #d4edda;
  color: #1e5e2a;
}

.badge-orange {
  background: #ffe5cc;
  color: #7a3e00;
}

.badge-red {
  background: #f8d7da;
  color: #7a1e22;
}

/* ================================
   Upcoming Cases - Left Panel
   ================================ */

.case-list-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f5f8fc;
  padding: 4px 12px 18px 6px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-sizing: border-box;
}

.case-list-header::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 12px;
  bottom: 8px;
  height: 1px;
  background: #c7d3e2;
}

.case-search-input {
  width: 260px;
  flex: 0 0 260px;
  padding: 9px 10px;
  border: 1px solid #d0d7e2;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.case-search-input:focus {
  outline: none;
  border-color: #9fb6da;
}

.case-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 12px 6px;
}

.case-review-status {
  align-self: flex-start;
  margin-top: 2px;

  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;

  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid;
}

/* Finalised — green */
.case-review-status-finalised {
  color: #2f7a3e;
  background: #e7f4ea;
  border-color: #2f7a3e;
}

/* Editing — amber */
.case-review-status-editing {
  color: #a66a00;
  background: #fff4e0;
  border-color: #a66a00;
}

.case-row {
  padding: 10px 10px 12px 10px;
  border: 1px solid #c7d3e2;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}

.case-row:hover {
  background: #f8fbff;
}

.case-row.active {
  background: #eef;
}

.case-row-header-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  margin-bottom: 8px;
}

.case-row-name {
  font-size: 17px;
  font-weight: 800;
  color: #2f4f6f;
}

.case-row-detail {
  font-size: 15px;
  font-weight: 550;
  color: #555;
}

/* Lead Clinician row */

.case-row-lead .case-row-label {
  color: #555;
  font-weight: 550;
  margin-right: 6px;
}

.case-row-lead-name {
  color: #2f4f6f;   /* same blue tone as app */
  font-weight: 600;
  font-size: 15px;
}

.case-row-dx {
  font-size: 15px;
  font-weight: 550;
  color: #555;
  margin-top: 6px;
  margin-bottom: 4px;
}

.case-row-sub {
  font-size: 15px;
  color: #555;
  font-weight: 550;
  margin-bottom: 4px;
}

.case-row-status-line {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 6px;
  gap: 24px;
}

.case-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.case-row-right {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 8px;
}

.case-row-status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.case-status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  border: 1px solid #d5dce3;
  background: #eef1f4;
  color: #5b6978;
}

/* Submitted */
.badge-grey {
  background: #e8f0fb;
  color: #2f5f9e;
  border-color: #2f5f9e;
}

/* Assigned */
.badge-yellow {
  background: #fff6db;
  color: #8a6d00;
  border-color: #8a6d00;
}

/* Discussed */
.badge-green {
  background: #e7f4ea;
  color: #2f7a3e;
  border-color: #2f7a3e;
}

/* Deferred */
.badge-orange {
  background: #fff0e6;
  color: #a65300;
  border-color: #d97a2b;
}

/* Rejected / Withdrawn */
.badge-red {
  background: #fdeaea;
  color: #a12626;
  border-color: #d9534f;
}

/* ================================
   Upcoming Cases - Right Panel
   ================================ */

.case-workspace-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f5f8fc;
  padding: 14px 16px;
  border-bottom: 1px solid #dde5ef;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.case-workspace-body {
  padding: 0;
}

.case-workspace-sheet {
  background: #ffffff;
  min-height: 100%;
  padding: 16px;
  box-sizing: border-box;
}

.case-section {
  background: #ffffff;
  border: 1px solid #c7d3e2;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.case-section {
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.case-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #2f4f6f;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.case-section-title {
  border-bottom: 1px solid #e3e8ef;
  padding-bottom: 2px;
}

.case-section-body {
  font-size: 14px;
  color: #333;
  line-height: 1.45;
}

.case-section-title + .case-section-body + .case-section-title {
  margin-top: 8px;
}

.case-dual-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.case-section-highlight {
  background: #eef5ff;
  border: 1px solid #c7dafc;
  border-radius: 6px;
  padding: 6px;
}

.case-subsection-title {
  font-size: 12px;
  font-weight: 700;
  color: #5b6f8f;
  margin-top: 10px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.selected-case-header {
  margin-bottom: 4px;
}

.selected-case-name {
  font-size: 22px;
  font-weight: 700;
  color: #2f4f6f;
  margin-bottom: 6px;
}

.selected-case-sub {
  font-size: 14px;
  color: #666;
  margin-top: 2px;
  margin-bottom: 0;
}

.selected-case-block {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  color: #444;
  line-height: 1.8;
}

.selected-case-status-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 6px;
}

.selected-case-status-strip {
  margin-top: 6px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.selected-case-lead {
  font-size: 15px;
  font-weight: 600;
  color: #2f4f6f;
  margin-top: 10px;
}

.selected-case-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.case-operational-history-shell {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid #dddddd;
}

.case-operational-history-toggle {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0 0 4px 0;

  font-size: 11px !important;
  font-weight: 500 !important;
  color: #707070 !important;

  cursor: pointer;
  text-decoration: none;
}

.case-operational-history-toggle:hover {
  color: #707070 !important;
  text-decoration: underline;
}

.case-operational-history-container.collapsed {
  max-height: 0;
  overflow: hidden;
}

.case-operational-history-container {
  transition: max-height 0.15s ease;
}

.case-operational-history-rows {
  max-height: 72px;
  overflow-y: auto;

  font-size: 11px !important;
  line-height: 18px;
  color: #707070 !important;
}

.case-operational-history-row {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  font-size: 11px !important;
  font-weight: 500 !important;
  color: #707070 !important;
}

.case-operational-history-label,
.case-operational-history-sep,
.case-operational-history-actor,
.case-operational-history-time {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: #707070 !important;
}

.case-operational-history-empty {
  font-size: 11px !important;
  color: #909090 !important;
}

/* ================================
   Status Dots and Tooltips
   ================================ */

.dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  min-width: 11px;
  min-height: 11px;
  max-width: 11px;
  max-height: 11px;
  flex: 0 0 11px;
  box-sizing: border-box;
  border-radius: 50%;
  margin: 0 6px 0 4px;
  position: relative;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.35);
}

.dot-yellow {
  background: radial-gradient(circle at 35% 35%, #ffd24d, #b88600);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.55),
    inset 0 -1px 2px rgba(0, 0, 0, 0.35),
    0 0 4px rgba(184, 134, 0, 0.55);
}

.dot-green {
  background: radial-gradient(circle at 35% 35%, #3fd68a, #0a6f2d);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.55),
    inset 0 -1px 2px rgba(0, 0, 0, 0.35),
    0 0 4px rgba(10, 111, 45, 0.55);
}

.dot-grey {
  background: radial-gradient(circle at 35% 35%, #e0e0e0, #a0a0a0);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.55),
    inset 0 -1px 2px rgba(0, 0, 0, 0.25);
}

.dot-red {
  background: radial-gradient(circle at 35% 35%, #ff6b6b, #c40000);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.35),
    0 0 5px rgba(196, 0, 0, 0.6);
}

.dot-na {
  background: #ffffff;
  border: 2px solid #3f5875;
  box-shadow: none;
}

.dot-na::after {
  display: none;
}

.dot-with-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot-with-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #f4f7fb;
  color: #2f3b4a;
  font-size: 11px;
  line-height: 1.1;
  padding: 4px 8px;
  border-radius: 5px;
  border: 2px solid #bfcad8;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 50;
}

.dot-with-tooltip:hover::after {
  opacity: 1;
}

/* ================================
   Requested Items Tables
   ================================ */

.requested-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.requested-items-table th,
.requested-items-table td {
  border: 1px solid #c7d3e2;
  padding: 3px 6px;
  line-height: 1.2;
  font-size: 13px;
  text-align: left;
}

.requested-items-table th {
  background: #f5f8fc;
  font-weight: 700;
}

.requested-items-row {
  background: #fff;
}

.empty-state-text {
  font-size: 13px;
  color: #666;
  padding: 4px 2px;
}

.locked-overlay {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d9c27a;
  background: #fff8e1;
  color: #6b5a1f;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.requested-items-table-locked {
  opacity: 0.82;
}

.add-row-link {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  color: #6b85a6;
  cursor: pointer;
  display: inline-block;
}

.add-row-link:hover {
  color: #2f4f6f;
  text-decoration: underline;
  font-weight: 600;
}

.requested-item-cell {
  padding: 2px 6px;
  font-size: 13px;
  font-family: Arial, sans-serif;
  line-height: 1.15;
  min-height: 16px;
  vertical-align: middle;
}

.requested-item-cell:focus {
  outline: none;
  background: #f8fbff;
}

.requested-item-cell:empty::before {
  content: attr(data-placeholder);
  color: #7a8899;
}

.requested-item-delete-header {
  width: 16px;
  padding: 0;
  border-left: none;
  border-right: none;
  background: transparent;
}

.requested-item-delete-cell {
  width: 16px;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  border-left: none;
}

.requested-item-delete-inline {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 16px;
  line-height: 1;
  color: #8da0b8;
  cursor: pointer;
  user-select: none;
}

.requested-item-delete-inline:hover {
  color: #5f7897;
  font-weight: 600;
}

/* ================================
   New Case / Patient Forms
   ================================ */

.new-case-search-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.new-case-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #2f4f6f;
}

.new-case-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #c7d3e2;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

.new-case-search-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.new-case-search-results {
  margin-top: 14px;
}

.form-row {
  margin-bottom: 6px;
}

.form-row label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #2f4f6f;
}

.case-section-body textarea,
.case-section-body input[type="text"],
.case-section-body input[type="date"],
.case-section-body select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #c7d3e2;
  border-radius: 6px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  color: #333;
  background: #fff;
  resize: vertical;
}

.case-section-body input[type="text"],
.case-section-body input[type="date"] {
  height: 34px;
  padding: 6px 10px;
}

.case-section-body textarea:focus,
.case-section-body input[type="text"]:focus,
.case-section-body input[type="date"]:focus,
.case-section-body select:focus {
  outline: none;
  border-color: #9fb6da;
  box-shadow: 0 0 0 2px rgba(159, 182, 218, 0.18);
}

.case-section-body textarea::placeholder,
.case-section-body input[type="text"]::placeholder {
  color: #7a8899;
}

.case-section-body pre {
  margin: 0;
}

.patient-form-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

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

.patient-form-grid-bottom {
  grid-template-columns: 1fr 1fr;
  max-width: 66.66%;
}

.patient-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.case-new-button {
  padding: 7px 12px;
  border: 1px solid #b9cce6;
  background: #e2ecfb;
  color: #2f4f6f;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.case-new-button:hover {
  background: #cfe0f7;
  border-color: #9fb6da;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.case-new-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.case-primary-button {
  background: #2f6fd6;
  border-color: #2a5fb8;
  color: #ffffff;
}

.case-primary-button:hover {
  background: #255ec0;
  border-color: #204fa3;
}

.case-secondary-button {
  background: #f3f5f8;
  border-color: #d3dbe6;
  color: #5a6b7c;
}

.case-secondary-button:hover {
  background: #e6ebf2;
}

/* ================================
   Validation
   ================================ */

.input-error {
  border: 1px solid #c94a4a !important;
  background: #fff5f5;
}

/* ================================
   Case Header Actions Layout
   ================================ */

.case-header-top-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.case-header-left {
  display: flex;
  flex-direction: column;
}

.case-header-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-left: 20px;
}

/* Selected Patient + Lead Clinician layout */

.case-two-col-wrap {
  display: inline-grid;
  grid-template-columns: max-content max-content;
  column-gap: 25px; /* about 1cm visual spacing */
  row-gap: 4px;
  align-items: start;
}

.case-two-col-left {
  font: inherit;
}

.case-two-col-right {
  display: flex;
  align-items: center;
  position: relative;
  top: -4px;
}

.case-two-col-select {
  width: 90px;
  min-width: 90px;

  height: 34px;
  line-height: 22px;

  padding: 0 18px 0 6px;

  font-size: 12px;
  font-weight: 700;
  color: #555;

  box-sizing: border-box;
}

/* =================================
   Case row spacing (shared pattern)
   ================================= */

.case-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.case-row-header-line,
.case-row-sub,
.case-row-dx {
  margin: 0;
}

.outcome-textarea {
  padding: 6px 8px;
}

/* ================================
   Auth Pages
   ================================ */

.auth-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f4f6f9;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  overflow: auto;
}

.auth-card {
  background: #ffffff;
  width: 420px;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.auth-logo-box {
  width: 58px;
  height: 58px;
  border: 2px solid #5b6f8f;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #2f4f6f;
  background: #eef4fb;
  box-sizing: border-box;
  flex: 0 0 58px;
}

.auth-app-name {
  font-size: 20px;
  font-weight: 700;
  color: #2f4f6f;
  line-height: 1.1;
}

.auth-title {
  margin: 6px 0 12px 5px;
  text-align: left;
  color: #1f3a5f;
  font-size: 20px;
  font-weight: 700;
}

.auth-input,
.auth-select {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1.5px solid #a8b3c2;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 14px;
  background: #ffffff;
}

.auth-input:focus,
.auth-select:focus {
  outline: none;
  border-color: #5b6f8f;
  box-shadow: 0 0 0 2px rgba(91, 111, 143, 0.25);
  box-shadow: 0 0 0 2px rgba(159, 182, 218, 0.18);
}

.auth-button {
  width: 100%;
  padding: 10px;
  background-color: #1f3a5f;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.auth-button:hover {
  background-color: #16324f;
}

.auth-links {
  margin-top: 16px;
  text-align: left;
  font-size: 13px;
  margin-left: 5px;
}

.auth-links a {
  color: #1f3a5f;
  text-decoration: none;
  font-weight: 500;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-message {
  margin-bottom: 10px;
  font-size: 13px;
  text-align: center;
  color: #8a1f1f;
  min-height: 16px;
}

.auth-message.success {
  color: #1f6a35;
}

/*Admin*/

.admin-details-sheet {
  border: 2px solid #cfd8e3;
  border-radius: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.45);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-details-sheet.editing {
  background: #eef5fc;
  border: 2px solid #7aa7d9;
  box-shadow: 0 0 0 2px rgba(122, 167, 217, 0.18);
}