:root {
    /* ── Fedis Brand Palette ── */
    --fedis-red: #D12027;
    --fedis-red-dark: #a81820;
    --fedis-red-glow: rgba(209, 32, 39, 0.2);

    /* ── Primary Blue (matches reference) ── */
    --primary: #2563EB;
    --primary-dark: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.12);
    --violet: #6366f1;

    /* ── Sidebar ── */
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #64748b;
    --sidebar-active-bg: rgba(37, 99, 235, 0.08);
    --sidebar-active: #2563EB;

    /* ── Main canvas ── */
    --bg-page: #eef2ff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-elevated: #f1f5f9;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;

    /* ── Status ── */
    --success: #10b981;
    --danger: #ef4444;

    /* ── Shape & Shadow ── */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    --shadow-md: 0 4px 16px -2px rgb(0 0 0 / 0.08), 0 2px 6px -2px rgb(0 0 0 / 0.05);
    font-family: 'Inter', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-page);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-size: 14.5px;
    line-height: 1.55;
}

/* ─── Layout ───────────────────────────────── */

.view {
    display: none;
    min-height: 100vh;
}

#login-view {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(209, 32, 39, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 70%, rgba(37, 99, 235, 0.08) 0%, transparent 60%);
}

#app-view {
    display: none;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
}

/* ─── Login Card ───────────────────────────── */

.login-card {
    background: #ffffff;
    padding: 2.75rem 3rem;
    border-radius: var(--radius-lg);
    width: 400px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 20px 60px rgba(37, 99, 235, 0.1);
    border: 1px solid var(--border);
    text-align: center;
}

.login-card .login-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.login-card .login-company-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    opacity: 0.95;
}

.login-card .login-app-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    border-radius: 10px;
    margin-top: 0.5rem;
    filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.25));
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 0;
}

.subtitle {
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 2rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ─── Forms ────────────────────────────────── */

.input-group {
    text-align: left;
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.login-card .input-group label {
    color: var(--muted);
}

.login-card .input-group input {
    background: var(--bg-elevated);
    border-color: var(--border);
    color: var(--text);
}

.login-card .input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fff;
}

.login-card .btn.primary {
    background: var(--fedis-red);
    box-shadow: 0 4px 16px rgba(209, 32, 39, 0.25);
}

.login-card .btn.primary:hover {
    background: var(--fedis-red-dark);
    box-shadow: 0 6px 20px rgba(209, 32, 39, 0.35);
    transform: translateY(-1px);
}

.login-card .error-msg {
    color: var(--danger);
}

.input-group input,
.select-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg-elevated);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input-group input:focus,
.select-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

/* ─── Buttons ──────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn.full-width {
    width: 100%;
    justify-content: center;
}

.btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn.text {
    background: transparent;
    color: var(--muted);
}

.btn.text:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.btn.danger-text {
    background: transparent;
    color: #ef4444;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

.btn.danger-text:hover {
    background: rgba(239, 68, 68, 0.08);
}

.btn.text-sm {
    background: transparent;
    color: var(--primary);
    font-size: 0.78rem;
    padding: 0.22rem 0.55rem;
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: var(--radius-sm);
}

.btn.text-sm:hover {
    background: rgba(37, 99, 235, 0.06);
    border-color: var(--primary);
}

/* Amber warning button for Disable action */
.btn-warn {
    color: #b45309 !important;
    border-color: #fcd34d !important;
}

.btn-warn:hover {
    background: #fef3c7 !important;
}

/* Disabled client row */
tr.row-disabled td {
    opacity: 0.5;
}

tr.row-disabled td:first-child {
    opacity: 1;
}

/* ─── Sidebar ──────────────────────────────── */

.sidebar {
    width: 248px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

.sidebar::after {
    display: none;
}

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--primary);
}

/* Company logo strip */
.sidebar-company-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
    object-position: left;
    filter: brightness(0) invert(1);
    opacity: 0.95;
    transition: opacity 0.2s;
}

.sidebar-company-logo:hover {
    opacity: 1;
}

/* Divider between company logo and app logo+name */
.sidebar-logo-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 -1.25rem;
}

/* App row: shield + name */
.sidebar-app-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-top: 0.1rem;
}

.sidebar-app-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    object-fit: cover;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
    flex-shrink: 0;
}

.logo-small {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.logo-small span {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 800;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.58rem 0.9rem;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 2.5px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transform: scaleY(0);
    transition: opacity 0.18s, transform 0.18s;
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
    font-weight: 600;
}

.nav-item.active::before {
    opacity: 1;
    transform: scaleY(1);
}

.nav-item .icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-elevated);
}

.user-info {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.sidebar-footer .btn.text {
    color: var(--muted);
    font-size: 0.78rem;
}

.sidebar-footer .btn.text:hover {
    background: var(--border);
    color: var(--text);
}

/* ─── Main Content ─────────────────────────── */

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.25rem 2.75rem;
    background: var(--bg-page);
}

.main-content::before {
    display: none;
}

.panel {
    position: relative;
    z-index: 1;
}

.panel {
    display: none;
    animation: fadeUp 0.25s ease;
}

.panel.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}

.header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* ─── Stat Cards ───────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    border-top: 3px solid transparent;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, border-top-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.02) 0%, transparent 100%);
    pointer-events: none;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-top-color: var(--primary);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2.35rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

/* ─── Cards ────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.mt-2 {
    margin-top: 1.75rem;
}

/* ─── Tables ───────────────────────────────── */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.table td {
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.03);
}

.empty-row {
    color: var(--muted);
    font-style: italic;
    text-align: center;
    padding: 2rem !important;
}

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

.mono {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
}

/* ─── Badges ───────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge.neutral {
    background: var(--bg-elevated);
    color: var(--muted);
}

.badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge.primary-badge {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

/* ─── Code Pills ───────────────────────────── */

.code-pill {
    display: inline-block;
    background: rgba(37, 99, 235, 0.07);
    border: 1px solid rgba(37, 99, 235, 0.15);
    padding: 1px 7px;
    border-radius: 4px;
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: var(--primary);
}

/* ─── Modals ───────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadein 0.15s ease;
}

@keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 520px;
    max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border);
    border: 1px solid var(--border);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--muted);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── Error Message ────────────────────────── */

.error-msg {
    font-size: 0.85rem;
    min-height: 20px;
    color: var(--danger);
}

/* ─── Subject Chips (policy table + picker) ── */

.subj-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.subj-chip.any {
    background: var(--bg-elevated);
    color: var(--muted);
    border-color: var(--border);
}

.subj-chip.client {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

.subj-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.subj-dot.client {
    background: #16a34a;
}

.subj-ip {
    font-family: ui-monospace, monospace;
    font-size: 10px;
    color: var(--muted);
    margin-left: 1px;
}

/* ─── Policy / SSH Row Layout ────────────────── */

.policy-rule-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 5px;
    color: var(--text);
}

.policy-flow {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.policy-arrow {
    color: var(--muted);
    font-size: 14px;
    flex-shrink: 0;
    font-weight: 400;
}

.policy-meta {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

.policy-ports {
    font-family: ui-monospace, monospace;
    font-size: 11.5px;
}

/* ─── Subject Picker Component ───────────────── */

.subj-picker {
    position: relative;
}

.subj-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    cursor: pointer;
    min-height: 38px;
    transition: border-color 0.15s;
    user-select: none;
}

.subj-trigger:hover {
    border-color: var(--primary);
}

.subj-trigger:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.subj-chevron {
    color: var(--muted);
    font-size: 10px;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform .15s;
}

.subj-trigger.open .subj-chevron {
    transform: rotate(180deg);
}

.subj-drop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 400;
    overflow: hidden;
    min-width: 240px;
}

.subj-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 8px 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.subj-tab {
    padding: 4px 11px;
    border: none;
    background: transparent;
    border-radius: 5px 5px 0 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all .1s;
}

.subj-tab.on {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    box-shadow: 0 -2px 0 var(--primary) inset;
}

.subj-tab:hover:not(.on) {
    background: var(--border);
    color: var(--text);
}

.subj-search {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    background: #fff;
    color: var(--text);
}

.subj-list {
    max-height: 230px;
    overflow-y: auto;
}

.subj-hint {
    padding: 8px 12px;
    font-size: 11px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    text-align: center;
}

.subj-dot.client.online {
    background: var(--success, #10b981);
}

.subj-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    cursor: pointer;
    gap: 8px;
    transition: background .1s;
    color: var(--text);
}

.subj-opt:hover {
    background: rgba(37, 99, 235, 0.05);
}

.subj-opt.sel {
    background: rgba(37, 99, 235, 0.08);
}

.subj-opt-hint {
    font-size: 11px;
    color: var(--muted);
    font-family: ui-monospace, monospace;
    flex-shrink: 0;
}

.subj-section {
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.subj-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--muted);
    font-style: italic;
    font-size: 13px;
}

/* ─── Modal size variant ─────────────────────── */
.modal.modal-lg {
    width: 620px;
}

/* ─── Form row 2-col variant ─────────────────── */
.form-row.two-col {
    grid-template-columns: 1fr 1fr;
}

/* ─── SSH identity pill ──────────────────────── */
.identity-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-family: ui-monospace, monospace;
    font-size: 12px;
    font-weight: 600;
}

/* ─── Topology ──────────────────────────────────────────────────────────────── */
.topo-stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.topo-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    box-shadow: var(--shadow);
}

.topo-stat-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.topo-stat-lbl {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.topo-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

#svcmap-time-filters {
    padding-right: 12px;
    border-right: 1px solid var(--border);
    margin-right: 4px;
}

.topo-filter-btn {
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.topo-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.topo-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.topo-filter-btn[data-svc]:not([data-svc=""]).active {
    background: var(--svc-col, var(--primary));
    border-color: var(--svc-col, var(--primary));
}

.topo-svc-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.topology-note {
    font-size: 11px;
    padding: 6px 4px 2px;
    opacity: 0.7;
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination-bar {
    padding: 10px 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.page-info {
    font-size: 0.8rem;
    color: var(--muted);
    margin-right: 6px;
}

.page-btns {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
    margin-left: auto;
}

.page-btn {
    min-width: 32px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.12s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not([disabled]):not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.page-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─── Expiry Toggle ─────────────────────────────────────────────────────────── */

.expiry-toggle {
    display: inline-flex;
    background: var(--bg-elevated);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.expiry-btn {
    border: none;
    background: transparent;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.expiry-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.expiry-btn:hover:not(.active) {
    color: var(--text);
    background: var(--border);
}

.expiry-duration {
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px 10px;
    margin-top: 2px;
}

.expiry-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.expiry-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
}

.expiry-input-wrap input[type="number"] {
    width: 60px;
    border: none;
    outline: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    text-align: center;
    padding: 0;
}

.expiry-unit {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}

.expiry-sep {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--muted);
}

.expiry-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0;
}

/* ─── Expiry Badges ─────────────────────────────────────────────────────────── */

.expiry-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.expiry-badge.permanent {
    background: var(--bg-elevated);
    color: var(--muted);
}

.expiry-badge.ok {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.expiry-badge.warn {
    background: rgba(251, 191, 36, 0.12);
    color: #d97706;
}

.expiry-badge.critical {
    background: rgba(225, 29, 72, 0.1);
    color: #e11d48;
    animation: pulse-critical 1.5s infinite;
}

.expiry-badge.expired {
    background: var(--bg-elevated);
    color: var(--muted);
    text-decoration: line-through;
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

.page-ellipsis {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 0 2px;
    line-height: 30px;
}

/* ─── Events / SIEM Page ────────────────────── */

.header-actions { display: flex; gap: 0.5rem; }

.events-filter-bar {
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: visible;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    white-space: nowrap;
    min-width: 70px;
}

.preset-group { display: flex; gap: 4px; flex-wrap: wrap; }

.preset-btn {
    padding: 0.3rem 0.7rem;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
}
.preset-btn:hover  { border-color: var(--primary); color: var(--primary); background: rgba(37,99,235,0.04); }
.preset-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.custom-range { display: flex; align-items: center; gap: 0.4rem; }
.custom-range input[type="datetime-local"] {
    padding: 0.3rem 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    background: var(--bg-card);
    color: var(--text);
}
.range-sep { color: var(--muted); font-size: 0.85rem; }

.filter-select { width: auto; min-width: 180px; padding: 0.35rem 0.7rem; height: auto; }

.filter-search {
    flex: 1;
    min-width: 200px;
    max-width: 380px;
    padding: 0.35rem 0.7rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.15s;
}
.filter-search:focus { outline: none; border-color: var(--primary); }

.events-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}
.page-size-wrap { display: flex; align-items: center; gap: 0.5rem; }
.text-sm { font-size: 0.8rem; }

.events-table th, .events-table td { padding: 0.65rem 1rem; }

.event-row { transition: background 0.1s; }
.event-row--high   { border-left: 3px solid var(--danger); }
.event-row--medium { border-left: 3px solid #f59e0b; }
.event-row--low    { border-left: 3px solid var(--success); }
.event-row--info   { border-left: 3px solid var(--border); }

.sev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sev-dot--high   { background: var(--danger); }
.sev-dot--medium { background: #f59e0b; }
.sev-dot--low    { background: var(--success); }
.sev-dot--info   { background: #94a3b8; }

.badge.warning-badge { background: #fef3c7; color: #92400e; }

.events-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1rem;
    padding-bottom: 0.5rem;
}
