/* Epic-style EMR layout and chart view */

.emr-body {
    margin: 0;
    padding: 0;
    background: #e8eaed;
    font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    color: #1a1a1a;
    min-height: 100vh;
}

.emr-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
}

/* Top application bar - Epic-style dark */
.emr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0d2137;
    color: #fff;
    padding: 0 16px;
    height: 40px;
    flex-shrink: 0;
}

.emr-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.emr-logo {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
}

.emr-app-name {
    font-size: 13px;
    color: #b0bec5;
    font-weight: 400;
}

.emr-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 12px;
    color: #cfd8dc;
}

.emr-user {
    font-weight: 500;
}

/* Patient banner - compact single row */
.emr-patient-banner {
    background: #fff;
    border-bottom: 1px solid #c5cae9;
    padding: 4px 12px 6px;
    flex-shrink: 0;
}

.emr-banner-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    font-size: 12px;
}

.emr-banner-item {
    white-space: nowrap;
}

.emr-banner-divider {
    color: #90a4ae;
    margin: 0 2px;
    user-select: none;
}

/* Main area: sidebar + content (min-height so .emr-app scrolls and flow bar can stick) */
.emr-main {
    display: flex;
    flex-direction: row;
    flex: 1 1 auto;
    min-height: 60vh;
}

/* Iframe-style wrapper (portal area): must get remaining width so it’s visible */
.emr-iframe-wrap {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 8px 8px 8px 0;
    border: 2px solid #006064;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 99, 100, 0.2);
    background: #e8eaed;
}

.emr-iframe-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    min-height: 44px;
    background: #006064;
    color: #fff;
    font-family: "Segoe UI", Arial, sans-serif;
    border-bottom: 2px solid #004d52;
}

/* Left sidebar navigation */
.emr-sidebar {
    width: 180px;
    flex-shrink: 0;
    background: #37474f;
    color: #eceff1;
    padding: 8px 0;
}

.emr-nav-section {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #90a4ae;
    padding: 6px 12px;
    margin-top: 6px;
}

.emr-nav-section:first-child {
    margin-top: 0;
}

.emr-nav-item {
    display: block;
    padding: 5px 12px;
    color: #cfd8dc;
    text-decoration: none;
    font-size: 13px;
}

.emr-nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.emr-nav-item-active {
    background: #0d2137;
    color: #fff;
    font-weight: 500;
}

/* Main content area (also used inside .emr-iframe-wrap) */
.emr-content {
    flex: 1 1 0%;
    min-height: 0;
    overflow: auto;
    background: #fff;
    padding: 12px 16px 16px;
}

.emr-panel {
    max-width: 900px;
}

.emr-panel-hidden {
    display: none;
}

.emr-panel-title {
    margin: 0 0 10px 0;
    font-size: 17px;
    font-weight: 600;
    color: #0d2137;
    border-bottom: 2px solid #0d2137;
    padding-bottom: 6px;
}

/* Summary grid */
.emr-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.emr-summary-block h3 {
    font-size: 13px;
    font-weight: 600;
    color: #37474f;
    margin: 0 0 8px 0;
}

.emr-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.6;
}

.emr-list li {
    margin-bottom: 4px;
}

.emr-muted {
    color: #607d8b;
    font-size: 12px;
}

/* Tables - clinical data */
.emr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.emr-table th,
.emr-table td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    text-align: left;
}

.emr-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #37474f;
}

.emr-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Order card and workflow in Orders panel */
.emr-order-card {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.emr-order-card h3 {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: #37474f;
}

.emr-workflow .step {
    border: 1px solid #e0e0e0;
    padding: 12px 14px;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #fafafa;
}

.emr-workflow .step.completed {
    border-left: 4px solid #2e7d32;
    background: #f1f8e9;
}

.emr-workflow .step.completed h3 {
    color: #558b2f;
}

.emr-workflow .step h3 {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: #0d2137;
}

.emr-btn {
    background: #0d2137;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    margin-top: 6px;
}

.emr-btn:hover {
    background: #1a365d;
}

/* Status messages in workflow (reuse from main styles, ensure visibility) */
.emr-workflow .status {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.emr-workflow .form-group {
    margin-bottom: 12px;
}

.emr-workflow .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.emr-workflow .form-group input,
.emr-workflow .form-group select {
    width: 100%;
    max-width: 400px;
    padding: 6px 10px;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    font-size: 13px;
}

.emr-workflow .final-status {
    margin-top: 12px;
    padding: 12px 14px;
    background: #e8f5e9;
    border: 1px solid #2e7d32;
    border-radius: 4px;
}

.emr-workflow .final-status h2 {
    margin-top: 0;
    font-size: 16px;
    color: #1b5e20;
}
