.dl-page {
    gap: 20px;
}

.dl-hero.tat-hero {
    gap: 18px;
    padding: 22px 26px;
}

.dl-hero-top {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.dl-hero-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

    .dl-hero-icon .mud-icon-root {
        color: #fff;
        font-size: 1.75rem;
    }

.dl-hero-heading {
    flex: 1 1 260px;
    min-width: 0;
}

.dl-hero-title {
    margin: 0;
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.15;
}

.dl-hero-subtitle {
    margin: 6px 0 0 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

.dl-hero-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 128px;
    padding: 10px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
}

.dl-hero-total-value {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.dl-hero-total-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.dl-hero-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.dl-hero-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dl-hero-link,
.dl-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.dl-hero-link {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
}

    .dl-hero-link:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
        transform: translateY(-1px);
    }

    .dl-hero-link .mud-icon-root,
    .dl-hero-cta .mud-icon-root {
        color: inherit;
        font-size: 1.05rem;
    }

.dl-hero-link--active,
.dl-hero-link--active:hover {
    background: #fff;
    border-color: #fff;
    color: var(--cdna-band-dark, #0c1524);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transform: none;
}

.dl-hero-cta {
    border: 1px solid #16a34a;
    background: #16a34a;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

    .dl-hero-cta:hover {
        background: #15803d;
        border-color: #15803d;
        color: #fff;
        transform: translateY(-1px);
    }

.dl-tabs.tat-tabs > .mud-tabs-panels {
    display: none;
}

.dl-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .dl-tab .dl-tab-icon.mud-icon-root {
        font-size: 1.1rem;
    }

.dl-tab-count {
    display: inline-block;
    min-width: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--primary-bg-color);
    color: var(--secondary-text-color);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.dl-tab-count--empty {
    opacity: 0.6;
}

.mud-tab-active .dl-tab-count {
    border-color: transparent;
    background: var(--cdna-header-band);
    color: #fff;
    opacity: 1;
}

.dark-mode .dl-tab-count {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.dark-mode .mud-tab-active .dl-tab-count {
    border-color: transparent;
    background: color-mix(in srgb, var(--cdna-band-light, #ffffff) 35%, transparent);
    color: #fff;
}

.dl-card.tat-card {
    padding: 0;
}

.dl-card .mud-table {
    background: transparent;
    color: var(--primary-text-color);
}

.dl-card .mud-table-toolbar.mud-toolbar {
    height: auto;
    min-height: 0;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 20px;
}

.dl-search {
    flex: 1 1 280px;
    max-width: 440px;
}

    .dl-search.mud-input-control {
        margin-top: 0;
    }

    .dl-search .mud-input.mud-input-outlined {
        background: var(--primary-bg-color);
        border-radius: 10px;
        font-size: 14px;
    }

        .dl-search .mud-input.mud-input-outlined .mud-input-outlined-border {
            border-color: var(--border-color);
            border-radius: 10px;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }

        .dl-search .mud-input.mud-input-outlined:not(.mud-disabled):not(:focus-within):hover .mud-input-outlined-border {
            border-color: #b9c0cc;
        }

        .dl-search .mud-input.mud-input-outlined:focus-within > .mud-input-outlined-border {
            border-width: 1px;
            border-color: var(--tenant-colour-primary);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--tenant-colour-primary) 18%, transparent);
        }

.dark-mode .dl-search .mud-input.mud-input-outlined {
    background: rgba(255, 255, 255, 0.03);
}

    .dark-mode .dl-search .mud-input.mud-input-outlined:not(.mud-disabled):not(:focus-within):hover .mud-input-outlined-border {
        border-color: rgba(255, 255, 255, 0.3);
    }

.dl-table .mud-table-head .mud-table-cell {
    padding: 12px 16px;
    background: var(--primary-bg-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    color: var(--secondary-text-color);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

    .dl-table .mud-table-head .mud-table-cell .mud-table-sort-label {
        color: inherit;
    }

.dl-table .mud-table-body .mud-table-cell {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    vertical-align: middle;
}

.dl-table .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: none;
}

.dl-table .mud-table-head .mud-table-cell:first-child,
.dl-table .mud-table-body .mud-table-cell:first-child {
    padding-left: 20px;
}

.dl-table .mud-table-head .mud-table-cell:last-child,
.dl-table .mud-table-body .mud-table-cell:last-child {
    padding-right: 20px;
}

.dl-table.mud-table-hover .mud-table-container .mud-table-root .mud-table-body .mud-table-row:hover {
    background-color: color-mix(in srgb, var(--tenant-colour-primary) 4%, transparent);
}

.dl-row--clickable {
    cursor: pointer;
}

.dl-table .mud-table-pagination {
    border-top: 1px solid var(--border-color);
}

.dark-mode .dl-table .mud-table-head .mud-table-cell {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .dl-table .mud-table-body .mud-table-cell,
.dark-mode .dl-table .mud-table-pagination {
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .dl-table.mud-table-hover .mud-table-container .mud-table-root .mud-table-body .mud-table-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.dl-player {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.dl-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cdna-header-band);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.dl-player-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dl-player-name {
    font-weight: 600;
    color: var(--primary-text-color);
}

.dl-player-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.dl-tag {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 18px;
    white-space: nowrap;
}

.dl-tag--draft {
    color: #a16207;
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.4);
}

.dl-tag--hot {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.35);
}

.dl-tag--archived {
    color: var(--secondary-text-color);
    background: var(--primary-bg-color);
    border-color: var(--border-color);
}

/* Matches the editor's Terminated badge (TransactionDocsPanel .tdp-badge-terminated). */
.dl-tag--terminated {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

.dark-mode .dl-tag--draft {
    color: #fde047;
}

.dark-mode .dl-tag--terminated {
    color: #fca5a5;
}

.dark-mode .dl-tag--hot {
    color: #93c5fd;
}

.dark-mode .dl-tag--archived {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.dl-muted {
    color: var(--secondary-text-color);
}

.dl-nowrap {
    white-space: nowrap;
}

.dl-position {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--primary-bg-color);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.dark-mode .dl-position {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.dl-date-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    white-space: nowrap;
}

.dl-date-sub {
    color: var(--secondary-text-color);
    font-size: 0.75rem;
}

.dl-due {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
}

.dl-due--neutral {
    color: var(--secondary-text-color);
    font-weight: 500;
}

.dl-due--warning,
.dl-due--danger {
    padding: 0 8px;
    border-radius: 999px;
    line-height: 18px;
}

.dl-due--warning {
    color: #a16207;
    background: rgba(234, 179, 8, 0.14);
}

.dl-due--danger {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
}

.dark-mode .dl-due--warning {
    color: #fde047;
}

.dark-mode .dl-due--danger {
    color: #fca5a5;
}

.dl-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 130px;
}

.dl-progress-track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
}

.dl-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cdna-band-stops));
    transition: width 0.3s ease;
}

.dl-progress--complete .dl-progress-fill {
    background: #22c55e;
}

.dl-progress-value {
    min-width: 36px;
    color: var(--secondary-text-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dark-mode .dl-progress-track {
    background: rgba(255, 255, 255, 0.1);
}

.dark-mode .dl-progress-fill {
    background: linear-gradient(90deg, var(--cdna-band-light, #ffffff), color-mix(in srgb, var(--cdna-band-light, #ffffff) 55%, #ffffff));
}

.dl-reason {
    display: -webkit-box;
    max-width: 340px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dl-actions-cell {
    width: 56px;
    text-align: right;
}

.dl-open-btn.mud-icon-button {
    width: 34px;
    height: 34px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--secondary-text-color);
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

    .dl-open-btn.mud-icon-button:hover,
    .dl-row--clickable:hover .dl-open-btn.mud-icon-button {
        color: var(--primary-text-color);
        border-color: #b9c0cc;
        background: var(--secondary-bg-color);
    }

.dark-mode .dl-open-btn.mud-icon-button {
    border-color: rgba(255, 255, 255, 0.14);
}

    .dark-mode .dl-open-btn.mud-icon-button:hover,
    .dark-mode .dl-row--clickable:hover .dl-open-btn.mud-icon-button {
        border-color: rgba(255, 255, 255, 0.3);
        background: rgba(255, 255, 255, 0.06);
    }

.dl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 48px 20px;
    color: var(--secondary-text-color);
    font-size: 0.875rem;
    text-align: center;
}

    .dl-empty .mud-icon-root {
        font-size: 2.25rem;
        opacity: 0.6;
        margin-bottom: 4px;
    }

.dl-empty-title {
    color: var(--primary-text-color);
    font-size: 1rem;
    font-weight: 700;
}

.dl-skeleton-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 48px;
    padding: 0 20px;
    background: var(--secondary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.dark-mode .dl-skeleton-tabs {
    border-color: rgba(255, 255, 255, 0.12);
}

.dl-skeleton-card.tat-card {
    padding: 20px;
}

.dl-skeleton-rows {
    padding: 8px 20px;
}

.dl-skeleton-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
}

.dl-templates-table .dl-group-row .mud-table-cell {
    padding-top: 14px;
    padding-bottom: 14px;
    background: color-mix(in srgb, var(--primary-bg-color) 70%, transparent);
    border-bottom: 1px solid var(--border-color);
}

.dark-mode .dl-templates-table .dl-group-row .mud-table-cell {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

.dl-group-title {
    margin-right: 8px;
    color: var(--primary-text-color);
    font-size: 0.875rem;
    font-weight: 700;
}

.dl-template {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dl-template-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--primary-bg-color);
}

    .dl-template-icon .mud-icon-root {
        color: var(--secondary-text-color);
    }

.dark-mode .dl-template-icon {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.dl-template-name.mud-link {
    color: var(--primary-text-color);
    font-weight: 600;
}

    .dl-template-name.mud-link:hover {
        color: var(--tenant-colour-primary);
    }

.dark-mode .dl-template-name.mud-link:hover {
    color: color-mix(in srgb, var(--cdna-band-light, #ffffff) 60%, #ffffff);
}

.dl-archived-switch .mud-typography {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

@media (max-width: 640px) {
    .dl-hero.tat-hero {
        padding: 18px;
    }

    .dl-hero-title {
        font-size: 1.4rem;
    }

    .dl-hero-total {
        align-items: flex-start;
    }

    .dl-card .mud-table-toolbar.mud-toolbar {
        padding: 14px 16px;
    }
}
