/**
 * Monitoring Page Styles
 * LinkGuard - Dark Cyberpunk Dashboard
 *
 * All selectors prefixed with .monitoring-* to avoid conflicts.
 * Status badge classes (.status-badge.*) are global and reusable.
 */

/* ============================================================
   STATUS BADGES — Global, reusable across dashboard pages
   ============================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    transition: box-shadow var(--duration-fast) ease;
}

.status-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* "!" reason indicator next to a WARNING badge — hover shows the specific
   rel/anchor mismatch reason (mirrors the group links table). */
.warning-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    background: rgba(254, 228, 64, 0.2);
    color: var(--neon-yellow);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: help;
}

/* ACTIVE — neon-cyan */
.status-badge.status-active {
    background: rgba(0, 245, 212, 0.12);
    border: 1px solid rgba(0, 245, 212, 0.4);
    color: var(--neon-cyan);
}
.status-badge.status-active::before {
    background: var(--neon-cyan);
    box-shadow: 0 0 6px var(--neon-cyan);
    animation: status-pulse-cyan 2s ease-in-out infinite;
}

@keyframes status-pulse-cyan {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* WARNING / NOFOLLOW — neon-yellow */
.status-badge.status-warning,
.status-badge.status-nofollow {
    background: rgba(254, 228, 64, 0.1);
    border: 1px solid rgba(254, 228, 64, 0.35);
    color: var(--neon-yellow);
}
.status-badge.status-warning::before,
.status-badge.status-nofollow::before {
    background: var(--neon-yellow);
    box-shadow: 0 0 6px rgba(254, 228, 64, 0.6);
}

/* NOT_FOUND / ERROR — neon-magenta */
.status-badge.status-not-found,
.status-badge.status-error {
    background: rgba(247, 37, 133, 0.12);
    border: 1px solid rgba(247, 37, 133, 0.4);
    color: var(--neon-magenta);
}
.status-badge.status-not-found::before,
.status-badge.status-error::before {
    background: var(--neon-magenta);
    box-shadow: 0 0 6px rgba(247, 37, 133, 0.6);
}

/* PENDING — muted grey */
.status-badge.status-pending {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
}
.status-badge.status-pending::before {
    background: rgba(255, 255, 255, 0.35);
    animation: status-pulse-grey 3s ease-in-out infinite;
}

@keyframes status-pulse-grey {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* NOT_INDEXED — yellow variant */
.status-badge.status-not-indexed {
    background: rgba(254, 228, 64, 0.08);
    border: 1px solid rgba(254, 228, 64, 0.25);
    color: rgba(254, 228, 64, 0.8);
}
.status-badge.status-not-indexed::before {
    background: rgba(254, 228, 64, 0.6);
}

/* EXPIRED — neon-purple */
.status-badge.status-expired {
    background: rgba(123, 44, 191, 0.15);
    border: 1px solid rgba(123, 44, 191, 0.4);
    color: var(--neon-purple);
}
.status-badge.status-expired::before {
    background: var(--neon-purple);
    box-shadow: 0 0 6px rgba(123, 44, 191, 0.6);
}

/* ============================================================
   MONITORING PAGE HEADER
   ============================================================ */

.monitoring-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.monitoring-title-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.monitoring-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 1px;
}

.monitoring-subtitle {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.monitoring-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

/* A2 — Cost preview line under the "Run All Checks" header button.
   Stays empty until the subtitle text is set by JS, so the layout
   doesn't reserve visible space prematurely. */
.btn-run-check-subtitle {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    min-height: 1em;
    text-align: right;
}

.btn-run-check-subtitle.subtitle--warning {
    color: var(--neon-yellow);
}

.btn-run-check-subtitle.subtitle--critical {
    color: var(--neon-magenta);
}

/* ============================================================
   KPI CARDS ROW
   ============================================================ */

.monitoring-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.monitoring-kpi-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--space-5) var(--space-6);
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) ease;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.monitoring-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--kpi-color, var(--neon-cyan)), transparent);
    opacity: 0.6;
}

.monitoring-kpi-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.monitoring-kpi-card.kpi-total   { --kpi-color: var(--neon-blue); }
.monitoring-kpi-card.kpi-active  { --kpi-color: var(--neon-cyan); }
.monitoring-kpi-card.kpi-warning { --kpi-color: var(--neon-yellow); }
.monitoring-kpi-card.kpi-broken  { --kpi-color: var(--neon-magenta); }

.monitoring-kpi-card.kpi-active:hover  { box-shadow: 0 8px 24px rgba(0, 245, 212, 0.1); }
.monitoring-kpi-card.kpi-warning:hover { box-shadow: 0 8px 24px rgba(254, 228, 64, 0.1); }
.monitoring-kpi-card.kpi-broken:hover  { box-shadow: 0 8px 24px rgba(247, 37, 133, 0.1); }

.monitoring-kpi-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.monitoring-kpi-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--kpi-color, var(--text-primary));
    margin-bottom: var(--space-2);
}

.monitoring-kpi-value.loading {
    display: flex;
    align-items: center;
}

.monitoring-kpi-sub {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.monitoring-kpi-icon {
    position: absolute;
    top: var(--space-5);
    right: var(--space-5);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    opacity: 0.6;
}

.monitoring-kpi-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--kpi-color, var(--neon-cyan));
}

/* ============================================================
   FILTERS BAR
   ============================================================ */

.monitoring-filters {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}

.monitoring-filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.monitoring-filter-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.monitoring-select {
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    padding: 7px 32px 7px 12px;
    cursor: pointer;
    transition: border-color var(--duration-fast) ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300f5d4' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    min-width: 140px;
}

.monitoring-select:hover {
    border-color: rgba(0, 245, 212, 0.3);
}

.monitoring-select:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(0, 245, 212, 0.1);
}

.monitoring-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.monitoring-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 340px;
}

.monitoring-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.monitoring-search {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    padding: 7px 12px 7px 36px;
    transition: border-color var(--duration-fast) ease;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.monitoring-search::placeholder {
    color: var(--text-muted);
}

.monitoring-search:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(0, 245, 212, 0.1);
}

.monitoring-filter-spacer {
    flex: 1;
}

.monitoring-results-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ============================================================
   LINKS TABLE (Desktop)
   ============================================================ */

.monitoring-table-wrapper {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.monitoring-table {
    width: 100%;
    border-collapse: collapse;
}

.monitoring-table thead th {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.monitoring-table thead th.col-actions {
    text-align: right;
}

.monitoring-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background var(--duration-fast) ease;
}

.monitoring-table tbody tr:last-child {
    border-bottom: none;
}

.monitoring-table tbody tr:hover {
    background: rgba(0, 245, 212, 0.03);
}

.monitoring-table td {
    padding: var(--space-3) var(--space-4);
    vertical-align: middle;
}

/* Donor URL cell */
.monitoring-td-url {
    max-width: 280px;
}

.monitoring-url-primary {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
    display: block;
}

.monitoring-url-primary a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}

.monitoring-url-primary a:hover {
    color: var(--neon-cyan);
}

.monitoring-url-target {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
    display: block;
    margin-top: 2px;
}

/* REL cell */
.monitoring-rel-badge {
    display: inline-flex;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: lowercase;
    background: rgba(76, 201, 240, 0.1);
    border: 1px solid rgba(76, 201, 240, 0.25);
    color: var(--neon-blue);
    clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px));
}

.monitoring-rel-badge.rel-nofollow {
    background: rgba(254, 228, 64, 0.08);
    border-color: rgba(254, 228, 64, 0.2);
    color: var(--neon-yellow);
}

/* DR cell — Domain Rating by Ahrefs
   Angular clip-path badge, three color tiers:
   0–29 = muted/grey (low authority)
   30–59 = cyan/accent (medium authority)
   60–100 = neon-green glow (high authority)
   null → plain muted em-dash, no badge shell */
.dr-badge {
    display: inline-block;
    min-width: 32px;
    padding: 2px 7px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    line-height: 1.6;
    clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px));
    vertical-align: middle;
}

/* DR null / unknown — no badge, just muted dash */
.dr-badge--null {
    clip-path: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0;
    min-width: unset;
    font-size: 13px;
    font-weight: 400;
}

/* DR 0–29: low authority — grey */
.dr-badge--low {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-muted);
}

/* DR 30–59: medium authority — cyan */
.dr-badge--mid {
    background: rgba(0, 245, 212, 0.1);
    border: 1px solid rgba(0, 245, 212, 0.3);
    color: var(--neon-cyan);
}

/* DR 60–100: high authority — neon-green glow (--neon-green palette token) */
.dr-badge--high {
    background: rgba(46, 232, 110, 0.12);
    border: 1px solid rgba(46, 232, 110, 0.4);
    color: var(--neon-green);
    box-shadow: 0 0 8px var(--glow-green);
}

/* DR secondary line (target DR, shown below donor DR in table cells) */
.dr-badge-target {
    display: block;
    margin-top: 3px;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Domain Trust chip (§9.8) — "% lost" removal stat under the DR badge.
   Angular clip-path per design system; tone tiers:
   <10% ok (muted) · 10–24% warn (amber) · ≥25% risk (magenta). */
.trust-chip {
    display: block;
    margin-top: 3px;
    padding: 1px 6px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    line-height: 1.6;
    cursor: help;
    clip-path: polygon(0 0, calc(100% - 3px) 0, 100% 3px, 100% 100%, 3px 100%, 0 calc(100% - 3px));
}

.trust-chip--ok {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
}

.trust-chip--warn {
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--warning, #f59e0b);
}

.trust-chip--risk {
    background: rgba(255, 42, 109, 0.10);
    border: 1px solid rgba(255, 42, 109, 0.35);
    color: var(--neon-magenta);
}

/* Last checked cell */
.monitoring-last-checked {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.monitoring-last-checked.never {
    color: rgba(255, 255, 255, 0.25);
    font-style: italic;
}

/* DR column */
.col-dr {
    width: 56px;
    text-align: center;
}

.monitoring-td-dr {
    text-align: center;
    white-space: nowrap;
}

/* Actions cell */
.monitoring-td-actions {
    text-align: right;
    white-space: nowrap;
}

/* ============================================================
   RUN CHECK BUTTON
   ============================================================ */

.btn-run-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 245, 212, 0.08);
    border: 1px solid rgba(0, 245, 212, 0.25);
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    white-space: nowrap;
}

.btn-run-check:hover {
    background: rgba(0, 245, 212, 0.15);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px rgba(0, 245, 212, 0.2);
    transform: translateY(-1px);
}

.btn-run-check:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-run-check svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* Spinner inside button */
.btn-run-check .btn-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 245, 212, 0.3);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.monitoring-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px var(--space-6);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.monitoring-empty-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 245, 212, 0.06);
    border: 1px solid rgba(0, 245, 212, 0.2);
    border-radius: 50%;
    margin-bottom: var(--space-6);
    animation: monitoring-idle-pulse 4s ease-in-out infinite;
}

@keyframes monitoring-idle-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 245, 212, 0); }
    50%       { box-shadow: 0 0 0 12px rgba(0, 245, 212, 0.06); }
}

.monitoring-empty-icon svg {
    width: 36px;
    height: 36px;
    color: var(--neon-cyan);
    opacity: 0.7;
}

.monitoring-empty-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-3) 0;
    letter-spacing: 0.5px;
}

.monitoring-empty-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.6;
    margin: 0 0 var(--space-6) 0;
}

/* ============================================================
   PENDING-ONLY EMPTY STATE (all links are PENDING)
   ============================================================ */

.monitoring-pending-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px var(--space-6);
    background: var(--bg-card);
    border: 1px solid rgba(254, 228, 64, 0.15);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.monitoring-pending-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(254, 228, 64, 0.06);
    border: 1px solid rgba(254, 228, 64, 0.25);
    border-radius: 50%;
    margin-bottom: var(--space-5);
    animation: monitoring-idle-pulse-yellow 3s ease-in-out infinite;
}

@keyframes monitoring-idle-pulse-yellow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(254, 228, 64, 0); }
    50%       { box-shadow: 0 0 0 10px rgba(254, 228, 64, 0.05); }
}

.monitoring-pending-icon svg {
    width: 32px;
    height: 32px;
    color: var(--neon-yellow);
    opacity: 0.8;
}

.monitoring-pending-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-2) 0;
}

.monitoring-pending-desc {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 380px;
    line-height: 1.6;
    margin: 0 0 var(--space-3) 0;
}

/* B4 — timing/cost nudge under the pending-state body copy. */
.monitoring-pending-hint {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--neon-cyan);
    opacity: 0.75;
    max-width: 380px;
    line-height: 1.5;
    margin: 0 0 var(--space-5) 0;
}

/* B4 — secondary line under the true monitoring empty-state copy.
   Reuses the empty-state container styles; styled here for the new class only. */
.empty-state__hint {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--neon-cyan);
    opacity: 0.75;
    max-width: 460px;
    line-height: 1.5;
    margin: var(--space-2) 0 var(--space-4) 0;
}

/* ============================================================
   LOADING STATE (table skeleton)
   ============================================================ */

.monitoring-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px var(--space-6);
    gap: var(--space-4);
}

.monitoring-loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(0, 245, 212, 0.15);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.monitoring-loading p {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   PAGINATION
   ============================================================ */

.monitoring-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-5) 0;
}

.monitoring-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px));
}

.monitoring-page-btn:hover {
    border-color: rgba(0, 245, 212, 0.3);
    color: var(--neon-cyan);
}

.monitoring-page-btn.active {
    background: rgba(0, 245, 212, 0.12);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.monitoring-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.monitoring-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.monitoring-toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.12);
    max-width: 360px;
    pointer-events: all;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    animation: toast-in 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes toast-in {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.monitoring-toast.toast-out {
    animation: toast-out 0.25s ease forwards;
}

@keyframes toast-out {
    to { transform: translateX(120%); opacity: 0; }
}

.monitoring-toast.toast-success { border-left: 3px solid var(--neon-cyan); }
.monitoring-toast.toast-error   { border-left: 3px solid var(--neon-magenta); }
.monitoring-toast.toast-warning { border-left: 3px solid var(--neon-yellow); }
.monitoring-toast.toast-info    { border-left: 3px solid var(--neon-blue); }

.monitoring-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.monitoring-toast.toast-success .monitoring-toast-icon { color: var(--neon-cyan); }
.monitoring-toast.toast-error   .monitoring-toast-icon { color: var(--neon-magenta); }
.monitoring-toast.toast-warning .monitoring-toast-icon { color: var(--neon-yellow); }
.monitoring-toast.toast-info    .monitoring-toast-icon { color: var(--neon-blue); }

.monitoring-toast-icon svg {
    width: 20px;
    height: 20px;
}

.monitoring-toast-body {
    flex: 1;
    min-width: 0;
}

.monitoring-toast-title {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.monitoring-toast-msg {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    word-break: break-all;
}

/* -----------------------------------------------------------------------------
 * Actionable toast variant — used by the 402 "Out of tokens" CTA and any
 * future toast that needs inline buttons. Disables click-to-dismiss on the
 * toast body and exposes a dedicated close affordance.
 * --------------------------------------------------------------------------- */
.monitoring-toast.toast-with-actions {
    cursor: default;
    max-width: 420px;
    padding-right: var(--space-7, 32px);
}

.monitoring-toast-actions {
    display: flex;
    gap: var(--space-2, 8px);
    margin-top: var(--space-3, 12px);
    flex-wrap: wrap;
}

.monitoring-toast-action {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.18s ease;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.monitoring-toast-action:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.05);
}

.monitoring-toast-action--primary {
    border-color: var(--neon-cyan, #0ff);
    background: rgba(0, 255, 255, 0.1);
    color: var(--neon-cyan, #0ff);
}

.monitoring-toast-action--primary:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 16px rgba(0, 255, 255, 0.3);
}

.monitoring-toast-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

.monitoring-toast-close:hover {
    color: var(--text-primary);
}

.monitoring-toast.toast-with-actions {
    position: relative;
}

/* ============================================================
   MOBILE CARDS (< 768px: table → card layout)
   ============================================================ */

.monitoring-card-list {
    display: none;
    flex-direction: column;
    gap: var(--space-3);
}

.monitoring-link-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--space-4);
    transition: all var(--duration-fast) ease;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.monitoring-link-card:hover {
    border-color: rgba(0, 245, 212, 0.2);
    background: var(--bg-card-hover);
}

.monitoring-link-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.monitoring-link-card-url {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.4;
}

.monitoring-link-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.monitoring-link-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.monitoring-link-card-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 1200px) {
    .monitoring-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    /* Hide some table columns on tablet */
    .monitoring-table .col-target,
    .monitoring-table .col-last-checked {
        display: none;
    }
}

@media (max-width: 768px) {
    .monitoring-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    /* Disable hover lift on touch devices — design system rule */
    .monitoring-kpi-card:hover {
        transform: none;
    }

    .monitoring-kpi-value {
        font-size: 1.5rem;
    }

    .monitoring-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .monitoring-filter-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .monitoring-select {
        width: 100%;
        min-width: unset;
    }

    .monitoring-search-wrapper {
        max-width: 100%;
        min-width: unset;
    }

    .monitoring-filter-spacer {
        display: none;
    }

    /* Switch table to card layout */
    .monitoring-table-wrapper {
        display: none;
    }

    .monitoring-card-list {
        display: flex;
    }

    .monitoring-header {
        flex-direction: column;
    }

    .monitoring-header-actions {
        width: 100%;
    }

    /* Ensure touch target meets 44px minimum */
    .btn-run-check {
        min-height: 44px;
    }

    /* Header run-all button spans full width on mobile */
    .monitoring-header-actions .btn-run-check {
        width: 100%;
        justify-content: center;
    }

    /* 44px touch targets for filter controls */
    .monitoring-select,
    .monitoring-search {
        min-height: 44px;
        /* Prevent iOS input zoom (inputs must be >= 16px on mobile) */
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .monitoring-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .monitoring-toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .monitoring-toast {
        max-width: 100%;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .status-badge::before,
    .monitoring-empty-icon,
    .monitoring-pending-icon,
    .monitoring-loading-spinner,
    .btn-spinner {
        animation: none !important;
    }

    .monitoring-toast,
    .monitoring-toast.toast-out {
        animation: none !important;
        transition: opacity 0.15s ease;
    }
}
