/* =========================================================
   DataToCare - md-data-table overrides
   ========================================================= */

/* ---------- Page/Table wrapper ---------- */
md-table-container,
md-table-pagination,
table.md-table {
    background: transparent;
}

/* Optional reusable card wrapper around table */
.table-card,
md-card.table-card,
md-card.md-table-card {
    background: #ffffff;
    border: 1px solid #e6ebf2;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
    overflow: hidden;
}

/* If your table is directly inside a generic md-card */
md-card table.md-table,
md-card md-table-container,
md-card md-table-pagination {
    background: transparent;
}

/* ---------- Table ---------- */
table.md-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
}

/* Header row */
table.md-table thead.md-head > tr.md-row,
table.md-table thead > tr.md-row {
    background: #fbfcfe;
}

/* Header cells */
table.md-table th.md-column,
table.md-table thead th,
md-table-container table.md-table th.md-column {
    color: #667085 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.1px;
    line-height: 1.3;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #e6ebf2 !important;
    background: #fbfcfe;
    vertical-align: middle;
    white-space: nowrap;
}

/* Body rows */
table.md-table tbody.md-body > tr.md-row,
table.md-table tbody > tr.md-row,
md-table-container table.md-table tbody.md-body > tr.md-row {
    min-height: 60px;
    background: #ffffff;
    transition: background-color 0.15s ease;
}

/* Zebra */
table.md-table tbody.md-body > tr.md-row:nth-child(even),
table.md-table tbody > tr.md-row:nth-child(even) {
    background: #fcfdff;
}

/* Hover */
table.md-table tbody.md-body > tr.md-row:hover,
table.md-table tbody > tr.md-row:hover {
    background: #f5f9ff !important;
}

/* Body cells */
table.md-table td.md-cell,
table.md-table tbody td,
md-table-container table.md-table td.md-cell {
    color: #344054 !important;
    font-size: 14px !important;
    font-weight: 400;
    line-height: 1.4;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #eef2f6 !important;
    vertical-align: middle;
    background: transparent;
}

/* Remove last border if wanted */
table.md-table tbody.md-body > tr.md-row:last-child td.md-cell,
table.md-table tbody > tr.md-row:last-child td {
    border-bottom: 0 !important;
}

/* Sorted / active column */
table.md-table th.md-column.md-active,
table.md-table td.md-cell.md-active,
table.md-table th.md-column.active,
table.md-table td.md-cell.active {
    color: #101828 !important;
}

/* Sort icon */
table.md-table th.md-column md-icon,
table.md-table th.md-column i,
table.md-table th.md-column .material-icons {
    color: #667085 !important;
    opacity: 0.9;
}

/* ---------- Better text hierarchy helpers ----------
   You can use these classes inside your td if needed */
.cell-primary {
    color: #101828 !important;
    font-weight: 600 !important;
}

.cell-secondary {
    color: #667085 !important;
    font-weight: 400 !important;
}

.cell-muted {
    color: #98a2b3 !important;
}

.cell-diagnosis {
    line-height: 1.35;
}

/* ---------- Result / status helpers ---------- */
.result-positive,
.text-positive {
    color: #d92d20 !important;
    font-weight: 600 !important;
}

.result-negative,
.text-negative {
    color: #067647 !important;
    font-weight: 600 !important;
}

.result-warning,
.text-warning {
    color: #b54708 !important;
    font-weight: 600 !important;
}

/* ---------- Pagination ---------- */
md-table-pagination,
.md-table-pagination {
    background: #ffffff !important;
    color: #667085 !important;
    border-top: 1px solid #e6ebf2 !important;
    min-height: 56px;
}

md-table-pagination .md-select-value,
md-table-pagination .md-button,
md-table-pagination .label,
md-table-pagination span,
md-table-pagination div,
.md-table-pagination .md-select-value,
.md-table-pagination .md-button,
.md-table-pagination span,
.md-table-pagination div {
    color: #667085 !important;
    font-size: 13px;
}

md-table-pagination md-icon,
md-table-pagination i,
md-table-pagination .material-icons,
.md-table-pagination md-icon,
.md-table-pagination i,
.md-table-pagination .material-icons {
    color: #667085 !important;
    opacity: 0.9;
}

/* Hover on pagination buttons */
md-table-pagination .md-button:hover,
.md-table-pagination .md-button:hover {
    background: #f5f9ff !important;
    border-radius: 8px;
}

/* ---------- Checkbox / selection cleanup ---------- */
table.md-table td.md-cell md-checkbox,
table.md-table th.md-column md-checkbox {
    margin: 0;
}

/* ---------- Dense columns alignment helpers ----------
   Add classes to td/th if needed */
.col-center {
    text-align: center !important;
}

.col-right {
    text-align: right !important;
}

.col-date,
.col-number {
    white-space: nowrap;
}

.col-patient {
    color: #101828 !important;
    font-weight: 600 !important;
}

/* ---------- Toolbar/actions above table ----------
   Useful for export/search icons row */
.table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-actions .material-icons,
.table-actions md-icon {
    color: #667085 !important;
}

.table-actions .md-button:hover{
    background: #f5f9ff !important;
    border-radius: 8px;
}

/* ---------- Empty states / no data ---------- */
.table-empty{
    color: #98a2b3;
    text-align: center;
    padding: 32px 16px;
    font-size: 14px;
}

/* ---------- Rounded corners for first/last header cells ---------- */
table.md-table thead.md-head > tr.md-row th.md-column:first-child,
table.md-table thead > tr.md-row th:first-child {
    border-top-left-radius: 14px;
}

table.md-table thead.md-head > tr.md-row th.md-column:last-child,
table.md-table thead > tr.md-row th:last-child {
    border-top-right-radius: 14px;
}

/* ---------- Make Angular Material default shadows less aggressive if applied ---------- */
md-table-container,
md-table-pagination,
table.md-table,
table.md-table th.md-column,
table.md-table td.md-cell {
    box-shadow: none !important;
}

/* ---------- Optional: smoother font rendering ---------- */
table.md-table,
md-table-container,
md-table-pagination {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Mobile / smaller screens ---------- */
@media (max-width: 1024px) {
    table.md-table th.md-column,
    table.md-table td.md-cell {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }

    md-table-pagination,
    .md-table-pagination {
        min-height: 52px;
    }
}

@media (max-width: 768px) {
    .table-card,
    md-card.table-card,
    md-card.md-table-card {
        border-radius: 10px;
    }

    table.md-table th.md-column,
    table.md-table td.md-cell {
        font-size: 13px !important;
    }
}


/* Keep md-data-table loading progress as a thin strip.
   Our broader thead/th styles add padding to the progress <th>, which inflates
   the row unless we collapse the whole progress header group explicitly. */
table.md-table thead.md-table-progress,
table.md-table thead.md-table-progress > tr,
table.md-table thead.md-table-progress > tr > th {
    height: 0px !important;
    min-height: 0px !important;
    max-height: 0px !important;
}

table.md-table thead.md-table-progress > tr > th {
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    border: 0 !important;
    background: transparent !important;
}