.order-entry-container {
    padding: 20px;
    max-width: min(1400px, 95vw);
    width: 100%;
    margin: 0 auto;
}

/* AI Suggestions Toggle Bar */
.ai-suggestions-toggle-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.ai-loading-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

/* AI Suggestions Panel */
.ai-suggestions-panel {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border: 1px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.ai-suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ai-suggestions-header h3 {
    margin: 0;
    font-size: 16px;
    color: #4a5568;
}

.ai-suggestions-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-suggestions-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: #6b7280;
    font-size: 14px;
}

.ai-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-suggestion-btn {
    background: white;
    border: 1px solid #667eea;
    border-radius: 6px;
    padding: 10px 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #2d3748;
}

.ai-suggestion-btn:hover {
    background: #667eea;
    color: white;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.ai-suggestions-empty {
    padding: 15px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.ai-suggestions-toggle {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

.order-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
}

.header-left h1 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
    color: #2160e8;
}

.quick-templates {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

.quick-template-btn {
    background-color: #2160e8;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.quick-template-btn:hover {
    background-color: #1e4fd9;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.order-queue-panel {
    background-color: #f9fafb;
    border: 1px solid #2160e8;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.queue-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.queue-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.queue-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.queue-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.queue-item-type {
    font-size: 11px;
    color: #6b7280;
}

.empty-queue {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    padding: 20px;
}

.order-form {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    height: 32px;
}

.form-control:focus {
    outline: none;
    border-color: #2160e8;
    box-shadow: 0 0 0 3px rgba(33, 96, 232, 0.1);
}

textarea.form-control {
    height: auto;
    resize: vertical;
}

.schedule-inputs {
    display: flex;
    gap: 8px;
}

.smart-entry-section {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
}

.smart-entry-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.smart-entry-header label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.smart-entry-input-group {
    display: flex;
    gap: 8px;
    flex: 1;
}

.smart-entry-input-group input {
    flex: 1;
}

.detected-type {
    font-size: 10px;
    font-style: italic;
    color: #2160e8;
    margin-top: 4px;
}

.validation-message {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
}

.validation-message.error {
    background-color: #fee2e2;
    color: #dc2626;
}

.validation-message.info {
    background-color: #dbeafe;
    color: #2563eb;
}

.order-details-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.order-details-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.btn-primary {
    background-color: #2160e8;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #1e4fd9;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #111827;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-text {
    background: transparent;
    border: none;
    color: #2160e8;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-text:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    color: #6b7280;
}

.btn-icon-small {
    background: transparent;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
}

.btn-icon:hover,
.btn-icon-small:hover {
    color: #111827;
}

/* AI Medication Safety Warnings */
.ai-medication-warnings {
    margin-top: 20px;
    padding: 15px;
    background: #fff9e6;
    border-radius: 6px;
    border: 1px solid #fbbf24;
}

.ai-medication-warnings h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #78350f;
}

.medication-warning {
    margin-bottom: 12px;
    padding: 12px;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #d1d5db;
}

.medication-warning.critical {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.medication-warning.high {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.medication-warning.medium {
    border-left-color: #fbbf24;
    background: #fffbeb;
}

.medication-warning.low {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.warning-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.warning-severity {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.medication-warning.critical .warning-severity {
    background: #dc2626;
    color: white;
}

.medication-warning.high .warning-severity {
    background: #f59e0b;
    color: white;
}

.medication-warning.medium .warning-severity {
    background: #fbbf24;
    color: #78350f;
}

.medication-warning.low .warning-severity {
    background: #3b82f6;
    color: white;
}

.warning-message {
    font-size: 13px;
    color: #374151;
    margin-bottom: 8px;
}

.warning-recommendation {
    margin-top: 8px;
    padding: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 12px;
    color: #1f2937;
}

.warning-context {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.warning-context ul {
    margin: 4px 0 0 0;
    padding-left: 20px;
}

.warning-context li {
    margin: 2px 0;
}

.ai-warning-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: #6b7280;
    font-size: 13px;
}

/* Differential Diagnosis Panel */
.differential-diagnosis-panel {
    margin-top: 20px;
    padding: 20px;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #0ea5e9;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.1);
}

.diagnosis-header {
    margin-bottom: 16px;
}

.diagnosis-header h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #0c4a6e;
}

.diagnosis-subtitle {
    margin: 0;
    font-size: 12px;
    color: #64748b;
}

.diagnosis-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    color: #64748b;
    font-size: 13px;
}

.diagnosis-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diagnosis-card {
    background: white;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.diagnosis-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.diagnosis-header-row h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.confidence-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.confidence-badge.high {
    background: #10b981;
    color: white;
}

.confidence-badge.medium {
    background: #f59e0b;
    color: white;
}

.confidence-badge.low {
    background: #6b7280;
    color: white;
}

.diagnosis-reasoning {
    margin: 10px 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.diagnosis-factors {
    margin: 10px 0;
    font-size: 12px;
    color: #6b7280;
}

.diagnosis-factors ul {
    margin: 4px 0 0 0;
    padding-left: 20px;
}

.diagnosis-factors li {
    margin: 2px 0;
}

.diagnosis-tests {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.diagnosis-tests strong {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: #374151;
}

.test-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.diagnosis-empty {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

.differential-diagnosis-toggle {
    margin-top: 8px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #2160e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

