@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   Design Tokens
   ============================================================ */
:root {
    --bg-base:        #080C14;
    --bg-surface:     #FFFFFF;
    --bg-panel:       #F6F8FB;
    --bg-panel-2:     #EEF1F7;
    --nav-bg:         #0D1424;
    --nav-border:     rgba(6, 182, 212, 0.3);

    --accent:         #06B6D4;
    --accent-hover:   #0891B2;
    --accent-dim:     rgba(6, 182, 212, 0.10);
    --accent-glow:    rgba(6, 182, 212, 0.25);

    --success:        #10B981;
    --success-dim:    rgba(16, 185, 129, 0.12);
    --danger:         #F43F5E;
    --danger-hover:   #E11D48;
    --danger-dim:     rgba(244, 63, 94, 0.10);
    --warning:        #F59E0B;

    --text-primary:   #0F172A;
    --text-secondary: #64748B;
    --text-muted:     #94A3B8;
    --text-on-dark:   #F1F5F9;
    --text-on-accent: #FFFFFF;

    --border:         #E2E8F0;
    --border-strong:  #CBD5E1;

    --shadow-xs:  0 1px 2px rgba(0,0,0,0.06);
    --shadow-sm:  0 1px 4px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
    --shadow-lg:  0 16px 48px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.10);
    --shadow-xl:  0 24px 64px rgba(0,0,0,0.28), 0 8px 24px rgba(0,0,0,0.12);

    --r-sm: 6px;
    --r:    10px;
    --r-lg: 16px;
    --r-xl: 20px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   Top Navigation
   ============================================================ */
.top-nav {
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: var(--text-on-dark);
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 58px;
    flex-shrink: 0;
    position: relative;
    z-index: 200;
}

.top-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 60%);
    opacity: 0.4;
}

.nav-left .app-title {
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-on-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-left .app-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-glow);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-user {
    color: var(--text-muted);
    font-size: 0.82em;
    font-weight: 500;
    padding: 5px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-sm);
    letter-spacing: 0.01em;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    padding: 8px 18px;
    border: none;
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    letter-spacing: 0.01em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
    background: #059669;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-panel-2);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    color: rgba(255,255,255,0.75);
    border: 1px solid rgba(255,255,255,0.2);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    border-color: rgba(255,255,255,0.35);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 6px rgba(244,63,94,0.25);
}
.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 4px 12px rgba(244,63,94,0.35);
    transform: translateY(-1px);
}

.btn-small {
    padding: 5px 11px;
    font-size: 0.8em;
    margin: 0 2px;
}

/* ============================================================
   Main Container
   ============================================================ */
.container {
    margin: 20px;
    height: calc(100vh - 58px - 40px);
    background: var(--bg-surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.03);
}

/* ============================================================
   Error Messages
   ============================================================ */
.error-message {
    background: var(--danger-dim);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--r-sm);
    margin-top: 10px;
    border-left: 3px solid var(--danger);
    font-size: 0.88em;
    font-weight: 500;
}

/* ============================================================
   Tables
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-panel);
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.12s ease;
}

.data-table tbody tr:hover td {
    background: var(--accent-dim);
}

.loading {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 24px !important;
    font-size: 0.9em;
}

/* ============================================================
   Modals
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(8, 12, 20, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: var(--bg-surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.22s ease;
    border: 1px solid rgba(255,255,255,0.06);
}

@keyframes modalSlideIn {
    from { transform: translateY(-12px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-small  { max-width: 440px; }
.modal-medium { max-width: 580px; }
.modal-large  { max-width: 1100px; }

.modal-header {
    background: var(--nav-bg);
    color: var(--text-on-dark);
    padding: 18px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-close {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-size: 1.1em;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    transition: all 0.15s ease;
}
.modal-close:hover {
    background: rgba(244,63,94,0.15);
    border-color: rgba(244,63,94,0.3);
    color: var(--danger);
}

.modal-body {
    padding: 26px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 26px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* ============================================================
   Forms
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.82em;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 0.92em;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

input[readonly] {
    background: var(--bg-panel);
    color: var(--text-muted);
    cursor: not-allowed;
}

input[type="date"] { min-width: 160px; }

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.8em;
}

/* ============================================================
   Patient Info Bar (in screening modal)
   ============================================================ */
.patient-info-bar {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--r-sm);
    font-size: 0.83em;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.08);
}

/* ============================================================
   Total Score Bar (in screening)
   ============================================================ */
.total-score-bar {
    background: var(--nav-bg);
    color: var(--text-on-dark);
    padding: 14px 20px;
    border-radius: var(--r);
    margin-bottom: 20px;
    font-size: 1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    letter-spacing: 0.01em;
}

.score-value {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--success);
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
    letter-spacing: -0.02em;
    min-width: 2ch;
    text-align: center;
}

/* ============================================================
   Survey / Screening
   ============================================================ */
.category {
    margin-bottom: 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.category-header {
    color: white;
    padding: 12px 18px;
    font-size: 0.9em;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.category-content {
    padding: 16px;
    background: var(--bg-surface);
}

.condition {
    margin-bottom: 10px;
    padding: 12px 14px;
    background: var(--bg-panel);
    border-radius: var(--r-sm);
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.condition:last-child { margin-bottom: 0; }

.condition:hover { background: var(--bg-panel-2); }

.condition.has-selection {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.condition-single {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex: 1;
    gap: 0;
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 12px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.checkbox-label {
    font-size: 0.9em;
    cursor: pointer;
    user-select: none;
    color: var(--text-primary);
}

.score-badge {
    background: var(--bg-panel-2);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.82em;
    min-width: 44px;
    text-align: center;
    transition: all 0.2s ease;
    font-family: 'JetBrains Mono', monospace;
    border: 1.5px solid var(--border);
    flex-shrink: 0;
}

.score-badge.active {
    background: var(--success);
    color: white;
    border-color: var(--success);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
    transform: scale(1.05);
}

.score-badge.inactive { opacity: 0.45; }

.group-label {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.group-items {
    margin-left: 14px;
    margin-top: 8px;
}

.group-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.group-item input[type="checkbox"],
.group-item input[type="radio"] {
    width: 16px;
    height: 16px;
}

.group-item .checkbox-label { font-size: 0.85em; }

.radio-score-hint {
    font-size: 0.78em;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 2px;
}

/* Category breakdown bar inside screening modal */
.category-breakdown-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-panel-2);
    border-bottom: 1px solid var(--border);
    min-height: 0;
}

/* Score breakdown panel inside patient details */
.score-breakdown-panel {
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.score-breakdown-title {
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.score-breakdown-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-panel-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px 3px 8px;
    font-size: 0.78em;
}

.breakdown-cat {
    color: var(--text-primary);
    font-weight: 500;
}

.breakdown-score {
    background: var(--success);
    color: white;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.9em;
}

.breakdown-empty {
    color: var(--text-muted);
    font-size: 0.85em;
    font-style: italic;
}

/* ============================================================
   Master-Detail Layout
   ============================================================ */
.patient-master-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1 1 50%;
    min-height: 200px;
    max-height: calc(100% - 230px);
    overflow: hidden;
}

.resize-handle {
    height: 16px;
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px 0;
    position: relative;
    user-select: none;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    transition: background 0.15s ease;
}

.resize-handle:hover { background: var(--accent-dim); }

.resize-handle-line {
    width: 48px;
    height: 3px;
    background: var(--border-strong);
    border-radius: 2px;
    transition: background 0.2s, width 0.2s;
}

.resize-handle:hover .resize-handle-line {
    background: var(--accent);
    width: 60px;
}

/* Panel shared styles */
.patient-selector-section,
.patient-details-section {
    background: var(--bg-panel);
    border-radius: var(--r);
    border: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.patient-selector-section {
    padding: 16px;
}

.patient-details-section {
    padding: 16px;
    overflow: auto;
}

.patient-selector-section h2,
.patient-details-section h2 {
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.patient-selector {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 8px;
}

.patient-list-container {
    flex: 1;
    overflow-y: auto;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    min-height: 0;
    background: var(--bg-surface);
}

.patient-list-items { background: var(--bg-surface); }

.patient-list-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.patient-list-item:last-child { border-bottom: none; }
.patient-list-item:hover { background: var(--accent-dim); }

.patient-list-item.selected {
    background: var(--accent);
    color: white;
    border-bottom-color: var(--accent-hover);
}

.patient-list-item.selected:hover { background: var(--accent-hover); }

.patient-list-item .patient-name {
    font-weight: 600;
    font-size: 0.88em;
    flex: 0 0 auto;
}

.patient-list-item .patient-meta {
    font-size: 0.77em;
    opacity: 0.75;
    text-align: right;
    white-space: nowrap;
    flex: 0 0 auto;
}

/* Procedures section */
.procedures-section {
    background: var(--bg-panel);
    border-radius: var(--r);
    border: 1.5px solid var(--border);
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 150px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid var(--border);
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Patient details card */
.patient-details-card {
    background: var(--bg-surface);
    padding: 16px;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.detail-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 12px;
}
.detail-row:last-child { margin-bottom: 0; }

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-item label {
    font-size: 0.72em;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0;
}

.detail-item span {
    font-size: 0.92em;
    color: var(--text-primary);
    font-weight: 500;
}

/* Patient ID in details gets monospace treatment */
.detail-item span.patient-id-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
    color: var(--accent-hover);
    letter-spacing: 0.04em;
}

/* ============================================================
   User / Doctor / Procedure Management Tables
   ============================================================ */
.user-management-header { margin-bottom: 16px; }
.user-list { overflow-x: auto; }

/* ============================================================
   Help Modal
   ============================================================ */
.help-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: var(--bg-panel);
    padding: 14px 22px 0;
    border-bottom: 1.5px solid var(--border);
    flex-shrink: 0;
}

.help-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    font-family: inherit;
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.help-tab:hover { color: var(--text-primary); }

.help-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.help-content {
    display: none;
    padding: 24px 26px;
    max-height: 58vh;
    overflow-y: auto;
    line-height: 1.75;
    color: var(--text-primary);
    font-size: 0.9em;
}

.help-content.active { display: block; }

.help-content h3 {
    font-size: 0.88em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-hover);
    margin: 22px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.help-content h3:first-child { margin-top: 0; }
.help-content p { margin-bottom: 10px; }

.help-content ul,
.help-content ol {
    margin: 6px 0 12px 20px;
}

.help-content li { margin-bottom: 6px; }

.help-content code {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.85em;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}

kbd {
    display: inline-block;
    background: var(--bg-panel);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.82em;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.help-note {
    background: rgba(6, 182, 212, 0.06);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    margin: 14px 0;
    font-size: 0.9em;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 16px;
    font-size: 0.88em;
}

.help-table th {
    background: var(--bg-panel);
    padding: 8px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.help-table td {
    padding: 9px 12px;
    border: 1px solid var(--border);
    vertical-align: top;
}

.help-table tr:nth-child(even) td { background: var(--bg-panel); }

/* ============================================================
   Search input overrides (patient search)
   ============================================================ */
#patientSearch {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 0.88em;
    background: var(--bg-surface);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#patientSearch:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

#patientSearch::placeholder { color: var(--text-muted); }

/* ============================================================
   Inline note boxes (versioning notice etc.)
   ============================================================ */
[style*="background: #e6f3ff"],
[style*="background: #fff3cd"] {
    border-radius: var(--r-sm) !important;
    font-size: 0.88em;
}

/* ============================================================
   Google Sign-in Button
   ============================================================ */
.btn-google-signin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    color: #3c4043;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-google-signin:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .container { margin: 12px; }
    .form-row { grid-template-columns: 1fr; }
    .modal-content { width: 96%; }
    table { font-size: 0.82em; }
    th, td { padding: 9px 10px; }
}

@media (max-width: 768px) {
    .patient-master-container { grid-template-columns: 1fr; }
    .patient-list-container { max-height: 280px; }
    .detail-row { grid-template-columns: 1fr; gap: 12px; }
    .help-tabs { padding: 10px 14px 0; }
    .help-tab { padding: 7px 10px; font-size: 0.78em; }
}
