/* ═══════════════════════════════════════════════════════════════════════
   app.css — Global styles consuming theme variables from theme-minidba.css
   ═══════════════════════════════════════════════════════════════════════ */

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--mdb-font-family);
    font-size: var(--mdb-font-size-base);
    color: var(--mdb-text);
    background-color: var(--mdb-bg-page);
}

*, *::before, *::after {
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    color: var(--mdb-text-heading);
}

a {
    color: var(--mdb-accent);
}

    a:hover {
        color: var(--mdb-accent-hover);
    }

/* ── Bootstrap-style Alert Boxes ──────────────────────────────────── */

.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--mdb-radius);
    font-size: 0.9rem;
}

.alert-info {
    color: var(--mdb-info-text);
    background-color: var(--mdb-info-bg);
    border-color: var(--mdb-info-border);
}

.alert-success {
    color: var(--mdb-green-text);
    background-color: var(--mdb-green-bg);
    border-color: var(--mdb-green);
}

.alert-warning {
    background: var(--mdb-orange-bg);
    border: 1px solid var(--mdb-orange);
    color: var(--mdb-orange-text);
}

.alert-secondary {
    background: var(--mdb-bg-surface-alt);
    border: 1px solid var(--mdb-border);
    color: var(--mdb-text-secondary);
}

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--mdb-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--mdb-transition), border-color var(--mdb-transition), color var(--mdb-transition);
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
}

.btn-primary {
    background: var(--mdb-accent);
    color: var(--mdb-text-on-accent);
    border-color: var(--mdb-accent);
}

    .btn-primary:hover {
        background: var(--mdb-accent-hover);
        border-color: var(--mdb-accent-hover);
    }

.btn-secondary {
    background: var(--mdb-bg-surface);
    color: var(--mdb-text-secondary);
    border-color: var(--mdb-border);
}

    .btn-secondary:hover {
        background: var(--mdb-bg-muted);
    }

.btn-danger {
    background: var(--mdb-red);
    color: var(--mdb-text-on-accent);
    border-color: var(--mdb-red);
}

    .btn-danger:hover {
        background: var(--mdb-red-text);
        border-color: var(--mdb-red-text);
    }

.btn-outline-secondary {
    background: transparent;
    color: var(--mdb-text-secondary);
    border-color: var(--mdb-border);
}

    .btn-outline-secondary:hover {
        background: var(--mdb-bg-surface-alt);
    }

/* ── Form Controls ────────────────────────────────────────────────── */

.form-control, .form-select {
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
    border: 1px solid var(--mdb-border);
    border-radius: var(--mdb-radius);
    background: var(--mdb-bg-surface);
    color: var(--mdb-text);
    transition: border-color var(--mdb-transition);
}

    .form-control:focus, .form-select:focus {
        outline: none;
        border-color: var(--mdb-accent);
        box-shadow: 0 0 0 2px var(--mdb-accent-subtle);
    }

.form-check-input {
    accent-color: var(--mdb-accent);
}

/* ── Tables ───────────────────────────────────────────────────────── */

.table {
    width: 100%;
    border-collapse: collapse;
}

    .table thead th {
        font-weight: 600;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--mdb-text-secondary);
        border-bottom: 2px solid var(--mdb-border);
        white-space: nowrap;
        padding: 0.5rem;
    }

    .table tbody td {
        vertical-align: middle;
        padding: 0.4rem 0.5rem;
        border-bottom: 1px solid var(--mdb-border-light);
    }

    .table-hover tbody tr:hover {
        background-color: var(--mdb-row-hover);
    }

.server-dashboard-alerts-table thead th,
.server-dashboard-alerts-table tbody td,
.alerts-table thead th,
.alerts-table tbody td {
    text-align: left;
}

.table-responsive {
    overflow-x: auto;
}

/* ── Utility classes ──────────────────────────────────────────────── */

.px-4 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.mt-2 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-3 { margin-top: 1rem; }

.text-muted {
    color: var(--mdb-text-muted) !important;
}

.fw-500 {
    font-weight: 500;
}

/* ── Blazor Specific ──────────────────────────────────────────────── */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;charset=utf-8,...) no-repeat 1rem/1.8rem;
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--mdb-red-text);
    background-color: var(--mdb-red-bg);
    border-color: var(--mdb-red);
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ── Server Child Pages (shared) ──────────────────────────────────── */

.child-page {
    padding: 0.5rem 0;
}

.child-header {
    margin-bottom: 1rem;
}

    .child-header .back-link {
        font-size: 0.82rem;
        text-decoration: none;
        color: var(--mdb-text-muted);
    }

        .child-header .back-link:hover {
            color: var(--mdb-accent);
        }

    .child-header h3 {
        margin: 0.25rem 0 0;
        font-size: 1.3rem;
        font-weight: 600;
    }

.child-icon {
    margin-right: 0.3rem;
}

.metric-summary {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 0.75rem;
}

.inline-metric {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--mdb-bg-surface);
    border: 1px solid var(--mdb-border-light);
    border-radius: var(--mdb-radius);
    font-size: 0.9rem;
}

.ilabel {
    color: var(--mdb-text-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.ivalue {
    font-weight: 600;
    color: var(--mdb-text);
}

.stub-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.stub-card {
    padding: 1rem 1.2rem;
    background: var(--mdb-bg-surface);
    border: 1px solid var(--mdb-border-light);
    border-radius: var(--mdb-radius-lg);
}

    .stub-card h5 {
        margin: 0 0 0.5rem;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--mdb-text);
    }

    .stub-card p {
        margin: 0;
        font-size: 0.83rem;
        color: var(--mdb-text-muted);
        line-height: 1.4;
    }

/* ── Shared Alert Table Styles ────────────────────────────────────── */

.alerts-table {
    font-size: 0.85rem;
}

    .alerts-table thead th {
        font-weight: 600;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--mdb-text-secondary);
        border-bottom-width: 2px;
        white-space: nowrap;
        padding: 0.5rem;
    }

    .alerts-table tbody td {
        vertical-align: middle;
        padding: 0.4rem 0.5rem;
    }

.alert-badge {
    display: inline-block;
    min-width: 48px;
    padding: 2px 8px;
    border-radius: var(--mdb-radius-xl);
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.alert-major {
    background: var(--mdb-red-badge);
    color: var(--mdb-text-on-accent);
}

.alert-minor {
    background: var(--mdb-orange-badge);
    color: var(--mdb-text-heading);
}

.row-major {
    background-color: var(--mdb-red-bg);
}

    .row-major:hover {
        background-color: var(--mdb-red-bg-hover) !important;
    }

.row-minor {
    background-color: var(--mdb-orange-bg);
}

    .row-minor:hover {
        background-color: var(--mdb-orange-bg-hover) !important;
    }

/* ── Page Header (shared across pages) ────────────────────────────── */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

    .page-header h2 {
        margin: 0;
        font-size: 1.4rem;
        font-weight: 600;
    }

/* ── Section Header (shared) ──────────────────────────────────────── */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--mdb-border);
}

    .section-header h4 {
        margin: 0;
        font-size: 1rem;
        font-weight: 600;
    }
/* ── Infragistics DataGrid (IgbDataGrid / igc-data-grid) ─────────────── */
/*   IgbDataGrid is the canvas-based grid (IgbGrid/igc-grid is NOT used). */
/*   CSS custom properties cascade into the component for theming.         */

igc-data-grid {
    /* Density: 1=compact (miniDBA default), 2=medium, 3=large */
    --ig-size: 1;

    /* Colors — mapped to miniDBA theme variables */
    --ig-grid-header-background:              var(--mdb-bg-highlight);
    --ig-grid-header-text-color:              var(--mdb-text-secondary);
    --ig-grid-content-background:             var(--mdb-bg-surface);
    --ig-grid-row-hover-background:           var(--mdb-bg-muted);
    --ig-grid-row-selected-background:        var(--mdb-accent-subtle);
    --ig-grid-row-selected-text-color:        var(--mdb-text);
    --ig-grid-row-selected-hover-background:  var(--mdb-accent-muted);

    font-family: var(--mdb-font-family);
    color: var(--mdb-text);
    scrollbar-color: var(--mdb-border) transparent;
    scrollbar-width: thin;
}

    /* Header cells — compact uppercase style matching miniDBA tables */
    igc-data-grid::part(header-cell) {
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        border-right: 1px solid var(--mdb-border);
        border-bottom: 2px solid var(--mdb-border-strong);
    }

    /* Data cells */
    igc-data-grid::part(cell) {
        font-size: 0.72rem;
        border-right: 1px solid var(--mdb-border-light);
        border-bottom: 1px solid var(--mdb-border-light);
        color: var(--mdb-text);
    }

/* Enterprise alert grids are all row-clickable — show pointer cursor */
.ent-grid-wrap igc-data-grid { cursor: pointer; }

/* ── Infragistics Chart Legend (igc-legend) ─────────────────── */

igc-data-chart {
    /* Prevent the chart web component from adding extra bottom space */
    margin-bottom: 0;
}

igc-legend {
    --ig-legend-padding-top: 0;
    --legend-item-font: 10px sans-serif;
    display: block;
}

/* ── Shared Settings Pages ─────────────────────────────────── */

.sett-page {
    padding: 1.25rem 1.5rem;
    max-width: 860px;
}

/* Page heading — matches .page-header h2 used across the app */
.sett-page h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 1rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--mdb-text-heading);
}

.sett-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--mdb-text-muted, #888);
}

/* Section divider — matches .section-header used across the app */
.sett-section-title {
    display: flex;
    align-items: center;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--mdb-border);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mdb-text-heading);
}

/* Form container */
.sett-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Each label + input row */
.sett-field {
    display: grid;
    grid-template-columns: 240px 1fr;
    align-items: center;
    gap: 0 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(128,128,128,0.07);
}

.sett-field:last-of-type {
    border-bottom: none;
}

/* Left-aligned label — modern, readable */
.sett-label {
    font-size: 0.85rem;
    color: var(--mdb-text);
    font-weight: 500;
    padding-left: 2px;
}

/* Inputs and selects */
.sett-input,
.sett-select {
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--mdb-border);
    border-radius: var(--mdb-radius, 4px);
    background: var(--mdb-bg-surface);
    color: var(--mdb-text);
    font-size: 0.85rem;
    width: 100%;
    max-width: 440px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .sett-input:focus,
    .sett-select:focus {
        outline: none;
        border-color: var(--mdb-accent, #1976d2);
        box-shadow: 0 0 0 2px rgba(25,118,210,0.15);
    }

input[type=password].sett-input {
    letter-spacing: 2px;
}

.sett-input-sm {
    max-width: 110px;
}

/* Checkbox row — same grid as .sett-field */
.sett-checkbox-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    align-items: center;
    gap: 0 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(128,128,128,0.07);
}

    .sett-checkbox-row:last-of-type {
        border-bottom: none;
    }

    .sett-checkbox-row label {
        font-size: 0.85rem;
        color: var(--mdb-text);
        font-weight: 500;
        padding-left: 2px;
    }

    .sett-checkbox-row input[type=checkbox] {
        width: 16px;
        height: 16px;
        accent-color: var(--mdb-accent, #1976d2);
        cursor: pointer;
    }

/* Actions bar — matches section-header top margin */
.sett-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 0.85rem;
    border-top: 2px solid var(--mdb-border);
}

/* Buttons — identical look to .btn / .btn-primary used in the app */
.sett-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--mdb-radius, 4px);
    border: 1px solid var(--mdb-border);
    background: var(--mdb-bg-surface);
    color: var(--mdb-text);
    cursor: pointer;
    transition: background var(--mdb-transition, 0.15s), border-color var(--mdb-transition, 0.15s);
}

    .sett-btn:hover:not(:disabled) {
        border-color: var(--mdb-accent, #1976d2);
        background: var(--mdb-accent-subtle, rgba(25,118,210,0.08));
    }

    .sett-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.sett-btn-save {
    background: var(--mdb-accent, #1976d2);
    color: var(--mdb-text-on-accent, #fff);
    border-color: var(--mdb-accent, #1976d2);
}

    .sett-btn-save:hover:not(:disabled) {
        background: var(--mdb-accent-hover, #1565c0);
        border-color: var(--mdb-accent-hover, #1565c0);
    }

body.mdb-kiosk-settings-readonly .sett-page input:not([readonly]),
body.mdb-kiosk-settings-readonly .sett-page textarea:not([readonly]),
body.mdb-kiosk-settings-readonly .sett-page select,
body.mdb-kiosk-settings-readonly .settings-page input:not([readonly]),
body.mdb-kiosk-settings-readonly .settings-page textarea:not([readonly]),
body.mdb-kiosk-settings-readonly .settings-page select {
    opacity: 0.62;
    cursor: not-allowed;
    background: var(--mdb-bg-surface-alt, #f4f5f7);
}

body.mdb-kiosk-settings-readonly .settings-page button,
body.mdb-kiosk-settings-readonly .sett-page .sett-btn,
body.mdb-kiosk-settings-readonly .sett-page .sett-btn-save,
body.mdb-kiosk-settings-readonly .sett-page .rg-del-btn,
body.mdb-kiosk-settings-readonly .sett-page .rg-add-btn,
body.mdb-kiosk-settings-readonly .sett-page .mcp-add-btn,
body.mdb-kiosk-settings-readonly .sett-page .mcp-delete-btn {
    opacity: 0.55;
    cursor: not-allowed;
}

body.mdb-kiosk-settings-readonly .sett-page [data-kiosk-allow="true"],
body.mdb-kiosk-settings-readonly .sett-page .mcp-copy-btn:not(.mcp-add-btn):not(.mcp-delete-btn) {
    opacity: 1;
    cursor: pointer;
}

.kiosk-settings-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2600;
    background: rgba(0, 0, 0, 0.35);
}

.kiosk-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2601;
    display: flex;
    gap: 0.9rem;
    width: min(460px, calc(100vw - 32px));
    padding: 1.1rem 1.2rem;
    transform: translate(-50%, -50%);
    border: 1px solid var(--mdb-border);
    border-radius: var(--mdb-radius-lg, 8px);
    background: var(--mdb-bg-surface, #fff);
    color: var(--mdb-text);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.kiosk-settings-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--mdb-accent, #1976d2);
    color: #fff;
    font-weight: 700;
}

.kiosk-settings-modal-content h3 {
    margin: 0 0 0.45rem;
    font-size: 1.05rem;
    color: var(--mdb-text-heading);
}

.kiosk-settings-modal-content p {
    margin: 0 0 0.55rem;
    font-size: 0.88rem;
    line-height: 1.45;
}

.kiosk-settings-modal-note {
    color: var(--mdb-text-muted);
}

.kiosk-settings-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.7rem;
}

/* Status messages */
.sett-status {
    font-size: 0.82rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--mdb-radius, 4px);
    border: 1px solid transparent;
}

.sett-status-ok {
    background: rgba(76,175,80,0.1);
    color: var(--mdb-green-text, #4caf50);
    border-color: rgba(76,175,80,0.3);
}

.sett-status-err {
    background: rgba(244,67,54,0.08);
    color: var(--mdb-red-text, #f44336);
    border-color: rgba(244,67,54,0.25);
}

/* Loading / disconnected states */
.sett-loading {
    font-size: 0.85rem;
    color: var(--mdb-text-muted);
    padding: 1.5rem 0;
}

.sett-not-connected {
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--mdb-radius, 4px);
    background: rgba(244,67,54,0.08);
    color: var(--mdb-red-text, #f44336);
    border: 1px solid rgba(244,67,54,0.25);
    margin-top: 0.5rem;
}

/* Table for recipients / groups */
.sett-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
    margin-top: 0.5rem;
}

    .sett-table th {
        font-weight: 600;
        text-align: left;
        padding: 0.45rem 0.75rem;
        border-bottom: 2px solid var(--mdb-border);
        color: var(--mdb-text-muted);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .sett-table td {
        padding: 0.45rem 0.75rem;
        border-bottom: 1px solid var(--mdb-border);
        color: var(--mdb-text);
        vertical-align: middle;
    }

    .sett-table tbody tr:hover td {
        background: var(--mdb-surface-hover, rgba(255,255,255,0.04));
    }

    .sett-table tbody tr:last-child td {
        border-bottom: none;
    }

/* Add-row toolbar */
.sett-add-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

/* Descriptive note text */
.sett-note {
    font-size: 0.8rem;
    color: var(--mdb-text-muted);
    margin: 0.25rem 0 0.75rem;
    line-height: 1.5;
}

/* MCP copy row — input + copy button side-by-side */
.mcp-copy-row {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 440px;
}

    .mcp-copy-row .sett-input {
        flex: 1;
        max-width: none;
    }

.mcp-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    height: 30px;
    border: 1px solid var(--mdb-border);
    border-radius: var(--mdb-radius, 4px);
    background: var(--mdb-bg-surface);
    color: var(--mdb-text);
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

    .mcp-copy-btn:hover {
        background: var(--mdb-accent, #119EDA);
        color: #fff;
        border-color: var(--mdb-accent, #119EDA);
    }

    .mcp-copy-btn--ok {
        background: #2e7d32;
        color: #fff;
        border-color: #2e7d32;
    }

    .mcp-copy-btn--ok:hover {
        background: #2e7d32;
        border-color: #2e7d32;
    }

.mcp-delete-btn {
    color: var(--mdb-text-muted);
}

    .mcp-delete-btn:hover {
        background: #c62828;
        color: #fff;
        border-color: #c62828;
    }

.mcp-add-btn {
    background: var(--mdb-accent, #119EDA);
    color: #fff;
    border-color: var(--mdb-accent, #119EDA);
}

    .mcp-add-btn:hover:not(:disabled) {
        background: var(--mdb-accent-hover, #0E86BA);
        border-color: var(--mdb-accent-hover, #0E86BA);
    }

    .mcp-add-btn:disabled {
        opacity: 0.45;
        cursor: default;
    }

.mcp-tools-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mcp-tool-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    max-height: 480px;
    overflow-y: auto;
}

.mcp-tool-card {
    background: var(--mdb-bg-surface);
    border: 1px solid var(--mdb-border);
    border-radius: var(--mdb-radius, 4px);
    padding: 8px 12px;
}

.mcp-tool-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mdb-accent, #119EDA);
}

.mcp-tool-raw-name {
    font-size: 0.72rem;
    color: var(--mdb-text-muted);
    font-family: monospace;
    margin-top: 1px;
}

.mcp-tool-desc {
    font-size: 0.78rem;
    color: var(--mdb-text);
    margin-top: 4px;
    line-height: 1.4;
}

.mcp-tool-params {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.mcp-tool-param {
    font-size: 0.72rem;
    font-family: monospace;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--mdb-bg-hover);
    color: var(--mdb-text-muted);
    border: 1px solid var(--mdb-border);
}

    .mcp-tool-param--required {
        color: var(--mdb-accent, #119EDA);
        border-color: var(--mdb-accent, #119EDA);
    }

.mcp-tool-param-opt {
    opacity: 0.5;
    font-size: 0.68rem;
}


/* ═══════════════════════════════════════════════════════════════════════
   IgbTabs / igc-tabs — desktop AzureTabItem style
   Active tab: azure filled background + white text (matches desktop).
   Inactive tab: gray fill + dark text + azure 3px bottom border.
   ═══════════════════════════════════════════════════════════════════════ */
igc-tabs {
    --ig-primary-500:                 var(--mdb-accent, #119EDA);
    --ig-primary-600:                 var(--mdb-accent-hover, #0E86BA);
    --ig-primary-A200:                var(--mdb-accent, #119EDA);
    /* Hide the default underline indicator — we use filled-bg instead */
    --igc-tabs-indicator-color:       transparent;
    --igc-tabs-item-active-color:     #fff;
    --igc-tabs-item-color:            #222;
    --igc-tabs-item-hover-background: var(--mdb-tab-active, #729DC5);
    --igc-tabs-item-focus-background: var(--mdb-tab-active, #729DC5);
    --igc-tabs-item-focus-border-color: transparent;
    /* Suppress IgniteUI focus ring drawn inside shadow DOM */
    --ig-focus-ring-shadow:           none;
    --ig-focus-ring-color:            transparent;
    --igc-focus-outline-color:        transparent;
    --igc-focus-outline-width:        0px;
    /* Tab-strip background: light gray rail */
    --igc-tabs-background:            #EBEBEB;
    --igc-tabs-item-border-color:     transparent;
    width: 100%;
}

/* Base tab shape — gray fill, compact, 3px azure bottom border */
igc-tab::part(base) {
    font-size:     0.88rem;
    font-weight:   500;
    padding:       0.38rem 1.2rem;
    min-height:    34px;
    background:    #D9D9D9;
    color:         #222;
    border-right:  1px solid #C0C0C0;
    border-bottom: 3px solid var(--mdb-accent, #119EDA);
    margin-right:  2px;
    transition:    background 0.13s, color 0.13s;
    outline:       none !important;
    box-shadow:    none !important;
}
/* Kill focus ring on all tab states */
igc-tab:focus::part(base),
igc-tab:focus-visible::part(base) {
    outline:    none !important;
    box-shadow: none !important;
}

/* Kill the native focus outline on the web-component host element */
igc-tab:focus,
igc-tab:focus-visible {
    outline:    none !important;
    box-shadow: none !important;
}

/* Active tab: Azure2 fill, white text — matches desktop AzureTabItem selected state */
igc-tab[selected]::part(base) {
    background:   var(--mdb-tab-active, #729DC5);
    color:        #fff;
    font-weight:  600;
    border-bottom-color: var(--mdb-tab-active, #729DC5);
}

/* Hover (non-selected): Azure2 fill, white text — matching desktop hover */
igc-tab:not([selected]):hover::part(base) {
    background: var(--mdb-tab-active, #729DC5);
    color:      #fff;
}

/* ── Dark theme overrides for IgbTabs ───────────────────────────────── */
:root[data-theme="2"] igc-tabs {
    --igc-tabs-item-color:             var(--mdb-tab-inactive-color, #a6adc8);
    --igc-tabs-background:             var(--mdb-tab-strip-bg, #313244);
    --igc-tabs-item-hover-background:  var(--mdb-tab-active, #119EDA);
    --igc-tabs-item-focus-background:  var(--mdb-tab-active, #119EDA);
}

/* Inactive tab: dark surface, light text */
:root[data-theme="2"] igc-tab::part(base) {
    background:    var(--mdb-tab-inactive-bg, #45475a);
    color:         var(--mdb-tab-inactive-color, #a6adc8);
    border-right:  1px solid var(--mdb-border-strong, #585b70);
    border-bottom: 3px solid var(--mdb-tab-active, #119EDA);
}

/* Active tab: keep azure — same as Classic (already via --mdb-tab-active) */
:root[data-theme="2"] igc-tab[selected]::part(base) {
    background:        var(--mdb-tab-active, #119EDA);
    color:             #fff;
    border-bottom-color: var(--mdb-tab-active, #119EDA);
}

/* Hover on inactive: azure fill, white text */
:root[data-theme="2"] igc-tab:not([selected]):hover::part(base) {
    background: var(--mdb-tab-active, #119EDA);
    color:      #fff;
}

/* ── Dark theme overrides for .mdb-tab-btn ────────────────────── */
/* (inactive bg/color now driven by --mdb-tab-inactive-* vars; no hardcodes needed) */
:root[data-theme="2"] .mdb-tab-strip {
    background: var(--mdb-tab-strip-bg, #313244);
}

/* ════════════════════════════════════════════════════════════
   Shared plain-button tab strip — replaces IgbTabs across
   server child pages (Activity, Queries, Waits, Memory,
   Deadlocks) and Reports. Matches desktop AzureTabItem style.
   ════════════════════════════════════════════════════════════ */
.mdb-tab-strip {
    display: flex;
    gap: 2px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.mdb-tab-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    border: none;
    border-bottom: 3px solid var(--mdb-tab-active, #729DC5);
    background: var(--mdb-tab-inactive-bg, #D9D9D9);
    color: var(--mdb-tab-inactive-color, var(--mdb-text-secondary, #555));
    cursor: pointer;
    border-radius: 3px 3px 0 0;
    white-space: nowrap;
    transition: background-color var(--mdb-transition-fast, 0.12s), color var(--mdb-transition-fast, 0.12s);
}

    .mdb-tab-btn:hover,
    .mdb-tab-btn.active {
        background: var(--mdb-tab-active, #729DC5);
        color: #fff;
        border-bottom-color: var(--mdb-tab-active, #729DC5);
    }

/* ════════════════════════════════════════════════════════════
   IgbDataChart stacked column tooltip (global — rendered outside component scope)
   Mirrors desktop Alerts.xaml StackedFragmentSeries tooltip:
   Title (bold) | Time | Major Alerts count | Minor Alerts count
   ════════════════════════════════════════════════════════════ */

.sa-chart-tooltip {
    background: #fff;
    border: 1px solid #CCCCCC;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    min-width: 160px;
    font-family: var(--mdb-font, "Segoe UI", sans-serif);
}

.sa-ct-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 1px 0;
}

.sa-ct-lbl {
    color: #666;
    font-weight: 500;
}

.sa-ct-major { color: #C04444; }
.sa-ct-minor { color: #B87000; }

/* ════════════════════════════════════════════════════════════
   IgbDataChart custom hover tooltip (global)
   Used by wwwroot/js/app.js for every igc-data-chart so chart
   tooltip styling can be changed in one place.
   ════════════════════════════════════════════════════════════ */

.mdb-chart-tooltip {
    position: fixed;
    z-index: 10050;
    min-width: 150px;
    max-width: 280px;
    padding: 8px 10px;
    border: 1px solid var(--mdb-border, #D7D7D7);
    border-radius: var(--mdb-radius-sm, 4px);
    background: var(--mdb-bg-surface, #fff);
    color: var(--mdb-text, #333);
    box-shadow: var(--mdb-shadow-lg, 0 12px 40px rgba(0,0,0,0.20));
    font-family: var(--mdb-font-family, "Segoe UI", sans-serif);
    font-size: 0.76rem;
    line-height: 1.4;
    pointer-events: none;
}

.mdb-chart-tooltip-time {
    margin-bottom: 5px;
    font-weight: 700;
    color: var(--mdb-text-heading, #282828);
}

.mdb-chart-tooltip-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
}

.mdb-chart-tooltip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.mdb-chart-tooltip-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mdb-text-secondary, #565656);
}

/* ═══════════════════════════════════════════════════════════════════════
   RecipientGroups / ServerGroups — two-panel layout
   ═══════════════════════════════════════════════════════════════════════ */

.rg-layout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    min-width: 0;
}

.rg-groups-panel {
    flex: 0 0 230px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--mdb-border);
    border-radius: var(--mdb-radius, 4px);
    background: var(--mdb-bg-surface-alt, #f8f9fa);
    overflow: hidden;
}

.rg-detail-panel {
    flex: 1 1 0;
    min-width: 0;
    border: 1px solid var(--mdb-border);
    border-radius: var(--mdb-radius, 4px);
    padding: 10px 12px;
    background: var(--mdb-bg-surface);
}

.rg-panel-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mdb-text-muted);
    padding: 7px 10px 6px;
    border-bottom: 1px solid var(--mdb-border);
    background: var(--mdb-bg-surface-alt, #f1f3f5);
}

.rg-group-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--mdb-border);
    cursor: pointer;
    font-size: 0.83rem;
    transition: background 0.12s;
}

    .rg-group-row:hover { background: var(--mdb-surface-hover, rgba(25,118,210,0.06)); }

.rg-group-selected {
    background: var(--mdb-accent-subtle, rgba(25,118,210,0.1)) !important;
    color: var(--mdb-accent, #1976d2);
    font-weight: 600;
}

.rg-group-name { flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Agent Jobs page ── */
.agent-page { display: block; }

.agent-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.agent-filter-group {
    display: flex;
    gap: 4px;
    margin-left: 12px;
}

.agent-grid-wrap {
    height: 400px;
    position: relative;
}

.agent-split-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.agent-jobs-grid-wrap {
    height: 340px;
    position: relative;
}

.agent-steps-section {
    margin-top: 6px;
    border-top: 2px solid var(--mdb-border, #dee2e6);
    padding-top: 4px;
}

.agent-steps-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mdb-text-muted);
    padding: 3px 4px 4px 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.agent-steps-grid-wrap {
    height: 200px;
    position: relative;
}

.agent-command-section {
    margin-top: 4px;
    border-top: 1px solid var(--mdb-border, #dee2e6);
}

.agent-command-text {
    font-size: 0.78rem;
    font-family: Consolas, 'Cascadia Code', monospace;
    background: var(--mdb-bg-surface-alt, #f8f9fa);
    border: 1px solid var(--mdb-border, #dee2e6);
    border-radius: 4px;
    padding: 8px 10px;
    max-height: 160px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 4px 0 0 0;
}

.agent-detail-panel {
    margin-top: 6px;
    border-top: 2px solid var(--mdb-border, #dee2e6);
    padding: 6px 4px;
    font-size: 0.82rem;
}

.agent-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 4px;
}

.agent-detail-title {
    font-weight: 600;
    font-size: 0.85rem;
}

.agent-detail-row {
    display: flex;
    gap: 8px;
    padding: 1px 0;
}

.agent-detail-label {
    font-weight: 600;
    color: var(--mdb-text-muted);
    min-width: 90px;
}

.agent-detail-section {
    margin-top: 4px;
}

.rg-group-count { font-size: 0.75rem; color: var(--mdb-text-muted); flex-shrink: 0; margin-right: 2px; }

.rg-del-btn {
    padding: 1px 5px !important;
    font-size: 0.7rem !important;
    border-radius: 3px !important;
    flex-shrink: 0;
    opacity: 0.6;
    line-height: 1.4;
}

    .rg-del-btn:hover { opacity: 1; }

.rg-add-btn {
    padding: 1px 7px !important;
    font-size: 0.8rem !important;
    border-radius: 3px !important;
    flex-shrink: 0;
    background: var(--mdb-accent, #1976d2) !important;
    color: #fff !important;
    border-color: var(--mdb-accent, #1976d2) !important;
    line-height: 1.4;
}

.rg-add-group-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 8px;
    border-top: 1px solid var(--mdb-border);
    background: var(--mdb-bg-surface);
}

    .rg-add-group-form button { align-self: flex-start; }

.rg-glist {
    overflow-y: auto;
    height: calc(6 * 31px);
}

.rg-input-new {
    max-width: 100% !important;
    height: 26px !important;
    font-size: 0.8rem !important;
}

.rg-select-hint {
    font-size: 0.82rem;
    color: var(--mdb-text-muted);
    padding: 1.5rem 0.5rem;
    text-align: center;
}

.rg-field-label {
    font-size: 0.82rem;
    color: var(--mdb-text);
    font-weight: 500;
    white-space: nowrap;
}

.rg-detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mdb-border);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.rg-member-columns {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.rg-member-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rg-col-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mdb-text-muted);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--mdb-border);
    margin-bottom: 4px;
}

    .rg-col-title span { flex: 1 1 0; }

.rg-member-list {
    min-height: 120px;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--mdb-border);
    border-radius: var(--mdb-radius, 4px);
    background: var(--mdb-bg-surface-alt, #f8f9fa);
    padding: 3px 0;
}

.rg-member-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(128,128,128,0.07);
}

    .rg-member-item:last-child { border-bottom: none; }
    .rg-member-item span:first-child { flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tag shown when a server is already assigned to a different group */
.rg-other-group-tag {
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(17, 158, 218, 0.1);
    color: var(--mdb-accent, #119EDA);
    border: 1px solid rgba(17, 158, 218, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
    cursor: default;
    line-height: 1.4;
}

.rg-empty {
    font-size: 0.78rem;
    color: var(--mdb-text-muted);
    padding: 6px 8px;
    font-style: italic;
}

/* ── Alert Recipients inline-edit row ── */
.ar-edit-row td { background: var(--mdb-bg-surface-alt, #f8f9fa) !important; padding: 8px 10px !important; }

.ar-edit-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: flex-end;
}

.ar-edit-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .ar-edit-field label {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--mdb-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

/* ── Shared Dashboard Chart Panel ─────────────────────────────── */
/* Used by SqlServerCharts (server dashboard) and SqlServerDatabaseDetail */

.chart-panel {
    background: var(--mdb-bg-surface);
    border: 1px solid var(--mdb-border);
    border-radius: var(--mdb-radius);
    padding: 0.5rem 0.75rem 0.25rem;
    box-shadow: var(--mdb-shadow);
    min-height: 260px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.dashboard-chart-axis-overlay {
    display: contents;
}

.dashboard-chart-axis-guides,
.sql-chart-axis-guides {
    position: absolute;
    top: 28px;
    bottom: 52px;
    left: 0.75rem;
    right: 0.75rem;
    pointer-events: none;
    z-index: 2;
}

.dashboard-chart-axis-guide,
.sql-chart-axis-guide {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--mdb-chart-major-stroke, rgba(120, 120, 120, 0.35));
    opacity: 0.65;
    transform: translateX(-50%);
}

    .chart-panel h6 {
        margin: 0 0 0.25rem 0;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--mdb-text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.03em;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .chart-panel igc-data-chart {
        flex: 1;
        min-height: 0;
        display: block;
    }

    .chart-panel igc-legend {
        flex: 0 0 auto;
        align-self: center;
        width: fit-content;
        margin-top: var(--mdb-chart-legend-gap, 2px);
    }

.chart-context-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2400;
}

.chart-context-menu {
    position: fixed;
    min-width: 210px;
    padding: 4px 0;
    background: var(--mdb-bg-surface, #fff);
    border: 1px solid var(--mdb-border, #b8b8b8);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
    font-size: 12px;
    z-index: 2401;
}

.chart-context-submenu {
    position: relative;
}

.chart-context-submenu-panel {
    display: none;
    position: absolute;
    top: -5px;
    left: 100%;
    min-width: 210px;
    padding: 4px 0;
    background: var(--mdb-bg-surface, #fff);
    border: 1px solid var(--mdb-border, #b8b8b8);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.chart-context-submenu:hover > .chart-context-submenu-panel,
.chart-context-submenu:focus-within > .chart-context-submenu-panel {
    display: block;
}

.chart-context-item {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 12px;
    border: 0;
    background: transparent;
    color: var(--mdb-text-primary, #1f1f1f);
    font: inherit;
    text-align: left;
    white-space: nowrap;
}

.chart-context-item:hover,
.chart-context-item:focus-visible {
    background: var(--mdb-bg-hover, #e9f2ff);
    outline: none;
}

/* ── Plan Modal AI Panel (pmai-) ─────────────────────────────────────────── */
.pmai-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 380px;
    background: var(--mdb-bg-surface, #fff);
    border-left: 2px solid var(--mdb-accent, #119EDA);
    display: flex;
    flex-direction: column;
    z-index: 2;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    overflow: hidden;
}
.pmai-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--mdb-bg-highlight, #CCCEDB);
    border-bottom: 1px solid var(--mdb-border, #D7D7D7);
    flex-shrink: 0;
}
.pmai-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--mdb-text-heading, #333);
}
.pmai-server {
    font-size: 0.75rem;
    color: var(--mdb-text-muted, #666);
    margin-left: 2px;
}
.pmai-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--mdb-text-muted, #666);
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1;
}
.pmai-close:hover { background: var(--mdb-border, #D7D7D7); }
.pmai-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 0;
}
.pmai-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--mdb-text-muted, #666);
    font-size: 0.85rem;
}
.pmai-error {
    padding: 10px 12px;
    color: #B00;
    font-size: 0.82rem;
    background: #FFF0F0;
    border-radius: 4px;
    border: 1px solid #F5C6C6;
}
.pmai-response {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--mdb-text, #333);
}
.pmai-response .ai-h1,
.pmai-response .ai-h2,
.pmai-response .ai-h3 {
    font-weight: 600;
    margin: 8px 0 4px;
    color: var(--mdb-text-heading, #222);
    font-size: 0.85rem;
}
.pmai-response .ai-para { margin: 0 0 4px; }
.pmai-response .ai-bullet {
    padding-left: 14px;
    position: relative;
    margin: 2px 0;
}
.pmai-response .ai-bullet::before {
    content: "•";
    position: absolute;
    left: 3px;
    color: var(--mdb-accent, #119EDA);
}
.pmai-response code {
    background: var(--mdb-bg-highlight, #EFEFEF);
    padding: 0 3px;
    border-radius: 2px;
    font-size: 0.8rem;
    font-family: Consolas, monospace;
}
.pmai-token-info {
    font-size: 0.72rem;
    color: var(--mdb-text-muted, #999);
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--mdb-border, #E0E0E0);
}
.pmai-footer {
    padding: 8px;
    border-top: 1px solid var(--mdb-border, #E0E0E0);
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.pmai-input {
    flex: 1;
    font-size: 0.82rem;
    padding: 4px 8px;
    border: 1px solid var(--mdb-border, #D7D7D7);
    border-radius: 4px;
    background: var(--mdb-bg-input, #fff);
    color: var(--mdb-text, #333);
    min-width: 0;
}
.pmai-input:focus {
    outline: none;
    border-color: var(--mdb-accent, #119EDA);
}
.pmai-send { flex-shrink: 0; }
/* Ask AI button in plan modal headers */
.pmai-ask-btn {
    font-size: 0.78rem;
    padding: 2px 10px;
    border: 1px solid var(--mdb-accent, #119EDA);
    color: var(--mdb-accent, #119EDA);
    background: transparent;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.pmai-ask-btn:hover,
.pmai-ask-btn.active {
    background: var(--mdb-accent, #119EDA);
    color: #fff;
}
.pmai-ask-btn:disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

/* ── Log viewer line colouring (global: MarkupString bypasses scoped CSS) ── */
.log-line-warn {
    color: var(--mdb-log-warn);
    font-weight: 500;
}

.log-line-error {
    color: var(--mdb-log-error);
    font-weight: 500;
}

/* ── Shared permissions modals used by non-SQL Server context menus ── */
.perms-overlay {
    position: fixed;
    inset: 0;
    background: var(--mdb-backdrop, rgba(0,0,0,0.40));
    z-index: 9000;
}

.perms-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9001;
    width: 820px;
    max-width: 95vw;
    max-height: 90vh;
    background: var(--mdb-bg-surface, #fff);
    border: 1px solid var(--mdb-border, #D7D7D7);
    border-radius: var(--mdb-radius-lg, 8px);
    box-shadow: var(--mdb-shadow-lg, 0 12px 40px rgba(0,0,0,0.20));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--mdb-text, #333);
    font-family: var(--mdb-font-family, "Segoe UI", sans-serif);
    font-size: var(--mdb-font-size-base, 14px);
}

.perms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--mdb-bg-highlight, #CCCEDB);
    border-bottom: 1px solid var(--mdb-border, #D7D7D7);
    font-weight: 600;
    font-size: 1rem;
    color: var(--mdb-text-heading, #282828);
}

.perms-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--mdb-text-muted, #858585);
    line-height: 1;
    padding: 2px 6px;
    border-radius: var(--mdb-radius-sm, 4px);
}

.perms-close:hover {
    color: var(--mdb-text, #333);
    background: var(--mdb-bg-muted, #E7E7E7);
}

.perms-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
    color: var(--mdb-text, #333);
}

.perms-info { margin-bottom: 12px; }

.perms-info p {
    margin: 2px 0;
    font-size: 0.88rem;
    color: var(--mdb-text-secondary, #565656);
}

.perms-hint {
    margin-top: 10px !important;
    color: var(--mdb-text-muted, #858585);
    font-style: italic;
}

.perms-busy {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    font-size: 0.95rem;
    color: var(--mdb-text-secondary, #565656);
}

.perms-content {
    display: flex;
    gap: 0;
    border: 1px solid var(--mdb-border, #D7D7D7);
    border-radius: var(--mdb-radius-sm, 4px);
    min-height: 280px;
    max-height: 360px;
}

.perms-tabs {
    display: flex;
    flex-direction: column;
    min-width: 260px;
    max-width: 280px;
    border-right: 1px solid var(--mdb-border, #D7D7D7);
    overflow-y: auto;
    background: var(--mdb-bg-surface-alt, #F4F4F4);
}

.perms-tab {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 14px;
    border: none;
    border-bottom: 1px solid var(--mdb-border-light, #E7E7E7);
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.perms-tab:hover { background: var(--mdb-bg-muted, #E7E7E7); }

.perms-tab.active {
    background: var(--mdb-bg-surface, #fff);
    box-shadow: inset 3px 0 0 var(--mdb-accent, #119EDA);
}

.perms-tab.perm-ok { color: var(--mdb-green-text, #1A6E2E); }
.perms-tab.perm-no { color: var(--mdb-red-text, #D0284C); }
.perms-tab.perm-info { color: var(--mdb-text-secondary, #565656); }

.perms-tab.active.perm-ok { color: var(--mdb-green-text, #1A6E2E); }
.perms-tab.active.perm-no { color: var(--mdb-red-text, #D0284C); }
.perms-tab.active.perm-info { color: var(--mdb-text-secondary, #565656); }

.perms-tab.perm-no:nth-child(1),
.perms-tab.perm-no:nth-child(2),
.perms-tab.perm-no:nth-child(3),
.perms-tab.active.perm-no:nth-child(1),
.perms-tab.active.perm-no:nth-child(2),
.perms-tab.active.perm-no:nth-child(3) {
    color: var(--mdb-red-text, #D0284C);
}

.perms-detail {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: var(--mdb-bg-surface, #fff);
}

.perms-detail-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--mdb-text, #333);
}

.perms-detail-text code {
    background: var(--mdb-bg-code, #F8F8F8);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-family: var(--mdb-font-mono, Consolas, monospace);
    color: var(--mdb-text, #333);
}

.perms-summary {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--mdb-text-muted, #858585);
    text-align: right;
}

.perms-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--mdb-border-light, #E7E7E7);
    margin-top: 12px;
}

.connectivity-log-modal {
    width: min(1100px, 95vw);
}

.connectivity-log-content {
    min-height: 420px;
    max-height: 65vh;
    overflow: auto;
    margin: 0;
    padding: 12px;
    background: var(--mdb-bg-code, #F8F8F8);
    border: 1px solid var(--mdb-border-light, #E7E7E7);
    border-radius: var(--mdb-radius-sm, 4px);
    color: var(--mdb-text, #333);
    font-family: var(--mdb-font-mono, Consolas, monospace);
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.connection-info-modal {
    width: min(520px, 95vw);
}

.connection-info-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px 16px;
    align-items: start;
    padding: 4px 0 8px;
}

.connection-info-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mdb-text-secondary, #565656);
}

.connection-info-value {
    font-size: 0.92rem;
    color: var(--mdb-text, #333);
    word-break: break-word;
}
