/* ================================
   ARCHIVE PAGE - MEDICAL UI
   ================================ */

/* Global Overrides for Hospital Theme */
.btn-primary {
    background-color: #f3f4f6;
    /* Light Gray (Gray-100) */
    color: #1f2937;
    /* Dark Gray Text */
    border: 1px solid #e5e7eb;
}

.btn-primary:hover {
    background-color: #e5e7eb;
    /* Gray-200 */
    border-color: #d1d5db;
}

/* Logo Alignment */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon svg {
    display: block;
}


/* Statistics Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    color: var(--text);
    padding: 24px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.stat-icon {
    font-size: 28px;
    color: var(--primary);
    background: var(--primary-light);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text);
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

/* Search and Filters */
.search-filters-container {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.search-bar {
    position: relative;
    margin-bottom: 16px;
}

.search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter);
    width: 20px;
    height: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--surface);
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: var(--text-light);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Modern Record Cards */
.records-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.record-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.record-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.record-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.patient-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #9ca3af;
    /* Light Gray (Gray-400) */
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}

.record-header-content {
    flex: 1;
    min-width: 0;
}

.record-header h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-date {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.relative-time {
    font-size: 11px;
    color: var(--text-lighter);
    margin-top: 2px;
}

.record-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    flex: 1;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.info-label {
    font-weight: 600;
    color: var(--text-lighter);
    min-width: 36px;
    font-size: 11px;
    text-transform: uppercase;
}

.record-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    margin-top: auto;
}

.record-actions .btn-sm {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    cursor: pointer;
}

.btn-sm.btn-secondary {
    background: var(--surface);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-sm.btn-secondary:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--text-light);
}

.btn-sm.btn-danger {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fee2e2;
}

.btn-sm.btn-danger:hover {
    background: #fee2e2;
    border-color: var(--danger);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 24px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 24px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-filters-container {
        padding: 16px;
    }

    .filters {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
        gap: 12px;
    }

    .filter-select,
    .filters .btn {
        width: 100%;
    }

    .records-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .record-card {
        padding: 16px;
    }

    .record-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .patient-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .stats-dashboard {
        grid-template-columns: 1fr;
    }
}