/* ============================================
   AFRI LAND HOSPITAL - COMPONENT STYLES
   ============================================ */

/* ---------- Status Badges ---------- */
.status-badge {
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Patient Status */
.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

/* Appointment Status */
.status-badge.scheduled {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.cancelled {
    background: #fce4e4;
    color: #991b1b;
}

.status-badge['no-show'] {
    background: #fef3c7;
    color: #92400e;
}

/* Billing Status */
.status-badge.paid {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.overdue {
    background: #fce4e4;
    color: #991b1b;
}

/* Lab Status */
.status-badge.processing {
    background: #dbeafe;
    color: #1e40af;
}

/* Doctor Status */
.status-badge['on-leave'] {
    background: #fef3c7;
    color: #92400e;
}

/* Ward Status */
.status-badge.admitted {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.discharged {
    background: #f3f4f6;
    color: #6b7280;
}

/* ---------- Buttons ---------- */
.btn-primary {
    background: #0a2e4a;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary:hover {
    background: #061e30;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 46, 74, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #e2e8f0;
    color: #334155;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-success {
    background: #22c55e;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-warning:hover {
    background: #d97706;
}

/* ---------- Cards ---------- */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    color: #475569;
}

/* ---------- Form Inputs ---------- */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.form-input:focus {
    outline: none;
    border-color: #0a2e4a;
    box-shadow: 0 0 0 3px rgba(10, 46, 74, 0.1);
    background: white;
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

/* ---------- Modals ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content-large {
    max-width: 900px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ---------- Tables ---------- */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: #f8fafc;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.table tr:hover td {
    background: #f8fafc;
}

.table-striped tbody tr:nth-child(odd) {
    background: #fafbfc;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.pagination-btn.active {
    background: #0a2e4a;
    color: white;
    border-color: #0a2e4a;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.875rem;
    color: #64748b;
    margin-right: 12px;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #3b82f6;
    animation: toastSlideIn 0.3s ease-out;
    min-width: 280px;
    max-width: 450px;
    font-size: 0.875rem;
    color: #1e293b;
}

.toast-success {
    border-left-color: #22c55e;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
    margin-left: 12px;
}

/* ---------- Loading Spinner ---------- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top-color: #0a2e4a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 4px;
}

/* ---------- Empty States ---------- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
}

.empty-state-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

.empty-state-description {
    font-size: 0.875rem;
}

/* ---------- Filters Bar ---------- */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: #1e293b;
}

.filter-select:focus {
    outline: none;
    border-color: #0a2e4a;
    box-shadow: 0 0 0 3px rgba(10, 46, 74, 0.1);
}

.filter-input {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: #1e293b;
}

.filter-input:focus {
    outline: none;
    border-color: #0a2e4a;
    box-shadow: 0 0 0 3px rgba(10, 46, 74, 0.1);
}

/* ---------- Progress Bar ---------- */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar-green {
    background: #22c55e;
}

.progress-bar-yellow {
    background: #f59e0b;
}

.progress-bar-red {
    background: #ef4444;
}

/* ---------- Stats Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

/* ---------- Charts Container ---------- */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        margin: 12px;
        padding: 16px;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-wrap: wrap;
    }
    
    .toast {
        min-width: 200px;
        max-width: 90vw;
    }
    
    .stat-card {
        padding: 12px 16px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
}

/* ---------- Utility Helpers ---------- */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-4 {
    margin-bottom: 16px;
}

/* ---------- Scrollbar Styling ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ---------- Print Styles ---------- */
@media print {
    .no-print {
        display: none !important;
    }
    
    .modal {
        position: static !important;
        background: none !important;
        backdrop-filter: none !important;
    }
    
    .modal-content {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .btn,
    .modal-close,
    .pagination {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
    }
    
    .status-badge {
        border: 1px solid #e2e8f0 !important;
    }
}