/* ═══════════════════════════════════════
   utilities.css — Shared Page Patterns
   ═══════════════════════════════════════ */

/* ── همهٔ فیلدهای عددی بدون دکمهٔ افزایش/کاهش ── */
.mud-input-numeric-spin,
.mud-input-numeric-spin-buttons {
    display: none !important;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin: 0 12px 16px 12px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .header-title h1 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        color: #1e293b;
        line-height: 1.3;
    }

    .header-title .subtitle {
        margin: 2px 0 0 0;
        font-size: 12px;
        color: #64748b;
    }

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

    .header-actions .mud-button {
        font-weight: 700 !important;
        min-height: 40px;
        padding-top: 7px !important;
        padding-bottom: 7px !important;
    }

/* ── Section Header ── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 16px;
    background: #f0f4f8;
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
}

    .section-header .section-title {
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .section-header .section-title h3 {
            margin: 0;
            font-weight: 600;
            font-size: 15px;
            color: #1e293b;
        }

.section-subtitle {
    font-size: 11px !important;
    color: #94a3b8 !important;
}

/* ── Filters Section ── */
.filters-section {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 16px 20px;
    margin: 0 12px 16px 12px;
}

.filters-container {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* ── Search Field Wrapper ── */
.search-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.search-label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    text-align: right;
    display: block;
}

.search-field {
    width: 100%;
}

/* ── Field Wrapper ── */
.field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

.field-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #424242;
    padding-right: 2px;
    user-select: none;
    text-align: right;
    display: block;
}

    .field-label.required::after {
        content: " *";
        color: #d32f2f;
        font-weight: bold;
    }

/* ── Patient Name Cell ── */
.patient-name {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

/* ── Patient Avatar ── */
.patient-avatar {
    background: #1f6392 !important;
    color: white !important;
    width: 26px !important;
    height: 26px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    flex-shrink: 0;
}

/* ── Validation Error ── */
.validation-error {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef2f2;
    color: #dc2626;
    border-right: 4px solid #dc2626;
}

/* ── Search Field Width Variants ── */
.search-field-wrapper-md {
    max-width: 450px;
}

.search-field-wrapper-sm {
    max-width: 250px;
}

/* ── Report Filter Label ── */
.filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 150px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
    display: block;
}

/* ── Table Info (used in section-header right side) ── */
.table-info {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Chip List (diagnoses, tags) ── */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.chip-sm {
    font-size: 10px !important;
}

/* ── Gender Cell inline flex ── */
.gender-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Filter Button (last item in filters-container) ── */
.filter-button .mud-button-root {
    height: 38px;
    min-height: 38px;
    width: 100%;
    margin-top: 20px;
}

/* ── Chart Title Text span (inside section-title in chart header) ── */
.chart-title-text {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}

/* ── Page header + actions — mobile layout ── */
@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 14px;
        margin: 0 8px 12px 8px;
        border-radius: 12px;
    }
    .header-title h1 { font-size: 15px; }
    .header-title .subtitle { font-size: 11px; }
    .header-actions {
        width: 100%;
        gap: 6px;
    }
    .header-actions .mud-button-root {
        flex: 1;
        min-width: 0 !important;
        justify-content: center;
    }
}

/* ── Slide Animation ── */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
