/* ═══════════════════════════════════════════════════════════════
   Sultana EMR Trainer — Plugin Styles
   Mobile-first for iPad/iPhone student use
═══════════════════════════════════════════════════════════════ */

:root {
    --emr-navy:    #1B3A6B;
    --emr-red:     #C0392B;
    --emr-green:   #27AE60;
    --emr-yellow:  #F39C12;
    --emr-blue:    #2980B9;
    --emr-bg:      #F4F6F9;
    --emr-surface: #FFFFFF;
    --emr-border:  #D0D6E4;
    --emr-text:    #1a1d2e;
    --emr-mid:     #444;
    --emr-dim:     #888;
    --emr-radius:  6px;
    --emr-touch:   48px; /* minimum tap target height */
}

/* ── Base ── */
.emr-form, .emr-dash, .emr-results, .emr-grade-view, .emr-picker {
    font-family: 'Arial', sans-serif;
    font-size: 15px;
    color: var(--emr-text);
    line-height: 1.5;
    max-width: 960px;
    margin: 0 auto;
}

/* ══════════════════════════════════════
   SCENARIO CALLOUT
══════════════════════════════════════ */
.emr-scenario-callout {
    background: #EBF3FB;
    border-left: 5px solid var(--emr-navy);
    border-radius: var(--emr-radius);
    padding: 14px 16px;
    margin-bottom: 18px;
}
.emr-scenario-label {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--emr-navy);
    margin-bottom: 6px;
}
.emr-scenario-callout p { margin: 0; color: var(--emr-mid); font-size: 14px; line-height: 1.65; }

/* ══════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════ */
.emr-progress-bar-wrap { margin-bottom: 18px; }
.emr-progress-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--emr-navy);
    margin-bottom: 6px;
}
.emr-progress-track {
    height: 12px;
    background: #dde2ee;
    border-radius: 99px;
    overflow: hidden;
}
.emr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emr-navy), var(--emr-blue));
    border-radius: 99px;
    width: 0%;
    transition: width 0.4s ease;
}

/* ══════════════════════════════════════
   SECTION TITLES
══════════════════════════════════════ */
.emr-section-title {
    background: var(--emr-navy);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: var(--emr-radius) var(--emr-radius) 0 0;
    margin-top: 22px;
}
.emr-section-title:first-child,
.emr-section-title.emr-section-first { margin-top: 0; }

/* ══════════════════════════════════════
   FIELD GROUPS & ROWS
══════════════════════════════════════ */
.emr-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--emr-surface);
    border: 1px solid var(--emr-border);
    border-top: none;
    padding: 12px;
}
.emr-row-2col > .emr-field-group  { flex: 1 1 45%; }
.emr-row-3col > .emr-field-group  { flex: 1 1 28%; }
.emr-row-4col > .emr-field-group  { flex: 1 1 20%; }
.emr-row-pqrst > .emr-field-group { flex: 1 1 16%; }
.emr-span2 { flex: 2 1 60% !important; }

.emr-field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.emr-field-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--emr-navy);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.emr-field-group input[type="text"],
.emr-field-group input[type="date"],
.emr-field-group input[type="number"],
.emr-field-group textarea,
.emr-field-group select {
    border: 1px solid var(--emr-border);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 16px; /* prevents iOS zoom on focus */
    background: #fafbff;
    color: var(--emr-text);
    outline: none;
    transition: border-color 0.15s;
    -webkit-appearance: none;
    min-height: var(--emr-touch);
    box-sizing: border-box;
    width: 100%;
}
.emr-field-group input:focus,
.emr-field-group textarea:focus,
.emr-field-group select:focus {
    border-color: var(--emr-navy);
    background: #fff;
}
.emr-full-width  { width: 100%; }
.emr-input-sm    { max-width: 120px; }
.emr-input-xs    { max-width: 70px; }
.emr-sublabel    { font-size: 11px; color: var(--emr-dim); }

/* ══════════════════════════════════════
   CHECKBOXES & RADIOS
══════════════════════════════════════ */
.emr-checks-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    padding: 4px 0;
}
.emr-checks-inline label {
    font-size: 15px;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: var(--emr-mid) !important;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    min-height: 36px;
    padding: 2px 4px;
}
.emr-checks-inline input[type="checkbox"],
.emr-checks-inline input[type="radio"] {
    margin: 0;
    accent-color: var(--emr-navy);
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}
.emr-checks-wrap { flex-wrap: wrap; }

/* Standalone blocks below section titles */
.emr-mt {
    background: var(--emr-surface);
    border: 1px solid var(--emr-border);
    border-top: none;
    padding: 12px;
}

/* ══════════════════════════════════════
   TIMES TABLE — stacked cards on mobile
══════════════════════════════════════ */
.emr-times-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--emr-surface);
    border: 1px solid var(--emr-border);
    font-size: 14px;
}
.emr-times-table th {
    background: #e8ecf5;
    color: var(--emr-navy);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 7px 8px;
    border: 1px solid var(--emr-border);
    text-align: left;
}
.emr-times-table td {
    border: 1px solid var(--emr-border);
    padding: 6px 8px;
    vertical-align: middle;
}
.emr-times-table input[type="text"] {
    font-size: 16px;
    min-height: var(--emr-touch);
    border: 1px solid var(--emr-border);
    border-radius: 4px;
    padding: 6px 8px;
    background: #fafbff;
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
}
.emr-row-label {
    font-weight: 700;
    color: var(--emr-navy);
    font-size: 12px;
    white-space: nowrap;
    width: 90px;
}

/* ══════════════════════════════════════
   PHYSICAL ASSESSMENT
   Desktop: 7-col grid | Mobile: 2-col
══════════════════════════════════════ */
.emr-phys-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--emr-surface);
    border: 1px solid var(--emr-border);
    border-top: none;
}
.emr-phys-col {
    border-right: 1px solid var(--emr-border);
    padding: 10px 8px;
    font-size: 13px;
}
.emr-phys-col:last-child { border-right: none; }
.emr-phys-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--emr-navy);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}
.emr-phys-col label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--emr-mid);
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 13px;
    min-height: 30px;
}
.emr-phys-col input {
    accent-color: var(--emr-navy);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════
   GCS
   Desktop: 4-col | Mobile: 2-col
══════════════════════════════════════ */
.emr-gcs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--emr-surface);
    border: 1px solid var(--emr-border);
    border-top: none;
}
.emr-gcs-col {
    border-right: 1px solid var(--emr-border);
    padding: 12px;
    font-size: 14px;
}
.emr-gcs-col:last-child { border-right: none; }
.emr-gcs-col label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--emr-mid);
    margin-bottom: 8px;
    cursor: pointer;
    min-height: 36px;
}
.emr-gcs-col input {
    accent-color: var(--emr-navy);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════
   VITAL SIGNS
   Desktop: horizontal row | Mobile: card per set
══════════════════════════════════════ */
#emr-vitals-wrap {
    background: var(--emr-surface);
    border: 1px solid var(--emr-border);
    border-top: none;
}
.emr-vital-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px;
    border-bottom: 1px solid var(--emr-border);
}
.emr-vital-row:last-child { border-bottom: none; }
.emr-vital-set-label {
    display: none; /* shown on mobile only */
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--emr-navy);
    margin-bottom: 4px;
}
.emr-vital-row .emr-field-group { flex: 1 1 120px; }
.emr-vital-row .emr-field-group label { font-size: 10px; }

/* ══════════════════════════════════════
   TRAUMA TABLE
   Desktop: table | Mobile: stacked rows
══════════════════════════════════════ */
.emr-trauma-wrap {
    background: var(--emr-surface);
    border: 1px solid var(--emr-border);
    border-top: none;
    padding: 10px 12px;
}
.emr-trauma-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--emr-surface);
    font-size: 14px;
}
.emr-trauma-table th {
    background: #e8ecf5;
    color: var(--emr-navy);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 7px 10px;
    border: 1px solid var(--emr-border);
    text-align: left;
}
.emr-trauma-table td {
    border: 1px solid var(--emr-border);
    padding: 8px 10px;
    vertical-align: middle;
}
.emr-trauma-table td:first-child { font-weight: 600; color: var(--emr-mid); }
.emr-trauma-table input[type="checkbox"],
.emr-trauma-table input[type="radio"] {
    width: 20px; height: 20px;
    accent-color: var(--emr-navy);
    cursor: pointer;
}

/* ══════════════════════════════════════
   TREATMENT TABLE
   Desktop: wide table | Mobile: cards
══════════════════════════════════════ */
.emr-treatment-wrap {
    background: var(--emr-surface);
    border: 1px solid var(--emr-border);
    border-top: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.emr-treatment-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    background: var(--emr-surface);
    font-size: 13px;
}
.emr-treatment-table th {
    background: #e8ecf5;
    color: var(--emr-navy);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 7px 8px;
    border: 1px solid var(--emr-border);
    white-space: nowrap;
    text-align: left;
}
.emr-treatment-table td {
    border: 1px solid var(--emr-border);
    padding: 5px 6px;
    vertical-align: middle;
}
.emr-treatment-table input[type="text"] {
    font-size: 16px;
    min-height: 40px;
    border: 1px solid var(--emr-border);
    border-radius: 4px;
    padding: 4px 6px;
    background: #fafbff;
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
}
.emr-treatment-table input[type="radio"] {
    width: 18px; height: 18px;
    accent-color: var(--emr-navy);
}
.emr-treatment-scroll-hint {
    font-size: 11px;
    color: var(--emr-dim);
    padding: 4px 12px;
    display: none;
    background: #f7f8fc;
    border-bottom: 1px solid var(--emr-border);
}

/* ══════════════════════════════════════
   TEAM MEMBERS
   Desktop: 3-col | Mobile: stacked
══════════════════════════════════════ */
.emr-team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--emr-surface);
    border: 1px solid var(--emr-border);
    border-top: none;
}
.emr-team-col {
    border-right: 1px solid var(--emr-border);
    padding: 14px;
}
.emr-team-col:last-child { border-right: none; }
.emr-team-col .emr-field-group { margin-bottom: 10px; }

/* ══════════════════════════════════════
   SUBMIT
══════════════════════════════════════ */
.emr-submit-wrap {
    text-align: center;
    padding: 24px 0 8px;
}
.emr-submit-note { font-size: 12px; color: var(--emr-dim); margin-top: 8px; }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.emr-btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: var(--emr-radius);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
    min-height: var(--emr-touch);
    line-height: 1.2;
    text-align: center;
}
.emr-btn-primary { background: var(--emr-navy); color: #fff; }
.emr-btn-primary:hover { background: #142D55; color: #fff; }
.emr-btn-sm { padding: 8px 16px; font-size: 13px; min-height: 36px; }
.emr-btn-ghost {
    background: transparent;
    border: 1px solid var(--emr-border);
    color: var(--emr-mid);
}
.emr-btn-ghost:hover { background: var(--emr-bg); }

/* Submit button — full-width on mobile */
#emr-submit-btn { min-width: 220px; font-size: 17px; padding: 16px 32px; }

/* ══════════════════════════════════════
   NOTICES & MESSAGES
══════════════════════════════════════ */
.emr-notice {
    background: #FFF8E1;
    border-left: 4px solid var(--emr-yellow);
    padding: 12px 16px;
    border-radius: var(--emr-radius);
    margin: 16px 0;
    font-size: 14px;
}
.emr-notice-info { background: #EBF3FB; border-left-color: var(--emr-blue); }
.emr-form-msg {
    margin: 12px auto;
    max-width: 500px;
    padding: 12px 16px;
    border-radius: var(--emr-radius);
    font-weight: 600;
    font-size: 15px;
}
.emr-form-msg.success { background: #d4edda; color: #155724; }
.emr-form-msg.error   { background: #f8d7da; color: #721c24; }

/* ══════════════════════════════════════
   BACK LINK
══════════════════════════════════════ */
.emr-back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--emr-navy);
    text-decoration: none;
    font-weight: 600;
    min-height: 36px;
}
.emr-back-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   GENERIC TABLE (shared)
══════════════════════════════════════ */
.emr-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--emr-surface);
    font-size: 13px;
}
.emr-table th {
    background: #e8ecf5;
    color: var(--emr-navy);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 7px 8px;
    border: 1px solid var(--emr-border);
    text-align: left;
}
.emr-table td {
    border: 1px solid var(--emr-border);
    padding: 6px 8px;
    vertical-align: middle;
}
.emr-table tr:nth-child(even) td { background: #f7f8fc; }

/* ══════════════════════════════════════
   TEACHER DASHBOARD
══════════════════════════════════════ */
.emr-dash-header { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.emr-dash-header h2 { margin: 0; color: var(--emr-navy); }
.emr-stat-cards { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.emr-stat-card { flex: 1 1 110px; background: var(--emr-surface); border: 1px solid var(--emr-border); border-radius: 8px; padding: 16px; text-align: center; }
.emr-stat-card.emr-stat-blue   { border-top: 3px solid var(--emr-blue); }
.emr-stat-card.emr-stat-green  { border-top: 3px solid var(--emr-green); }
.emr-stat-card.emr-stat-yellow { border-top: 3px solid var(--emr-yellow); }
.emr-stat-num   { font-size: 30px; font-weight: 700; color: var(--emr-navy); }
.emr-stat-label { font-size: 11px; color: var(--emr-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.emr-badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.emr-badge-blue   { background: #D6EAF8; color: #1A5276; }
.emr-badge-green  { background: #D5F5E3; color: #145A32; }
.emr-badge-red    { background: #FADBD8; color: #7B241C; }
.emr-badge-grey   { background: #EAECEE; color: #666; }
.emr-mini-bar-wrap { height: 8px; background: #e0e4ee; border-radius: 99px; overflow: hidden; width: 80px; display: inline-block; vertical-align: middle; }
.emr-mini-bar { height: 100%; border-radius: 99px; transition: width 0.3s; }
.emr-prog-low  { background: var(--emr-red); }
.emr-prog-mid  { background: var(--emr-yellow); }
.emr-prog-high { background: var(--emr-green); }
.emr-pct-label { font-size: 12px; color: var(--emr-dim); margin-left: 6px; vertical-align: middle; }
.emr-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.emr-dash-table th { white-space: nowrap; }
.emr-row-needs-grade { background: #FEFDE8 !important; }
.emr-text-dim { color: var(--emr-dim); }

/* Tabs */
.emr-tabs { display: flex; border-bottom: 2px solid var(--emr-border); margin-bottom: 24px; }
.emr-tab { display: inline-block; padding: 10px 22px; font-size: 14px; font-weight: 600; color: var(--emr-dim); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color 0.15s, border-color 0.15s; }
.emr-tab:hover { color: var(--emr-navy); }
.emr-tab-active { color: var(--emr-navy); border-bottom-color: var(--emr-navy); }

/* Filter bar */
.emr-filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.emr-filter-bar label { font-size: 13px; font-weight: 600; color: var(--emr-navy); }
.emr-filter-bar select { padding: 7px 12px; border: 1px solid var(--emr-border); border-radius: var(--emr-radius); font-size: 14px; background: var(--emr-surface); color: var(--emr-text); }

/* Grade view */
.emr-grade-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--emr-border); }
.emr-grade-header h2 { color: var(--emr-navy); margin: 10px 0 4px; }
.emr-grade-meta { font-size: 13px; color: var(--emr-dim); }
.emr-grade-panel { background: var(--emr-bg); border: 1px solid var(--emr-border); border-radius: 8px; padding: 20px; margin-bottom: 28px; }
.emr-grade-panel h3 { color: var(--emr-navy); margin: 0 0 16px; }
.emr-grade-panel .emr-field-group { margin-bottom: 14px; }
.emr-grade-panel .emr-field-group label { color: var(--emr-navy); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.emr-grade-panel input, .emr-grade-panel textarea, .emr-grade-panel select { border: 1px solid var(--emr-border); border-radius: 4px; padding: 8px 10px; font-size: 14px; width: 100%; max-width: 100%; }

/* Read-only */
.emr-ro-wrap { margin-top: 10px; }
.emr-ro-section { margin-bottom: 16px; background: var(--emr-surface); border: 1px solid var(--emr-border); border-radius: var(--emr-radius); overflow: hidden; }
.emr-ro-section h4 { background: #e8ecf5; color: var(--emr-navy); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 12px; margin: 0; }
.emr-ro-dl { display: grid; grid-template-columns: 180px 1fr; font-size: 13px; }
.emr-ro-dl dt { font-weight: 700; color: var(--emr-navy); padding: 7px 12px; border-bottom: 1px solid #f0f2f8; background: #fafbff; }
.emr-ro-dl dd { color: var(--emr-mid); padding: 7px 12px; border-bottom: 1px solid #f0f2f8; }
.emr-ro-dl dt:last-of-type, .emr-ro-dl dd:last-of-type { border-bottom: none; }
.emr-ro-table { border: none; }

/* Student results */
.emr-results h2 { color: var(--emr-navy); margin-bottom: 16px; }
.emr-feedback-row td { padding: 0 !important; }
.emr-feedback-box { background: #EBF3FB; border-left: 4px solid var(--emr-blue); padding: 10px 14px; font-size: 13px; color: var(--emr-mid); }

/* ══════════════════════════════════════
   SCENARIO MANAGER
══════════════════════════════════════ */
.emr-scn-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.emr-scn-hint { font-size: 12px; color: var(--emr-dim); margin-left: auto; max-width: 320px; text-align: right; line-height: 1.4; }
.emr-scn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.emr-scn-card { background: var(--emr-surface); border: 1px solid var(--emr-border); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.emr-scn-card:hover { border-color: var(--emr-navy); }
.emr-scn-hidden { opacity: 0.55; border-style: dashed; }
.emr-scn-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.emr-scn-card-title { font-size: 15px; font-weight: 700; color: var(--emr-navy); line-height: 1.3; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.emr-scn-card-badges { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.emr-scn-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.emr-scn-badge-visible  { background: #D5F5E3; color: #145A32; }
.emr-scn-badge-hidden   { background: #EAECEE; color: #555; }
.emr-scn-badge-sample   { background: #D6EAF8; color: #1A5276; }
.emr-scn-badge-resubmit { background: #FEF3C7; color: #92400E; }
.emr-scn-card-dispatch { font-size: 13px; color: var(--emr-mid); line-height: 1.6; border-left: 3px solid #ccd4e8; padding-left: 10px; flex: 1; }
.emr-scn-card-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--emr-dim); }
.emr-scn-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.emr-btn-hide { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.emr-btn-hide:hover { background: #FDE68A; }
.emr-btn-show { background: #D5F5E3; color: #145A32; border: 1px solid #9FE1CB; }
.emr-btn-show:hover { background: #9FE1CB; }

/* ══════════════════════════════════════
   STUDENT SCENARIO PICKER
══════════════════════════════════════ */
.emr-picker-header { margin-bottom: 24px; }
.emr-picker-header h2 { color: var(--emr-navy); margin: 0 0 6px; font-size: 22px; }
.emr-picker-header p  { color: var(--emr-dim); font-size: 14px; margin: 0; }
.emr-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.emr-picker-card { background: var(--emr-surface); border: 1px solid var(--emr-border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.emr-picker-card:hover { border-color: var(--emr-navy); }
.emr-picker-card-done { opacity: 0.75; }
.emr-picker-card-header { background: var(--emr-navy); color: #fff; padding: 14px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.emr-picker-card-title { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.3; }
.emr-picker-card-dispatch { padding: 14px 16px; flex: 1; }
.emr-picker-dispatch-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--emr-navy); margin-bottom: 6px; }
.emr-picker-card-dispatch p { font-size: 13px; color: var(--emr-mid); line-height: 1.65; margin: 0; }
.emr-picker-card-footer { padding: 14px 16px; border-top: 1px solid var(--emr-border); display: flex; align-items: center; gap: 10px; background: #fafbff; }
.emr-picker-done-msg { font-size: 13px; color: var(--emr-green); font-weight: 600; }
.emr-picker-card-footer .emr-btn { width: 100%; justify-content: center; }

/* ══════════════════════════════════════
   TABLET (768px) — medium screens
══════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE OVERHAUL
   Strategy per section:
   - Field rows: wrap to full-width at 600px
   - Physical grid: 2-col at 480px, 4-col at 768px
   - GCS: 2-col at 768px, 1-col at 480px
   - Times table: card-per-row at 600px (hide thead, reflow)
   - Vital signs: card-per-set at 600px (already flex wrap)
   - Trauma table: compact grid row at 600px
   - Treatment table: card-per-row at 600px (hide thead, reflow)
   - Team: 2-col at 768px, 1-col at 480px
   - Touch targets: min 44px height on all inputs/buttons at 600px
════════════════════════════════════════════════════════════════ */

/* ── Tablet (768px) ─────────────────────────────────────────── */
@media (max-width: 768px) {

    .emr-phys-grid  { grid-template-columns: repeat(4, 1fr); }
    .emr-gcs-grid   { grid-template-columns: repeat(2, 1fr); }
    .emr-team-grid  { grid-template-columns: repeat(2, 1fr); }

    .emr-team-grid .emr-team-col:nth-child(2) { border-right: none; }
    .emr-team-grid .emr-team-col:nth-child(3) {
        grid-column: 1 / -1;
        border-top: 1px solid var(--emr-border);
        border-right: none;
    }

    .emr-row-4col > .emr-field-group  { flex: 1 1 42%; }
    .emr-row-pqrst > .emr-field-group { flex: 1 1 30%; }

    .emr-vital-row { flex-wrap: wrap; }
    .emr-vital-row .emr-field-group { flex: 1 1 40%; }

    .emr-picker-grid { grid-template-columns: repeat(2, 1fr); }
    .emr-scn-grid    { grid-template-columns: repeat(2, 1fr); }
    .emr-ro-dl       { grid-template-columns: 140px 1fr; }

    .emr-stat-cards  { gap: 10px; }
    .emr-stat-card   { padding: 14px 12px; }
    .emr-stat-num    { font-size: 26px; }
}

/* ── Mobile (600px) — the main mobile overhaul ──────────────── */
@media (max-width: 600px) {

    /* ── Base form layout ── */
    .emr-form, .emr-picker, .emr-dash,
    .emr-results, .emr-grade-view {
        font-size: 15px;
    }

    /* All multi-col field rows go single column */
    .emr-row { flex-direction: column; gap: 16px; padding: 14px; }
    .emr-row-2col  > .emr-field-group,
    .emr-row-3col  > .emr-field-group,
    .emr-row-4col  > .emr-field-group,
    .emr-row-pqrst > .emr-field-group { flex: 1 1 100%; }

    /* Bigger touch targets on all inputs */
    .emr-field-group input[type="text"],
    .emr-field-group input[type="date"],
    .emr-field-group input[type="number"],
    .emr-field-group select {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 10px 12px;
    }
    .emr-field-group textarea {
        font-size: 16px;
        padding: 10px 12px;
    }

    /* Bigger checkbox/radio targets */
    .emr-checks-inline label {
        font-size: 15px;
        padding: 6px 4px;
        min-height: 36px;
        display: flex;
        align-items: center;
    }
    .emr-checks-inline input[type="checkbox"],
    .emr-checks-inline input[type="radio"] {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    .emr-checks-inline { gap: 4px 12px; }

    /* Labels more readable */
    .emr-field-group label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    /* ── Physical assessment: 2 columns ── */
    .emr-phys-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .emr-phys-col {
        border-right: 1px solid var(--emr-border);
        border-bottom: 1px solid var(--emr-border);
        padding: 10px;
    }
    .emr-phys-col:nth-child(even) { border-right: none; }
    .emr-phys-col:nth-last-child(-n+2) { border-bottom: none; }
    .emr-phys-col label { font-size: 14px; padding: 4px 0; min-height: 32px; }
    .emr-phys-col input { width: 20px; height: 20px; }
    .emr-phys-label { font-size: 11px; }

    /* ── GCS: single column ── */
    .emr-gcs-grid { grid-template-columns: 1fr; }
    .emr-gcs-col {
        border-right: none;
        border-bottom: 1px solid var(--emr-border);
        padding: 12px;
    }
    .emr-gcs-col:last-child { border-bottom: none; }
    .emr-gcs-col label { font-size: 15px; padding: 6px 0; min-height: 36px; display: flex; align-items: center; gap: 8px; }
    .emr-gcs-col input { width: 20px; height: 20px; }

    /* ── TIMES TABLE → card per event ── */
    .emr-times-table { border: none; background: transparent; }
    .emr-times-table thead { display: none; }
    .emr-times-table tbody { display: flex; flex-direction: column; gap: 10px; }
    .emr-times-table tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        background: var(--emr-surface);
        border: 1px solid var(--emr-border);
        border-radius: var(--emr-radius);
        padding: 12px;
    }
    .emr-times-table td {
        display: flex;
        flex-direction: column;
        border: none;
        padding: 0;
    }
    .emr-times-table td.emr-row-label {
        grid-column: 1 / -1;
        font-size: 12px;
        font-weight: 700;
        color: var(--emr-navy);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding-bottom: 4px;
        border-bottom: 1px solid var(--emr-border);
        margin-bottom: 4px;
        width: auto;
    }
    .emr-times-table td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--emr-dim);
        margin-bottom: 4px;
    }
    .emr-times-table td input[type="text"] {
        min-height: 44px;
        font-size: 16px;
        padding: 8px 10px;
        width: 100%;
        max-width: 100%;
    }
    .emr-times-table .emr-checks-inline { flex-direction: row; gap: 8px; }
    .emr-times-table .emr-checks-inline label { font-size: 15px; min-height: 44px; }
    .emr-input-sm { max-width: 100% !important; width: 100% !important; }
    .emr-input-xs { max-width: 100% !important; width: 100% !important; }

    /* ── VITAL SIGNS → card per set ── */
    #emr-vitals-wrap {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        background: var(--emr-surface);
        border: 1px solid var(--emr-border);
        border-top: none;
    }
    .emr-vital-row {
        background: #f4f6fb;
        border: 1px solid var(--emr-border);
        border-radius: var(--emr-radius);
        padding: 14px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin: 0;
    }
    .emr-vital-row::before {
        content: "Vital Set " attr(data-row);
        display: block;
        grid-column: 1 / -1;
        font-size: 12px;
        font-weight: 700;
        color: var(--emr-navy);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--emr-border);
        margin-bottom: 4px;
    }
    .emr-vital-row .emr-field-group {
        flex: none;
        width: 100%;
    }
    .emr-vital-row .emr-field-group label { font-size: 11px; }
    .emr-vital-row input[type="text"] {
        min-height: 44px;
        font-size: 16px;
        padding: 8px 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* ── TRAUMA TABLE → compact labeled rows ── */
    .emr-trauma-table { border: none; background: transparent; }
    .emr-trauma-table thead { display: none; }
    .emr-trauma-table tbody { display: flex; flex-direction: column; gap: 0; }
    .emr-trauma-table tr {
        display: grid;
        grid-template-columns: 1fr 44px 80px;
        align-items: center;
        border-bottom: 1px solid var(--emr-border);
        background: var(--emr-surface);
    }
    .emr-trauma-table tr:nth-child(even) { background: #f7f8fc; }
    .emr-trauma-table tr:last-child { border-bottom: none; border-radius: 0 0 var(--emr-radius) var(--emr-radius); }
    .emr-trauma-table tr:first-child { border-radius: var(--emr-radius) var(--emr-radius) 0 0; }
    .emr-trauma-table td {
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        padding: 10px 8px;
        font-size: 14px;
    }
    .emr-trauma-table td:first-child {
        justify-content: flex-start;
        font-weight: 600;
        color: var(--emr-mid);
        font-size: 14px;
        padding-left: 12px;
    }
    /* WNL / ABN column — show labels above radios */
    .emr-trauma-table td:nth-child(3) {
        display: flex;
        gap: 0;
        padding: 0;
    }
    .emr-trauma-table td:nth-child(3) label {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 10px;
        font-weight: 700;
        color: var(--emr-dim);
        gap: 4px;
        padding: 8px 10px;
        cursor: pointer;
    }
    .emr-trauma-table td:nth-child(3) input { width: 20px; height: 20px; }
    /* Presence checkbox column */
    .emr-trauma-table td:nth-child(2) input { width: 22px; height: 22px; }

    /* ── TREATMENT TABLE → card per row ── */
    .emr-treatment-table { border: none; background: transparent; }
    .emr-treatment-table thead { display: none; }
    .emr-treatment-table tbody { display: flex; flex-direction: column; gap: 10px; }
    .emr-treatment-table tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        background: var(--emr-surface);
        border: 1px solid var(--emr-border);
        border-radius: var(--emr-radius);
        padding: 14px;
    }
    .emr-treatment-table tr::before {
        content: "Treatment " counter(treatment-row);
        counter-increment: treatment-row;
        display: block;
        grid-column: 1 / -1;
        font-size: 12px;
        font-weight: 700;
        color: var(--emr-navy);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--emr-border);
        margin-bottom: 2px;
    }
    .emr-treatment-table td {
        display: flex;
        flex-direction: column;
        border: none;
        padding: 0;
        position: relative;
    }
    .emr-treatment-table td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--emr-dim);
        margin-bottom: 4px;
    }
    .emr-treatment-table td input[type="text"] {
        min-height: 44px;
        font-size: 16px;
        padding: 8px 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    /* Result +/- spans full width */
    .emr-treatment-table td:last-child {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
    }
    .emr-treatment-table td:last-child::before { content: "Result"; flex-basis: 100%; }
    .emr-treatment-table td:last-child label {
        font-size: 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .emr-treatment-table td:last-child input { width: 22px; height: 22px; }

    /* Counter reset for treatment rows */
    .emr-treatment-table tbody { counter-reset: treatment-row; }

    /* ── Team: 1 column ── */
    .emr-team-grid { grid-template-columns: 1fr; }
    .emr-team-col {
        border-right: none;
        border-bottom: 1px solid var(--emr-border);
        padding: 14px;
    }
    .emr-team-col:last-child { border-bottom: none; }
    .emr-team-grid .emr-team-col:nth-child(3) { grid-column: auto; border-top: none; }
    .emr-team-col .emr-field-group input { min-height: 44px; font-size: 16px; }
    .emr-team-col .emr-checks-inline label { font-size: 15px; min-height: 36px; }

    /* ── Section title: bigger ── */
    .emr-section-title {
        font-size: 13px;
        padding: 10px 14px;
    }

    /* ── Submit button: full width, thumb-friendly ── */
    #emr-submit-btn {
        width: 100%;
        font-size: 18px;
        padding: 18px;
        border-radius: 8px;
    }
    .emr-submit-wrap { padding-top: 28px; padding-bottom: 16px; }

    /* ── Progress bar: stickier on mobile ── */
    .emr-progress-bar-wrap {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--emr-surface);
        padding: 10px 14px;
        border-bottom: 1px solid var(--emr-border);
        margin: 0 -14px 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    /* ── Scenario callout: tighter on mobile ── */
    .emr-scenario-callout { padding: 14px; margin-bottom: 14px; }
    .emr-scenario-callout p { font-size: 14px; }

    /* ── Back link ── */
    .emr-back-link { font-size: 15px; min-height: 44px; display: flex; align-items: center; }

    /* ── Picker cards: full width ── */
    .emr-picker-grid { grid-template-columns: 1fr; gap: 14px; }
    .emr-picker-card-footer .emr-btn { font-size: 16px; padding: 14px 20px; flex: 1; text-align: center; }
    .emr-picker-card-footer { flex-direction: column; }
    .emr-picker-card-dispatch p { font-size: 14px; }

    /* ── Dashboard: scenario manager cards ── */
    .emr-scn-grid { grid-template-columns: 1fr; }
    .emr-scn-hint { margin-left: 0; text-align: left; max-width: 100%; }
    .emr-scn-actions { flex-direction: column; align-items: flex-start; }

    /* ── RO (read-only grade view) ── */
    .emr-ro-dl { grid-template-columns: 110px 1fr; }
    .emr-ro-dl dt, .emr-ro-dl dd { font-size: 13px; padding: 8px 10px; }

    /* ── Stat cards: 2x2 grid ── */
    .emr-stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .emr-stat-num   { font-size: 28px; }

    /* ── Dashboard table: horizontal scroll with hint ── */
    .emr-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .emr-table-wrap::before {
        content: "← Scroll to see all columns →";
        display: block;
        font-size: 11px;
        color: var(--emr-dim);
        text-align: center;
        padding: 4px;
    }
    .emr-dash-table th, .emr-dash-table td { font-size: 12px; padding: 8px 8px; white-space: nowrap; }

    /* ── Tabs: full width ── */
    .emr-tabs { gap: 0; }
    .emr-tab  { padding: 12px 16px; font-size: 13px; flex: 1; text-align: center; }

    /* ── Filter bar ── */
    .emr-filter-bar { flex-direction: column; align-items: flex-start; }
    .emr-filter-bar select { width: 100%; min-height: 44px; font-size: 16px; }
}

/* ── Small phone (390px) — iPhone SE / small Android ───────── */
@media (max-width: 390px) {
    .emr-vital-row { grid-template-columns: 1fr; }
    .emr-treatment-table tr { grid-template-columns: 1fr; }
    .emr-times-table tr { grid-template-columns: 1fr; }
    .emr-phys-grid { grid-template-columns: 1fr 1fr; }
    .emr-stat-cards { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════
   SCENARIO EDITOR (front-end)
══════════════════════════════════════ */
.emr-scene-editor {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 0 60px;
    font-family: Arial, sans-serif;
}

.emr-scene-editor__header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--emr-border);
}
.emr-scene-editor__header h2 {
    color: var(--emr-navy);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}
.emr-scene-id-badge {
    margin-left: auto;
    font-size: 12px;
    color: var(--emr-dim);
    background: var(--emr-bg);
    border: 1px solid var(--emr-border);
    border-radius: 99px;
    padding: 3px 10px;
}

.emr-scene-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.emr-scene-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.emr-scene-field label {
    font-size: 13px;
    font-weight: 700;
    color: var(--emr-navy);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.emr-required { color: var(--emr-red); }
.emr-optional { color: var(--emr-dim); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 12px; }

.emr-scene-field input[type="text"],
.emr-scene-field textarea {
    border: 1.5px solid var(--emr-border);
    border-radius: var(--emr-radius);
    padding: 12px 14px;
    font-size: 15px;
    font-family: Arial, sans-serif;
    color: var(--emr-text);
    background: #fafbff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}
.emr-scene-field input:focus,
.emr-scene-field textarea:focus {
    border-color: var(--emr-navy);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(27,58,107,0.1);
}
.emr-scene-hint {
    font-size: 12px;
    color: var(--emr-dim);
    line-height: 1.5;
    margin: 0;
}

/* Options toggles */
.emr-scene-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--emr-bg);
    border: 1px solid var(--emr-border);
    border-radius: var(--emr-radius);
    padding: 16px 20px;
}
.emr-scene-option { display: flex; }
.emr-scene-toggle-label {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
}
.emr-scene-toggle-wrap {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}
.emr-scene-toggle-wrap input { opacity: 0; width: 0; height: 0; position: absolute; }
.emr-scene-toggle {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 99px;
    transition: background 0.2s;
    cursor: pointer;
}
.emr-scene-toggle::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.emr-scene-toggle-wrap input:checked + .emr-scene-toggle { background: var(--emr-navy); }
.emr-scene-toggle-wrap input:checked + .emr-scene-toggle::before { transform: translateX(20px); }

.emr-scene-option-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--emr-text);
    margin-bottom: 2px;
}
.emr-scene-option-desc {
    display: block;
    font-size: 12px;
    color: var(--emr-dim);
    line-height: 1.4;
}

/* Action buttons */
.emr-scene-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid var(--emr-border);
}
.emr-btn-danger {
    background: var(--emr-red);
    color: #fff;
    margin-left: auto;
}
.emr-btn-danger:hover { background: #a93226; color: #fff; }

@media (max-width: 600px) {
    .emr-scene-actions { flex-direction: column; }
    .emr-btn-danger { margin-left: 0; width: 100%; text-align: center; }
    .emr-scene-editor__header { gap: 8px; }
}

/* ══════════════════════════════════════
   STUDENT IMPORT TAB
══════════════════════════════════════ */
.emr-import-wrap { display: flex; flex-direction: column; gap: 32px; }

.emr-import-section {
    background: var(--emr-surface);
    border: 1px solid var(--emr-border);
    border-radius: 10px;
    overflow: hidden;
}

.emr-import-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--emr-border);
    flex-wrap: wrap;
}
.emr-import-section-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--emr-navy);
    margin: 0 0 4px;
}
.emr-import-section-header p {
    font-size: 13px;
    color: var(--emr-dim);
    margin: 0;
}

/* Format reference box */
.emr-import-format-box {
    margin: 20px 24px;
    background: #f4f6fb;
    border: 1px solid var(--emr-border);
    border-radius: var(--emr-radius);
    padding: 16px;
}
.emr-import-format-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--emr-navy);
    margin-bottom: 10px;
}
.emr-import-format-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.emr-import-format-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.emr-import-format-table th {
    background: var(--emr-navy);
    color: #fff;
    padding: 7px 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--emr-border);
}
.emr-import-format-table td {
    padding: 6px 10px;
    border: 1px solid var(--emr-border);
    background: #fff;
    font-family: monospace;
    font-size: 12px;
    color: var(--emr-mid);
}
.emr-import-rules {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.emr-import-rules li {
    font-size: 12px;
    color: var(--emr-dim);
    padding-left: 16px;
    position: relative;
    line-height: 1.5;
}
.emr-import-rules li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: var(--emr-navy);
    opacity: 0.5;
}
.emr-import-rules code {
    background: #e8ecf5;
    color: var(--emr-navy);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
}

/* Upload area */
.emr-import-upload-area {
    margin: 0 24px 24px;
    border: 2px dashed var(--emr-border);
    border-radius: var(--emr-radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.emr-import-upload-area:hover,
.emr-upload-drag {
    border-color: var(--emr-navy);
    background: #f0f4ff;
}
.emr-import-upload-icon { font-size: 32px; margin-bottom: 8px; }
.emr-import-upload-text { font-size: 15px; font-weight: 600; color: var(--emr-navy); margin-bottom: 4px; }
.emr-import-upload-sub  { font-size: 13px; color: var(--emr-dim); margin-bottom: 12px; }
.emr-import-upload-filename {
    margin-top: 12px;
    font-size: 13px;
    color: var(--emr-mid);
    font-weight: 600;
}

/* Preview */
#emr-preview-wrap { margin: 0 24px 24px; }
.emr-import-preview-header { margin-bottom: 12px; }
.emr-import-preview-header h4 { font-size: 15px; color: var(--emr-navy); margin: 0 0 8px; }
.emr-import-errors {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid var(--emr-red);
    border-radius: var(--emr-radius);
    padding: 10px 14px;
    font-size: 13px;
    color: #991b1b;
    margin-bottom: 12px;
}
.emr-import-errors ul { margin: 6px 0 0 16px; }
.emr-import-errors li { margin-bottom: 2px; }
.emr-import-table-wrap { overflow-x: auto; border-radius: var(--emr-radius); border: 1px solid var(--emr-border); }
.emr-import-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.emr-row-error td { background: #fff8f8 !important; }

/* Students table */
.emr-import-section--students { }
.emr-students-table { font-size: 13px; }
.emr-students-table td code {
    background: #e8ecf5;
    color: var(--emr-navy);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

@media (max-width: 600px) {
    .emr-import-section-header { flex-direction: column; }
    .emr-import-format-box { margin: 14px; }
    .emr-import-upload-area { margin: 0 14px 16px; }
    #emr-preview-wrap { margin: 0 14px 16px; }
}
