/* =============================================
   PRACTICE FUSION MOCK EHR — CUSTOM STYLES
   ============================================= */

/* =============================================
   SOAP NOTE SECTIONS
   ============================================= */

/* Container heading above all SOAP sections */
.soap-note-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}
.soap-note-heading h2 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}
.soap-note-heading a {
  font-size: 12px;
  color: #2563eb;
  text-decoration: none;
}
.soap-note-heading a:hover { text-decoration: underline; }

/* Individual SOAP section card */
.soap-section {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 12px;
  background: white;
}

/* SOAP section top row: bold title + Minimize */
.soap-section-header {
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.soap-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

/* SOAP sub-header: "Subjective note  View templates  Import past encounter" */
.soap-sub-header {
  padding: 4px 14px 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.soap-sub-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.soap-sub-link {
  font-size: 12px;
  color: #2563eb;
  text-decoration: none;
  cursor: pointer;
}
.soap-sub-link:hover { text-decoration: underline; }

/* Rich-text-style toolbar */
.soap-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 4px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.soap-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border: none;
  background: none;
  border-radius: 3px;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.soap-toolbar-btn:hover { background: #e5e7eb; }
.soap-toolbar-btn.bold { font-weight: 700; }
.soap-toolbar-btn.italic { font-style: italic; }
.soap-toolbar-sep {
  width: 1px;
  height: 16px;
  background: #d1d5db;
  margin: 0 4px;
  flex-shrink: 0;
}
.soap-toolbar-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  background: white;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
}
.soap-toolbar-dropdown:hover { background: #f3f4f6; }
.soap-patient-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  background: white;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  margin-left: 4px;
}
.soap-patient-info-btn:hover { background: #f3f4f6; }

/* Editable content area */
.soap-editor {
  min-height: 90px;
  padding: 10px 14px;
  font-size: 13px;
  color: #374151;
  outline: none;
  line-height: 1.6;
  font-family: inherit;
  white-space: pre-wrap;
}
.soap-editor:focus { background: #fffffe; }
.soap-editor:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

/* Footer links below some SOAP sections */
.soap-footer-links {
  padding: 6px 14px 8px;
  display: flex;
  gap: 14px;
  border-top: 1px solid #f1f5f9;
}
.soap-footer-link {
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  text-decoration: none;
}
.soap-footer-link:hover { text-decoration: underline; }

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  color: #374151;
}

/* ── Scrollbars ───────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Utility ──────────────────────────────── */
.hidden { display: none !important; }

/* ── Login shake animation ────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}
.shake { animation: shake 0.4s ease-in-out; }

/* =============================================
   TOP NAV (#top-nav)
   ============================================= */
#top-nav {
  background-color: #1e3a5f;
  min-height: 44px;
  flex-shrink: 0;
}

.patient-nav-tab {
  background: rgba(255,255,255,0.18);
  border-radius: 4px 4px 0 0;
  padding: 5px 12px 5px 12px;
  font-size: 12px;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 10px;
  white-space: nowrap;
}
.patient-nav-tab .close-x {
  opacity: 0.65;
  font-size: 14px;
  line-height: 1;
}
.patient-nav-tab .close-x:hover { opacity: 1; }

.nav-help-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 3px;
  color: white;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.nav-icon-btn {
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  background: none;
  border: none;
}
.nav-icon-btn:hover {
  color: white;
  background: rgba(255,255,255,0.12);
}

/* =============================================
   PATIENT INFO BAR
   ============================================= */
#patient-bar {
  background-color: #2a5298;
  flex-shrink: 0;
}

.patient-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3d6db5;
  border: 2px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

/* =============================================
   SUB-NAV TABS
   ============================================= */
#sub-nav {
  background: #e5ebf4;
  border-bottom: 1px solid #c0cede;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  overflow-x: auto;
  padding: 0 4px;
}

.tab-btn {
  padding: 6px 13px;
  font-size: 12px;
  color: #4b5563;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
  outline: none;
}
.tab-btn:hover { color: #2a5298; }
.tab-btn.active {
  color: #2a5298;
  border-bottom-color: #2a5298;
  font-weight: 500;
  background: white;
}
.tab-btn.date-tab {
  background: white;
  border-left: 1px solid #c0cede;
  border-right: 1px solid #c0cede;
  border-top: 1px solid #c0cede;
  border-bottom: 2px solid white;
  color: #2a5298;
  font-weight: 500;
  margin-left: 4px;
}

/* =============================================
   TOOLBAR
   ============================================= */
#toolbar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  min-height: 38px;
}

.display-settings-link {
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  white-space: nowrap;
}
.display-settings-link:hover { text-decoration: underline; }

.toolbar-btn {
  padding: 3px 10px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  color: #374151;
  background: white;
  cursor: pointer;
  white-space: nowrap;
}
.toolbar-btn:hover { background: #f9fafb; }
.toolbar-btn.sign {
  background: white;
  border-color: #9ca3af;
  font-weight: 500;
}

#goto-select {
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  padding: 2px 6px;
  color: #374151;
  background: white;
  cursor: pointer;
  outline: none;
}

/* =============================================
   ICON RAIL
   ============================================= */
#icon-rail {
  background-color: #1a2e4a;
  width: 56px;
  flex-shrink: 0;
}

.rail-btn {
  width: 100%;
  padding: 9px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #7f9ab5;
  font-size: 9px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  position: relative;
  background: none;
  border: none;
  outline: none;
}
.rail-btn svg { width: 18px; height: 18px; }
.rail-btn:hover { color: #d1e0f0; background: rgba(255,255,255,0.07); }
.rail-btn.active { color: #60a5fa; background: rgba(96,165,250,0.12); }

.task-badge {
  position: absolute;
  top: 5px;
  right: 4px;
  background: #ef4444;
  color: white;
  font-size: 8px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* =============================================
   LEFT PANEL
   ============================================= */
#left-panel {
  background: #f4f7fb;
  border-right: 1px solid #d1dbe8;
  width: 272px;
  flex-shrink: 0;
}

#left-panel-tabs {
  background: white;
  border-bottom: 1px solid #dde5ef;
  display: flex;
  overflow-x: auto;
  flex-shrink: 0;
}
#left-panel-tabs .tab-btn {
  padding: 7px 10px;
  font-size: 11.5px;
  flex-shrink: 0;
}

/* Panel sections */
.panel-section { border-bottom: 1px solid #dde5ef; }

.section-header {
  background: #ebf0f8;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #3d4f66;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.section-header.collapsible { cursor: pointer; }
.section-header.collapsible::after {
  content: '▾';
  font-size: 10px;
  color: #9ca3af;
  margin-left: 4px;
}
.section-header.collapsible.collapsed::after { content: '▸'; }

.section-add-btn {
  color: #2a5298;
  font-size: 18px;
  font-weight: 300;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  background: none;
  border: none;
}
.section-add-btn:hover { color: #1e3a5f; }

.section-body { padding: 4px 0; }
.section-body.collapsed { display: none; }

/* Diagnosis items */
.dx-group-label {
  padding: 6px 12px 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dx-item {
  padding: 5px 12px 5px 16px;
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dx-item:hover { background: #e8eef8; }
.dx-item .dx-code { color: #1d4ed8; font-size: 11.5px; }
.dx-item .dx-date { color: #9ca3af; font-size: 10.5px; }

/* SMART link */
.smart-link {
  color: #2563eb;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.smart-link:hover { color: #1d4ed8; }

/* Social items */
.social-item {
  padding: 5px 12px;
  font-size: 12px;
  color: #374151;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.social-add-btn {
  color: #2a5298;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
}

/* =============================================
   RIGHT PANEL
   ============================================= */
#right-panel { background: white; }

/* Encounter details form */
.encounter-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.field-label .today-link {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  color: #2563eb;
  font-size: 11px;
  text-decoration: none;
  margin-left: 6px;
}
.field-label .today-link:hover { text-decoration: underline; }

.req-star { color: #ef4444; }

.field-input {
  border: 1px solid #d1d5db;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 12px;
  color: #374151;
  background: white;
  width: 100%;
  font-family: inherit;
  outline: none;
}
.field-input:focus { outline: 2px solid #2a5298; outline-offset: -1px; }
.field-static { font-size: 12px; color: #374151; display: block; padding-top: 4px; }

/* Info circle icon */
.info-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d1d5db;
  color: #4b5563;
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  margin-left: 3px;
  font-style: normal;
  vertical-align: middle;
}

/* Status badge */
.status-unsigned {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

/* Encounter sections (bordered cards) */
.encounter-section {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 12px;
  background: white;
}
.encounter-section-header {
  padding: 7px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 4px 4px 0 0;
}
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: #2a5298;
}
.encounter-section-body { padding: 10px 12px; }

/* Section action buttons */
.section-action-btn {
  font-size: 11px;
  color: #2563eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  outline: none;
  padding: 0;
}
.section-action-btn:hover { text-decoration: underline; }
.section-minimize-btn {
  font-size: 11px;
  color: #2563eb;
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  padding: 0;
}
.section-minimize-btn:hover { text-decoration: underline; }

/* Textarea */
.pf-textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  padding: 8px;
  font-size: 12px;
  color: #374151;
  resize: vertical;
  font-family: inherit;
  outline: none;
  display: block;
}
.pf-textarea:focus { outline: 2px solid #2a5298; outline-offset: -1px; border-color: transparent; }
.pf-textarea::placeholder { color: #9ca3af; }
.pf-textarea:disabled { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }

.char-counter { font-size: 10px; color: #9ca3af; text-align: right; margin-top: 3px; }

/* Vitals table */
#vitals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#vitals-table th {
  background: #f1f5f9;
  padding: 5px 10px;
  font-weight: 600;
  font-size: 11px;
  color: #4b5563;
  border: 1px solid #dde5ef;
  white-space: nowrap;
}
#vitals-table th.center { text-align: center; }
#vitals-table td {
  padding: 4px 10px;
  border: 1px solid #dde5ef;
  color: #374151;
  vertical-align: middle;
}
#vitals-table td.center { text-align: center; }
#vitals-table tr:nth-child(even) { background: #f8fafc; }
#vitals-table tr:hover { background: #f0f6ff; }

.vitals-input {
  width: 90px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 12px;
  color: #374151;
  padding: 2px 4px;
  border-radius: 2px;
  font-family: inherit;
  outline: none;
}
.vitals-input:focus { background: #fffbeb; border: 1px solid #d1d5db; }
.vitals-input[readonly] { cursor: default; color: #6b7280; }
.vitals-input.editable { background: #fffff0; border: 1px solid #d1d5db; }

/* Actions dropdown */
.actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 180px;
  z-index: 100;
}
.actions-menu-item {
  padding: 8px 14px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
}
.actions-menu-item:hover { background: #f3f4f6; }
.actions-menu-item:first-child { border-radius: 4px 4px 0 0; }
.actions-menu-item:last-child { border-radius: 0 0 4px 4px; }

/* Collapse arrow between panels */
.collapse-panel-btn {
  background: #e8eef8;
  border: none;
  border-right: 1px solid #d1dbe8;
  color: #9ca3af;
  font-size: 10px;
  cursor: pointer;
  padding: 0 4px;
  writing-mode: vertical-rl;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
}
.collapse-panel-btn:hover { color: #4b5563; background: #dde5ef; }

/* Last refreshed block */
.last-refreshed-block {
  line-height: 1.2;
  white-space: nowrap;
}
.last-refreshed-block .label {
  font-size: 9px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.last-refreshed-block .time {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}

/* Appointment select */
.appointment-select { max-width: 420px; }

/* View toggle buttons */
.view-toggle {
  display: flex;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  overflow: hidden;
}
.view-toggle-btn {
  padding: 3px 7px;
  font-size: 13px;
  background: white;
  border: none;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
}
.view-toggle-btn.active { background: #f3f4f6; color: #374151; }
.view-toggle-btn:first-child { border-right: 1px solid #d1d5db; }

/* Vitals sub-header row */
.vitals-subheader {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.vitals-subheader .vitals-title {
  font-weight: 600;
  color: #374151;
  font-size: 12px;
}
.vitals-subheader select {
  font-size: 11px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  padding: 2px 6px;
  color: #374151;
  background: white;
  cursor: pointer;
  outline: none;
}
.add-column-btn {
  font-size: 11px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  padding: 2px 7px;
  background: white;
  color: #374151;
  cursor: pointer;
}
.add-column-btn:hover { background: #f9fafb; }

/* Patient list breadcrumb */
.patient-list-tab {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  padding-bottom: 8px;
  white-space: nowrap;
}
.patient-list-tab:hover { color: white; }

/* Toolbar separator */
.toolbar-sep { color: #d1d5db; font-size: 16px; user-select: none; }

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  background: #edf2f8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
  width: 360px;
  padding: 36px 32px 28px;
}
.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.login-tagline {
  font-size: 12.5px;
  color: #6b7280;
  text-align: center;
  margin-bottom: 24px;
}
.login-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  color: #374151;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.login-input:focus { border-color: #2a5298; box-shadow: 0 0 0 3px rgba(42,82,152,0.12); }
.login-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 5px;
}
.login-btn {
  width: 100%;
  background: #2a5298;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 9px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.login-btn:hover { background: #1e3a5f; }
.login-btn:active { background: #172d4a; }
.login-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  font-size: 12px;
  border-radius: 4px;
  padding: 9px 12px;
  margin-bottom: 14px;
  display: none;
}
.login-footer {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  margin-top: 20px;
}
