﻿/* ========================================
   TABLE STYLING - Isolated from shared.css
   ======================================== */

/* ========== MUDBLAZOR TABLE STRUCTURE ========== */

.mud-table {
    overflow: hidden;
    background-color: transparent;
    border-radius: 12px 12px 0px 0px;
}

.mud-toolbar.mud-table-toolbar {
    border-radius: 0;
    border-bottom: 0;
}

.mud-table-head th {
    border-radius: 0 !important;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    background-color: transparent !important;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.mud-table-striped tbody tr:nth-child(odd) {
    background-color: color-mix(in srgb, var(--md-sys-color-surface-container) 10%, transparent);
}

.mud-table-striped tbody tr:nth-child(even) {
    background-color: color-mix(in srgb, var(--md-sys-color-surface-container) 50%, transparent);
}

/* ========== SELECTED ROWS ========== */

.mud-table tbody tr.mud-selected-row {
    background-color: color-mix(in srgb, var(--md-sys-color-primary-container) 70%, transparent) !important;
    color: var(--md-sys-color-on-primary-container) !important;
}

.mud-table tbody tr.mud-selected-row:hover {
    opacity: 0.9;
}

/* ========== TABLE GROUP HEADERS ========== */

.mud-table .mud-table-row-group-header {
    height: 32px !important;
    line-height: 32px !important;
}

.mud-table .mud-table-row-group-header td,
.mud-table .mud-table-row-group-header th {
    padding: 6px 12px !important;
    vertical-align: middle !important;
    font-weight: 600 !important;
}

/* Chevron-kolonne: smal + eksplicit baggrund */
.mud-table .mud-table-row-group-header > td:first-child,
.mud-table .mud-table-row-group-header > th:first-child {
    background-color: color-mix(in srgb, var(--md-sys-color-secondary-container) 15%, var(--md-sys-color-surface-container-lowest)) !important;
    width: 24px !important;
    min-width: 24px !important;
    max-width: 48px !important;
    padding-left: 8px !important;
    padding-right: 4px !important;
}

/* Indholdskolonne: eksplicit baggrund via din egen klasse */
.mud-table-cell-custom-group {
    background-color: color-mix(in srgb, var(--md-sys-color-secondary-container) 15%, var(--md-sys-color-surface-container-lowest)) !important;
    padding: 6px 16px !important;
    position: sticky;
    top: 0 !important;
    z-index: 15 !important;
}

/*.mud-table .mud-table-row-group-header .py-2 {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}*/

/* ========== PLAN TABLE OVERRIDES ========== */

/* Ensure plan tables are readable */
.plan-table .mud-table-cell {
    vertical-align: middle;
}

/* Plan quantity input fields */
.plan-quantity-input {
    max-width: 80px;
}

/* ========== CUSTOM TABLES (Print Designer, etc.) ========== */

@media screen {
    .preview-table,
    .print-table {
        border-collapse: collapse;
        width: 100%;
        font-size: 12px;
        background-color: var(--md-sys-color-surface);
    }

        .preview-table th,
        .preview-table td,
        .print-table th,
        .print-table td {
            border: 1px solid var(--md-sys-color-outline-variant);
            padding: 8px 12px;
            color: var(--md-sys-color-on-surface);
        }

        .preview-table th,
        .print-table th {
            background-color: var(--md-sys-color-surface-container);
            font-weight: 600;
        }

        .preview-table tbody tr:hover,
        .print-table tbody tr:hover {
            background-color: var(--md-sys-color-surface-variant);
        }
}
