/* ============================================================
   Trelity Automations portal - UI kit
   Loaded after MudBlazor.min.css from index.html.
   ============================================================ */

:root {
    --tr-navy: #00183c;
    --tr-blue: #234692;
    --tr-lime: #d9e73b;
    --tr-tint: #f6f9ec;
    --tr-line: rgba(0, 24, 60, 0.14);
    --tr-line-strong: rgba(0, 24, 60, 0.26);
    --tr-muted: rgba(0, 24, 60, 0.56);
}

/* --- muted body text (theme Secondary is a strong blue, wrong for captions) --- */
.tr-dim {
    color: var(--tr-muted) !important;
}

.tr-eyebrow {
    display: block;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .68rem;
    font-weight: 600;
    color: var(--tr-muted);
}

.tr-head {
    border-bottom: 1px solid var(--tr-line);
    padding-bottom: 16px;
}

/* --- cards --- */
.tr-card {
    border: 1px solid var(--tr-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 24, 60, .05);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tr-card--interactive {
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

    .tr-card--interactive:hover {
        border-color: var(--tr-line-strong);
        box-shadow: 0 12px 26px -16px rgba(0, 24, 60, .5);
        transform: translateY(-2px);
    }

.tr-card__body {
    padding: 18px;
    flex: 1 1 auto;
}

.tr-card__foot {
    margin-top: auto;
    padding: 6px 10px;
    border-top: 1px solid var(--tr-line);
    background: var(--tr-tint);
}

.tr-accent {
    height: 4px;
    width: 100%;
    flex: 0 0 auto;
    background: linear-gradient(90deg, var(--tr-navy), var(--tr-blue) 55%, var(--tr-lime));
}

/* --- sections --- */
.tr-section {
    border: 1px solid var(--tr-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 24, 60, .05);
    overflow: hidden;
}

.tr-section__bar {
    padding: 14px 18px;
    border-bottom: 1px solid var(--tr-line);
    background: var(--tr-tint);
}

.tr-section__body {
    padding: 4px;
}

/* --- label / value rows inside cards --- */
.tr-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 26px;
}

.tr-row__ico {
    color: var(--tr-muted);
}

.tr-row__label {
    color: var(--tr-muted);
    font-size: .8rem;
}

.tr-row__value {
    margin-left: auto;
    text-align: right;
    font-size: .85rem;
    font-weight: 600;
}

.tr-row__value--warn {
    color: var(--mud-palette-warning);
}

/* --- tables --- */
.tr-table th,
.tr-table .mud-table-head th {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .68rem !important;
    font-weight: 600;
    color: var(--tr-muted) !important;
    white-space: nowrap;
}

.tr-table .mud-table-row:hover .tr-row-actions {
    opacity: 1;
}

.tr-row-actions {
    opacity: .5;
    transition: opacity .15s ease;
    white-space: nowrap;
}

.tr-group-row {
    background: var(--tr-tint) !important;
}

.tr-key {
    display: inline-block;
    font-family: 'Cascadia Mono', Consolas, ui-monospace, monospace;
    font-size: .74rem;
    color: var(--tr-blue);
    background: var(--tr-tint);
    border: 1px solid var(--tr-line);
    border-radius: 6px;
    padding: 1px 6px;
    white-space: nowrap;
}

/* --- access matrix --- */
.tr-matrix {
    overflow: auto;
    max-height: calc(100vh - 320px);
}

    .tr-matrix table {
        border-collapse: separate;
        border-spacing: 0;
        width: 100%;
    }

    .tr-matrix thead th {
        position: sticky;
        top: 0;
        z-index: 3;
        background: #fff;
        border-bottom: 1px solid var(--tr-line-strong) !important;
        padding: 12px 10px !important;
        vertical-align: bottom;
    }

    .tr-matrix tbody td {
        border-bottom: 1px solid var(--tr-line);
    }

    .tr-matrix th:first-child,
    .tr-matrix td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #fff;
        min-width: 250px;
        box-shadow: 1px 0 0 var(--tr-line);
    }

    .tr-matrix thead th:first-child {
        z-index: 4;
    }

    .tr-matrix tr.tr-matrix__group td,
    .tr-matrix tr.tr-matrix__group td:first-child {
        background: var(--tr-tint);
        padding: 6px 12px !important;
    }

    .tr-matrix tbody tr:not(.tr-matrix__group):hover td,
    .tr-matrix tbody tr:not(.tr-matrix__group):hover td:first-child {
        background: #fbfcf5;
    }

.tr-matrix__col {
    min-width: 158px;
    text-align: center;
}

/* --- deployment layout tree --- */
.tr-tree {
    border: 1px solid var(--tr-line);
    border-radius: 12px;
    background: #fcfdf8;
    padding: 10px;
}

.tr-node {
    border-left: 2px solid var(--tr-line);
    padding-left: 14px;
    margin-left: 14px;
}

.tr-node__row {
    border: 1px solid var(--tr-line);
    border-radius: 10px;
    padding: 6px 8px 6px 12px;
    background: #fff;
    transition: border-color .15s ease, background .15s ease;
}

    .tr-node__row:hover {
        border-color: var(--tr-line-strong);
        background: #fcfdf7;
    }

    .tr-node__row:hover .tr-row-actions {
        opacity: 1;
    }

.tr-node__row--root {
    background: var(--tr-tint);
    border-color: var(--tr-line-strong);
}

.tr-node__text {
    flex: 1 1 auto;
    min-width: 0;
}

.tr-node__name {
    display: block;
    font-size: .88rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-node__meta {
    display: block;
    font-size: .72rem;
    color: var(--tr-muted);
}

/* --- upload dropzone --- */
.tr-drop {
    position: relative;
    border: 2px dashed var(--tr-line-strong);
    border-radius: 16px;
    background: var(--tr-tint);
    padding: 26px 16px;
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
}

    .tr-drop:hover {
        border-color: var(--tr-blue);
        background: #fbfdf2;
    }

.tr-drop--ready {
    border-style: solid;
    border-color: var(--tr-blue);
    background: #fff;
}

/* --- misc --- */
.tr-mono textarea {
    font-family: 'Cascadia Mono', Consolas, ui-monospace, monospace !important;
    font-size: .8rem !important;
    line-height: 1.45 !important;
}

.tr-dialog-scroll {
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 6px;
}
