.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f5f6fa;
}

main {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 80%);
    color: #fff;
}

.top-row {
    background-image: linear-gradient(90deg, rgba(5, 39, 103, 0.95), rgba(58, 6, 71, 0.85));
    color: #fff;
    height: 3.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand,
.logo a {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: inherit;
    text-decoration: none;
}

.brand:hover,
.logo a:hover,
.brand:focus,
.logo a:focus {
    text-decoration: underline;
}

article.content {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top, rgba(5, 39, 103, 0.35), transparent),
        radial-gradient(circle at bottom, rgba(58, 6, 71, 0.4), transparent);
    padding: 2rem 1rem;
}

.auth-content {
    width: min(28rem, 100%);
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 1.5rem 4rem rgba(20, 30, 60, 0.25);
    padding: 2.5rem;
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 17rem;
        position: sticky;
        top: 0;
        height: 100vh;
        z-index: 20;
    }

    article.content {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }
}

.nav-shell {
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
}

.nav-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.9);
}

.nav-title {
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
}

.nav-subtitle {
    font-size: 0.85rem;
    opacity: 0.7;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-bottom: 0.75rem;
}

/* Version badge - subtle pill at the very bottom of the sidebar */
.sidebar-version {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 0.2rem 0.65rem;
    text-align: center;
    margin-top: 0.75rem;
    letter-spacing: 0.03em;
    cursor: default;
    user-select: all;
    transition: opacity 0.2s ease;
}

.sidebar-version:hover {
    opacity: 0.8;
}

.nav-section__caption {
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.4;
    margin-bottom: 0.25rem;
    padding-left: 0.5rem;
    font-family: var(--font-display, 'Rajdhani', sans-serif);
    font-weight: 600;
}

.nav-scrollable {
    flex: 1;
    overflow-y: auto;
}

.navbar-toggler {
    appearance: none;
    cursor: pointer;
    width: 3.25rem;
    height: 2.5rem;
    color: white;
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    display: none;
}

.nav .nav-link {
    color: rgba(255, 255, 255, 0.55);
    background: none;
    border-radius: 2px;
    border-left: 2px solid transparent;
    padding: 0.45rem 0.5rem 0.45rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    transition: background 0.1s ease, color 0.1s ease, border-left-color 0.1s ease, padding-left 0.1s ease;
}

.nav .nav-link i {
    width: 1rem;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    border-left-color: var(--pop-orange, #d98c55);
    padding-left: 0.85rem;
}

.nav .nav-link:hover i {
    opacity: 0.9;
}

.nav .nav-link.active {
    background: rgba(217, 140, 85, 0.08);
    color: var(--pop-orange, #d98c55);
    border-left-color: var(--pop-orange, #d98c55);
}

.nav .nav-link.active i {
    opacity: 1;
    color: var(--pop-orange, #d98c55);
}

.account-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
}

.account-menu__identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.account-menu__initials {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: grid;
    place-items: center;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.account-menu__details {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.account-menu__email {
    font-weight: 600;
}

.account-menu__tenant {
    opacity: 0.7;
}

.account-menu__signout {
    color: #fff;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
}

.account-menu__signout:hover,
.account-menu__signout:focus {
    text-decoration: underline;
}

/* ── User Menu (header dropdown) ── */
.user-menu {
    position: relative;
}

.user-menu__trigger {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
}

.user-menu__initials {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.user-menu__trigger:hover .user-menu__initials {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(217, 140, 85, 0.3);
}

.user-menu__chevron {
    font-size: 0.5rem;
    opacity: 0.5;
    color: #fff;
    transition: transform 0.15s ease;
}

.user-menu__trigger[aria-expanded="true"] .user-menu__chevron {
    transform: rotate(180deg);
}

/* Dropdown panel — (0,2,0) beats .dropdown-menu (0,1,0) without !important */
.user-menu .user-menu__dropdown {
    min-width: 260px;
    padding: 0;
    background: var(--abyss-deep, #081a21);
    border: 1px solid var(--border-subtle, rgba(77, 166, 166, 0.1));
    border-radius: 2px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 1px rgba(77, 166, 166, 0.15);
    overflow: hidden;
}

.user-menu__dropdown .dropdown-divider {
    margin: 0;
    border-color: var(--border-subtle, rgba(77, 166, 166, 0.1));
}

/* Identity block inside dropdown */
.user-menu__identity {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
}

.user-menu__initials-lg {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    flex-shrink: 0;
}

.user-menu__details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.user-menu__email {
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu__role {
    font-family: var(--font-display, 'Rajdhani', sans-serif);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
}

.user-menu__role--superadmin {
    color: #fbbf24;
}

.user-menu__role--partner {
    color: var(--pop-cyan, #4da6a6);
}

/* Dropdown items — specificity (0,2,0) naturally beats .dropdown-item (0,1,0) */
.user-menu__dropdown .user-menu__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.75);
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s ease, border-left-color 0.1s ease, color 0.1s ease;
    text-decoration: none;
}

.user-menu__dropdown .user-menu__item:hover,
.user-menu__dropdown .user-menu__item:focus {
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--pop-orange, #d98c55);
    color: #fff;
    padding: 0.5rem 1rem;
    text-decoration: none;
}

/* Fixed-width icon slot — (0,2,0) beats .dropdown-item i (0,1,1) */
.user-menu__dropdown .user-menu__item-icon {
    width: 1rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    opacity: 0.6;
    position: relative;
    margin-right: 0;
}

.user-menu__dropdown .user-menu__item-icon i {
    width: auto;
    margin-right: 0;
}

.user-menu__dropdown .user-menu__item:hover .user-menu__item-icon {
    opacity: 1;
    color: var(--pop-orange, #d98c55);
}

/* Theme icon stacking: both occupy same space, display toggled by JS */
.user-menu__item-icon .theme-icon-light,
.user-menu__item-icon .theme-icon-dark {
    position: absolute;
}

.user-menu__dropdown .user-menu__item--danger {
    color: rgba(239, 68, 68, 0.85);
}

.user-menu__dropdown .user-menu__item--danger:hover,
.user-menu__dropdown .user-menu__item--danger:focus {
    color: #ef4444;
    border-left-color: #ef4444;
}

.user-menu__dropdown .user-menu__item--danger:hover .user-menu__item-icon {
    color: #ef4444;
}

/* External link icon (small arrow) */
.user-menu__external {
    margin-left: auto;
    font-size: 0.625rem;
    opacity: 0.35;
}

.user-menu__dropdown .user-menu__item:hover .user-menu__external {
    opacity: 0.6;
}

/* Logout form reset — remove default spacing so the inner button
   aligns with <a> siblings while preserving form semantics for a11y. */
.user-menu__logout-form {
    margin: 0;
    padding: 0;
    width: 100%;
}



.dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dashboard__header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard__header p {
    margin: 0;
    color: #6c6f7c;
    max-width: 38rem;
}

.dashboard__grid {
    display: grid;
    gap: 1.5rem;
}

.dashboard__card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1rem 2.5rem rgba(20, 30, 60, 0.12);
    padding: 1.75rem;
}

.dashboard__card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.dashboard__card p {
    color: #5c6070;
    margin-bottom: 0.75rem;
}

.dashboard__card .btn-link {
    font-weight: 600;
    padding: 0;
}

@media (min-width: 768px) {
    .dashboard__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.page-shell {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.page-shell header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-shell header p {
    margin: 0;
    color: #6c6f7c;
    max-width: 48rem;
}

.funnel-card {
    padding: 2rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1rem 2.5rem rgba(20, 30, 60, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    max-width: 40rem;
}

.funnel-card__intro h2 {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.funnel-card__intro p {
    margin: 0;
    color: #5c6070;
}

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

.form-grid label {
    font-weight: 600;
    color: #33374a;
}

.form-grid input,
.form-grid select {
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #d0d3dc;
    font-size: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.form-actions button,
.form-actions .btn {
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    background: #3943ff;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.form-actions button[disabled],
.form-actions .btn[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.form-actions button:not([disabled]):hover,
.form-actions .btn:not([disabled]):hover {
    background: #2b34cc;
}

.form-status {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
}

.form-status.success {
    background: #e6f7ed;
    color: #176437;
}

.form-status.error {
    background: #fdecec;
    color: #8c1c1c;
}

.funnel-list {
    padding: 2rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1rem 2.5rem rgba(20, 30, 60, 0.08);
}

.funnel-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.funnel-table th,
.funnel-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #eceff5;
}

.funnel-table .truncate {
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funnel-table .actions {
    white-space: nowrap;
}

.uptime-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #5b6071;
}

.refresh-button {
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #3357ff, #6b9bff);
    color: #fff;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
    box-shadow: 0 0.75rem 1.5rem rgba(51, 87, 255, 0.2);
}

.refresh-button[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

.refresh-button:not([disabled]):hover {
    transform: translateY(-1px);
    box-shadow: 0 1rem 2.25rem rgba(51, 87, 255, 0.25);
}

.uptime-alert {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 73, 105, 0.1);
    border: 1px solid rgba(255, 73, 105, 0.2);
    color: #c3213d;
    font-weight: 500;
}

.uptime-empty {
    padding: 2rem;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 1.5rem 3rem rgba(20, 30, 60, 0.08);
    text-align: left;
}

.uptime-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.uptime-card {
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 1.5rem 3rem rgba(20, 30, 60, 0.08);
    overflow: hidden;
}

.uptime-card summary {
    list-style: none;
    cursor: pointer;
    padding: 1.5rem;
}

.uptime-card summary::-webkit-details-marker,
.uptime-card summary::marker {
    display: none;
}

.uptime-card__summary {
    display: grid;
    grid-template-columns: 1.25fr 2fr 1fr;
    gap: 1rem;
    align-items: center;
}

.uptime-card__status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.uptime-card__status-indicator {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #36b37e;
}

.uptime-card__status.is-alert .uptime-card__status-indicator {
    background: #ff5c5c;
}

.uptime-card__status.is-healthy {
    color: #1b834c;
}

.uptime-card__status.is-alert {
    color: #c93636;
}

.uptime-card__title h2 {
    margin: 0;
    font-size: 1.2rem;
}

.uptime-card__meta {
    display: flex;
    gap: 0.5rem;
    color: #5b6071;
}

.uptime-card__sparkline {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.uptime-card__sparkline-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: rgba(91, 96, 113, 0.2);
}

.uptime-card__sparkline-dot.success {
    background: #36b37e;
}

.uptime-card__sparkline-dot.failure {
    background: #ff5c5c;
}

.uptime-page {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.uptime-page__header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.uptime-page__header h1 {
    margin: 0;
    font-size: 1.75rem;
    color: #1d2333;
}

.uptime-page__header p {
    margin: 0;
    color: #5b606f;
}

.uptime-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.uptime-banner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(224, 96, 96, 0.25);
    background: rgba(224, 96, 96, 0.08);
    color: #6b1f1f;
    font-size: 0.95rem;
}

.uptime-banner strong {
    font-weight: 600;
}

.uptime-banner--error {
    border-color: rgba(224, 96, 96, 0.35);
    background: rgba(224, 96, 96, 0.12);
}

.uptime-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.uptime-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.uptime-overview__card {
    background: linear-gradient(135deg, #ffffff, #f4f6ff);
    border-radius: 1.25rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border: 1px solid rgba(99, 106, 141, 0.12);
    box-shadow: 0 10px 30px rgba(24, 32, 56, 0.08);
}

.uptime-overview__label {
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6b7084;
}

.uptime-overview__value {
    font-size: 1.75rem;
    color: #20263a;
}

.uptime-overview__meta {
    font-size: 0.85rem;
    color: #737890;
}

.uptime-monitor-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.monitor-card {
    background: #fff;
    border-radius: 1.5rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border: 1px solid rgba(91, 96, 113, 0.12);
    box-shadow: 0 12px 32px rgba(20, 24, 56, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.monitor-card:hover,
.monitor-card:focus-within {
    border-color: rgba(5, 39, 103, 0.35);
    box-shadow: 0 18px 40px rgba(5, 39, 103, 0.12);
}

.monitor-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.monitor-card__title {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.monitor-card__name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #21263a;
    text-decoration: none;
}

.monitor-card__name:hover,
.monitor-card__name:focus {
    text-decoration: underline;
}

.monitor-card__url {
    font-size: 0.85rem;
    color: #6a6f84;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 32rem;
}

.monitor-card__body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.25rem;
    align-items: center;
}

.monitor-card__metric {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.monitor-card__metric-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6f7388;
}

.monitor-card__metric-value {
    font-size: 1.1rem;
    color: #2b3046;
}

.monitor-card__sparkline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sparkline-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: rgba(91, 96, 113, 0.14);
}

.sparkline-dot--ok {
    background: #36b37e;
}

.sparkline-dot--fail {
    background: #ff6b81;
}

.uptime-bar {
    position: relative;
    height: 0.65rem;
    border-radius: 999px;
    background: rgba(45, 132, 180, 0.12);
    overflow: hidden;
}

.uptime-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: calc(var(--uptime-percent, 0) * 1%);
    background: linear-gradient(90deg, #39c0a4, #2f7cf6);
}

.uptime-bar__value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2538;
    margin-top: 0.35rem;
    display: inline-block;
}

.monitor-card__footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid rgba(91, 96, 113, 0.12);
    padding-top: 1.25rem;
}

.monitor-card__footer-section {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: #535766;
    font-size: 0.9rem;
}

.monitor-card__footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.monitor-card__frequency {
    font-weight: 600;
    color: #394162;
}

.monitor-card__incident {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(91, 96, 113, 0.18);
    color: #2b3046;
    background: rgba(91, 96, 113, 0.05);
}

.monitor-card__incident:hover,
.monitor-card__incident:focus {
    background: rgba(47, 124, 246, 0.08);
    border-color: rgba(47, 124, 246, 0.35);
}

.monitor-card__incident--active {
    background: rgba(255, 92, 92, 0.08);
    border-color: rgba(255, 92, 92, 0.35);
    color: #a82b2b;
}

.monitor-card__incident-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.monitor-card__incident-meta {
    font-size: 0.85rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    padding: 0.6rem 1.1rem;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button--primary {
    background: linear-gradient(90deg, #2f7cf6, #4ab5ff);
    border: 1px solid rgba(47, 124, 246, 0.85);
    color: #fff;
}

.button--primary:hover,
.button--primary:focus {
    background: linear-gradient(90deg, #2768d4, #369ae4);
}

.button--ghost {
    background: rgba(47, 124, 246, 0.08);
    border: 1px solid rgba(47, 124, 246, 0.25);
    color: #2257c7;
}

.button--ghost:hover,
.button--ghost:focus {
    background: rgba(47, 124, 246, 0.12);
    border-color: rgba(47, 124, 246, 0.4);
}

.status-pill--ok {
    background: rgba(54, 179, 126, 0.14);
    color: #1a7a4a;
}

.status-pill--bad {
    background: rgba(255, 92, 92, 0.12);
    color: #b53b3b;
}

.status-pill--ok,
.status-pill--bad {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.monitor-card__status-detail {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.monitor-card__status-detail::before {
    content: "•";
    color: rgba(91, 96, 113, 0.4);
}

.monitor-card__status-detail:first-child::before {
    content: none;
}

.monitor-card__status-detail span {
    display: inline-flex;
    gap: 0.35rem;
}

.monitor-card__status-detail strong {
    font-weight: 600;
}

.monitor-card__status-detail .monitor-card__status-detail-break {
    display: inline-block;
    width: 1px;
    height: 1rem;
    background: rgba(91, 96, 113, 0.18);
}

.uptime-empty {
    text-align: center;
    background: #fff;
    border-radius: 1.5rem;
    padding: 3rem;
    box-shadow: 0 12px 40px rgba(20, 24, 56, 0.08);
    border: 1px solid rgba(91, 96, 113, 0.14);
    display: grid;
    gap: 0.75rem;
}

.uptime-empty h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #21263a;
}

.uptime-empty p {
    margin: 0;
    color: #5b606f;
    max-width: 28rem;
    justify-self: center;
}

.uptime-empty .button {
    justify-self: center;
    margin-top: 0.5rem;
}

.monitor-detail,
.incident-detail {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.monitor-detail__header,
.incident-detail__header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.monitor-detail__title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.monitor-detail__breadcrumb,
.incident-detail__breadcrumbs a {
    font-size: 0.85rem;
    color: #2768d4;
    text-decoration: none;
}

.incident-detail__breadcrumbs {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.incident-detail__breadcrumbs span {
    color: #9aa0b5;
    font-size: 0.85rem;
}

.monitor-detail__breadcrumb:hover,
.monitor-detail__breadcrumb:focus,
.incident-detail__breadcrumbs a:hover,
.incident-detail__breadcrumbs a:focus {
    text-decoration: underline;
}

.monitor-detail__title h1,
.incident-detail__header h1 {
    margin: 0;
    font-size: 1.85rem;
    color: #1e2435;
}

.monitor-detail__url,
.incident-detail__url {
    color: #5a5f74;
    text-decoration: none;
    font-size: 0.95rem;
}

.monitor-detail__url:hover,
.monitor-detail__url:focus,
.incident-detail__url:hover,
.incident-detail__url:focus {
    text-decoration: underline;
}

.monitor-detail__status,
.incident-detail__status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #495066;
}

.monitor-summary,
.incident-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.monitor-summary__card,
.incident-summary__card {
    background: #fff;
    border-radius: 1.25rem;
    padding: 1.5rem;
    border: 1px solid rgba(91, 96, 113, 0.12);
    box-shadow: 0 12px 36px rgba(20, 24, 56, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.monitor-summary__label,
.incident-summary__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c7289;
    font-weight: 600;
}

.monitor-summary__value,
.incident-summary__value {
    font-size: 1.5rem;
    color: #232942;
}

.monitor-summary__meta,
.incident-summary__meta {
    font-size: 0.85rem;
    color: #6f758c;
}

.monitor-incident-callout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 92, 92, 0.25);
    background: rgba(255, 92, 92, 0.08);
    color: #8d2f2f;
}

.monitor-incident-callout p {
    margin: 0.25rem 0 0;
}

.monitor-detail__grid {
    display: grid;
    gap: 1.5rem;
}

.monitor-panel,
.incident-panel {
    background: #fff;
    border-radius: 1.5rem;
    border: 1px solid rgba(91, 96, 113, 0.12);
    box-shadow: 0 12px 36px rgba(20, 24, 56, 0.08);
    display: flex;
    flex-direction: column;
}

.monitor-panel__header,
.incident-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(91, 96, 113, 0.12);
}

.monitor-panel__header h2,
.incident-panel__header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #20263b;
}

.monitor-panel__body,
.incident-panel__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.monitor-panel__body--scroll {
    max-height: 24rem;
    overflow: auto;
}

.monitor-table {
    width: 100%;
    border-collapse: collapse;
}

.monitor-table th,
.monitor-table td {
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(91, 96, 113, 0.12);
    font-size: 0.95rem;
}

.monitor-table__row--error td {
    color: #b83c3c;
}

.monitor-panel__empty {
    margin: 0;
    color: #5b606f;
}

.incident-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.incident-timeline__item {
    display: flex;
    gap: 1.25rem;
    padding: 1rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(91, 96, 113, 0.12);
}

.incident-timeline__item--active {
    border-color: rgba(255, 92, 92, 0.35);
    background: rgba(255, 92, 92, 0.08);
    color: #8f2f2f;
}

.incident-timeline__item--resolved {
    border-color: rgba(54, 179, 126, 0.25);
    background: rgba(54, 179, 126, 0.08);
    color: #1f6946;
}

.incident-timeline__status {
    min-width: 6.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.incident-timeline__details {
    flex: 1;
}

.incident-timeline__details h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.incident-timeline__details p {
    margin: 0 0 0.5rem;
    color: inherit;
}

.incident-timeline__link {
    font-size: 0.9rem;
    color: inherit;
    text-decoration: underline;
}

.incident-panel__body .button {
    align-self: flex-start;
}

.incident-activity {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.incident-activity__timestamp {
    font-size: 0.9rem;
    color: #5b606f;
}

.incident-activity__details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.incident-activity__details strong {
    font-size: 1rem;
    color: #222844;
}

.incident-activity__details p {
    margin: 0;
    color: #5b606f;
}

@media (min-width: 960px) {
    .monitor-detail__grid {
        grid-template-columns: 1fr 0.9fr;
    }

    .incident-detail__header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .monitor-summary__card,
    .incident-summary__card,
    .monitor-panel,
    .incident-panel,
    .monitor-incident-callout {
        padding: 1.25rem;
    }

    .monitor-incident-callout {
        flex-direction: column;
        align-items: flex-start;
    }

    .incident-timeline__item {
        flex-direction: column;
    }
}

@media (min-width: 960px) {
    .uptime-page__header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .monitor-card__body {
        grid-template-columns: 1fr 1fr 1fr auto;
    }

    .monitor-card__footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .monitor-card {
        padding: 1.25rem;
    }

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

    .monitor-card__url {
        max-width: 100%;
    }

    .monitor-card__footer-actions {
        width: 100%;
    }

    .monitor-card__footer-actions .button {
        width: 100%;
        justify-content: center;
    }
}

.uptime-card__details {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.uptime-card__incident-banner {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: rgba(255, 173, 9, 0.08);
    border: 1px solid rgba(255, 173, 9, 0.2);
    color: #7a5300;
    font-size: 0.95rem;
}

.uptime-card__incident-banner.is-active {
    background: rgba(255, 92, 92, 0.1);
    border-color: rgba(255, 92, 92, 0.25);
    color: #a8262c;
}

.uptime-card__incident-banner strong {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.uptime-card__incident-history {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.uptime-card__incident-history h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2b3042;
}

.uptime-card__incident-history ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.uptime-card__incident-history li {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    font-size: 0.9rem;
    color: #41475a;
}

.incident-log__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(91, 96, 113, 0.14);
    color: #4c5161;
}

.incident-log__status.active {
    background: rgba(255, 92, 92, 0.14);
    color: #c93636;
}

.incident-log__status.resolved {
    background: rgba(54, 179, 126, 0.16);
    color: #1b834c;
}

.uptime-card__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.metric {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: #f6f7fd;
}

.metric__label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7184;
    margin-bottom: 0.35rem;
}

.metric__value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d2232;
}

.uptime-card__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.uptime-card__table th,
.uptime-card__table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #eceff8;
}

.uptime-card__table tr.error td {
    background: rgba(255, 92, 92, 0.08);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pill.success {
    background: rgba(54, 179, 126, 0.16);
    color: #1b834c;
}

.status-pill.failure {
    background: rgba(255, 92, 92, 0.16);
    color: #c93636;
}

@media (max-width: 960px) {
    .uptime-card__summary {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .uptime-toolbar {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .navbar-toggler {
        display: block;
    }

    .nav-scrollable {
        display: none;
    }

    .navbar-toggler:checked ~ .nav-shell .nav-scrollable {
        display: block;
    }

    .refresh-button {
        width: 100%;
        justify-content: center;
    }

    .uptime-card__details {
        padding: 1.25rem;
    }

    .uptime-card__table th,
    .uptime-card__table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }
}

.page-placeholder {
    padding: 2rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1rem 2.5rem rgba(20, 30, 60, 0.08);
}

.page-placeholder h2 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.page-placeholder p {
    margin: 0;
    color: #5c6070;
}

/* ============================================
   Funnel Pulse & Signal Indicators
   ============================================ */

.funnel-pulse-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1.5rem rgba(20, 30, 60, 0.08);
    position: relative;
    overflow: hidden;
}

.funnel-pulse-card--clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.funnel-pulse-card--clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 2rem rgba(20, 30, 60, 0.12);
}

/* EKG Background Animation */
.funnel-pulse-canvas {
    position: absolute;
    inset: 0; 
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.25;
}

/* Card Content (above EKG) */
.funnel-pulse-card__content {
    position: relative;
    z-index: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.funnel-pulse-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.funnel-pulse-card__info {
    flex: 1;
    min-width: 0;
}

.funnel-pulse-card__name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1d2e;
    margin: 0 0 0.25rem;
}

.funnel-pulse-card__url {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funnel-pulse-card__url:hover {
    color: #052767;
    text-decoration: underline;
}

/* Pulse Score Circle */
.pulse-score {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pulse-score::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid currentColor;
    opacity: 0.3;
}

.pulse-score .score {
    font-size: 1.5rem;
    line-height: 1;
}

.pulse-score .label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

/* Pulse Heartbeat Animation */
.pulse-score {
    animation: heartbeat 2s ease-in-out infinite;
}

.pulse-score::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    5% {
        transform: scale(1.05);
    }
    10% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.03);
    }
    20% {
        transform: scale(1);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        opacity: 0;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Critical pulse beats faster */
.pulse-critical {
    animation: heartbeat-fast 1s ease-in-out infinite;
}

.pulse-critical::after {
    animation: pulse-ring-critical 1s ease-out infinite;
    border-color: #ef4444;
}

@keyframes heartbeat-fast {
    0%, 100% {
        transform: scale(1);
    }
    10% {
        transform: scale(1.08);
    }
    20% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.05);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes pulse-ring-critical {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Warning has medium speed */
.pulse-warning {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.pulse-warning::after {
    animation: pulse-ring 1.5s ease-out infinite;
}

/* Unknown/no data - no animation */
.pulse-unknown {
    animation: none;
}

.pulse-unknown::after {
    display: none;
}

.pulse-healthy {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.pulse-warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.pulse-critical {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.pulse-unknown {
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.1);
}

/* Signal LEDs */
.signal-leds {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.signal-led {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f3f4f6;
    color: #6b7280;
    cursor: default;
    transition: transform 0.15s ease;
}

.signal-led:hover {
    transform: translateY(-1px);
}

.signal-led .led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.signal-led i {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Signal Status Colors */
.signal-healthy .led {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.signal-healthy {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.signal-warning .led {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.signal-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.signal-critical .led {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
    animation: pulse-critical 1.5s ease-in-out infinite;
}

.signal-critical {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.signal-unknown .led {
    background: #9ca3af;
}

.signal-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

/* Locked Signal State (Tier-gated) */
.signal-locked .led {
    background: #8b5cf6;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.signal-locked {
    background: rgba(139, 92, 246, 0.08);
    color: #7c3aed;
}

.signal-locked i:first-of-type {
    opacity: 0.5;
}

/* Lock badge inside LED indicator */
.signal-lock-badge {
    font-size: 6px !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    opacity: 1 !important;
}

.signal-led .led {
    position: relative;
}

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

/* Funnel Card Actions */
.funnel-pulse-card__actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.funnel-pulse-card__actions .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

/* Funnel Card Meta */
.funnel-pulse-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.funnel-pulse-card__meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.funnel-pulse-card__meta i {
    opacity: 0.6;
}

/* Grid layout for funnel cards */
.funnel-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 1.25rem;
}

/* Pulse Score Container with Trend */
.pulse-score-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Trend Arrows */
.pulse-trend {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.pulse-trend:hover {
    transform: scale(1.1);
}

.pulse-trend.trend-up {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.pulse-trend.trend-down {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.pulse-trend.trend-stable {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.pulse-trend.trend-unknown {
    display: none;
}

@media (max-width: 640px) {
    .funnel-pulse-card__header {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    
    .pulse-score-container {
        align-self: flex-end;
    }
    
    .pulse-score {
        align-self: flex-end;
    }
    
    /* Vertical signal list on mobile */
    .signal-leds {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }
    
    .signal-led {
        justify-content: flex-start;
        padding: 0.5rem 0.75rem;
        border-radius: 0.5rem;
    }
    
    .signal-led span:last-child {
        flex: 1;
    }
    
    /* Add status text on mobile */
    .signal-led::after {
        content: attr(data-status);
        font-size: 0.7rem;
        opacity: 0.7;
        margin-left: auto;
    }
}

/* ============================================
   Pulse Dashboard
   ============================================ */

.pulse-dashboard {
    padding: 0;
}

.pulse-dashboard__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.pulse-dashboard__header p {
    margin: 0;
    color: #6b7280;
}

/* ECG Line Animation */
@keyframes ecg-sweep {
    0% { stroke-dashoffset: 400; }
    100% { stroke-dashoffset: 0; }
}

.pulse-ecg {
    flex: 1;
    max-width: 300px;
    min-width: 150px;
    height: 50px;
    overflow: hidden;
}

.ecg-line {
    width: 100%;
    height: 100%;
    color: #10b981;
}

.ecg-line path {
    stroke-dasharray: 400;
    animation: ecg-sweep 2s linear infinite;
}

.pulse-dashboard__title-area h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: #1a1d2e;
}

.pulse-dashboard__title-area p {
    margin: 0;
    color: #6b7280;
}

/* Pulse Stats Bar */
.pulse-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 0.25rem 1rem rgba(20, 30, 60, 0.06);
}

.pulse-stat {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Featured stat with circular pulse score */
.pulse-stat--featured {
    flex: 0 0 auto;
    padding: 0.25rem 1rem;
}

.pulse-stat--featured .pulse-score--stat {
    width: 5rem;
    height: 5rem;
}

.pulse-stat--featured .pulse-score--stat .score {
    font-size: 1.75rem;
}

.pulse-stat__value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: #1a1d2e;
}

.pulse-stat__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-top: 0.35rem;
}

.pulse-stat--healthy .pulse-stat__value {
    color: #10b981;
}

.pulse-stat--warning .pulse-stat__value {
    color: #f59e0b;
}

.pulse-stat--critical .pulse-stat__value {
    color: #ef4444;
}

/* Empty State */
.pulse-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 0.25rem 1rem rgba(20, 30, 60, 0.06);
}

.pulse-empty-state__icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.pulse-empty-state h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1d2e;
    margin: 0 0 0.5rem;
}

.pulse-empty-state p {
    color: #6b7280;
    margin: 0 0 1.5rem;
}

@media (max-width: 640px) {
    .pulse-dashboard__header {
        flex-direction: column;
    }
    
    .pulse-stats {
        flex-direction: column;
    }
    
    .pulse-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .pulse-stat:last-child {
        border-bottom: none;
    }
    
    .pulse-stat__value {
        font-size: 1.5rem;
    }
    
    .pulse-stat__label {
        margin-top: 0;
    }
}

/* ============================================
   Floating Action Button (FAB)
   ============================================ */

.fab-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    height: 3.5rem;
    padding: 0 1.125rem;
    border-radius: 2rem;
    background: linear-gradient(135deg, #052767, #3a0647);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(5, 39, 103, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    z-index: 100;
}

.fab-button i {
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.fab-button .fab-label {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
    transition: max-width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

.fab-button:hover {
    padding: 0 1.25rem;
    box-shadow: 0 6px 24px rgba(5, 39, 103, 0.5);
}

.fab-button:hover i {
    transform: rotate(90deg);
}

.fab-button:hover .fab-label {
    max-width: 120px;
    opacity: 1;
    margin-left: 0.5rem;
}

.fab-button:active {
    transform: scale(0.96);
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    margin: 1rem;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 0;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1d2e;
    margin: 0;
}

.modal-close {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #1a1d2e;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body .form-group {
    margin-bottom: 1.25rem;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    color: #1a1d2e;
    background: #fff;
    transition: all 0.2s ease;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: #052767;
    box-shadow: 0 0 0 3px rgba(5, 39, 103, 0.1);
}

.modal-body input::placeholder {
    color: #9ca3af;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #f3f4f6;
}

.modal-footer .btn {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* ============================================
   Icon Buttons (for card actions)
   ============================================ */

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #052767;
    border-color: #052767;
}

.btn-icon--danger:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #dc2626;
}

.funnel-pulse-card__actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-notification {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.toast-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.toast-notification i {
    font-size: 1.125rem;
}

.toast-close {
    margin-left: auto;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

/* ============================================
   Link Check Status Banner
   ============================================ */

.link-check-status {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    animation: slideIn 0.3s ease;
}

.link-check-status i {
    font-size: 1rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.link-check-status--success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.link-check-status--error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

[data-theme="light"] .link-check-status--success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

[data-theme="light"] .link-check-status--error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Funnel Detail Pulse Canvas Support */
.funnel-detail__pulse-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    
    /* Layout & Dimensions */
    height: 140px;
    width: 240px;
    background: var(--abyss-surface, #0f172a);
    border-radius: 16px; /* CRT / oscilloscope display */
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 0 30px rgba(0, 0, 0, 0.4);
    
    display: flex;
    align-items: center;
    justify-content: center;
}

.funnel-detail__pulse-hero > .funnel-pulse-canvas {
    z-index: 0;
    opacity: 0.3; /* Subtle background pulse */
}

/* Ensure the text sits clearly above the pulse */
.pulse-hero__score {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.pulse-hero__score .score {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary, #ffffff);
    font-variant-numeric: tabular-nums;
    font-family: 'JetBrains Mono', monospace; /* Tech feel */
}

.pulse-hero__score .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
    margin-top: 0.25rem;
    font-weight: 600;
}

/* Add a subtle vignette/inner shadow to integrate seamlessly */
.funnel-detail__pulse-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    z-index: 1;
    pointer-events: none;
    border-radius: 16px;
}

/* Light mode: soften vignette, fix text contrast */
[data-theme="light"] .funnel-detail__pulse-hero {
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.06),
        inset 0 0 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .funnel-detail__pulse-hero::after {
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .pulse-hero__score {
    text-shadow: none;
}

/* ── Reports hero card (sits next to Pulse Score in the header) ───────────── */
.funnel-detail__title-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    width: 100%;
    align-self: stretch;
}

.funnel-detail__reports-hero {
    position: relative;
    height: 140px;
    width: 200px;
    margin-left: auto;
    background: var(--abyss-surface);
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    text-decoration: none;
    transition: border-color 0.2s;
    overflow: hidden;
}
.funnel-detail__reports-hero:hover {
    border-color: rgba(255,255,255,0.18);
    text-decoration: none;
}
.reports-hero__label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    font-weight: 600;
}
.reports-hero__count-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}
.reports-hero__count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary, #ffffff);
    font-variant-numeric: tabular-nums;
}
.reports-hero__count-unit {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}
.reports-hero__pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.reports-hero__pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
}
.reports-hero__pill--draft {
    background: rgba(255, 140, 0, 0.1);
    border: 1px solid rgba(255, 140, 0, 0.25);
    color: var(--pop-orange);
}
.reports-hero__pill--final {
    background: rgba(77, 166, 166, 0.08);
    border: 1px solid rgba(77, 166, 166, 0.25);
    color: var(--pop-cyan);
}
.reports-hero__pill--empty {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}
.reports-hero__new {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.62rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    transition: border-color 0.15s, color 0.15s;
}
.reports-hero__new:hover {
    border-color: rgba(255,255,255,0.25);
    color: var(--text-primary, #ffffff);
}


/* ===================================
   Bootstrap Dropdown Fixes
   =================================== */

/* Utility class to fix dropdown menus being clipped by parent containers with overflow.
   Apply this class selectively to containers (e.g. tables, cards, accordions) that host
   dropdowns which would otherwise be clipped, instead of globally changing Bootstrap
   layout components. */
.dropdown-overflow-visible {
    overflow: visible !important;
}

/* Ensure dropdown menus appear above other content and use fixed positioning */
.dropdown-menu {
    z-index: 1050;
    position: absolute;
}

/* For dropdowns in tables/cards that get clipped, use fixed strategy */
.dropdown-menu.show {
    z-index: 1055;
}

/* Fix dropdown items with forms inside */
.dropdown-menu form {
    margin: 0;
}

.dropdown-menu .dropdown-item {
    cursor: pointer;
}

/* Button-as-dropdown-item reset for table action menus.
   Exclude .user-menu__item which has its own scoped styles. */
.dropdown-menu button.dropdown-item:not(.user-menu__item) {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.25rem 1rem;
}

.dropdown-menu button.dropdown-item:not(.user-menu__item):hover,
.dropdown-menu button.dropdown-item:not(.user-menu__item):focus {
    background-color: var(--bs-dropdown-link-hover-bg, #f8f9fa);
}

/* ===================================
   Bootstrap Modal Fixes
   =================================== */

/* Ensure modal is centered in viewport when shown */
.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* Force viewport height, not document height */
    height: 100vh !important;
    max-height: 100vh !important;
}

/* Hidden modals should not intercept clicks */
.modal:not(.show) {
    pointer-events: none;
}

.modal.fade .modal-dialog {
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

.modal-dialog {
    margin: 0;
    max-height: calc(100vh - 2rem);
}

/* Cyberpunk Modal Styling */
.modal-content {
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--accent-cyan, rgba(0, 255, 255, 0.2));
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-content.modal-danger {
    border-color: rgba(220, 53, 69, 0.4);
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.15), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-header {
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    padding: 1rem 1.25rem;
    background: transparent;
}

.modal-header .modal-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.modal-header .modal-title.text-danger {
    color: #ff6b7a !important;
}

.modal-content.modal-danger .modal-header {
    border-bottom-color: rgba(220, 53, 69, 0.3);
}

.modal-content.modal-primary {
    border-color: rgba(0, 200, 200, 0.4);
    box-shadow: 0 0 20px rgba(0, 200, 200, 0.15), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-header .modal-title.text-primary {
    color: var(--accent-cyan, #00c8c8) !important;
}

.modal-content.modal-primary .modal-header {
    border-bottom-color: rgba(0, 200, 200, 0.3);
}

.modal-footer {
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
}

/* Dark theme modal adjustments */
[data-theme="dark"] .modal-content {
    background: var(--card-bg, #1a1a2e);
    color: var(--text-primary, #e0e0e0);
}

[data-theme="dark"] .modal-body {
    background: var(--card-bg, #1a1a2e);
}

[data-theme="dark"] .modal-footer {
    background: var(--card-bg, #1a1a2e);
}

[data-theme="dark"] .alert-danger {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    color: #ff6b7a;
}
