/* main layout styles */
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  font-size: 14px; /* reduced from default ~16px by 2px */
  margin: 0;
  display: grid;
  grid-template-rows: 1fr;
  grid-template-columns: 200px 1fr;
  height: 100vh;
  background-color: #f0f2f9;
}

/* username styling */
/* Inbox icon next to user-trigger (top-right) */
.inbox-link { margin-left: auto; margin-right: 10px; font-size: 20px; text-decoration: none; color: #fff; }
.inbox-link:hover { color: #d4e6ff; }
header .user.dropdown { position: relative; }
.sidebar-user.dropdown { position: relative; padding: 0px 5px; }
.user-trigger { background: transparent; color: #fff; border: none; cursor:pointer; font-size: 11px; display:flex; align-items:center; gap:8px; }
.user-trigger .arrow { margin-left: 6px; }
.user-trigger .avatar { width:30px; height:30px; border-radius:50%; object-fit:cover; }
.dropdown-menu { position: absolute; right: 0; top: 100%; background: #003366; color:#fff; border: 1px solid #00264d; border-radius:6px; min-width:180px; display:none; z-index:1000; }
.sidebar-user .dropdown-menu { left: 15px; right: auto; top: 100%; bottom: auto; }
.dropdown-menu.open { display:block; }
.dropdown-menu a { display:block; padding:10px 14px; color:#fff; text-decoration:none; }
.dropdown-menu a:hover { background:#0b4f90; }

aside {
  background-color: #051c32;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  padding-top: 20px;
  overflow-y: auto;
}

.sidebar-user-li {
  list-style: none;
  margin-top: 6px;
  border-top: 1px solid #0a3a66;
  padding-top: 6px;
}

.sidebar-version {
  padding: 4px 20px 10px;
  font-size: 10px;
  color: #5a7a9a;
  text-align: center;
  letter-spacing: 0.3px;
  margin-bottom: 150px;
}

.sidebar-version-li {
  list-style: none;
}

aside nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

aside nav li {
  margin: 10px 0;
}

aside nav a {
  color: white;
  text-decoration: none;
  font-size: 14px; /* reduced from 18px by 2px */
  display: block;
  padding: 10px 20px;
}

aside nav a.active {
  color: lightblue;
  background-color: #023a72;
}

/* Mark required fields with a red asterisk before the label */
.required-label::before {
  content: "* ";
  color: #B00020;
  font-weight: 700;
}

/* Sidebar submenu */
aside nav li.has-children > a { position: relative; }
aside nav li.has-children .submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
}
aside nav li.has-children .submenu a { font-size: 13px; padding-left: 36px; }

aside nav li.has-children .submenu a.disabled {
  pointer-events: none;
  cursor: not-allowed;
  color: #c0c7d1 !important;
  position: relative;
}
aside nav li.has-children .submenu a.disabled::after {
  content: "Soon";
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #e2e6ec;
  color: #a0a8b4;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Back arrow link (reusable) */
.back-arrow-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 65px;
  height: 30px;
  border-radius: 6px;
  font-size: 31px;
  color: #245ca5;
  background: #eef3fa;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
  flex-shrink: 0;
  padding-bottom: 5px;
}
.back-arrow-link:hover {
  background: #dce8f5;
}

main {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  padding: 20px;
}

/* Add wrapper for content sections */
.section-box {
  background-color: white;
  border-radius: 10px;
  padding: 50px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 800px;
}
.form-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.form-grid-single {
  grid-template-columns: 1fr;
  max-width: 100%;
}
.form-grid div {
  display: flex;
  flex-direction: column;
}
.form-grid label {
  margin-bottom: 5px;
}

.form-grid input, .form-grid select {
  padding: 8px;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fafafa;
}
/* Enhanced clients table grid and alignment */
table.clients {
  border-collapse: collapse;
  border: 1px solid #ccc;
  width: 100%;
}
table.clients th,
table.clients td {
  padding: 12px 8px;
  text-align: left;
  border-right: 1px solid #ccc;
}
table.clients th:last-child,
table.clients td:last-child {
  border-right: none;
}
table.clients thead th {
  background-color: #f5f5f5;
  font-weight: 600;
}
table.clients tbody tr {
  border-bottom: 1px solid #ccc;
}
table.clients .actions a {
  margin-right: 10px;
  font-size: 1rem;
  color: #007bff;
  text-decoration: none;
}
table.clients .actions a:hover {
  color: #0056b3;
}
table.clients .actions button {
  margin-right: 10px;
  font-size: 1rem;
  color: #007bff;
  background: none;
  border: none;
  cursor: pointer;
}
table.clients .actions button:hover {
  color: #0056b3;
}
.table.clients .actions .protocols-icon {
  margin-right: 10px;
  font-size: 1.2rem;
  color: #007bff;
  text-decoration: none;
}
.table.clients .actions .protocols-icon:hover {
  color: #0056b3;
}
.clients-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.clients-header h1 {
  margin: 0;
}

.clients-left { display:flex; align-items:center; gap:12px; }

h1 {
  font-size: 21px;
  font-weight: 800;
}

.new-client-btn {
  background-color: #007bff;
  color: white;
  font-size: 12px;
  padding: 8px 20px;
  border-radius: 5px;
  text-decoration: none;
  border: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  height: 36px;
  box-sizing: border-box;
}
.new-client-btn:hover {
  background-color: #0056b3;
}
.btn {
  background-color: #0c60b3;
  color: white;
  font-size: 12px;
  padding: 8px 20px;
  border-radius: 5px;
  text-decoration: none;
  border: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  height: 30px;
  box-sizing: border-box;
}
.btn:disabled,
.btn[disabled] {
  background-color: #e2e4e7;
  color: #9ca3af;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-secondary:disabled,
.btn-secondary[disabled] {
  background-color: #e2e4e7;
  color: #9ca3af;
  cursor: not-allowed;
  pointer-events: none;
}

a#missedBtn { background: #e2e4e7; color: #000000; }
a#missedBtn.missed-empty { background: #f7f7f7; color: #000000; }
a#missedBtn.missed-alert { background: #f7f7f7; color: #ff1212; position: relative;}
a#missedBtn.missed-alert::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #ff1212;
  border-radius: 50%;
  margin-right: 6px;
}
/* New generic button classes */
.simpleBtn {
  background: #f7f7f7;
  color: #000000;
  border: none;
  border-radius: 5px;
  padding: 7px 20px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  margin-right: 5px;
  font-size: 12px;
  border: solid;
  border-width: 1px;
  border-color: #e3e3e3;
}
.simpleBtn:hover { background:#e7e7e7; color:#000000; }
.simpleBtn:disabled,
.simpleBtn[disabled] {
  color: #c5c5c5;
  cursor: not-allowed;
  pointer-events: none;
}
.disabledBtn { background:#e2e4e7 !important; color:#c9c9c9 !important; cursor:not-allowed !important; }

/* Delete button (red) */
.deleteBtn { background-color: #dc3545; }
.deleteBtn:hover { background-color: #b02a37; }
.deleteBtn.disabledBtn { background:#e2e4e7 !important; color:#c9c9c9 !important; }

/* Small buttons variant for footer and compact areas */
.smallButtons {
  background-color: #ffffff;
  color: #245ca5;
  font-size: 11px;
  padding: 7px 17px;
  border-radius: 10px;
  text-decoration: none;
  border: solid;
  display: inline-block;
  cursor: default;
  border-width: 1px;
  border-color: #e3e3e3;
  margin-top: 5px;
}
.smallButtons:hover { background:#f0f0f0; color:#000000; }

/* Session count pill: like .smallButtons but white background and no pointer */
.sessionCountPill {
  background-color: #ffffff;
  color: #245ca5;
  font-size: 11px;
  padding: 7px 17px;
  border-radius: 5px;
  text-decoration: none;
  border: solid;
  display: inline-block;
  cursor: default;
  border-width: 1px;
  border-color: #e3e3e3;
  margin-top: 5px;
}
.sessionCountPill:hover { background: #f0f0f070; color: #245ca5; }

/* Clients actions icons (Edit/Delete) pill style */
table.clients .actions .edit-icon,
table.clients .actions .delete-icon {
  background-color: #f9f9f9;
  color: #245ca5;
  font-size: 16px;
  padding: 8px 8px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid #e3e3e3;
  display: inline-block;
  cursor: pointer;
  line-height: 1;
}
table.clients .actions .edit-icon:hover,
table.clients .actions .delete-icon:hover {
  background: #f0f0f070;
  color: #245ca5;
}
/* Links inside Clients table (Name/Family) */
table.clients td a { color: #2052b3; text-decoration: none; }
table.clients td a:hover,
table.clients td a:active,
table.clients td a:focus { color: #133068; text-decoration: none; }
/* Plus icon prefix for New/Add buttons */
.btn-plus { padding-left: 16px; }
.btn-plus::before {
  content: "+";
  display: inline-block;
  margin-right: 8px;
  font-weight: 800;
}

.btn:hover {
  background-color: #094a8b;
  color: #ffffff;}

/* See More button style */
.seeMorebtn {
  background-color: #f7f7f7;
  color: #245ca5;
  font-size: 12px;
  padding: 8px 17px;
  border-radius: 5px;
  text-decoration: none;
  border: solid;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  border-width: 1px;
  border-color: #e3e3e3;
  height: 33px;
  box-sizing: border-box;
}

/* Default Neurofeedback selected badge (green with dot) */
.default-selected { color: #167C2B !important; position: relative; }
.default-selected::before { content: ''; display: inline-block; width: 8px; height: 8px; background: #167C2B; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.default-neuro-label { margin-left: 8px;  color: #ffffff;  background: #a5a5a5;  font-weight: 400;  padding: 1% 3%;  border-radius: 5px;  font-size: 13px; }
.default-neuro-label.neuro-active { background: #41a704; }

/* Secondary grey button for Edit */
.btn-secondary {
  background-color: #f7f7f7;
  color: #000000;
  border-radius: 5px;
  padding: 7px 20px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  margin-right: 5px;
  font-size: 12px;
  border: solid;
  border-width: 1px;
  border-color: #e3e3e3;}

.btn-secondary:hover {
  background-color: #757a814a;
  color: #000000;}

/* Importing Tools: Overwrite button blue on both tabs */
.btn-overwrite-tools {
  background-color: #0c60b3;
  color: #fff;
  border-color: #0a4f94;
}
.btn-overwrite-tools:hover {
  background-color: #0a4f94;
  color: #fff;
}
.btn-overwrite-tools:disabled {
  background-color: #6c9ed9;
  color: #fff;
  border-color: #0a4f94;
}

.btn-back {
  background-color: #9aa3ad4a;
  color: #000000;
  height: 30px;
  line-height: 30px;
  font-size: 13px;
  padding: 0px 20px;
  border-radius: 8px;}

/* Stack forms so action buttons stay at bottom-right */
.stack-form {
  display: flex;
  flex-direction: column;
}
.form-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
/* When actions live inside a two-column form-grid, span both and align right */
.form-actions-grid {
  grid-column: 2 / 3;
  margin-top: 0;
  padding-top: 0;
  display: flex;
  justify-content: flex-end;
}
.form-actions-col2 {
  grid-column: 2 / 3;
  display: flex;
  justify-content: flex-end;
}
/* Note actions compact spacing */
.note-actions {
  margin-top: 5px;
}

/* Add top margin for save button on forms */
form > .btn {
  margin-top: 30px;
}

/* Login page overrides */
body.login-page {
  background-color: #003366;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  margin: 0;
}
.login-container {
  background-color: white;
  border-radius: 10px;
  padding: 50px;
  text-align: center;
  width: 350px;
  box-sizing: border-box;
}
.login-container input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 5px;
}
.error {
  color: #d32f2f;
  margin-bottom: 10px;
}
.logo-login {
  display: block;
  margin: 0 auto 20px;
}
.client-detail-grid {
  display: grid;
  grid-template-columns: 1fr 4fr; /* left ~20%, right ~80% */
  gap: 20px; /* 20px between all blocks */
  align-items: start;
}
.client-detail-grid.client-detail-full {
  grid-template-columns: 1fr;
}
.client-detail-full .client-right {
  grid-column: 1;
}

/* Responsive: stack on small screens */
@media (max-width: 1200px) {
  .client-detail-grid {
    grid-template-columns: 1fr 3fr;
  }
}
@media (max-width: 900px) {
  .client-detail-grid {
    grid-template-columns: 1fr;
  }
  .client-right {
    grid-column: 1;
  }
}
.client-left { display: grid; gap: 12px; 
  background: #f7f7f782;
  border-radius: 10px;
  padding: 22px;
  min-height: auto;
  border: solid;
  border-width: 1px;
  border-color: #efefef;

}
.section-card {
  background: white;
  border-radius: 10px;
  padding: 10px;
}
.client-info .form-grid,
.client-notes {
  max-width: unset; /* allow full column width for equal columns */
}
/* Single column layout for Name/Family to match General Note width */
.client-info .form-grid {
  grid-template-columns: 1fr; /* single column - equal width with General Note */
}
.client-info .form-grid input {
  width: 100%;
  box-sizing: border-box;
}
.client-right {
  grid-column: 2 / 3;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-gap: 12px;
  background: #f7f7f782;
  border-radius: 10px;
  padding: 40px;
  min-height: auto;
  border: solid;
  border-width: 1px;
  border-color: #efefef;
}
.client-protocols, .client-notes {
  background: #fbfbfb;
  border-radius: 10px;
  padding: 10px;
}
.nf-notes {
  background: white;
  border-radius: 10px;
  padding: 10px;
}
.client-protocols h2, .client-notes h2 {
  margin-top: 0;
  font-size: 18px;
  font-weight: 700;
}
.client-protocols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-top: 0; /* nudge up to align with input row */
  padding-bottom: 0;
  margin-top: -6px; /* bring slightly higher to match the Name/Family row */
}
.client-protocols h2 {
  margin: 0; /* ensure same height feeling as heading row */
  font-size: 18px; /* match client name heading size */
  font-weight: 700; /* match client name weight */
}
.proto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.new-payment {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.protocols-row { display:flex; align-items:center; gap:10px; }
.btn-green {
  background-color: #137230;
  color: #fff;
}
.btn-green:hover {
  background-color: #0b421d;
  color: #fff;
}
.client-notes textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  height: 260px;
}
.nf-notes textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  height: 260px;
}
.section-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  padding-right: 10px;
  margin-bottom: 10px;
}
.client-heading-left {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

/* Client Active/Deactive toggle in top bar */
.client-status-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 8px;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  background: #f8f9fa;
  transition: border-color .2s, background .2s;
}
.client-status-toggle-wrap.status-deactive {
  border-color: #e2c5c5;
  background: #fdf2f2;
}
.client-status-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.client-status-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.client-status-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #ccc;
  border-radius: 22px;
  transition: background .25s;
}
.client-status-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.client-status-toggle input:checked + .client-status-slider {
  background: #28a745;
}
.client-status-toggle input:checked + .client-status-slider::before {
  transform: translateX(18px);
}
.client-status-label {
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  user-select: none;
  white-space: nowrap;
}
.client-status-toggle-wrap.status-deactive .client-status-label {
  color: #a94442;
}

/* Client meta row (toggle + CHR status + treatment date) */
.client-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 50px;
  margin-bottom: 14px;
}
.client-meta-row-start {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.client-meta-session-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.client-meta-session-links a.cj-status-badge {
  text-decoration: none;
  color: #495057;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.client-meta-session-links a.cj-status-badge:hover {
  background: #e9ecef;
  border-color: #ced4da;
  color: #343a40;
}
.client-meta-session-links .cm-session-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
  user-select: none;
}

/* Client Journey status badge — matches .client-status-toggle-wrap style */
.cj-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  background: #f8f9fa;
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
}
.cj-status-loading {
  opacity: .5;
  font-weight: 500;
}
.cj-status-closed {
  color: #dc3545;
}
.cj-status-graduate,
.cj-status-graduated {
  color: #7b2d8e;
}
.cj-status-start-tx,
.cj-status-open {
  color: #28a745;
}

/* Treatment Start Date */
.treatment-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  background: #f8f9fa;
}
.treatment-date-label {
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
}
.treatment-date-input {
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 12px;
  color: #333;
  background: #ffffff70;
  cursor: pointer;
  border: solid 1px #d9d9d9;
}
.treatment-date-input:focus {
  outline: none;
  border-color: #0c60b3;
  box-shadow: 0 0 0 2px rgba(12,96,179,.15);
}
.treatment-date-saved {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.treatment-date-saved.saved-ok { color: #28a745; }
.treatment-date-saved.saved-err { color: #dc3545; }

/* Client status change confirmation modal */
.client-status-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.22);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.client-status-modal-overlay.open { opacity: 1; pointer-events: auto; }
.client-status-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 28px 36px 22px;
  min-width: 320px;
  max-width: 420px;
  text-align: center;
  transform: scale(.92);
  transition: transform .2s ease;
}
.client-status-modal-overlay.open .client-status-modal { transform: scale(1); }
.client-status-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}
.client-status-modal-icon.icon-active {
  background: #d4edda;
  color: #28a745;
}
.client-status-modal-icon.icon-deactive {
  background: #fff3cd;
  color: #856404;
}
.client-status-modal-msg {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  margin: 0 0 18px;
}
.client-status-modal-msg strong {
  color: #0c60b3;
}
.client-status-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.client-status-modal-btn {
  border: none;
  padding: 7px 28px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.client-status-modal-btn.btn-cancel {
  background: #e9ecef;
  color: #495057;
}
.client-status-modal-btn.btn-cancel:hover { background: #dee2e6; }
.client-status-modal-btn.btn-confirm {
  background: #0c60b3;
  color: #fff;
}
.client-status-modal-btn.btn-confirm:hover { background: #094d8e; }
.client-status-modal-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Datasheet toolbar */
.datasheet-toolbar { display:flex; align-items:center; gap:10px; justify-content:flex-end; margin-bottom:10px; }
.palette { display:flex; gap:6px; }
.swatch { width:20px; height:20px; border-radius:4px; border:1px solid #999; cursor:pointer; }
.swatch.selected { outline:2px solid #0c60b3; }
.search-input {     
  width: 353px;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 5px; }
.hint { color:#999999; font-size: 10px; margin-left:auto; }

/* Fallback table tweaks */
.fallback-table { border-collapse: separate; border-spacing: 0; width: 100%; user-select: none; }
.fallback-table th, .fallback-table td { border-bottom: 1px solid #ddd; border-right: 1px solid #ddd; padding: 6px; min-width: 100px; }
.fallback-table thead th { border-top: 1px solid #ddd; }
.fallback-table th:first-child, .fallback-table td:first-child { border-left: 1px solid #ddd; }
.fallback-table td { background: #fff; }
.fallback-table td[contenteditable="true"]:focus { outline: 2px solid #0c60b3; background: #eef5ff; }
.fallback-table td.sel { outline: 2px solid #0c60b3; }
.hidden-row { display:none; }

/* Datasheet/protocol sheets: visible seam for pinned (A–H) columns in AG Grid */
#myGrid .ag-pinned-left-header,
#myGrid .ag-pinned-left-cols-viewport,
#myGrid .ag-pinned-left-cols-container {
  border-right: 3px solid #cfd4dc; /* thicker seam to hide background gap */
}

/* Fallback table: visible seam after sticky columns (row number + A–H = 9th cell) */
#fallbackSheet thead th.sticky-col:nth-child(9),
#fallbackSheet tbody td.sticky-col:nth-child(9) {
  border-right: 3px solid #cfd4dc !important;
}

/* Clients header actions and search */
.clients-actions { display:flex; align-items:center; gap:10px; }
.search-group { display:flex; align-items:center; gap:6px; background:#fff; border:1px solid #ccc; border-radius:8px; padding:4px 8px; }
.search-group .search-icon { opacity:0.6; }

/* Sortable header styles */
table.clients th.sortable { user-select: none; }
table.clients th#nameHeader .th-inner,
table.clients th#createdHeader .th-inner,
table.clients th#updatedHeader .th-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
table.clients th#nameHeader .th-inner .sort-icons,
table.clients th#createdHeader .th-inner .sort-icons,
table.clients th#updatedHeader .th-inner .sort-icons { margin-left: auto; display: flex; flex-direction: column; align-items: center; line-height: 0.8; font-size: 10px; opacity: 0.5; }
table.clients th#nameHeader .sort-icons .arrow-up,
table.clients th#createdHeader .sort-icons .arrow-up,
table.clients th#updatedHeader .sort-icons .arrow-up,
table.clients th#nameHeader .sort-icons .arrow-down,
table.clients th#createdHeader .sort-icons .arrow-down,
table.clients th#updatedHeader .sort-icons .arrow-down { margin: 0; }
table.clients th .sort-icons:hover,
table.clients th .sort-icons .arrow-up:hover,
table.clients th .sort-icons .arrow-down:hover { cursor: pointer; opacity: 0.8; }
table.clients th.sort-asc .sort-icons .arrow-up { opacity: 1; }
table.clients th.sort-desc .sort-icons .arrow-down { opacity: 1; }

/* Protocols table (client detail) */
.protocols-table {
  width: 100%;
  border-collapse: separate; /* allow spacing without borders */
  border-spacing: 0 8px; /* row gaps, no lines */
}

/* Location column takes remaining space */
.protocols-table thead th {
  background: #f5f7fb;
  font-weight: 600;
  padding: 8px 10px;
  text-align: left;
}
.protocols-table tbody td {
  padding: 6px 10px;
  vertical-align: middle;
}
/* Align headers and cells for numeric columns (Total Sessions, Paid, Done, Remaining) */
.client-protocols .protocols-table th:nth-child(3),
.client-protocols .protocols-table th:nth-child(4),
.client-protocols .protocols-table th:nth-child(5),
.client-protocols .protocols-table th:nth-child(6) {
  text-align: center;
}
.protocols-table tbody td:nth-child(3),
.protocols-table tbody td:nth-child(4),
.protocols-table tbody td:nth-child(5),
.protocols-table tbody td:nth-child(6) {
  text-align: center;
}
.protocols-table .num-input {
  width: 70px;
  height: 20px;
  box-sizing: border-box;
  padding: 13px 6px;
  border: 1px solid #d7d7d7;
  border-radius: 5px;
  background-color: #f9f9f9;
  text-align: center;
}
/* Read-only span styled to match input fields exactly */
.protocols-table .num-readonly {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 30px;
  box-sizing: border-box;
  padding: 13px 6px;
  border: 1px solid #d7d7d7;
  border-radius: 5px;
  background-color: #f9f9f9;
  text-align: center;
  vertical-align: middle;
}
.protocols-table .remaining-value {
  font-weight: 700;
}
.protocols-table .btn {
  width: 100px; /* make all buttons equal width */
  height: 40px; /* increase height */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px; /* height controlled above */
  text-align: center;
}
/* Ensure simpleBtn protocol buttons also have fixed width */
.protocols-table .simpleBtn {
  width: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  position: relative;
  padding-right: 26px; /* room for open-link icon */
}

/* Add small open-link icon to protocol row buttons */
.protocols-table .protocol-row .simpleBtn::after {
  content: '\2197'; /* ↗ */
  position: absolute;
  right: 8px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.5;
}

/* Active program toggle switch */
.active-toggle-cell {
  text-align: center;
  vertical-align: middle;
}
.active-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.active-toggle .active-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.active-toggle .active-toggle-slider {
  position: absolute;
  inset: 0;
  background-color: #ccc;
  border-radius: 20px;
  transition: background-color 0.25s;
}
.active-toggle .active-toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
}
.active-toggle .active-toggle-input:checked + .active-toggle-slider {
  background-color: #34a853;
}
.active-toggle .active-toggle-input:checked + .active-toggle-slider::before {
  transform: translateX(16px);
}

/* Add open-link icon to dashboard Protocols template buttons */
.rp-buttons .simpleBtn {
  position: relative;
  padding-right: 26px; /* room for open-link icon */
}
.rp-buttons .simpleBtn::after {
  content: '\2197'; /* ↗ */
  position: absolute;
  right: 8px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.5;
}

/* Importing Tools: Preview buttons 30% smaller */
.tools-section .client-tools-biofeedback .rp-buttons .simpleBtn,
.tools-section .client-tools-sleep .rp-buttons .simpleBtn {
  font-size: 8.4px;
  padding: 5px 14px;
  padding-right: 18px;
}
.tools-section .client-tools-biofeedback .rp-buttons .simpleBtn::after,
.tools-section .client-tools-sleep .rp-buttons .simpleBtn::after {
  font-size: 10px;
  right: 5px;
}

/* Footer protocol buttons smaller look */
.protocols-footer .simpleBtn {
  font-size: 11px;
  padding: 5px 15px;
  background-color: #f9f9f9;
}

.protocols-footer { display:flex; gap:10px; padding-top: 12px; }

/* Modal for save/discard */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: none; align-items: center; justify-content: center; z-index: 2000; }
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 10px; padding: 18px; min-width: 320px; max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal-body { margin-bottom: 14px; font-size: 14px; color: #333; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Generic centered modal (used for import progress on multiple pages) */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: none; align-items: center; justify-content: center; z-index: 3000; }
.modal.open { display: flex; }
.modal-card { background: #fff; border-radius: 10px; padding: 20px; width: 420px; max-width: 90vw; box-shadow: 0 10px 24px rgba(0,0,0,0.2); }
.modal-title { margin: 0 0 10px 0; font-size: 18px; font-weight: 700; color:#333; }
.progress { width: 100%; height: 12px; background: #e9edf3; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: #0c60b3; transition: width 0.25s ease; }
.progress-text { font-size: 12px; color: #555; margin-top: 8px; text-align: right; }

/* Advanced box styles (client detail protocols expand) */
.advanced-container { margin-top: 10px; }
.advanced-box {
  text-align: left;
  display: none;
  background: #f9f9f9ad;
  border: 1px solid #dfe7f5;
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
}
/* Make a copy of .advanced-box styles for .clientProtoBox and hide by default */
.clientProtoBox {
  display: none; /* hidden by default */
  background: #f9f9f9ad;
  border: 1px solid #dfe7f5;
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
}

/* Thin vertical divider for inline action rows */
.v-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: #d7d7d7;
  margin: 0 6px;
}

/* Tools section with tabs (client detail) */
.tools-section {
  margin-top: 16px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}
.tools-section:not(.importing-tools-accordion) {
  padding: 14px 18px 18px;
}
.tools-section.importing-tools-accordion { overflow: visible; }
.importing-tools-accordion .importing-tools-accordion-body { overflow: visible; }

/* Importing Tools accordion (closed by default) */
.importing-tools-accordion .importing-tools-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  color: #333;
  background: #f8f9fa;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}
.importing-tools-accordion .importing-tools-accordion-toggle:hover {
  background: #e9ecef;
  color: #0c60b3;
}
.importing-tools-accordion .importing-tools-accordion-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
  background-size: 20px 20px;
  transition: transform 0.25s ease;
}
.importing-tools-accordion.importing-tools-accordion-open .importing-tools-accordion-icon {
  transform: rotate(180deg);
}
.importing-tools-accordion .importing-tools-accordion-body {
  display: none;
  padding: 16px 18px 18px;
  border-top: 1px solid #e0e0e0;
}
.importing-tools-accordion.importing-tools-accordion-open .importing-tools-accordion-body {
  display: block;
}
.tools-section-title {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 700;
  color: #333;
}
.tools-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 0;
  border-bottom: 1px solid #dee2e6;
  padding: 0 2px 0 0;
}
.tools-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #6c757d;
  background: #e9ecef;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.15s ease;
  position: relative;
}
.tools-tab:hover:not(.active) {
  color: #495057;
  background: #dee2e6;
}
.tools-tab.active {
  color: #0c60b3;
  background: #fff;
  border-color: #dee2e6;
  border-bottom: 1px solid #fff;
  margin-bottom: -1px;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.04);
}
.tools-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: #f1f1f1;
  border-radius: 3px 3px 0 0;
}
.tools-panel {
  padding: 0;
  background-color: #fff;
  border-radius: 0 0 8px 8px;
  border: 1px solid #e0e0e0;
  border-top: none;
  margin-top: -1px;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.04);
}
.tools-panel-inner,
.protocol-advanced-tools {
  padding: 20px 24px;
}
.tools-panel-inner .client-tools-block {
  margin-bottom: 20px;
}
.tools-panel-inner .client-tools-block:last-child {
  margin-bottom: 0;
}
.tools-panel-inner h4 {
  margin: 0 0 14px 0;
  font-size: 14px;
}
.tools-panel-inner .client-tools-row {
  margin-bottom: 12px;
}
.tools-panel-inner .rp-row.rp-buttons {
  margin-top: 12px;
}
.tools-panel-inner hr {
  margin: 20px 0;
}
.tools-panel-inner > p {
  margin-bottom: 14px;
}

/* Profile page: password-change errors */
.profile-error {
  color: #d32f2f;
  font-size: 13px;
  white-space: nowrap;
}
.profile-password-section input[type="password"] {
  min-width: 0;
  flex: 0 0 auto;
  width: 100%;
}

/* Profile: Change password — 3 columns (New password | Confirm new password | Show button) */
.profile-password-grid {
  grid-template-columns: 1fr 1fr auto;
  max-width: 520px;
  align-items: end;
}
.profile-password-btn-cell {
  display: flex;
  align-items: center;
  padding-bottom: 2px;
}
.profile-password-btn-cell .simpleBtn {
  margin: 0;
}

/* ── Password field: show/hide toggle ── */
.password-wrapper {
  position: relative;
  display: block !important;
  flex-direction: unset !important;
}
.password-wrapper input {
  padding-right: 40px;
  width: 100%;
  box-sizing: border-box;
}
.password-toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-left: 1px solid #e0e0e0;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
}
.password-toggle:hover {
  color: #111827;
  background: #f3f4f6;
}

/* Password input border states for real-time validation */
.form-grid input.input-error { border-color: #dc2626; }
.form-grid input.input-success { border-color: #16a34a; }

/* Password strength bar */
.password-strength { margin-top: 6px; min-height: 18px; }
.strength-bar { height: 4px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 99px; transition: width 0.3s ease, background 0.3s ease; }
.strength-fill.str-1 { background: #dc2626; }
.strength-fill.str-2 { background: #f97316; }
.strength-fill.str-3 { background: #eab308; }
.strength-fill.str-4 { background: #22c55e; }
.strength-fill.str-5 { background: #16a34a; }
.strength-label { font-size: 11px; margin-top: 2px; display: inline-block; }
.strength-label.str-1 { color: #dc2626; }
.strength-label.str-2 { color: #f97316; }
.strength-label.str-3 { color: #a16207; }
.strength-label.str-4 { color: #22c55e; }
.strength-label.str-5 { color: #16a34a; }

/* Password match indicator */
.password-match { font-size: 12px; margin-top: 6px; min-height: 18px; display: flex; align-items: center; gap: 5px; }
.password-match.match-ok { color: #16a34a; }
.password-match.match-fail { color: #dc2626; }

/* Row: input + "Show password" button (technician form, profile, etc.) */
.password-row-with-btn {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
}
.password-row-with-btn .password-input-wrap { flex: 1; min-width: 0; }
.password-row-with-btn .password-input-wrap input { width: 100%; box-sizing: border-box; }

/* Technician form: "Show password" in right column below Password, aligned with Confirm password row */
.tech-show-pw-cell {
  display: flex;
  align-items: flex-start;
}
.tech-show-pw-cell .simpleBtn { margin: 0; }

/* ── Help icon with tooltip ── */
.help-icon-wrapper {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #f3f3f3;
  border: solid;
  border-color: #00000026;
  border-width: 0.1px;
  color: #0c60b3;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  font-family: Georgia, 'Times New Roman', serif;
  cursor: help;
  transition: all 0.2s ease;
}
.help-icon:hover {
  background: #0c60b3;
  color: #fff;
}
.help-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: #efefef;
  color: #6e6e6e;
  border: solid;
  border-width: 1px;
  border-color: #d5d5d5;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 100;
}
.help-tooltip::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #d5d5d5;
}
.help-tooltip--below {
  bottom: auto;
  top: 100%;
  left: 0;
  transform: none;
  margin-bottom: 0;
  margin-top: 8px;
}
.help-tooltip--below::before {
  bottom: auto;
  top: -6px;
  left: 8px;
  transform: none;
  border-top: none;
  border-bottom: 6px solid #d5d5d5;
}
.help-tooltip code {
  background: rgba(255,255,255,0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}
.help-icon-wrapper:hover .help-tooltip {
  display: block;
}

/* ── Action button (blue primary) ── */
.actionBtn {
  background: #0c60b3;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

/* ── Shared layout: panes, rows, selects (dashboard & tools) ── */
.column-card {
  display: grid;
  gap: 12px;
  background: #f7f7f782;
  border-radius: 10px;
  padding: 22px;
  min-height: auto;
  border: solid;
  border-width: 1px;
  border-color: #efefef;
}
.right-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f7f7f782;
  border-radius: 10px;
  padding: 40px;
  min-height: auto;
  border: solid;
  border-width: 1px;
  border-color: #efefef;
}
.left-pane {
  display: grid;
  gap: 12px;
  background: #f7f7f782;
  border-radius: 10px;
  padding: 40px;
  min-height: auto;
  border: solid;
  border-width: 1px;
  border-color: #efefef;
}
.combined-pane { display: flex; flex-direction: column; gap: 12px; }
.rp-row h2 { margin: 0; }
.rp-row h3 { margin: 0; font-size: 18px; }
.rp-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.select-box { display: flex; flex-direction: column; gap: 6px; }
.select-box label { font-weight: 600; }
.select-box select, .select-box input { border: 1px solid #ccc; border-radius: 8px; padding: 8px; background: #fff; }
.rp-actions { display: flex; justify-content: flex-end; }
.excel-importer { display: flex; align-items: center; gap: 10px; padding: 12px 0px 0px 0px; }
.note-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btn-row { display: flex; gap: 10px; justify-content: flex-start; margin-top: 10px; }

/* Export protocol-type checkboxes */
.export-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.export-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #0c60b3;
  cursor: pointer;
}
select#defaultNeuroSelect {
  border-radius: 3px !important;
}