/* Dashboard Styles */

.dashboard-container {
    padding: 20px;
    max-width: min(1400px, 95vw);
    margin: 0 auto;
    background-color: #F9FAFB;
    min-height: 100vh;
    width: 100%;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: bold;
    color: #111827;
    margin: 0 0 2px 0;
}

.dashboard-subtitle {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Link button style */
.link-button {
    background: none;
    border: none;
    color: #2160E8;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
}

.link-button:hover {
    color: #1E4FC7;
}

.link-button:focus {
    outline: 2px solid #2160E8;
    outline-offset: 2px;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.workflow-switcher {
    display: flex;
    gap: 4px;
}

.workflow-btn {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid #E5E7EB;
    background-color: white;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.workflow-btn:hover {
    background-color: #F3F4F6;
}

.workflow-btn.active {
    background-color: #2160E8;
    color: white;
    border-color: #2160E8;
}

.btn-primary {
    padding: 10px 16px;
    background-color: #2160E8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #1E4FC7;
}

.btn-primary:focus {
    outline: 2px solid #2160E8;
    outline-offset: 2px;
}

.btn-primary:active {
    background-color: #1A3FA5;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #E5E7EB;
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.stat-card.stat-clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border-color: #D1D5DB;
}

.stat-card.stat-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #2160E8;
}


.stat-card.stat-clickable:focus {
    outline: 2px solid #2160E8;
    outline-offset: 2px;
}

.stat-card.stat-clickable:active {
    transform: translateY(0);
}

.stat-indicator {
    width: 3px;
    height: 100%;
    border-radius: 2px;
    flex-shrink: 0;
}

.stat-indicator.stat-primary {
    background-color: #2160E8;
    opacity: 0.1;
}

.stat-indicator.stat-danger {
    background-color: #DC2626;
    opacity: 0.1;
}

.stat-indicator.stat-warning {
    background-color: #F59E0B;
    opacity: 0.1;
}

.stat-indicator.stat-info {
    background-color: #3498DB;
    opacity: 0.1;
}

.stat-indicator.stat-purple {
    background-color: #9B59B6;
    opacity: 0.1;
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.stat-value.stat-primary {
    color: #2160E8;
}

.stat-value.stat-danger {
    color: #DC2626;
}

.stat-value.stat-warning {
    color: #F59E0B;
}

.stat-value.stat-info {
    color: #3498DB;
}

.stat-value.stat-purple {
    color: #9B59B6;
}

.stat-value-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-value-with-icon span:first-child {
    font-size: 20px;
}

.stat-label {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #E5E7EB;
    border-top-color: #2160E8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Filters */
.filters-section {
    margin-bottom: 24px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.filter-group {
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.filter-label {
    font-size: 11px;
    font-weight: bold;
    color: #374151;
    display: block;
    margin-bottom: 3px;
}

.filter-select {
    width: 100%;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    background: white;
    color: #111827;
}

/* Search Bar */
.search-bar {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.search-icon {
    font-size: 16px;
    color: #9CA3AF;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #111827;
}

.search-input::placeholder {
    color: #9CA3AF;
}

.search-clear {
    background: #F3F4F6;
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: #6B7280;
    font-size: 12px;
}

.search-clear:hover {
    background: #E5E7EB;
}

/* Patient List */
.patient-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.patient-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
    cursor: pointer;
}

.patient-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: #2160E8;
}

.patient-card:focus {
    outline: 2px solid #2160E8;
    outline-offset: 2px;
}

.patient-card:active {
    transform: translateY(0);
}

.patient-card-content {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.patient-info {
    flex: 1;
}

.patient-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.patient-name {
    font-size: 16px;
    font-weight: bold;
    color: #111827;
    margin: 0;
}

.patient-age {
    font-size: 13px;
    color: #6B7280;
}

.patient-sex {
    font-size: 13px;
    color: #6B7280;
}

.patient-details {
    font-size: 12px;
    color: #6B7280;
    margin: 2px 0;
}

.patient-location {
    font-size: 11px;
    color: #6B7280;
    margin-top: 4px;
}

.patient-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-badge {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.alert-badge:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.alert-badge:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.alert-badge.alert-danger {
    background-color: #DC2626;
}

.btn-action {
    padding: 6px 10px;
    background-color: #3498DB;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-action:hover {
    background-color: #2980B9;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 40px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: bold;
    color: #111827;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}
