:root {
    --bg: #0b1220;
    --surface: #111827;
    --surface-2: #182235;
    --surface-3: #1f2a3d;
    --border: #243247;
    --text: #e5edf8;
    --muted: #94a3b8;
    --heading: #f8fafc;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    --accent: #38bdf8;
}

html,
body {
    min-height: 100%;
}

body {
    background: linear-gradient(180deg, #08101d 0%, #0b1220 100%);
    color: var(--text);
}

a {
    color: #7dd3fc;
}

a:hover {
    color: #bae6fd;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.card-title,
.fw-semibold,
.fw-bold,
pre,
code {
    color: var(--heading);
}

.text-muted,
.small.text-muted,
p.text-muted,
.text-body-secondary,
.form-text {
    color: var(--muted) !important;
}

.navbar,
.app-navbar {
    background: rgba(10, 15, 27, 0.94) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(14px);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.app-topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1.25rem;
}

.navbar-brand,
.navbar .nav-link,
.navbar .navbar-text {
    color: var(--text) !important;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    max-width: 340px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo-shell {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.92) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 48px;
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.35);
}

.brand-logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.38rem;
}

.brand-logo-fallback {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-copy {
    display: inline-flex;
    flex-direction: column;
    min-width: 0;
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.08;
    color: #ffffff;
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 0.77rem;
    color: var(--muted);
    line-height: 1.2;
    white-space: nowrap;
}

#appNav {
    min-width: 0;
}

.app-nav-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.app-nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.35rem;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.app-nav-list .nav-link {
    padding: 0.52rem 0.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.96rem;
    color: #cbd5e1 !important;
    line-height: 1.15;
    white-space: nowrap;
}

.app-nav-list .nav-link.active,
.app-nav-list .nav-link:hover {
    color: #ffffff !important;
    background: rgba(37, 99, 235, 0.18);
}

.navbar-toggler {
    border-color: rgba(148, 163, 184, 0.35);
    margin-left: auto;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    filter: invert(1) grayscale(1);
}

.app-user-panel {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(36, 50, 71, 0.95);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.76);
    color: var(--text);
    min-width: 0;
}

.app-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.22) 0%, rgba(37, 99, 235, 0.22) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    flex: 0 0 38px;
}

.app-user-copy {
    display: inline-flex;
    flex-direction: column;
    min-width: 0;
}

.app-user-name {
    color: #ffffff;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
}

.app-user-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.app-user-email {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.1;
    white-space: nowrap;
}

.role-badge,
.badge.text-bg-dark {
    background: #1d4ed8 !important;
    color: #eff6ff !important;
    padding: 0.38rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.app-logout-btn {
    white-space: nowrap;
}

.card,
.stat-box,
.bg-soft,
.import-log,
.branding-preview-card {
    background: linear-gradient(180deg, rgba(24, 34, 53, 0.96) 0%, rgba(17, 24, 39, 0.98) 100%);
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow) !important;
    color: var(--text);
}

.dashboard-card {
    overflow: hidden;
}

.dashboard-card .label {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 0.45rem;
}

.dashboard-card .value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--heading);
}

.table,
.table > :not(caption) > * > * {
    color: var(--text);
    border-color: var(--border);
    background-color: transparent;
}

.table thead.table-light,
.table thead.table-light th {
    background: var(--surface-2) !important;
    color: var(--heading) !important;
    border-color: var(--border) !important;
}

.table tbody tr:hover td {
    background: rgba(56, 189, 248, 0.05);
}

.border-bottom,
hr {
    border-color: var(--border) !important;
}

.form-control,
.form-select,
textarea {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: rgba(56, 189, 248, 0.5) !important;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.16) !important;
}

.form-control::placeholder {
    color: #718096;
}

.btn-primary {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
    border-color: #475569;
    color: var(--text);
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-danger:hover {
    color: #ffffff;
}

.alert {
    border: 1px solid var(--border);
    color: var(--text);
}

.alert-success {
    background: rgba(16, 185, 129, 0.14);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.14);
}

.alert-info {
    background: rgba(56, 189, 248, 0.14);
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-warning {
    background-color: #d97706 !important;
    color: #fff !important;
}

.badge.bg-secondary {
    background-color: #64748b !important;
}

.badge.bg-info {
    background-color: #0891b2 !important;
    color: #fff !important;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: min(100%, 440px);
}

.site-meta,
.mono {
    color: var(--muted);
}

@media (max-width: 1399.98px) {
    .brand-subtitle {
        display: none;
    }

    .app-user-email {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 1199.98px) {
    .app-topbar {
        grid-template-columns: 1fr auto;
    }

    #appNav {
        grid-column: 1 / -1;
        margin-top: 0.9rem;
    }

    .app-nav-shell {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .app-nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        width: 100%;
    }

    .app-nav-list .nav-link {
        padding-left: 0;
        padding-right: 0;
        border-radius: 0;
        border-bottom: 1px solid rgba(36, 50, 71, 0.85);
    }

    .app-nav-list .nav-link.active,
    .app-nav-list .nav-link:hover {
        background: transparent;
        color: #ffffff !important;
    }

    .app-user-panel {
        justify-content: space-between;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .brand-lockup {
        max-width: calc(100vw - 120px);
    }

    .brand-title {
        font-size: 1.08rem;
    }

    .brand-subtitle,
    .app-user-email,
    .role-badge {
        display: none !important;
    }

    .app-user-panel {
        padding: 0.55rem 0.65rem;
    }
}


.dashboard-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 30%),
        linear-gradient(180deg, rgba(18, 28, 45, 0.98) 0%, rgba(14, 21, 35, 0.98) 100%);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    inset: auto -8% -45% auto;
    width: 300px;
    height: 300px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12), transparent 68%);
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 700;
    color: #7dd3fc;
}

.dashboard-hero-title {
    font-size: clamp(2rem, 2vw + 1rem, 2.7rem);
    line-height: 1.05;
    color: #ffffff;
}

.hero-copy {
    max-width: 760px;
    font-size: 1rem;
}

.hero-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    width: min(100%, 620px);
}

.hero-mini-stat {
    border: 1px solid rgba(46, 63, 89, 0.92);
    background: rgba(10, 18, 30, 0.72);
    border-radius: 18px;
    padding: 1rem 1.05rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.hero-mini-label {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.hero-mini-value {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 0.2rem;
}

.hero-mini-meta,
.card-meta,
.status-legend-meta,
.attention-meta {
    color: var(--muted);
    font-size: 0.84rem;
}

.stat-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.status-split-bar {
    display: flex;
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(46, 63, 89, 0.92);
}

.status-split-segment {
    height: 100%;
    min-width: 2px;
}

.status-split-segment.up,
.status-dot.up {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.95), rgba(74, 222, 128, 0.95));
}

.status-split-segment.down,
.status-dot.down {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(248, 113, 113, 0.95));
}

.status-split-segment.paused,
.status-dot.paused {
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.95), rgba(250, 204, 21, 0.95));
}

.status-legend-card {
    border: 1px solid rgba(46, 63, 89, 0.92);
    background: rgba(12, 20, 33, 0.76);
    border-radius: 18px;
    padding: 1rem;
}

.status-legend-top {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    display: inline-block;
}

.status-legend-title {
    color: #ffffff;
    font-weight: 600;
}

.status-legend-value {
    color: #ffffff;
    font-size: 1.6rem;
    line-height: 1.05;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.empty-panel {
    border: 1px dashed rgba(71, 85, 105, 0.9);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    color: var(--muted);
    background: rgba(11, 17, 28, 0.5);
}

.attention-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.attention-item {
    display: block;
    border: 1px solid rgba(46, 63, 89, 0.92);
    border-radius: 18px;
    background: rgba(12, 20, 33, 0.76);
    padding: 1rem 1.05rem;
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.attention-item:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(16, 25, 40, 0.9);
}

.attention-item-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.3rem;
}

.dashboard-card .label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
}

@media (max-width: 1199.98px) {
    .hero-metrics-grid {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .hero-metrics-grid {
        grid-template-columns: 1fr;
    }

    .attention-item-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
    }
}

.monitor-page-title,
.detail-page-title {
    font-size: clamp(2rem, 2vw + 1rem, 2.6rem);
    color: #ffffff;
    line-height: 1.05;
}

.monitor-summary-grid,
.detail-summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.monitor-summary-card,
.detail-summary-card {
    grid-column: span 12;
    border: 1px solid rgba(36, 50, 71, 0.95);
    background: linear-gradient(180deg, rgba(18, 28, 45, 0.98) 0%, rgba(13, 20, 33, 0.98) 100%);
    border-radius: 22px;
    padding: 1.1rem 1.15rem;
    box-shadow: var(--shadow);
}

.monitor-summary-label,
.detail-summary-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    margin-bottom: 0.55rem;
}

.monitor-summary-value,
.detail-summary-value {
    color: #ffffff;
    font-size: 1.9rem;
    line-height: 1.05;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.monitor-summary-meta,
.detail-summary-meta,
.detail-history-caption,
.detail-subline {
    color: var(--muted);
    font-size: 0.9rem;
}

.monitor-summary-card-wide {
    grid-column: span 12;
}

.monitor-filter-card .card-body {
    padding-top: 1.15rem;
    padding-bottom: 1.15rem;
}

.monitor-list-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.monitor-row-card {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.9fr);
    gap: 1.25rem;
    align-items: center;
    border: 1px solid rgba(36, 50, 71, 0.95);
    background: linear-gradient(180deg, rgba(18, 28, 45, 0.98) 0%, rgba(13, 20, 33, 0.98) 100%);
    border-radius: 24px;
    padding: 1.1rem 1.15rem;
    box-shadow: var(--shadow);
}

.monitor-row-main,
.monitor-row-side {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.monitor-row-side {
    justify-content: flex-end;
}

.monitor-row-status {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(11, 18, 32, 0.9);
    border: 1px solid rgba(36, 50, 71, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex: 0 0 44px;
}

.monitor-row-status-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    display: inline-block;
    box-shadow: 0 0 0 6px rgba(148, 163, 184, 0.08);
}

.monitor-row-status-dot.large {
    width: 18px;
    height: 18px;
}

.monitor-row-status-dot.up {
    background: #22c55e;
}

.monitor-row-status-dot.down {
    background: #ef4444;
}

.monitor-row-status-dot.unknown {
    background: #64748b;
}

.monitor-row-status-dot.paused {
    background: #f59e0b;
}

.monitor-row-copy {
    min-width: 0;
}

.monitor-row-title-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.3rem;
}

.monitor-row-title {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.1;
}

.monitor-row-title:hover {
    color: #bae6fd;
}

.monitor-row-meta-line,
.monitor-row-url,
.detail-history-stats,
.response-mini-stats {
    color: var(--muted);
    font-size: 0.9rem;
}

.monitor-row-meta-line {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.monitor-row-url {
    word-break: break-word;
}

.monitor-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: rgba(37, 99, 235, 0.12);
    color: #cfe1ff;
    padding: 0.2rem 0.55rem;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
}

.monitor-kpis {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.monitor-kpi {
    min-width: 86px;
    padding: 0.55rem 0.7rem;
    border-radius: 16px;
    border: 1px solid rgba(36, 50, 71, 0.95);
    background: rgba(11, 18, 32, 0.78);
}

.monitor-kpi-label {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.68rem;
    margin-bottom: 0.25rem;
}

.monitor-kpi-value {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
}

.monitor-history-block {
    min-width: 138px;
}

.monitor-history-bars,
.detail-history-bars {
    display: flex;
    align-items: end;
    gap: 3px;
    min-height: 28px;
}

.detail-history-bars {
    gap: 4px;
    flex-wrap: wrap;
}

.history-bar {
    width: 5px;
    height: 16px;
    border-radius: 999px;
    background: #64748b;
    display: inline-block;
    opacity: 0.95;
}

.history-bar.large {
    width: 7px;
    height: 24px;
}

.history-bar.up {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
}

.history-bar.down {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
}

.history-bar.unknown {
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
}

.history-bar-empty {
    width: 100%;
    max-width: 120px;
}

.monitor-history-meta {
    color: var(--muted);
    font-size: 0.76rem;
    margin-top: 0.35rem;
    text-align: right;
}

.monitor-actions-trigger {
    min-width: 88px;
}

.monitor-actions-menu {
    border-radius: 16px;
    border-color: rgba(36, 50, 71, 0.95);
    overflow: hidden;
}

.monitor-actions-menu .dropdown-item,
.monitor-actions-menu .dropdown-divider {
    border-color: rgba(36, 50, 71, 0.95);
}

.monitor-actions-menu form {
    margin: 0;
}

.detail-sidebar {
    position: sticky;
    top: 104px;
}

.detail-side-list {
    display: grid;
    gap: 0.85rem;
}

.detail-side-list > div {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(36, 50, 71, 0.9);
}

.detail-side-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-side-list dt {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
}

.detail-side-list dd {
    margin: 0;
    color: #ffffff;
    font-weight: 500;
}

.detail-notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.detail-notification-item {
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(36, 50, 71, 0.95);
    background: rgba(11, 18, 32, 0.7);
}

.response-chart-wrap {
    border-radius: 22px;
    border: 1px solid rgba(36, 50, 71, 0.95);
    background: rgba(11, 18, 32, 0.72);
    padding: 0.85rem;
}

.response-chart-svg {
    width: 100%;
    height: auto;
    display: block;
}

@media (min-width: 768px) {
    .monitor-summary-card {
        grid-column: span 6;
    }

    .detail-summary-card {
        grid-column: span 6;
    }
}

@media (min-width: 1200px) {
    .monitor-summary-card {
        grid-column: span 2;
    }

    .monitor-summary-card-wide {
        grid-column: span 4;
    }

    .detail-summary-card {
        grid-column: span 3;
    }
}

@media (max-width: 1399.98px) {
    .monitor-row-card {
        grid-template-columns: 1fr;
    }

    .monitor-row-side {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .monitor-history-meta {
        text-align: left;
    }
}

@media (max-width: 767.98px) {
    .monitor-row-card {
        padding: 1rem;
        border-radius: 20px;
    }

    .monitor-row-main {
        align-items: flex-start;
    }

    .monitor-row-side,
    .monitor-kpis {
        width: 100%;
        justify-content: flex-start;
    }

    .monitor-kpi {
        min-width: calc(50% - 0.5rem);
    }

    .detail-sidebar {
        position: static;
    }

    .detail-page-head .btn {
        width: 100%;
    }
}

/* Dense monitor list refresh */
.monitor-list-shell-dense {
    gap: 0.85rem;
}

.monitor-row-card-dense {
    grid-template-columns: minmax(0, 1.65fr) minmax(228px, 0.78fr) minmax(220px, 0.7fr) auto;
    gap: 0.95rem;
    padding: 0.9rem 1rem;
    border-radius: 20px;
}

.monitor-row-card-dense.is-down {
    border-color: rgba(239, 68, 68, 0.28);
}

.monitor-row-card-dense.is-paused {
    border-color: rgba(245, 158, 11, 0.28);
}

.monitor-row-main-dense {
    gap: 0.85rem;
}

.monitor-row-title-wrap-dense {
    gap: 0.45rem;
    margin-bottom: 0.2rem;
}

.monitor-row-title-dense {
    font-size: 1.08rem;
}

.monitor-row-meta-line-dense,
.monitor-history-caption,
.monitor-history-label {
    font-size: 0.82rem;
}

.monitor-meta-separator {
    color: rgba(148, 163, 184, 0.5);
}

.monitor-row-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    gap: 0.55rem;
    align-items: stretch;
}

.monitor-kpi.compact {
    min-width: 0;
    padding: 0.5rem 0.65rem;
    border-radius: 14px;
}

.monitor-kpi.compact .monitor-kpi-value {
    font-size: 0.9rem;
}

.monitor-kpi-uptime .monitor-kpi-value {
    color: #e2e8f0;
}

.monitor-history-block-dense {
    min-width: 0;
}

.monitor-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.monitor-history-label {
    color: #dbeafe;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.monitor-history-caption {
    color: var(--muted);
}

.monitor-history-bars-dense {
    min-height: 34px;
    gap: 4px;
    align-items: center;
}

.history-bar-dense {
    width: 6px;
    height: 20px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.monitor-row-menu-wrap {
    justify-self: end;
}

.monitor-actions-trigger-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 14px;
    font-size: 1.45rem;
    line-height: 1;
}

.monitor-actions-trigger-icon span {
    position: relative;
    top: -1px;
}

.monitor-actions-menu {
    min-width: 210px;
}

@media (max-width: 1399.98px) {
    .monitor-row-card-dense {
        grid-template-columns: minmax(0, 1.6fr) minmax(210px, 0.85fr) minmax(200px, 0.7fr) auto;
    }
}

@media (max-width: 1199.98px) {
    .monitor-row-card-dense {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.85rem;
    }

    .monitor-row-metrics {
        grid-template-columns: repeat(3, minmax(86px, 1fr));
    }

    .monitor-history-block-dense,
    .monitor-row-menu-wrap {
        justify-self: stretch;
    }

    .monitor-row-menu-wrap {
        text-align: right;
    }
}

@media (max-width: 767.98px) {
    .monitor-row-card-dense {
        padding: 0.85rem;
    }

    .monitor-row-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .monitor-kpi-uptime {
        grid-column: span 2;
    }

    .monitor-history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-bar-dense {
        width: 5px;
        height: 18px;
    }
}

.ops-page-head {
    align-items: flex-start;
}

.ops-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.ops-summary-card {
    background: linear-gradient(180deg, rgba(18, 27, 42, 0.98) 0%, rgba(12, 19, 32, 0.98) 100%);
    border: 1px solid rgba(36, 50, 71, 0.95);
    border-radius: 22px;
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow);
}

.ops-summary-card-wide {
    grid-column: span 1;
}

.ops-summary-label {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.45rem;
}

.ops-summary-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--heading);
    line-height: 1.1;
}

.ops-summary-meta {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.ops-summary-inline-sep {
    color: rgba(148, 163, 184, 0.65);
    margin: 0 0.15rem;
}

.ops-filter-card .card-body {
    padding: 1rem 1.1rem;
}

.ops-list-shell {
    display: grid;
    gap: 0.95rem;
}

.ops-entry-card {
    position: relative;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(12, 19, 32, 0.98) 100%);
    border: 1px solid rgba(36, 50, 71, 0.96);
    border-radius: 22px;
    padding: 1.05rem 1.1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ops-entry-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 22px 0 0 22px;
    background: rgba(148, 163, 184, 0.4);
}

.ops-entry-card.is-open::before,
.ops-entry-card.is-down::before,
.ops-entry-card.is-danger::before {
    background: linear-gradient(180deg, rgba(248, 113, 113, 1) 0%, rgba(220, 38, 38, 1) 100%);
}

.ops-entry-card.is-resolved::before,
.ops-entry-card.is-up::before,
.ops-entry-card.is-success::before {
    background: linear-gradient(180deg, rgba(74, 222, 128, 1) 0%, rgba(22, 163, 74, 1) 100%);
}

.ops-entry-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.95rem;
}

.ops-entry-title-wrap {
    min-width: 0;
}

.ops-entry-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
}

.ops-state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.36rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ops-state-pill.success {
    background: rgba(22, 163, 74, 0.18);
    color: #bbf7d0;
}

.ops-state-pill.danger {
    background: rgba(220, 38, 38, 0.18);
    color: #fecaca;
}

.ops-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.34rem 0.68rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    background: rgba(18, 27, 42, 0.78);
    color: #dbeafe;
    font-size: 0.79rem;
    font-weight: 600;
}

.ops-chip.soft {
    color: var(--muted);
    border-color: rgba(100, 116, 139, 0.32);
}

.ops-entry-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--heading);
}

.ops-entry-title a {
    color: inherit;
    text-decoration: none;
}

.ops-entry-title a:hover {
    color: #bae6fd;
}

.ops-entry-url {
    color: var(--muted);
    font-size: 0.91rem;
}

.ops-entry-when {
    min-width: 180px;
    display: grid;
    gap: 0.5rem;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.ops-entry-when-label {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.18rem;
}

.ops-keyfacts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.ops-keyfact {
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(36, 50, 71, 0.9);
}

.ops-keyfact-label {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}

.ops-keyfact-value {
    color: var(--heading);
    font-size: 0.98rem;
    font-weight: 600;
}

.ops-note-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.ops-note-card {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(10, 15, 27, 0.72);
    border: 1px solid rgba(36, 50, 71, 0.9);
}

.ops-note-label {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.45rem;
}

.ops-note-value {
    color: #e2e8f0;
    font-size: 0.94rem;
    line-height: 1.55;
    word-break: break-word;
}

.ops-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.15rem;
}

@media (min-width: 1200px) {
    .ops-summary-card-wide {
        grid-column: span 1;
    }
}

@media (max-width: 1199.98px) {
    .ops-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ops-entry-head {
        flex-direction: column;
    }

    .ops-entry-when {
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .ops-summary-grid,
    .ops-keyfacts-grid,
    .ops-note-grid,
    .ops-entry-when {
        grid-template-columns: minmax(0, 1fr);
    }

    .ops-entry-card {
        padding: 0.95rem;
    }

    .ops-summary-value {
        font-size: 1.45rem;
    }
}


/* Header and mobile polish pack */
.app-nav-list .nav-link {
    position: relative;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.app-nav-list .nav-link::after {
    content: '';
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.28rem;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0) 0%, rgba(56, 189, 248, .95) 50%, rgba(56, 189, 248, 0) 100%);
    opacity: 0;
    transform: scaleX(.55);
    transition: opacity .18s ease, transform .18s ease;
}

.app-nav-list .nav-link.active::after,
.app-nav-list .nav-link:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

.app-user-panel {
    box-shadow: 0 14px 32px rgba(2, 8, 23, 0.22);
}

.empty-state-card {
    background: linear-gradient(180deg, rgba(24, 34, 53, 0.98) 0%, rgba(13, 22, 38, 0.98) 100%);
    border: 1px solid rgba(49, 67, 96, 0.88) !important;
}

.empty-state-card .card-body {
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    font-weight: 800;
    color: #f8fafc;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.26) 0%, rgba(15, 23, 42, 0.9) 100%);
    box-shadow: 0 16px 34px rgba(2, 8, 23, 0.26);
}

.empty-state-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.55rem;
}

.empty-state-copy {
    max-width: 540px;
    margin: 0 auto;
    color: var(--muted);
}

.empty-state-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1.15rem;
}

@media (max-width: 1199.98px) {
    .app-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .brand-lockup {
        max-width: none;
    }

    #appNav {
        grid-column: 1 / -1;
        margin-top: 0.9rem;
    }

    .app-nav-shell {
        grid-template-columns: 1fr;
        gap: 0.9rem;
        border: 1px solid rgba(36, 50, 71, 0.95);
        background: rgba(11, 18, 32, 0.96);
        border-radius: 18px;
        padding: 0.9rem;
    }

    .app-nav-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .app-nav-list .nav-link {
        border: 1px solid rgba(36, 50, 71, 0.72);
        background: rgba(15, 23, 42, 0.55);
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .app-user-panel {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 0.85rem;
    }

    .app-user-copy {
        flex: 1 1 auto;
    }

    .app-user-meta {
        flex-wrap: wrap;
        row-gap: 0.3rem;
    }
}

@media (max-width: 767.98px) {
    .navbar,
    .app-navbar {
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }

    .brand-logo-shell {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .brand-title {
        font-size: 1.08rem;
    }

    .brand-subtitle {
        font-size: 0.72rem;
        white-space: normal;
    }

    .app-nav-list {
        grid-template-columns: 1fr;
    }

    .app-user-panel {
        align-items: flex-start;
        gap: 0.65rem;
    }

    .app-logout-btn {
        margin-left: auto;
    }

    .monitor-page-head,
    .ops-page-head {
        align-items: flex-start !important;
    }

    .monitor-page-head .btn,
    .ops-page-head .btn {
        width: 100%;
    }

    .empty-state-card .card-body {
        padding: 2.2rem 1.1rem;
    }
}

.diagnostics-table thead th {
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.82);
    border-bottom: 1px solid rgba(36, 50, 71, 0.85);
    padding-bottom: 0.85rem;
}

.diagnostics-table tbody td {
    border-bottom: 1px solid rgba(36, 50, 71, 0.58);
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
    vertical-align: top;
}

.diagnostics-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-link {
    color: #e5eefc;
    text-decoration: none;
}

.table-link:hover {
    color: #8b5cf6;
}

.diagnostic-stat-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.diagnostic-mini-card {
    border: 1px solid rgba(36, 50, 71, 0.88);
    background: rgba(8, 15, 28, 0.84);
    border-radius: 18px;
    padding: 1rem 1rem 0.95rem;
}

.diagnostic-mini-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-bottom: 0.45rem;
}

.diagnostic-mini-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: #f8fbff;
}

.diagnostic-feed {
    display: grid;
    gap: 0.85rem;
}

.diagnostic-feed-item {
    border: 1px solid rgba(36, 50, 71, 0.8);
    background: rgba(8, 15, 28, 0.82);
    border-radius: 18px;
    padding: 0.95rem 1rem;
}

.browser-verified-chip {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.12);
    color: #b8f7cf;
}

@media (max-width: 767.98px) {
    .diagnostic-stat-stack {
        grid-template-columns: 1fr;
    }
}


/* Cron diagnostics polish */
.cron-diagnostics-page .cron-page-title {
    font-size: clamp(1.8rem, 1.3vw + 1.1rem, 2.25rem);
    letter-spacing: -0.02em;
}

.cron-diagnostics-page .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.cron-diagnostics-page .text-muted {
    color: #90a4bf !important;
}

.cron-diagnostics-page .card > .card-body {
    padding: 1.05rem 1.05rem 1rem;
}

.cron-diagnostics-page h2.h5 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.cron-diagnostics-page .ops-note-card {
    background: linear-gradient(180deg, rgba(10, 16, 28, 0.98) 0%, rgba(7, 12, 22, 0.98) 100%);
    border-color: rgba(34, 47, 69, 0.95);
    padding: 0.85rem 0.95rem;
}

.cron-diagnostics-page .ops-note-label {
    font-size: 0.68rem;
    letter-spacing: 0.11em;
}

.cron-diagnostics-page .ops-note-value {
    font-size: 0.94rem;
    line-height: 1.45;
}

.cron-diagnostics-page .ops-state-pill {
    padding: 0.28rem 0.58rem;
    font-size: 0.7rem;
}

.cron-diagnostics-page .diagnostic-mini-card {
    background: linear-gradient(180deg, rgba(10, 16, 28, 0.96) 0%, rgba(7, 12, 22, 0.98) 100%);
    border: 1px solid rgba(32, 44, 64, 0.98);
    border-radius: 16px;
    padding: 0.9rem 0.9rem 0.85rem;
}

.cron-diagnostics-page .diagnostic-mini-label {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.35rem;
}

.cron-diagnostics-page .diagnostic-mini-value {
    font-size: 1.18rem;
    line-height: 1.15;
}

.cron-diagnostics-page .diagnostic-mini-value.small,
.cron-diagnostics-page .diagnostic-mini-value-compact {
    font-size: 0.9rem !important;
    font-weight: 600;
    line-height: 1.4;
}

.cron-diagnostics-page .cron-command-panel {
    margin: 0;
    padding: 0.9rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(31, 44, 63, 0.98);
    background: linear-gradient(180deg, rgba(6, 10, 18, 0.98) 0%, rgba(4, 8, 14, 1) 100%);
    color: #d5e3f3;
    font-size: 0.78rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.cron-diagnostics-page .diagnostic-stat-stack {
    gap: 0.75rem;
}

.cron-diagnostics-page .ops-summary-value,
.cron-diagnostics-page .metric-value,
.cron-diagnostics-page .stats-number {
    font-size: 1.45rem;
}

.cron-diagnostics-page .table,
.cron-diagnostics-page .table td,
.cron-diagnostics-page .table th {
    font-size: 0.86rem;
}

.cron-diagnostics-page .empty-panel {
    background: rgba(8, 14, 24, 0.78);
    border-color: rgba(32, 44, 64, 0.82);
}

@media (max-width: 767.98px) {
    .cron-diagnostics-page .cron-page-title {
        font-size: 1.75rem;
    }

    .cron-diagnostics-page .diagnostic-mini-value {
        font-size: 1.05rem;
    }
}
