/* Custom Styles für btn-light im Dark Mode */
[data-bs-theme="dark"] .btn-light {
    color: #f8f9fa; /* Helle Schrift */
    background-color: #343a40; /* Dunkelgrauer Hintergrund */
    border-color: #495057; /* Etwas hellerer Rand für Kontrast */
}

    /* Hover- und Focus-Effekte anpassen */
    [data-bs-theme="dark"] .btn-light:hover,
    [data-bs-theme="dark"] .btn-light:focus,
    [data-bs-theme="dark"] .btn-light:active {
        color: #ffffff;
        background-color: #495057; /* Leicht helleres Grau beim Hover */
        border-color: #6c757d;
        box-shadow: 0 0 0 0.15rem rgba(248, 249, 250, 0.25); /* Hellere Outline beim Fokussieren */
    }

.nav-link.disabled, .nav-link:disabled {
    color: #6f6f70 !important;
    pointer-events: none;
    cursor: default;
}

.modal-content.modal-form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
}

    .modal-content.modal-form .modal-body {
        flex: 1 1 auto;
        overflow-y: auto;
        max-height: calc(100vh - 10rem);
    }

    .modal-content.modal-form .modal-footer {
        flex-shrink: 0;
    }

.modal-form-body {
    max-height: calc(100vh - 8rem);
}

/* =================================================================
   Admin Info Dashboards
   ================================================================= */

.tf-storage-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tf-dashboard-hero {
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 8px;
    background: var(--bs-body-bg);
    box-shadow: 0 12px 28px rgba(30, 42, 58, .08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.tf-dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(14, 165, 233, .11), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, .04), transparent 42%);
    pointer-events: none;
}

.tf-dashboard-hero > * {
    position: relative;
    z-index: 1;
}

.tf-dashboard-eyebrow {
    color: var(--bs-secondary-color);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tf-dashboard-title {
    margin: .2rem 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bs-body-color);
}

.tf-dashboard-subtitle {
    color: var(--bs-secondary-color);
    font-size: .875rem;
}

.tf-dashboard-status {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tf-status-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: .4rem .7rem;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

.tf-status-pill i {
    font-size: 1rem;
}

.tf-health-good {
    color: #047857;
    background: rgba(16, 185, 129, .1);
    border-color: rgba(16, 185, 129, .26);
}

.tf-health-warn {
    color: #a16207;
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .28);
}

.tf-health-bad {
    color: #b91c1c;
    background: rgba(239, 68, 68, .1);
    border-color: rgba(239, 68, 68, .26);
}

.tf-health-muted {
    color: #475569;
    background: rgba(100, 116, 139, .1);
    border-color: rgba(100, 116, 139, .24);
}

.tf-storage-dashboard .info-box {
    min-width: 0;
}

.tf-storage-dashboard .info-box-content,
.tf-storage-dashboard .card-tools,
.tf-storage-dashboard .tf-panel-stat {
    min-width: 0;
}

.tf-storage-dashboard .info-box-number,
.tf-storage-dashboard .progress-description {
    display: block;
    max-width: 100%;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
}

.tf-storage-dashboard .info-box-number {
    font-size: 1.15rem;
}

.tf-storage-dashboard .progress-description {
    margin-top: .15rem;
}

.tf-panel-stat {
    color: var(--bs-secondary-color);
    font-size: .78rem;
    font-weight: 700;
    max-width: min(12rem, 100%);
    text-align: right;
    text-transform: uppercase;
}

.tf-panel-stat span {
    display: block;
    color: var(--bs-body-color);
    font-size: 1.1rem;
    line-height: 1.15;
    font-weight: 800;
    overflow-wrap: anywhere;
    white-space: normal;
}

.tf-panel-stat-group {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.tf-signal-list > div,
.tf-meta-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.tf-token-breakdown span,
.tf-signal-list span,
.tf-meta-list span {
    color: var(--bs-secondary-color);
    font-size: .82rem;
}

.tf-token-breakdown strong,
.tf-signal-list strong,
.tf-meta-list strong {
    color: var(--bs-body-color);
    font-weight: 800;
}

.tf-token-total {
    color: var(--bs-body-color);
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 800;
}

.tf-token-caption {
    color: var(--bs-secondary-color);
    font-size: .82rem;
}

.tf-token-breakdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.tf-token-breakdown > div,
.tf-signal-list > div,
.tf-meta-list > div {
    padding: .7rem .75rem;
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: 8px;
    background: var(--bs-tertiary-bg);
}

.tf-token-breakdown > div {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.tf-token-breakdown strong {
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.tf-token-breakdown small {
    color: var(--bs-secondary-color);
    display: inline-flex;
    font-weight: 700;
    max-width: 100%;
}

.tf-signal-list {
    display: grid;
    gap: .6rem;
}

.tf-health-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.tf-health-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem;
    border-radius: 8px;
    border: 1px solid currentColor;
}

.tf-health-item i {
    font-size: 1.3rem;
    flex: 0 0 auto;
}

.tf-health-item span {
    display: block;
    font-size: .75rem;
    color: var(--bs-secondary-color);
}

.tf-health-item strong {
    display: block;
    color: var(--bs-body-color);
    font-size: .95rem;
}

.tf-meta-list {
    display: grid;
    gap: .6rem;
}

.tf-meta-list code {
    color: var(--bs-body-color);
    white-space: normal;
    word-break: break-all;
    text-align: right;
    background: transparent;
    padding: 0;
}

.tf-empty-state {
    display: flex;
    align-items: center;
    gap: .8rem;
    border: 1px dashed rgba(100, 116, 139, .35);
    border-radius: 8px;
    background: var(--bs-tertiary-bg);
    padding: 1rem;
}

.tf-empty-state i {
    color: #0ea5e9;
    font-size: 1.6rem;
}

.tf-empty-state strong,
.tf-empty-state span {
    display: block;
}

.tf-empty-state strong {
    color: var(--bs-body-color);
}

.tf-empty-state span {
    color: var(--bs-secondary-color);
    font-size: .88rem;
}

.tf-usage-table {
    --bs-table-bg: transparent;
}

.tf-usage-table thead th {
    color: var(--bs-secondary-color);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    border-bottom-color: var(--bs-border-color);
}

.tf-usage-table tbody td {
    border-bottom-color: var(--bs-border-color-translucent);
    color: var(--bs-body-color);
    font-size: .88rem;
}

.tf-user-usage-cell {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 14rem;
}

.tf-user-usage-avatar {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #0ea5e9);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .14);
}

.tf-apex-chart {
    min-height: 260px;
}

.tf-apex-chart-sm {
    min-height: 220px;
}

.tf-apex-chart-lg {
    min-height: 300px;
}

@media (max-width: 767.98px) {
    .tf-dashboard-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .tf-dashboard-status {
        justify-content: flex-start;
    }

    .tf-health-grid {
        grid-template-columns: 1fr;
    }

    .tf-token-breakdown {
        grid-template-columns: 1fr;
    }
}

/* Markdown Preview */
.markdown-body { font-size: .9375rem; line-height: 1.7; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 { margin-top: 1.25rem; margin-bottom: .5rem; font-weight: 600; }
.markdown-body h1 { font-size: 1.6rem; border-bottom: 1px solid #dee2e6; padding-bottom: .3rem; }
.markdown-body h2 { font-size: 1.35rem; border-bottom: 1px solid #dee2e6; padding-bottom: .2rem; }
.markdown-body p  { margin-bottom: .75rem; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5rem; margin-bottom: .75rem; }
.markdown-body pre { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: .375rem; padding: 1rem; overflow-x: auto; }
.markdown-body code { background: #f8f9fa; border-radius: .25rem; padding: .15em .35em; font-size: .875em; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote { border-left: 4px solid #dee2e6; padding: .5rem 1rem; color: #6c757d; margin-bottom: .75rem; }
.markdown-body table { width: 100%; border-collapse: collapse; margin-bottom: .75rem; }
.markdown-body th, .markdown-body td { border: 1px solid #dee2e6; padding: .4rem .75rem; }
.markdown-body th { background: #f8f9fa; font-weight: 600; }
.markdown-body hr { border-top: 1px solid #dee2e6; margin: 1rem 0; }
