/* 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;
}

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

/* 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:40px; height:40px; border-radius:50%; object-fit:cover; background: #ffffff36; border: solid 1px #dbe9f8;}
.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: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #fff;
  text-decoration: none;
}
.dropdown-menu a:hover { background:#0b4f90; }

body > 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: 0 12px 12px;
  font-size: 10px;
  color: #5a7a9a;
  text-align: center;
  letter-spacing: 0.3px;
}

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

.sidebar-logo-li {
  list-style: none;
  text-align: center;
  padding: 10px 0 6px;
}

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

aside nav li {
  margin: 0;
}

aside nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

aside nav a:hover:not(.disabled) {
  color: #fff;
  background-color: #0a3058;
}

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

aside nav a.active .nav-icon {
  color: lightblue;
}

/* Parent item: subdued when a submenu child is the current page */
aside nav li.has-children:has(.submenu a.active) > a,
aside nav li.has-children:has(.submenu a.active) > a.active {
  background-color: #011e3a;
  color: rgba(173, 216, 230, 0.9);
  font-weight: 500;
}

aside nav li.has-children:has(.submenu a.active) > a .nav-icon,
aside nav li.has-children:has(.submenu a.active) > a.active .nav-icon {
  color: rgba(173, 216, 230, 0.9);
}

/* Child item: full highlight (must follow parent rules) */
aside nav li.has-children .submenu a.active {
  background-color: #023a72;
  color: lightblue;
  font-weight: 600;
}

aside nav li.has-children .submenu a.active .nav-icon {
  color: lightblue;
}

aside nav .nav-icon {
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  opacity: 0.92;
}

.nav-icon--sub {
  width: 16px;
  font-size: 12px;
  opacity: 0.85;
}

.nav-label {
  flex: 1;
  min-width: 0;
}

/* 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 li {
  border-bottom: none;
}

aside nav li.has-children .submenu a {
  font-size: 13px;
  padding: 9px 16px 9px 28px;
  gap: 10px;
}

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 (legacy; sg-table variant on /clients/) */
table.clients:not(.sg-table) {
  border-collapse: collapse;
  border: 1px solid #ccc;
  width: 100%;
}
table.clients:not(.sg-table) th,
table.clients:not(.sg-table) td {
  padding: 12px 8px;
  text-align: left;
  border-right: 1px solid #ccc;
}
table.clients:not(.sg-table) th:last-child,
table.clients:not(.sg-table) td:last-child {
  border-right: none;
}
table.clients:not(.sg-table) thead th {
  background-color: #f5f5f5;
  font-weight: 600;
}
table.clients:not(.sg-table) tbody tr {
  border-bottom: 1px solid #ccc;
}
/* Clients page: session-planner-style table (treatment.css .sg-table) */
table.clients.sg-table {
  border: none;
}
table.clients.sg-table th,
table.clients.sg-table td {
  border-right: none;
}
table.clients.sg-table tbody tr {
  border-bottom: none;
}
table.clients.sg-table thead th {
  background: #f6f8fb;
  font-weight: 600;
  color: #3a4a5e;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
table.clients.sg-table td a.sg-name-link {
  color: #245ca5;
  text-decoration: none;
}
table.clients.sg-table td a.sg-name-link:hover {
  color: #0c60b3;
  text-decoration: underline;
}
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: 2px;
  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: 2px;
  padding: 6px 20px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  margin-right: 5px;
  font-size: 11px;
  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: 1px;
  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; }

/* ── Reusable Treatment Type (TT) pills ───────────────────────────── */
:root {
  --tt-nf-bg: #dbeafe;
  --tt-nf-fg: #1e40af;
  --tt-nf-bd: #bfdbfe;
  --tt-nf-surface-bg: #cffafe;
  --tt-nf-surface-fg: #0e7490;
  --tt-nf-surface-bd: #a5f3fc;
  --tt-tms-bg: #fce7f3;
  --tt-tms-fg: #9d174d;
  --tt-tms-bd: #f9a8d4;
  --tt-tdcs-bg: #fce7f3;
  --tt-tdcs-fg: #9d174d;
  --tt-tdcs-bd: #f9a8d4;
  --tt-pbm-bg: #fef3c7;
  --tt-pbm-fg: #92400e;
  --tt-pbm-bd: #fcd34d;
  --tt-bf-bg: #d1fae5;
  --tt-bf-fg: #065f46;
  --tt-bf-bd: #86efac;
  --tt-bfs-bg: #e0e7ff;
  --tt-bfs-fg: #3730a3;
  --tt-bfs-bd: #c7d2fe;
  --tt-sleep-bg: #f3e8ff;
  --tt-sleep-fg: #6b21a8;
  --tt-sleep-bd: #d8b4fe;
  --tt-sdnt-bg: #f3e8ff;
  --tt-sdnt-fg: #6b21a8;
  --tt-sdnt-bd: #d8b4fe;
  --tt-silf-bg: #ffe4e6;
  --tt-silf-fg: #9f1239;
  --tt-silf-bd: #fecdd3;
}

.tt-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tt-pill--compact {
  font-size: 9px;
}
.tt-pill--nf { background: var(--tt-nf-bg); color: var(--tt-nf-fg); border-color: var(--tt-nf-bd); }
.tt-pill--nf_surface { background: var(--tt-nf-surface-bg); color: var(--tt-nf-surface-fg); border-color: var(--tt-nf-surface-bd); }
.tt-pill--tms { background: var(--tt-tms-bg); color: var(--tt-tms-fg); border-color: var(--tt-tms-bd); }
.tt-pill--tdcs { background: var(--tt-tdcs-bg); color: var(--tt-tdcs-fg); border-color: var(--tt-tdcs-bd); }
.tt-pill--pbm { background: var(--tt-pbm-bg); color: var(--tt-pbm-fg); border-color: var(--tt-pbm-bd); }
.tt-pill--bf { background: var(--tt-bf-bg); color: var(--tt-bf-fg); border-color: var(--tt-bf-bd); }
.tt-pill--bfs { background: var(--tt-bfs-bg); color: var(--tt-bfs-fg); border-color: var(--tt-bfs-bd); }
.tt-pill--sleep { background: var(--tt-sleep-bg); color: var(--tt-sleep-fg); border-color: var(--tt-sleep-bd); }
.tt-pill--sdnt { background: var(--tt-sdnt-bg); color: var(--tt-sdnt-fg); border-color: var(--tt-sdnt-bd); }
.tt-pill--silf { background: var(--tt-silf-bg); color: var(--tt-silf-fg); border-color: var(--tt-silf-bd); }
.tt-pill--off {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}

/* Planner-standard TT button/pill classes (reusable across pages) */
.tt-btn {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 0px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
  cursor: default;
  transition: opacity 0.15s, box-shadow 0.15s;
}
a.tt-btn,
a.ap-pill {
  cursor: pointer;
}
.tt-btn:hover {
  opacity: 0.85;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.ap-nf { background: var(--tt-nf-bg); color: var(--tt-nf-fg); }
.ap-nf_surface { background: var(--tt-nf-surface-bg); color: var(--tt-nf-surface-fg); }
.ap-tms { background: var(--tt-tms-bg); color: var(--tt-tms-fg); }
.ap-tdcs { background: var(--tt-tdcs-bg); color: var(--tt-tdcs-fg); }
.ap-pbm { background: var(--tt-pbm-bg); color: var(--tt-pbm-fg); }
.ap-bf { background: var(--tt-bf-bg); color: var(--tt-bf-fg); }
.ap-bfs { background: var(--tt-bfs-bg); color: var(--tt-bfs-fg); }
.ap-sdnt { background: var(--tt-sdnt-bg); color: var(--tt-sdnt-fg); }
.ap-silf { background: var(--tt-silf-bg); color: var(--tt-silf-fg); }
.tt-off { background: #f1f5f9; color: #94a3b8; }

/* Clients actions icons (Edit/Delete) pill style */
table.clients .actions .edit-icon,
table.clients .actions .delete-icon,
table.clients .actions .archive-icon,
table.clients .actions .activate-icon,
table.clients .actions .casual-icon,
table.clients .actions .pause-icon,
table.clients .actions .edit-status-icon {
  background-color: #f9f9f9;
  color: #245ca5;
  font-size: 16px;
  padding: 8px 8px;
  border-radius: 3px;
  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,
table.clients .actions .archive-icon:hover,
table.clients .actions .activate-icon:hover,
table.clients .actions .casual-icon:hover,
table.clients .actions .pause-icon:hover,
table.clients .actions .edit-status-icon:hover {
  background: #f0f0f070;
  color: #245ca5;
}
/* Links inside Clients table (CHR ID only — Active Programs use TT family colors) */
table.clients td a:not(.ap-pill) { color: #2052b3; text-decoration: none; }
table.clients td a:not(.ap-pill):hover,
table.clients td a:not(.ap-pill):active,
table.clients td a:not(.ap-pill):focus { color: #133068; text-decoration: none; }

/* Active Programs — standard TT family colors (match Session Counter / planner chips) */
table.clients .active-programs-pills a.ap-pill {
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  text-decoration: none;
}
table.clients .active-programs-pills a.ap-pill.ap-nf { background: var(--tt-nf-bg); color: var(--tt-nf-fg); }
table.clients .active-programs-pills a.ap-pill.ap-nf_surface { background: var(--tt-nf-surface-bg); color: var(--tt-nf-surface-fg); }
table.clients .active-programs-pills a.ap-pill.ap-tms { background: var(--tt-tms-bg); color: var(--tt-tms-fg); }
table.clients .active-programs-pills a.ap-pill.ap-tdcs { background: var(--tt-tdcs-bg); color: var(--tt-tdcs-fg); }
table.clients .active-programs-pills a.ap-pill.ap-pbm { background: var(--tt-pbm-bg); color: var(--tt-pbm-fg); }
table.clients .active-programs-pills a.ap-pill.ap-bf { background: var(--tt-bf-bg); color: var(--tt-bf-fg); }
table.clients .active-programs-pills a.ap-pill.ap-sdnt { background: var(--tt-sdnt-bg); color: var(--tt-sdnt-fg); }
table.clients .active-programs-pills a.ap-pill.ap-silf { background: var(--tt-silf-bg); color: var(--tt-silf-fg); }
table.clients .active-programs-pills a.ap-pill:hover,
table.clients .active-programs-pills a.ap-pill:active,
table.clients .active-programs-pills a.ap-pill:focus {
  opacity: 0.85;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
table.clients .active-programs-pills a.ap-pill.ap-nf:hover,
table.clients .active-programs-pills a.ap-pill.ap-nf:active,
table.clients .active-programs-pills a.ap-pill.ap-nf:focus { color: var(--tt-nf-fg); }
table.clients .active-programs-pills a.ap-pill.ap-nf_surface:hover,
table.clients .active-programs-pills a.ap-pill.ap-nf_surface:active,
table.clients .active-programs-pills a.ap-pill.ap-nf_surface:focus { color: var(--tt-nf-surface-fg); }
table.clients .active-programs-pills a.ap-pill.ap-tms:hover,
table.clients .active-programs-pills a.ap-pill.ap-tms:active,
table.clients .active-programs-pills a.ap-pill.ap-tms:focus { color: var(--tt-tms-fg); }
table.clients .active-programs-pills a.ap-pill.ap-tdcs:hover,
table.clients .active-programs-pills a.ap-pill.ap-tdcs:active,
table.clients .active-programs-pills a.ap-pill.ap-tdcs:focus { color: var(--tt-tdcs-fg); }
table.clients .active-programs-pills a.ap-pill.ap-pbm:hover,
table.clients .active-programs-pills a.ap-pill.ap-pbm:active,
table.clients .active-programs-pills a.ap-pill.ap-pbm:focus { color: var(--tt-pbm-fg); }
table.clients .active-programs-pills a.ap-pill.ap-bf:hover,
table.clients .active-programs-pills a.ap-pill.ap-bf:active,
table.clients .active-programs-pills a.ap-pill.ap-bf:focus { color: var(--tt-bf-fg); }
table.clients .active-programs-pills a.ap-pill.ap-sdnt:hover,
table.clients .active-programs-pills a.ap-pill.ap-sdnt:active,
table.clients .active-programs-pills a.ap-pill.ap-sdnt:focus { color: var(--tt-sdnt-fg); }
table.clients .active-programs-pills a.ap-pill.ap-silf:hover,
table.clients .active-programs-pills a.ap-pill.ap-silf:active,
table.clients .active-programs-pills a.ap-pill.ap-silf:focus { color: var(--tt-silf-fg); }
/* 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: 11px;
  padding: 6px 17px;
  border-radius: 2px;
  text-decoration: none;
  border: solid;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  border-width: 1px;
  border-color: #e3e3e3;
  height: 29px;
  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; }
/* Hidden: default-neuro-label badge (replaced by nf-planner-type-label on client detail)
.default-neuro-label { margin-left: 8px;
  color: #ffffff;
  background: #a5a5a5;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 2px;
  font-size: 10px; }

.default-neuro-label.neuro-active { background: #41a704; }
*/

.nf-planner-type-label {
  margin-left: 8px;
  color: #ffffff;
  background: #41a704;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 2px;
  font-size: 10px;
}

/* 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;
}
.login-error--warn {
  color: #b45309;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
}
.login-error--locked {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
}

/* Password upgrade page (forced legacy password reset) */
body.password-upgrade-page {
  background-color: #f0f2f9;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  height: auto;
  margin: 0;
  grid-template-columns: unset;
  grid-template-rows: unset;
}
.password-upgrade-shell {
  width: min(560px, calc(100vw - 32px));
}
.password-upgrade-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.password-upgrade-header {
  background: #0c60b3;
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.password-upgrade-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}
.password-upgrade-header-text {
  flex: 1;
  min-width: 0;
}
.password-upgrade-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
.password-upgrade-account {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.92;
}
.password-upgrade-account strong {
  font-weight: 600;
  word-break: break-word;
  color: #f9ff00;
  font-size: 16px;
}
.password-upgrade-body {
  padding: 24px;
}
.password-upgrade-intro {
  margin: 0 0 18px;
  color: #374151;
  line-height: 1.5;
  font-size: 14px;
}
.password-upgrade-form .profile-password-field {
  margin-bottom: 14px;
}
.password-upgrade-form .password-upgrade-confirm-field {
  margin-bottom: 0;
}
.password-upgrade-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.password-upgrade-logout {
  font-size: 14px;
  color: #0c60b3;
  text-decoration: none;
}
.password-upgrade-logout:hover {
  text-decoration: underline;
}
.password-upgrade-strength {
  margin-top: 0;
  min-height: 0;
}
.password-upgrade-form .profile-password-strength-panel {
  flex: none;
  margin-top: 0;
}
.password-upgrade-form .password-upgrade-show-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  margin-bottom: 0;
  padding-top: 0;
}
.password-upgrade-form .password-upgrade-show-row .simpleBtn {
  margin: 0;
}
.password-upgrade-form .password-match:empty {
  min-height: 0;
  margin-top: 0;
}
.password-upgrade-form .password-rules-checklist {
  margin-top: 0;
  margin-bottom: 6px;
}
.password-upgrade-form .profile-error {
  color: #b00020;
  font-size: 13px;
  margin-top: 6px;
}
.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 status dropdown (detail page) — dot + label per status */
.client-status-dd {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
}
.client-status-dd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #f8f9fa;
  min-height: 30px;
  box-sizing: border-box;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.client-status-dd-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.client-status-dd.is-open .client-status-dd-trigger {
  border-color: #adb5bd;
}
.client-status-dd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-active { background: #28a745; }
.status-dot-paused { background: #dc3545; }
.status-dot-archived { background: #868e96; }
.status-dot-casual { background: #7c3aed; }
.client-status-dd-label,
.client-status-dd-option-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.status-text-active { color: #28a745; }
.status-text-paused { color: #dc3545; }
.status-text-archived { color: #868e96; }
.status-text-casual { color: #7c3aed; }
.client-status-dd-chevron {
  width: 10px;
  height: 10px;
  margin-left: 2px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23495057' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform .15s ease;
}
.client-status-dd.is-open .client-status-dd-chevron {
  transform: rotate(180deg);
}
.client-status-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 120;
  min-width: 100%;
  padding: 4px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.client-status-dd-option {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.client-status-dd-option:hover,
.client-status-dd-option.is-selected {
  background: #f1f3f5;
}
.client-status-dd-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 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 note badge (pause reason) */
.client-status-note-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  background: #f8f9fa;
  font-size: 12px;
  font-weight: 700;
  color: #de454b;
  white-space: nowrap;
  cursor: help;
}
.client-status-note-badge.is-disabled {
  opacity: 0.55;
  cursor: default;
  color: #adb5bd;
  background: #f1f3f5;
  border-color: #e9ecef;
}
.client-status-note-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #efefef;
  color: #4a4a4a;
  border: 1px solid #d5d5d5;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
  width: max-content;
  max-width: 320px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 200;
  pointer-events: none;
}
.client-status-note-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #d5d5d5;
}
.client-status-note-badge:hover .client-status-note-tooltip {
  display: block;
}
.client-status-note-badge.is-disabled:hover .client-status-note-tooltip {
  display: none;
}

/* 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);
  min-width: 340px;
  max-width: 440px;
  overflow: hidden;
  transform: scale(.92);
  transition: transform .2s ease;
}
.client-status-modal-overlay.open .client-status-modal { transform: scale(1); }
.client-status-modal-header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background: #ab0000;
  border-bottom: none;
}
.client-status-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.client-status-modal-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.client-status-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: 20px;
  line-height: 1;
}
.client-status-modal-icon.icon-active {
  background: #d4edda;
  color: #28a745;
}
.client-status-modal-icon.icon-paused {
  background: #f8d7da;
  color: #dc3545;
}
.client-status-modal-icon.icon-deactive {
  background: #fff3cd;
  color: #856404;
}
.client-status-modal-icon.icon-casual {
  background: #ede9fe;
  color: #7c3aed;
}
.client-status-modal-msg {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  margin: 0;
  width: 100%;
}
.client-status-modal-msg strong {
  color: #0c60b3;
}
.client-status-modal-pause-reason {
  width: 100%;
  margin-top: 4px;
  text-align: left;
}
.client-status-modal-pause-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.client-status-modal-pause-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
}
.client-status-modal-pause-select:focus {
  outline: none;
  border-color: #0c60b3;
  box-shadow: 0 0 0 2px rgba(12, 96, 179, 0.14);
}
.client-status-modal-pause-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: #dc3545;
}
.client-status-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 8px 28px 22px;
}
.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 */
/* Clients table column shares: checkbox | CHR | Active Programs | Session Counter | Last Modified | Actions */
table.clients { table-layout: fixed; }
table.clients th:nth-child(1),
table.clients td:nth-child(1) {
  width: 2%;
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
}
table.clients th:nth-child(1) input[type="checkbox"],
table.clients td:nth-child(1) input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0 auto;
  display: block;
}
table.clients th:nth-child(2),
table.clients td:nth-child(2) { width: 14%; }
table.clients th.tcol-ap,
table.clients td.tcol-ap { width: 14%; }
table.clients th.tcol-sc,
table.clients td.tcol-sc { width: 34%; }
table.clients th.tcol-lm,
table.clients td.tcol-lm { width: 18%; }
table.clients th:last-child,
table.clients td.actions { width: 8%; }

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;
  border-spacing: 0 8px;
  background: #ffffff;
  border: solid 1px #e3e3e3;
  border-radius: 5px;
}

/* 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: 1px;
  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: 1px;
  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; }

/* Clinical program deactivation reason modal (client detail) */
.clinical-deact-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.clinical-deact-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.clinical-deact-modal {
  background: #fff;
  border-radius: 12px;
  padding: 22px 24px;
  width: 460px;
  max-width: 92vw;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}
.clinical-deact-modal-overlay.open .clinical-deact-modal {
  transform: scale(1);
}
.clinical-deact-modal-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: #222;
}
.clinical-deact-modal-subtitle {
  margin: 0 0 16px;
  font-size: 14px;
  color: #555;
}
.clinical-deact-modal-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.clinical-deact-modal-select,
.clinical-deact-modal-other {
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 9px 10px;
  font-family: inherit;
}
.clinical-deact-modal-other {
  margin-top: 10px;
  min-height: 72px;
  resize: vertical;
  display: none;
}
.clinical-deact-modal-other.visible {
  display: block;
}
.clinical-deact-modal-error {
  margin-top: 8px;
  font-size: 13px;
  color: #c0392b;
  min-height: 18px;
}
.clinical-deact-modal-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.clinical-deact-modal-btn {
  min-width: 96px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.clinical-deact-modal-btn.btn-cancel {
  background: #eef1f5;
  color: #444;
}
.clinical-deact-modal-btn.btn-cancel:hover {
  background: #e2e6eb;
}
.clinical-deact-modal-btn.btn-save {
  background: #1a8f4c;
  color: #fff;
}
.clinical-deact-modal-btn.btn-save:hover {
  background: #157a41;
}
.clinical-deact-modal-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.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: Change password — two columns (fields | rules + submit) */
.profile-password-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
}
.profile-password-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px 20px 0;
  border-right: 1px solid #e5e7eb;
  min-width: 0;
}
.profile-password-rules-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 20px 24px;
  min-width: 0;
}
.profile-password-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.profile-password-field .profile-error {
  margin-top: 4px;
}
.profile-password-section input[type="text"],
.profile-password-section input[type="email"],
.profile-password-section input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #111827;
  font-size: 14px;
  line-height: 1.4;
  min-width: 0;
}
.profile-password-section input[type="text"]:focus,
.profile-password-section input[type="email"]:focus,
.profile-password-section input[type="password"]:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.profile-password-section input.input-error {
  border-color: #dc2626;
  box-shadow: none;
}
.profile-password-section input.input-success {
  border-color: #16a34a;
  box-shadow: none;
}
.profile-password-show-row {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 4px;
}
.profile-password-show-row .simpleBtn {
  margin: 0;
}
.profile-password-strength-panel {
  margin-top: 0;
  flex: 1;
}
.profile-password-strength-panel .password-rules-checklist {
  gap: 8px;
}
.profile-password-strength-panel .password-rule {
  font-size: 13px;
}
.profile-password-submit-btn {
  align-self: flex-start;
  margin-top: auto;
}
.profile-change-password-form .profile-success {
  margin-bottom: 12px;
}
@media (max-width: 768px) {
  .profile-password-columns {
    grid-template-columns: 1fr;
  }
  .profile-password-fields {
    padding: 20px 0;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
  .profile-password-rules-col {
    padding: 20px 0 0;
  }
}
.profile-password-grid {
  grid-template-columns: 1fr 1fr auto;
  max-width: none;
  gap: 12px;
  align-items: end;
}
.profile-password-current {
  grid-column: 1 / -1;
}
.profile-password-btn-cell {
  display: flex;
  align-items: center;
  padding-bottom: 2px;
}
.profile-password-btn-cell .simpleBtn {
  margin: 0;
}

.profile-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
  margin-top: 24px;
  box-sizing: border-box;
}
.profile-section-title {
  margin: 0 0 16px 0;
  font-size: 18px;
}
.profile-password-header__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  font-size: 18px;
}
.password-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.password-field-label label {
  margin: 0;
}
.password-requirements-info {
  vertical-align: middle;
}
.help-tooltip--password-reqs {
  min-width: 240px;
  max-width: 300px;
  text-align: left;
  white-space: normal;
}
.help-tooltip--password-reqs__title {
  margin: 0 0 8px 0;
  font-weight: 700;
  font-size: 13px;
}
.help-tooltip--password-reqs ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 12px;
  line-height: 1.45;
}
.help-tooltip--password-reqs li {
  margin-bottom: 4px;
}
.help-tooltip--password-reqs li:last-child {
  margin-bottom: 0;
}
.profile-success {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #e8f5e9;
  border-radius: 8px;
  color: #1b5e20;
}
.profile-section-divider {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid #e5e7eb;
}
.profile-section-btn {
  margin-top: 16px;
}
.profile-details-grid {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.profile-details-grid .profile-details-email {
  grid-column: 1 / -1;
}
.profile-readonly-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.profile-readonly-value {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #111827;
  min-height: 20px;
  box-sizing: border-box;
}
.profile-password-section,
.profile-avatar-section {
  width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  box-sizing: border-box;
}
.profile-avatar-section {
  margin-top: 0px;
}

.profile-avatar-preview-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid #d8e7f8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: #f7fbff;
}
.profile-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}
.profile-avatar-picker {
  position: relative;
  max-width: 100%;
}
.profile-avatar-trigger {
  width: 100%;
  border: 1px solid #d7dce3;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.profile-avatar-trigger:hover,
.profile-avatar-trigger[aria-expanded="true"] {
  border-color: #0c60b3;
  box-shadow: 0 0 0 2px rgba(12, 96, 179, 0.14);
}
.profile-avatar-trigger-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #f3f6fb;
  border: 1px solid #dce4ef;
}
.profile-avatar-trigger-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.profile-avatar-trigger-title {
  font-size: 13px;
  color: #5f6b7a;
}
.profile-avatar-trigger-label {
  font-size: 14px;
  color: #1f2937;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-avatar-trigger-icon {
  margin-left: auto;
  color: #6b7280;
}
.profile-avatar-dropdown {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin-top: 8px;
  border: 1px solid #d7dce3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.18);
  padding: 12px;
}
.profile-avatar-dropdown-left {
  left: auto;
  right: calc(100% + 12px);
  top: 0;
  margin-top: 30px;
  width: min(720px, calc(176% + 16px));
  max-width: 61vw;
  animation: profileAvatarSlideLeft 0.16s ease-out;
}
@keyframes profileAvatarSlideLeft {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.profile-avatar-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.profile-avatar-search {
  width: 100%;
  height: 36px;
  border: 1px solid #d7dce3;
  border-radius: 9px;
  padding: 8px 10px;
}
.profile-avatar-search:focus {
  outline: none;
  border-color: #0c60b3;
  box-shadow: 0 0 0 2px rgba(12, 96, 179, 0.15);
}
.profile-avatar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.profile-avatar-filter {
  border: 1px solid #d7dce3;
  background: #f8fafc;
  color: #3f4b5b;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.profile-avatar-filter.is-active {
  border-color: #0c60b3;
  background: #e8f2fd;
  color: #0c60b3;
}
.profile-avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.profile-avatar-option {
  border: 1px solid #d9dde3;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  padding: 1px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.profile-avatar-option:hover {
  transform: translateY(-1px);
  border-color: #0c60b3;
}
.profile-avatar-option.is-selected {
  border-color: #0c60b3;
  box-shadow: 0 0 0 2px rgba(12, 96, 179, 0.2);
}
.profile-avatar-thumb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
@media (max-width: 980px) {
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .profile-password-section,
  .profile-avatar-section {
    max-width: 100%;
  }
  .profile-avatar-dropdown-left {
    right: 0;
    left: 0;
    top: calc(100% + 8px);
    width: auto;
    max-width: none;
  }
  .profile-avatar-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ── 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; }
.password-rules-checklist {
  margin: 0 0 8px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.password-rule {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.35;
}
.password-rule i {
  width: 14px;
  flex-shrink: 0;
  text-align: center;
  font-size: 12px;
}
.password-rule--pending {
  color: #94a3b8;
}
.password-rule--ok {
  color: #16a34a;
}
.password-rule--fail {
  color: #dc2626;
}
.strength-bar { height: 4px; background: #e5e7eb; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.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 edit page — profile-inspired account + password layout */
.tech-edit-details-section .form-grid {
  max-width: none;
}
.tech-edit-details-section .form-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.tech-edit-details-section .form-grid select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #111827;
  font-size: 14px;
  line-height: 1.4;
  min-width: 0;
}
.tech-edit-details-section .form-grid select:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.tech-edit-form-error {
  margin-bottom: 12px;
  white-space: normal;
}
.tech-edit-password-rules-col {
  justify-content: flex-start;
}

/* ── Help icon with tooltip ── */
.help-icon-wrapper {
  display: inline-flex;
  align-items: center;
  position: relative;
}
.help-icon,
.prot-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;
  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 {
  color: #0c60b3;
}
.help-icon:hover {
  background: #0c60b3;
  color: #fff;
}
/* Protocol row help (e.g. TMS planner summary): same shell as .help-icon, green accent */
.prot-help-icon {
  color: #34a853;
}
.prot-help-icon:hover {
  background: #34a853;
  color: #fff;
}

/* ── ACTIVE PROTOCOLS INDICATOR (client detail / Protocols): P + tooltips + .prot-active-pill ── */
.active-protocols-indicator {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  vertical-align: middle;
}

/* Client detail protocols table: planner protocol pills (green default, orange when >2 protocols) */
.prot-program-protocol-extras {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-left: 4px;
  max-width: 100%;
  vertical-align: middle;
}
.prot-active-protocols {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.prot-active-protocols--many {
  cursor: help;
}
.prot-active-pill {
  font-size: 10px;
  font-weight: 600;
  color: #34a853;
  background: #34a85330;
  padding: 2px 7px;
  border-radius: 2px;
  line-height: 1.35;
  white-space: nowrap;
  letter-spacing: 0.01em;
  border: solid 1px #34a8534a;
}
.prot-active-protocols--many .prot-active-pill {
  color: #d57b08;
  background: #fbecd9;
  border: solid 1px #c9781187;
}

.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,
.help-icon-wrapper:focus-within .help-tooltip {
  display: block;
}

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

/* ── 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;
}

/* ── App-wide alert / confirm (smc_app_dialog.js) — solid header, centered ── */
.smc-app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 400000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}
.smc-app-dialog-overlay.open {
  display: flex;
}
.smc-app-dialog-overlay--no-blur {
  backdrop-filter: none;
}
.smc-app-dialog {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  animation: smc-app-dialog-in 0.2s ease-out;
}
@keyframes smc-app-dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.smc-app-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.smc-app-dialog-header--info {
  background: #1565c0;
}
.smc-app-dialog-header--success {
  background: #1d9e75;
}
.smc-app-dialog-header--warn {
  background: #e67e22;
}
.smc-app-dialog-header--danger {
  background: #c62828;
}
.smc-app-dialog-title {
  flex: 1;
  min-width: 0;
}
.smc-app-dialog-x {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.smc-app-dialog-x:hover {
  background: rgba(255, 255, 255, 0.28);
}
.smc-app-dialog-body {
  padding: 20px 22px;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}
.smc-app-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 18px;
  border-top: 1px solid #e8ecf1;
  background: #fafbfc;
}
.smc-app-dialog-btn {
  min-width: 88px;
  padding: 8px 18px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.smc-app-dialog-btn-secondary {
  background: #fff;
  color: #475569;
  border: 1.5px solid #cbd5e1;
}
.smc-app-dialog-btn-secondary:hover {
  background: #f1f5f9;
}
.smc-app-dialog-btn-primary {
  background: #1d9e75;
  color: #fff;
}
.smc-app-dialog-btn-primary:hover {
  background: #178066;
}
.smc-app-dialog-header--danger ~ .smc-app-dialog-footer .smc-app-dialog-btn-primary {
  background: #c62828;
}
.smc-app-dialog-header--danger ~ .smc-app-dialog-footer .smc-app-dialog-btn-primary:hover {
  background: #a52222;
}
.smc-app-dialog-header--info ~ .smc-app-dialog-footer .smc-app-dialog-btn-primary {
  background: #1565c0;
}
.smc-app-dialog-header--info ~ .smc-app-dialog-footer .smc-app-dialog-btn-primary:hover {
  background: #0d47a1;
}