* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-nav {
    display: flex;
    gap: 1rem;
}

.main-nav a {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #666;
    border-radius: 5px;
    transition: all 0.3s;
}

.main-nav a:hover, .main-nav a.active {
    background: #667eea;
    color: white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.dashboard-header {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-header h1 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 5px solid;
}

.stat-card.emergency { border-color: #e74c3c; }
.stat-card.medium { border-color: #f39c12; }
.stat-card.low { border-color: #27ae60; }
.stat-card.total { border-color: #3498db; }

.stat-icon {
    font-size: 3rem;
    opacity: 0.7;
}

.stat-card.emergency .stat-icon { color: #e74c3c; }
.stat-card.medium .stat-icon { color: #f39c12; }
.stat-card.low .stat-icon { color: #27ae60; }
.stat-card.total .stat-icon { color: #3498db; }

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.ai-performance {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.ai-performance h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.performance-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.performance-item h3 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-info {
    background: #3498db;
    color: white;
}

.btn-large {
    flex: 1;
    justify-content: center;
    padding: 1.5rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.recent-cases {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.recent-cases h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #667eea;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-emergency {
    background: #ffebee;
    color: #e74c3c;
}

.badge-medium {
    background: #fff3e0;
    color: #f39c12;
}

.badge-low {
    background: #e8f5e9;
    color: #27ae60;
}

.patient-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h2 {
    color: #667eea;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #999;
    font-size: 0.85rem;
}

.required {
    color: #e74c3c;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.page-header {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    color: #667eea;
}

.urgency-banner {
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border-left: 5px solid;
    color: white;
    font-weight: bold;
}

.urgency-emergency {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
}

.urgency-medium {
    background: linear-gradient(135deg, #f39c12, #d68910);
    border-color: #f39c12;
}

.urgency-low {
    background: linear-gradient(135deg, #27ae60, #229954);
    border-color: #27ae60;
}

.urgency-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.urgency-content i {
    font-size: 3rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.details-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.details-section h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-table {
    width: 100%;
}

.info-table tr {
    border-bottom: 1px solid #ecf0f1;
}

.info-table th {
    padding: 0.75rem 0;
    text-align: left;
    color: #666;
    font-weight: 600;
    width: 40%;
}

.info-table td {
    padding: 0.75rem 0;
}

.risk-factors-list {
    list-style: none;
    padding: 0;
}

.risk-factors-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #fff3e0;
    border-left: 4px solid #f39c12;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.risk-factors-list i {
    color: #f39c12;
}

.clinical-info .info-item {
    margin-bottom: 1.5rem;
}

.clinical-info .info-item:last-child {
    margin-bottom: 0;
}

.clinical-info strong {
    display: block;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.referral-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2rem;
    border-radius: 10px;
}

.referral-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.referral-card .center-level {
    opacity: 0.9;
    margin-bottom: 1rem;
}

.referral-card p {
    margin-bottom: 0.5rem;
}

.specialties {
    margin-top: 1rem;
}

.specialty-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin: 0.25rem;
    font-size: 0.85rem;
}

.ai-support-box {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.ai-support-box pre {
    white-space: pre-wrap;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
}

.feedback-section p {
    margin-bottom: 1rem;
}

.feedback-buttons {
    display: flex;
    gap: 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.alert i {
    font-size: 1.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-header h1 {
    margin-bottom: 0.5rem;
}

.login-form {
    padding: 2rem;
}

.login-footer {
    padding: 1.5rem;
    background: #f8f9fa;
    text-align: center;
    font-size: 0.9rem;
}

.text-muted {
    color: #999;
}

.main-footer {
    background: white;
    margin-top: 3rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.footer-content p {
    margin: 0.5rem 0;
    color: #666;
}

@media print {
    .main-header, .main-footer, .action-buttons, .feedback-section {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .main-nav a {
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}
