﻿/* ================================
   FWportal Admin Styles (scoped)
   ================================ */

.admin-page {
    /* Corporate colors */
    --color-primary: #232d37; /* dunkelblau (Primärfarbe) */
    --color-primary-600: #3c4b5a; /* graublau (Hover/Focus) */
    --color-accent: #fa1e78; /* pink (Akzent, optional) */
    --color-highlight: #ffff00; /* gelb (optional) */

    --color-text: #232d37;
    --color-bg: #ffffff;
    /* Surfaces & borders */
    --surface-border: rgba(35, 45, 55, 0.08);
    --surface-border-hover: rgba(35, 45, 55, 0.16);
    --shadow-sm: 0 2px 6px rgba(0,0,0,.04);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
}

    /* =========
   Page head
   ========= */
    .admin-page .admin-header {
        margin-bottom: 1.25rem;
    }

    .admin-page .admin-title {
        display: flex;
        align-items: center;
        gap: .75rem;
        flex-wrap: wrap;
        color: var(--color-primary);
        margin: 0;
    }

        .admin-page .admin-title .logo {
            height: 36px;
            width: auto;
        }

        .admin-page .admin-title .muted {
            opacity: .7;
            font-weight: 400;
        }

    .admin-page .version-badge {
        font-size: .875rem;
        padding: .2rem .5rem;
        border-radius: .5rem;
        background: rgba(35,45,55,.06);
        color: var(--color-primary);
    }

    /* =====
   Grid
   ===== */
    .admin-page .admin-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1rem;
    }

    /* =====
   Card  (now fully clickable)
   ===== */
    .admin-page .admin-card {
        position: relative;
        background: var(--color-bg);
        border: 1px solid var(--surface-border);
        border-radius: 14px;
        padding: 1rem;
        box-shadow: var(--shadow-sm);
        transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
        color: var(--color-text);
        min-height: 168px;
        display: flex;
        flex-direction: column;
    }

        /* Hover/Focus states for the whole card */
        .admin-page .admin-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
            border-color: var(--surface-border-hover);
        }

            /* Icon hover color change */
            .admin-page .admin-card:hover .admin-card__icon {
                background: var(--color-primary); /* pink background tint */
                color: var(--color-highlight); /* pink icon color (#fa1e78) */
                transition: background-color 0.15s ease, color 0.15s ease;
            }

        .admin-page .admin-card:focus-within {
            outline: 3px solid var(--color-primary-600);
            outline-offset: 2px;
        }

    /* Make the whole card clickable using a stretched link */
    .admin-page .stretched-link {
        position: absolute;
        inset: 0;
        z-index: 1;
        border-radius: 14px;
        /* allow click-through on child elements if needed */
        background: transparent;
    }

    /* Optional hover tint */
    .admin-page .admin-card:hover .stretched-link {
        background: rgba(35,45,55,.02);
    }

    /* Icon, title, text */
    .admin-page .admin-card__icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: .5rem;
        background: rgba(35,45,55,.08);
        color: var(--color-primary);
        font-size: 22px;
    }

    .admin-page .admin-card__title {
        margin: .25rem 0 .25rem;
        font-size: 1.1rem;
        color: var(--color-primary);
    }

    .admin-page .admin-card__desc {
        margin: 0;
        opacity: .8;
        font-size: .95rem;
    }

    /* Remove button styles (no longer used) */
    .admin-page .admin-card__actions {
        display: none;
    }

/* =========================
   Optional dark mode support
   ========================= */
html[data-theme="dark"] .admin-page {
    --color-bg: #15171a;
    --color-text: #e7e7e7;
    --surface-border: rgba(255,255,255,.06);
    --surface-border-hover: rgba(255,255,255,.14);
}

    html[data-theme="dark"] .admin-page .admin-card {
        background: var(--color-bg);
        border-color: var(--surface-border);
        box-shadow: none;
    }

    html[data-theme="dark"] .admin-page .version-badge {
        background: rgba(255,255,255,.08);
        color: var(--color-text);
    }

    html[data-theme="dark"] .admin-page .admin-card__icon {
        background: rgba(58, 75, 90, .25);
        color: #9fb3c7;
    }


/* ============================
   Admin tables (responsive)
   ============================ */

.admin-page .page-toolbar {
    --toolbar-control-size: 34px;
    display: flex;
    align-items: center;
    gap: .5rem;
}

    .admin-page .page-toolbar label {
        margin-bottom: 0; /* remove Bootstrap’s default label margin */
    }

    .admin-page .page-toolbar .form-group > label {
        margin-bottom: 0;
    }

    .admin-page .page-toolbar .toolbar-label {
        margin: 0 .25rem 0 0; /* no bottom margin */
        line-height: var(--toolbar-control-size); /* vertically align with inputs/buttons */
        color: var(--text-muted, #6c757d);
        white-space: nowrap; /* keep it on one line */
    }

    /* Icon buttons inside toolbar */
    .admin-page .page-toolbar .icon-btn {
        width: var(--toolbar-control-size);
        height: var(--toolbar-control-size);
    }

    /* Chip-style buttons inside toolbar */
    .admin-page .page-toolbar .btn-chip {
        height: var(--toolbar-control-size);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 .6rem; /* horizontal only */
        line-height: 1;
        border-radius: 8px;
    }

    /* Inputs/selects INSIDE the toolbar: match button height */
    .admin-page .page-toolbar .form-control,
    .admin-page .page-toolbar input[type="search"],
    .admin-page .page-toolbar input[type="number"],
    .admin-page .page-toolbar input[type="text"],
    .admin-page .page-toolbar select {
        box-sizing: border-box;
        height: var(--toolbar-control-size);
        padding: 0 .6rem; /* vertical = 0 to keep exact height */
        border: 1px solid var(--surface-border);
        border-radius: 8px;
        line-height: 1;
        font-size: 14px; /* optional for compact look */
    }

        /* Normalize number spinners inside toolbar (prevents odd height visuals) */
        .admin-page .page-toolbar input[type="number"]::-webkit-outer-spin-button,
        .admin-page .page-toolbar input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

    .admin-page .page-toolbar input[type="number"] {
        -moz-appearance: textfield;
    }

.admin-page .admin-alert {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .5rem 0 .5rem;
    padding: .5rem .75rem;
    border: 1px solid #cfe5ff; /* light blue border */
    background: #eef7ff; /* light blue bg */
    color: #0c5460; /* readable blue text */
    border-radius: 8px;
    /* subtle entrance */
    animation: adminAlertFadeIn .2s ease-out;
}

.admin-page .admin-alert--success {
    background: #eafaf1;
    border-color: #ccebdc;
    color: #155724;
}

.admin-page .admin-alert--warn {
    background: #fff8e6;
    border-color: #ffe4a6;
    color: #8a6d3b;
}

.admin-page .admin-alert--error {
    background: #fdecea;
    border-color: #f5c2c7;
    color: #842029;
}

.admin-page .admin-alert.is-fading {
    animation: adminAlertFadeOut .35s ease-in forwards;
}

@keyframes adminAlertFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes adminAlertFadeOut {
    to {
        opacity: 0;
        transform: translateY(-4px);
    }
}

.admin-page .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    background: var(--color-bg);
    color: var(--color-primary);
    text-decoration: none; /* no underline by default */
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}

    .admin-page .icon-btn:hover {
        background: var(--color-primary); /* dunkelblau */
        color: var(--color-highlight); /* yellow icon */
        border-color: var(--color-primary);
        transform: translateY(-1px);
    }

.admin-page .table-wrap {
    overflow-x: auto;
}

.admin-page .table-admin {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-bg);
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

    /* center the icon-only columns (your <td class="nowrap"> cells) */
    .admin-page .table-admin td.nowrap {
        text-align: center;
        vertical-align: middle;
    }

        /* ensure perfect centering of the badge content */
        .admin-page .table-admin td.nowrap .status-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }   

    .admin-page .table-admin th,
    .admin-page .table-admin td {
        padding: .65rem .75rem;
        border-bottom: 1px solid var(--surface-border);
        vertical-align: middle;
    }

    .admin-page .table-admin thead th {
        position: sticky;
        top: 0;
        background: #f7f9fb; /* subtle header */
        color: var(--color-primary);
        z-index: 1;
        font-weight: 600;
    }

    .admin-page .table-admin tbody tr:hover {
        background: rgba(35,45,55,.02);
    }

.admin-page .id-text {
    max-width: 76px; /* adjust width as needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.admin-page .nowrap {
    white-space: nowrap;
}

/* Status icons / badges (using your palette) */
.admin-page .status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 600;
}

    .admin-page .status .glyphicon {
        font-size: 14px;
    }

.admin-page .status-ok {
    color: #219653;
}
/* green */
.admin-page .status-warn {
    color: #e6a700;
}
/* amber */
.admin-page .status-error {
    color: #d32f2f;
}
/* red  */
.admin-page .status-info {
    color: var(--color-primary);
}

.admin-page .table-actions {
    text-align: right;
}

/* Small icon action inside table */
.admin-page .btn-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    min-width: 30px;
    padding: 0 .5rem;
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    background: var(--color-bg); /* white background */
    color: var(--color-primary); /* primary-colored icon */
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}

    .admin-page .btn-chip:hover,
    .admin-page .btn-chip:focus {
        background: var(--color-primary); /* dunkelblau background */
        color: var(--color-highlight); /* yellow icon */
        border-color: var(--color-primary);
        transform: translateY(-1px);
        text-decoration: none;
    }

/* ============================
   Mobile: cardify table rows
   ============================ */
@media (max-width: 720px) {
    .admin-page .table-admin thead {
        display: none;
    }

    .admin-page .table-admin,
    .admin-page .table-admin tbody,
    .admin-page .table-admin tr,
    .admin-page .table-admin td {
        display: block;
        width: 100%;
    }

    .admin-page .table-admin {
        border: none;
        box-shadow: none;
    }

        .admin-page .table-admin tbody tr {
            border: 1px solid var(--surface-border);
            border-radius: 12px;
            padding: .5rem .75rem;
            margin-bottom: .75rem;
            box-shadow: var(--shadow-sm);
            background: var(--color-bg);
        }

        .admin-page .table-admin td {
            border: none;
            padding: .35rem 0;
            display: flex;
            justify-content: space-between;
            gap: 1rem;
        }

            .admin-page .table-admin td::before {
                content: attr(data-label);
                font-weight: 600;
                color: var(--color-primary);
            }

    .admin-page .table-actions {
        justify-content: flex-end;
    }

    .admin-page .id-text {
        max-width: none;
        overflow: visible;
        white-space: normal;
    }
}

/* Title area with breadcrumb + actions */
.admin-page .page-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .25rem;
}

    /* Combined icon + breadcrumb line */
    .admin-page .page-bar.combined {
        display: flex;
        align-items: center;
        gap: .75rem;
    }

.admin-page .page-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    /*background: rgba(35,45,55,.08);*/
    color: var(--color-primary);
    font-size: 1.4rem;
    border-radius: 8px;
    width: 36px;
    height: 36px;
}

.admin-page .breadcrumb-admin {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    line-height: 1;
}

    .admin-page .breadcrumb-admin .crumb {
        color: var(--color-primary);
        text-decoration: none;
        opacity: .7;
        font-weight: 600;
    }

        .admin-page .breadcrumb-admin .crumb:hover {
            text-decoration: underline;
            opacity: 1;
        }

    .admin-page .breadcrumb-admin .current {
        color: var(--color-primary);
        opacity: 1;
        font-weight: 700;
    }

    .admin-page .breadcrumb-admin .sep {
        opacity: .5;
    }

/* Keep actions aligned right */
.admin-page .page-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* Optional: make the bar sticky under the site header */
/*.admin-page .page-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--color-bg);
    padding-top: .25rem;
    padding-bottom: .25rem;
}*/

/* Status icon badges (matching index card style) */
.admin-page .status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 14px;
    color: #fff; /* icon color */
}

.admin-page .status-ok {
    background-color: #219653; /* green */
}

.admin-page .status-error {
    background-color: #d32f2f; /* red */
}

.admin-page .status-warn {
    background-color: #e6a700; /* amber */
}

.admin-page .status-info {
    background-color: var(--color-primary); /* your dunkelblau */
}

/* Optional: hover glow for better feedback */
.admin-page .status-icon:hover {
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

/* compact grant/type badges */
.admin-page .type-badge { 
    display: inline-block; 
    padding: 2px 8px; 
    border-radius: 999px; 
    background: rgba(35,45,55,.08); 
    color: var(--color-primary); 
    font-size: .85rem; 
    line-height: 1.4; 
}


.admin-page .pill-gt { 
    display: inline-block; 
    padding: 2px 8px; 
    margin-right: .25rem; 
    margin-bottom: .2rem; 
    border-radius: 999px; 
    background: rgba(35,45,55,.08); 
    color: var(--color-primary); 
    font-size: .8rem; 
    line-height: 1.4; 
}
    

    .admin-page .pill-gt.more { 
        background: var(--color-primary); 
        color: var(--color-highlight); 
    }


/* center icon-only columns for this table (re-uses your pattern) */
.admin-page .table-admin td.nowrap { 
    text-align: center; 
    vertical-align: middle; 
}
    

    .admin-page .table-admin td.nowrap .status-icon { 
        display: inline-flex; 
        align-items: center; 
        justify-content: center; 
    }

/* token lifetime pills (match existing pills) */
.admin-page .pill-tl {
    display: inline-block;
    padding: 4px 10px;
    margin-right: .25rem;
    margin-bottom: .2rem;
    border-radius: 999px;
    font-size: .8rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .2px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: box-shadow .12s ease, transform .05s ease;
}

    .admin-page .pill-tl:hover {
        transform: translateY(-1px);
        box-shadow: 0 0 0 3px rgba(0,0,0,.05);
    }

    /* Variants per token type */
    .admin-page .pill-tl.id {
        background: var(--color-primary);
        color: var(--color-highlight);
    }
    .admin-page .pill-tl.at {
        background: var(--color-accent);
        color: #fff;
    }
    .admin-page .pill-tl.rta {
        background: #e6a700;
        color: #232d37;
    }
    .admin-page .pill-tl.rts {
        background: var(--color-primary-600);
        color: #fff;
    }

@media (prefers-reduced-motion: reduce) {
    .admin-page .pill-tl:hover {
        transform: none;
    }
}

/* danger variant for chip buttons (delete) */
.admin-page .btn-chip.danger {
    background: #d32f2f;
    border-color: #d32f2f;
    color: #fff;
}

    .admin-page .btn-chip.danger:hover,
    .admin-page .btn-chip.danger:focus {
        background: #b71c1c;
        border-color: #b71c1c;
        color: #fff;
    }

/* small spacing top for pagination inside admin tables */
.admin-page .admin-pagination {
    /*adjust if needed*/ /*margin-top: .75rem;*/
}

.admin-page .icon-btn.is-disabled {
    opacity: .45;
    pointer-events: none;
}

.admin-page .pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 .6rem;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-primary);
    background: var(--color-bg);
}

    .admin-page .pager-btn:hover {
        background: var(--color-primary);
        color: var(--color-highlight);
        border-color: var(--color-primary);
    }

    .admin-page .pager-btn.active {
        background: var(--color-primary);
        color: var(--color-highlight);
        border-color: var(--color-primary);
        font-weight: 700;
    }

.admin-page .pager-dots {
    padding: 0 .35rem;
    opacity: .6;
}


/* 2) JWKS table: first column LEFT, the rest RIGHT (KID / ALG / USE) */
.admin-page .table-admin.discovery-jwks th:nth-child(1),
.admin-page .table-admin.discovery-jwks td:nth-child(1) {
    text-align: left;
}

.admin-page .table-admin.discovery-jwks th:nth-child(n+2),
.admin-page .table-admin.discovery-jwks td:nth-child(n+2) {
    text-align: right;
}

/* keep codes aligned like their cells */
.admin-page .table-admin.discovery-jwks td code {
    display: inline-block;
}

.admin-page details.discovery-raw {
    margin-top: .75rem;
}

    .admin-page details.discovery-raw summary {
        padding: 0;
        margin: 0 0 .35rem 0; /* no left margin */
        cursor: pointer;
        font-weight: 700;
    }

    .admin-page details.discovery-raw pre {
        margin: 0; /* kill default left margin */
        padding: .75rem; /* even padding */
        background: #fafbfd;
        border: 1px solid var(--surface-border);
        border-radius: 12px;
        overflow: auto;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        font-size: .9rem;
        line-height: 1.35;
    }

@media (max-width: 720px) {
    .admin-page .table-admin.discovery-jwks td:nth-child(n+2) {
        word-break: break-all; /* long KIDs/URLs wrap neatly */
    }
}

/* Tabs (top-level and sub) */
.admin-page .tabs-admin,
.admin-page .tabs-sub {
    display: flex;
    gap: .5rem;
    margin: .25rem 0 1rem;
    border-bottom: 1px solid var(--surface-border);
    flex-wrap: wrap;
}

    .admin-page .tabs-admin .tab,
    .admin-page .tabs-sub .tab {
        display: inline-flex;
        align-items: center;
        padding: .5rem .75rem;
        border-radius: 10px 10px 0 0;
        text-decoration: none;
        color: var(--color-primary);
        background: transparent;
        border: 1px solid transparent;
        border-bottom: none;
        transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    }

        .admin-page .tabs-admin .tab:hover,
        .admin-page .tabs-sub .tab:hover {
            background: rgba(35,45,55,.04);
        }

        .admin-page .tabs-admin .tab.active,
        .admin-page .tabs-sub .tab.active,
        .admin-page .tab-pane.show.active ~ .tabs-admin .tab[aria-selected="true"] {
            background: var(--color-bg);
            border-color: var(--surface-border);
            color: var(--color-primary);
        }

/* Cards inside tabs */
.admin-page .admin-card.soft {
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    background: var(--color-bg);
}

/* Form layout */
.admin-page .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: .85rem 1rem;
}

@media (max-width: 860px) {
    .admin-page .form-grid {
        grid-template-columns: 1fr;
    }
}

.admin-page .form-field {
    display: flex;
    flex-direction: column;
}

    .admin-page .form-field.col-span-2 {
        grid-column: span 2;
    }

.admin-page .form-label {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: .25rem;
}

    .admin-page .form-label.with-toggle {
        display: inline-flex;
        align-items: center;
        gap: .5rem;
    }

.admin-page .form-control {
    width: 100%;
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: .45rem .6rem;
    background: var(--color-bg);
    color: var(--color-text);
}

    .admin-page .form-control:focus {
        outline: none;
        border-color: var(--color-primary-600);
        box-shadow: 0 0 0 3px rgba(35,45,55,.08);
    }

/* Blocks & dividers */
.admin-page .form-block {
    margin: .25rem 0 1rem;
}

.admin-page .block-title {
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: .35rem;
}

.admin-page .block-divider {
    border: none;
    height: 1px;
    background: var(--surface-border);
    margin: 1rem 0;
}

/* Note */
.admin-page .note.warn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border-radius: 10px;
    background: #fff7e6;
    color: #8a6d3b;
    border: 1px solid rgba(230,167,0,.35);
}

/* Keep bootstrap nav-tabs JS working (if present) */
.admin-page .tab-content .tab-pane {
    display: none;
}

    .admin-page .tab-content .tab-pane.active,
    .admin-page .tab-content .tab-pane.show.active {
        display: block;
    }

/* Scoped tab styles for admin pages */
.admin-page .nav-tabs .nav-link {
    color: #212529; /* neutral text color, or your style guide default */
}

    .admin-page .nav-tabs .nav-link:hover {
        color: #000; /* optional: slightly darker on hover */
    }

    .admin-page .nav-tabs .nav-link.active {
        color: var(--brand-color, #0d6efd); /* your brand / bootstrap primary */
        border-color: var(--brand-color, #0d6efd) var(--brand-color, #0d6efd) transparent;
        background-color: #fff; /* keep Bootstrap’s white active tab bg */
    }


.admin-page .modal .modal-content.admin-modal {
    border-radius: 14px;
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-lg);
    background: var(--color-bg);
    color: var(--color-text);
}

.admin-page .modal .modal-header {
    border-bottom: 1px solid var(--surface-border);
}

.admin-page .modal .modal-footer {
    border-top: 1px solid var(--surface-border);
}

/* Secondary button to match your palette */
.admin-page .modal .btn.btn-secondary {
    background: var(--color-bg);
    border: 1px solid var(--surface-border);
    color: var(--color-primary);
}

    .admin-page .modal .btn.btn-secondary:hover,
    .admin-page .modal .btn.btn-secondary:focus {
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: var(--color-highlight);
    }

/* Danger primary aligns with your .btn-chip.danger */
.admin-page .modal .btn.btn-danger {
    background: #d32f2f;
    border-color: #d32f2f;
}

    .admin-page .modal .btn.btn-danger:hover,
    .admin-page .modal .btn.btn-danger:focus {
        background: #b71c1c;
        border-color: #b71c1c;
    }

/* Dark mode support */
html[data-theme="dark"] .admin-page .modal .modal-content.admin-modal {
    background: var(--color-bg);
    border-color: var(--surface-border);
    box-shadow: none;
}


/* ============================
   Highlighted text inside admin tables
   ============================ */

.admin-page .highlight {
    background-color: #fff59d; /* soft yellow that works in light & dark mode */
    color: var(--color-text); /* inherit main text color */
    padding: 0 .2em; /* little breathing room */
    border-radius: .25em; /* subtle rounded corners */
    font-weight: 600; /* slightly bolder for emphasis */
    transition: background-color .15s ease;
}

/* Optional dark-mode fine-tune */
html[data-theme="dark"] .admin-page .highlight {
    background-color: #b39ddb; /* a soft violet that stands out on dark bg */
}


/* Two-forms toolbar row: filter left (flex), cleanup right (auto), wrap on small screens */
.admin-page .page-toolbar.duo {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap; /* allows wrapping when space is tight */
    margin-bottom: .75rem; /* same spacing as other toolbars */
}

    /* Left form takes the remaining space, has a sensible min width */
    .admin-page .page-toolbar.duo .toolbar-left {
        display: flex;
        align-items: center;
        gap: .5rem;
        flex: 1 1 420px; /* grow, shrink, preferred width */
        min-width: 240px;
    }

    /* Right form stays compact on the right */
    .admin-page .page-toolbar.duo .toolbar-right {
        display: flex;
        align-items: center;
        gap: .5rem;
        flex: 0 0 auto; /* no grow, no shrink */
        margin-left: auto; /* pushes it to the far right on the first row */
    }

    /* Inputs inside this duo toolbar: use same compact height (inherits your variables) */
    .admin-page .page-toolbar.duo .form-control {
        height: var(--toolbar-control-size, 34px);
        padding: 0 .6rem;
        border: 1px solid var(--surface-border);
        border-radius: 8px;
        line-height: 1;
        font-size: 14px;
    }

/* On narrow screens the cleanup form will wrap under; keep it right-aligned on its line */
@media (max-width: 560px) {
    .admin-page .page-toolbar.duo .toolbar-right {
        margin-left: 0; /* allow full-width line */
        justify-content: flex-start;
        width: 100%;
    }
}

/* Grid layout for a clean, single-row toolbar that wraps nicely */
.admin-page .toolbar-filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    column-gap: .75rem;
    row-gap: .8rem;
    align-items: end; /* align bottoms of fields & buttons */
    margin-bottom: .85rem;
}

    /* Wider search */
    .admin-page .toolbar-filters .span-2 {
        grid-column: span 2;
    }

    /* Action area aligns with field bottoms */
    .admin-page .toolbar-filters .f-actions {
        display: inline-flex;
        gap: .4rem;
        align-self: end; /* line up with inputs */
    }

    /* Visible, compact submit button */
    .admin-page .toolbar-filters .btn-filter {
        height: 34px;
        line-height: 34px; /* keeps text centered like inputs */
        padding: 0 .9rem;
    }

/* Make labels more readable and spaced from inputs */
.admin-page .mini-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
    margin-bottom: .4rem; /* more space to the control */
}

/ /* Normalize control sizes */
.admin-page .toolbar-filters .form-control,
.admin-page .toolbar-filters select,
.admin-page .toolbar-filters input[type="search"],
.admin-page .toolbar-filters .icon-btn {
    height: 34px;
}

.admin-page .toolbar-filters .form-control,
.admin-page .toolbar-filters select,
.admin-page .toolbar-filters input[type="search"] {
    padding: 0 .6rem;
}

.admin-page .toolbar-filters .icon-btn {
    width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Priority badge for multi-sort (1,2,3) */
.admin-page .sort-order {
    display: inline-block;
    margin-left: .25rem;
    font-size: .72em;
    font-weight: 700;
    color: var(--text-muted, #6c757d);
}

/* Responsive wrap */
@media (max-width: 960px) {
    .admin-page .toolbar-filters {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 560px) {
    .admin-page .toolbar-filters {
        grid-template-columns: 1fr;
    }

        .admin-page .toolbar-filters .span-2 {
            grid-column: span 1;
        }
}