html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}




/* --- DESIGN SYSTEM --- */
:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-nested: #fcfcfd;
    --bg-hover: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-text: #047857;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    --timeline-bar-width: 4px;
    --timeline-bar-gap: 1px;
    /* Universal Grid for perfect alignment across all expanded tables */
    --details-grid: 2fr 120px 3fr 150px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    padding: 2rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- HEADER --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.title {
    color: inherit;
    text-decoration: none;
}

.title p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.polling-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

@@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* --- SERVICE GROUPS --- */
.group-section {
    margin-bottom: 3rem;
}

.group-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .group-title::after {
        content: '';
        flex-grow: 1;
        height: 1px;
        background-color: var(--border);
    }

.card-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
    overflow: hidden;
}

/* --- MICROSERVICE ROW (ACCORDION PARENT) --- */
.microservice {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
}

    .microservice:last-child {
        border-bottom: none;
    }

.ms-header {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    gap: 1.5rem;
    background-color: var(--bg-card);
}

    .ms-header:hover {
        background-color: var(--bg-hover);
    }

/* Identity (Favicon, Name, URL) */
.ms-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 280px;
    flex-shrink: 0;
}

.favicon {
    width: 48px;
    height: 48px;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    background: #fff;
    padding: 2px;
}

.ms-info {
    display: flex;
    flex-direction: column;
}

.ms-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.ms-url {
    font-size: 0.75rem;
    color: var(--text-light);
    font-family: var(--font-mono);
    margin-top: 0.1rem;
}

.ms-url-link {
    text-decoration: none;
}

.ms-url-link:hover {
    text-decoration: underline;
}

/* Timeline */
.ms-timeline {
    flex-grow: 1;
    display: flex;
    height: 28px;
    gap: 2px;
    align-items: stretch;
    min-width: 100px;
}

.bar {
    flex-grow: 1;
    min-width: 3px;
    border-radius: 2px;
    background-color: var(--success);
    opacity: 0.85;
    position: relative;
}

    .bar.err {
        background-color: var(--danger);
    }

    .bar:hover {
        opacity: 1;
        z-index: 10;
        transform: scaleY(1.1);
        transition: transform 0.1s;
    }

    /* Tooltip */
    .bar::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        background: #1e293b;
        color: white;
        padding: 0.3rem 0.6rem;
        border-radius: 0.375rem;
        font-size: 0.7rem;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: 0.2s;
        pointer-events: none;
        z-index: 20;
        box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    }

    .bar:hover::after {
        opacity: 1;
        visibility: visible;
    }

/* Stats & Status */
.ms-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.ms-uptime {
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: var(--text-muted);
    width: 60px;
    text-align: right;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 90px;
    justify-content: center;
}

    .badge.healthy {
        background: var(--success-bg);
        color: var(--success-text);
        border: 1px solid #a7f3d0;
    }

    .badge.unhealthy {
        background: var(--danger-bg);
        color: var(--danger-text);
        border: 1px solid #fecaca;
    }

.chevron {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.microservice.expanded .chevron {
    transform: rotate(180deg);
}

/* --- EXPANDED DETAILS (CHILD TABLE) --- */
.ms-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-nested);
}

.microservice.expanded .ms-details {
    max-height: 1000px;
    border-top: 1px solid var(--border-light);
}

.details-wrapper {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}

/* The Grid Header */
.detail-header {
    display: grid;
    grid-template-columns: var(--details-grid);
    gap: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

/* The Grid Rows */
.detail-row {
    display: grid;
    grid-template-columns: var(--details-grid);
    gap: 1rem;
    padding: 0.75rem 1rem;
    align-items: center;
    border-radius: 0.5rem;
    transition: background-color 0.15s;
}

    .detail-row:hover {
        background-color: var(--bg-card);
        box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    }

/* Cell Content */
.cell-identity {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.check-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid var(--border);
}

.cell-health {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.text-healthy {
    color: var(--success-text);
}

.text-unhealthy {
    color: var(--danger-text);
}

.cell-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.cell-timing {
    display: flex;
    flex-direction: column;
    text-align: right;
    gap: 0.15rem;
}

.time-dur {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-main);
}

.time-date {
    font-size: 0.7rem;
    color: var(--text-light);
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@@media (max-width: 1024px) {
    .ms-identity {
        width: 220px;
    }

    :root {
        --details-grid: 1.5fr 100px 2fr 120px;
    }
}

@@media (max-width: 768px) {
    .ms-header {
        flex-wrap: wrap;
    }

    .ms-identity {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .ms-stats {
        width: 100%;
        justify-content: space-between;
    }

    .ms-timeline {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
    }

    .detail-header {
        display: none;
    }

    .detail-row {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        border-bottom: 1px solid var(--border-light);
        padding: 1rem 0;
        border-radius: 0;
    }

        .detail-row:hover {
            box-shadow: none;
            background: transparent;
        }

    .cell-timing {
        text-align: left;
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem;
    }
}

.admin-link {
    text-decoration: none;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-right: 1rem;
}

    .admin-link:hover {
        text-decoration: underline;
    }

/* --- AUTH CONTROLS --- */
.auth-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.auth-container {
    position: relative;
}

.user-btn {
    background: none;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s, border-color 0.2s;
}

    .user-btn:hover {
        background-color: var(--bg-hover);
        border-color: var(--border);
    }

.user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    padding: 0.5rem;
    display: none;
    z-index: 50;
}

    .dropdown-menu.show {
        display: block;
    }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .dropdown-item:hover {
        background-color: var(--bg-hover);
        color: var(--text-main);
    }

.dropdown-divider {
    height: 1px;
    background-color: var(--border-light);
    margin: 0.5rem 0;
    border: none;
}

.btn-signin {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--text-main);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-signin:hover {
        background-color: #334155;
        color: white;
    }

.admin-shell {
    margin-bottom: 3rem;
}

.dashboard-root {
    min-height: 12rem;
}

.empty-state,
.empty-row {
    color: var(--text-muted);
    padding: 2rem;
    text-align: center;
}

.empty-state.loading {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.loading-progress {
    width: min(260px, 72vw);
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.loading-progress > span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
    animation: loading-slide 1.15s ease-in-out infinite;
}

@keyframes loading-slide {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(300%);
    }
}

.empty-state.error {
    color: var(--danger-text);
    background: var(--danger-bg);
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
}

.card-container {
    overflow: visible;
}

.microservice {
    position: relative;
}

.ms-header {
    border: 0;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(165px, 205px) minmax(0, 1fr) 148px;
    background: var(--bg-card);
    text-align: left;
    overflow: hidden;
    padding: 0.9rem 0.8rem;
}

.ms-identity {
    width: auto;
    min-width: 0;
}

.ms-info {
    min-width: 0;
}

.ms-name,
.ms-url {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-timeline {
    display: flex;
    gap: var(--timeline-bar-gap);
    height: 28px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    align-items: stretch;
}

.ms-timeline-host {
    min-width: 0;
    width: 100%;
}

.bar {
    display: block;
    flex: 0 0 var(--timeline-bar-width);
    width: var(--timeline-bar-width);
    border-radius: 0;
    opacity: 1;
    border-right: 0;
    transform: translateZ(0);
}

.bar.healthy {
    background-color: var(--success);
}

.bar.unhealthy {
    background-color: var(--danger);
}

.bar.slow {
    background-color: #f59e0b;
}

.bar.unknown {
    background-color: #cbd5e1;
}

.bar::after {
    content: none;
}

.bar:hover {
    opacity: 1;
    transform: translateZ(0);
}

.bar-tooltip {
    position: fixed;
    z-index: 1000;
    transform: translate(-50%, -100%);
    background: #1e293b;
    color: white;
    padding: 0.48rem 0.68rem;
    border-radius: 0.375rem;
    font-size: 0.82rem;
    line-height: 1.35;
    max-width: 330px;
    white-space: pre-line;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 10px 20px rgb(15 23 42 / 0.18);
}

.bar-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1e293b;
}

.bar-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.ms-stats {
    min-width: 148px;
    justify-content: flex-end;
    gap: 0.65rem;
}

.ms-timeline-placeholder {
    align-items: center;
    color: var(--text-light);
    display: inline-flex;
    font-size: 0.78rem;
    justify-content: flex-start;
    min-height: 28px;
}

.ms-uptime {
    width: 64px;
}

.logged-out-panel {
    max-width: 620px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgb(15 23 42 / 0.08);
}

.logged-out-kicker {
    color: var(--success-text);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logged-out-panel h2 {
    margin-top: 0.75rem;
    font-size: 1.75rem;
}

.logged-out-panel p {
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.logged-out-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.logged-out-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 0.45rem;
    text-decoration: none;
    font-weight: 700;
}

.logged-out-button.primary {
    background: var(--text-main);
    color: white;
}

.logged-out-button.secondary {
    color: var(--text-main);
    border: 1px solid var(--border);
}

@@media (max-width: 920px) {
    .ms-header {
        grid-template-columns: minmax(155px, 195px) minmax(0, 1fr);
    }

    .ms-stats {
        grid-column: 1 / -1;
        width: auto;
    }

    .ms-timeline {
        order: initial;
        width: 100%;
        margin-top: 0;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }
}

@@media (max-width: 680px) {
    .page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .ms-header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .ms-timeline {
        min-width: 0;
        width: 100%;
    }

    .ms-stats {
        grid-column: auto;
        justify-content: space-between;
        min-width: 0;
        width: 100%;
    }
}

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2rem 0 1rem;
}

.polling-select-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 0 0.75rem;
}

.polling-select {
    border: 0;
    background: transparent;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
}

.polling-select:focus {
    outline: none;
}

.dashboard-subscribe-btn,
.dashboard-history-link,
.history-admin,
.history-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.6rem 1rem;
    border-radius: 0.45rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.dashboard-subscribe-btn {
    gap: 0.45rem;
}

.dashboard-history-link {
    gap: 0.45rem;
}

.dashboard-subscribe-btn,
.dashboard-history-link,
.history-admin {
    background: var(--text-main);
    color: white;
}

.dashboard-subscribe-btn:hover,
.dashboard-history-link:hover,
.history-admin:hover {
    background: #1e293b;
}

.history-back {
    color: var(--text-main);
    border: 1px solid var(--border);
}

.history-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.history-empty {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.history-empty p {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.history-month {
    margin-bottom: 3rem;
}

.history-month h2 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.history-entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 5px solid var(--text-light);
    border-radius: 0.65rem;
    box-shadow: 0 1px 3px rgb(15 23 42 / 0.05);
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.history-entry.critical {
    border-left-color: var(--danger);
}

.history-entry.warning {
    border-left-color: #f59e0b;
}

.history-entry.resolved {
    border-left-color: var(--success);
}

.history-entry.info {
    border-left-color: #3b82f6;
}

.subscribe-modal-dialog {
    transition: none;
    z-index: 1002;
}

.subscribe-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    height: 100%;
    min-height: 420px;
    border-radius: 0.5rem;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
}

.subscribe-modal-header {
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    cursor: move;
    display: flex;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    user-select: none;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
}

.btn-close {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    height: 1.5rem;
    line-height: 1;
    width: 1.5rem;
}

.btn-close::before {
    content: "×";
}

.modal-body {
    padding: 1rem;
    overflow: auto;
}

.modal {
    background: rgb(15 23 42 / 0.45);
    display: none;
    inset: 0;
    position: fixed;
    z-index: 1001;
}

.modal.show {
    display: block;
}

body.modal-open {
    overflow: hidden;
}

.nav.nav-tabs {
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0 0 0.25rem;
}

.nav-link {
    background: transparent;
    border: 0;
    border-radius: 0.35rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.45rem 0.7rem;
}

.nav-link.active {
    background: #ecfeff;
    color: #0f766e;
}

.tab-pane {
    display: none;
}

.tab-pane.show.active {
    display: block;
}

.form-label {
    color: var(--text-muted);
    display: block;
    font-size: 0.83rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.form-control {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    color: var(--text-main);
    font-size: 0.92rem;
    padding: 0.55rem 0.65rem;
    width: 100%;
}

.form-control:focus {
    border-color: #38bdf8;
    outline: none;
}

.form-check {
    align-items: center;
    display: flex;
    gap: 0.55rem;
}

.btn {
    border: 1px solid transparent;
    border-radius: 0.45rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    min-height: 2.25rem;
    padding: 0.45rem 0.85rem;
}

.btn-primary {
    background: #0f172a;
    color: #fff;
}

.btn-primary:hover {
    background: #1e293b;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.d-none {
    display: none !important;
}

.subscribe-tab-content {
    padding-top: 1rem;
}

.subscribe-email-form {
    max-width: 520px;
}

.subscribe-component-selection {
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    padding: 0.75rem;
    max-height: 240px;
    overflow: auto;
}

.component-selection-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.component-checkboxes {
    display: grid;
    gap: 0.35rem;
}

.component-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
}

.subscribe-result {
    margin-top: 0.85rem;
    font-size: 0.9rem;
}

.subscribe-result.success {
    color: var(--success-text);
}

.subscribe-result.error {
    color: var(--danger-text);
}

.subscribe-tab-intro {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 0.75rem;
}

.subscribe-telegram-text {
    font-size: 1rem;
}

.subscribe-telegram-help {
    margin-top: 0.75rem;
    color: var(--text-muted);
}

.subscribe-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    padding: 0.9rem;
}

.subscribe-card-title {
    align-items: center;
    color: var(--text-main);
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 700;
    gap: 0.45rem;
    margin-bottom: 0.6rem;
}

.subscribe-link-btn {
    background: #0ea5e9;
    border-radius: 0.4rem;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.86rem;
    font-weight: 700;
    margin-top: 0.45rem;
    padding: 0.45rem 0.75rem;
    text-decoration: none;
}

.subscribe-link-btn:hover {
    background: #0284c7;
}

.subscribe-link-btn.disabled {
    background: #94a3b8;
    cursor: not-allowed;
    pointer-events: none;
}

.subscribe-modal-resize-handle {
    position: absolute;
    right: 0.3rem;
    bottom: 0.3rem;
    width: 1.1rem;
    height: 1.1rem;
    cursor: nwse-resize;
    opacity: 0.55;
}

.subscribe-modal-resize-handle::before {
    content: "";
    position: absolute;
    inset: 0;
    border-right: 2px solid var(--text-light);
    border-bottom: 2px solid var(--text-light);
}

.history-entry-header {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.history-entry h3 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.history-meta {
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    gap: 0.65rem;
}

.history-status {
    align-self: flex-start;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.25rem 0.55rem;
    text-transform: uppercase;
}

.history-status.critical {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.history-status.warning {
    background: #fffbeb;
    color: #b45309;
}

.history-status.resolved {
    background: var(--success-bg);
    color: var(--success-text);
}

.history-status.info {
    background: #eff6ff;
    color: #1d4ed8;
}

.history-endpoint {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.history-entry p {
    color: var(--text-main);
}

@@media (max-width: 680px) {
    body {
        padding: 0.75rem;
    }

    .page-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .title h1 {
        font-size: 1.35rem;
    }

    .title p,
    .polling-indicator {
        font-size: 0.78rem;
    }

    .auth-controls {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .group-section {
        margin-bottom: 1.25rem;
    }

    .group-title {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .ms-header {
        padding: 0.75rem;
    }

    .favicon {
        height: 24px;
        width: 24px;
    }

    .ms-name {
        font-size: 0.86rem;
    }

    .ms-url {
        font-size: 0.68rem;
    }

    .ms-timeline {
        height: 20px;
        gap: var(--timeline-bar-gap);
    }

    .ms-stats {
        gap: 0.5rem;
    }

    .ms-uptime {
        font-size: 0.78rem;
        text-align: left;
        width: auto;
    }

    .badge {
        font-size: 0.68rem;
        padding: 0.2rem 0.45rem;
        width: auto;
    }

    .details-wrapper {
        padding: 0.5rem 0.75rem 0.75rem;
    }

    .detail-row {
        gap: 0.35rem;
        padding: 0.65rem 0;
    }

    .history-actions,
    .history-entry-header {
        flex-direction: column;
    }

    .history-entry {
        padding: 1rem;
    }
}

.badge.ssl-warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    width: auto;
}

.ssl-warning-icon-only {
    min-width: 26px;
    width: 26px;
    padding: 0.2rem 0;
}
