* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --text: #172033;
    --muted: #6b7280;

    --border: #e4e8ef;

    --primary: #111827;
    --primary-hover: #263244;

    --green: #16a34a;
    --green-soft: #ecfdf3;

    --red: #dc2626;
    --red-soft: #fff1f2;

    --blue: #2563eb;

    --radius: 14px;
}

html {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--blue);
}

h1,
h2,
h3 {
    color: var(--text);
}

h1 {
    font-size: 34px;
    line-height: 1.15;
}

h2 {
    margin-top: 0;
}

p {
    line-height: 1.55;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.page {
    padding-bottom: 70px;
}

.narrow-page {
    width: min(760px, calc(100% - 32px));
    padding-bottom: 70px;
}


/* HEADER */

.topbar {
    background: #111827;
    color: white;
    border-bottom: 1px solid #263244;
}

.topbar-inner {
    min-height: 68px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;
}

.brand {
    color: white;
    text-decoration: none;

    font-size: 22px;
    font-weight: 750;

    white-space: nowrap;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topnav form {
    margin: 0;
}

.topnav > a {
    color: #d1d5db;
    text-decoration: none;
}

.topnav > a:hover,
.topnav .nav-active {
    color: white;
}

.user-email {
    color: #9ca3af;
}


/* BUTTONS */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 40px;

    border: 1px solid transparent;
    border-radius: 9px;

    padding: 9px 15px;

    text-decoration: none;

    font: inherit;
    font-weight: 600;

    cursor: pointer;
}

.button-primary {
    background: var(--primary);
    color: white;
}

.button-primary:hover {
    background: var(--primary-hover);
}

.button-secondary {
    background: white;
    color: var(--text);
    border-color: var(--border);
}

.topbar .button-secondary {
    background: transparent;
    color: white;
    border-color: #475569;
}

.button-danger-outline {
    background: white;
    color: var(--red);
    border-color: #fecaca;
}

.button-large {
    min-height: 48px;
    padding: 12px 20px;
}


/* PAGE TITLES */

.hero-row {
    padding: 44px 0 24px;

    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    gap: 30px;
}

.page-title {
    padding: 44px 0 10px;
}

.hero-row h1,
.page-title h1 {
    margin: 6px 0 8px;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 0.11em;
    font-weight: 800;
    color: #64748b;
}

.lead {
    color: var(--muted);
    margin-bottom: 0;
}


/* PANELS */

.panel {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 24px;

    margin-top: 22px;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.025);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}

.panel-header h2 {
    margin-bottom: 5px;
}

.panel-header p {
    margin: 0;
    color: var(--muted);
}


/* STATS */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;
}

.metric-card {
    min-width: 0;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 19px;
}

.metric-label {
    color: var(--muted);

    font-size: 13px;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 28px;
    font-weight: 750;

    letter-spacing: -0.02em;
}

.metric-value span {
    color: #94a3b8;
    font-size: 17px;
    font-weight: 500;
}

.metric-help {
    color: var(--muted);

    margin-top: 8px;
    font-size: 13px;
}

.status-good {
    color: var(--green);
    font-size: 18px;
    font-weight: 700;

    margin-top: 16px;
}

.status-muted {
    color: #94a3b8;
    font-size: 18px;
    font-weight: 700;

    margin-top: 16px;
}


/* PROGRESS */

.progress {
    overflow: hidden;

    height: 7px;

    margin-top: 14px;

    border-radius: 99px;

    background: #e9edf3;
}

.progress-fill {
    height: 100%;

    border-radius: inherit;

    background: #111827;
}


/* TELEGRAM */

.telegram-connected {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    padding: 16px;

    border-radius: 12px;

    background: var(--green-soft);
}

.telegram-connected p {
    margin-bottom: 0;
    color: #4b5563;
}

.telegram-link {
    background: #f8fafc;

    border: 1px dashed #cbd5e1;
    border-radius: 12px;

    padding: 20px;

    text-align: center;
}

.link-code {
    display: inline-block;

    margin: 12px 0;

    padding: 12px 18px;

    border-radius: 9px;

    background: #111827;
    color: white;

    font-family: monospace;

    font-size: 24px;
    font-weight: 700;

    letter-spacing: 0.12em;
}


/* MONITORS */

.monitor-list {
    border-top: 1px solid var(--border);
}

.monitor-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding: 22px 0;

    border-bottom: 1px solid var(--border);
}

.monitor-card:last-child {
    border-bottom: 0;
}

.monitor-main {
    min-width: 0;

    display: flex;
    align-items: flex-start;

    gap: 14px;

    flex: 1;
}

.monitor-status {
    padding-top: 8px;
}

.dot {
    display: block;

    width: 10px;
    height: 10px;

    border-radius: 50%;
}

.dot-green {
    background: var(--green);

    box-shadow:
        0 0 0 4px #dcfce7;
}

.dot-gray {
    background: #94a3b8;
}

.monitor-body {
    min-width: 0;
    flex: 1;
}

.monitor-title-row {
    display: flex;
    align-items: center;
    gap: 10px;

    flex-wrap: wrap;
}

.monitor-title-row h3 {
    margin: 0;
}

.badge {
    display: inline-flex;

    padding: 3px 8px;

    border-radius: 99px;

    background: #f1f5f9;
    color: #64748b;

    font-size: 12px;
    font-weight: 700;
}

.badge-green {
    color: #15803d;
    background: #dcfce7;
}

.monitor-condition {
    margin-top: 9px;

    font-weight: 600;
}

.monitor-url {
    display: block;

    max-width: 650px;

    margin-top: 6px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #64748b;

    font-size: 13px;
}

.monitor-meta {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;

    margin-top: 16px;
}

.monitor-meta > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.monitor-meta span {
    color: #94a3b8;
    font-size: 12px;
}

.monitor-meta strong {
    font-size: 13px;
    font-weight: 600;
}

.monitor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;

    justify-content: flex-end;
}

.monitor-actions form {
    margin: 0;
}


/* EMPTY */

.empty-state {
    text-align: center;

    padding: 48px 15px 36px;
}

.empty-icon {
    font-size: 42px;
}

.empty-state h3 {
    margin-bottom: 5px;
}

.empty-state p {
    color: var(--muted);

    margin-top: 0;
}


/* FORMS */

.form-panel {
    padding: 28px;
}

.main-form {
    display: flex;
    flex-direction: column;

    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 700;

    margin-bottom: 8px;
}

input,
select,
textarea {
    width: 100%;

    border: 1px solid #cfd6e1;
    border-radius: 9px;

    background: white;
    color: var(--text);

    padding: 12px 13px;

    font: inherit;

    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #64748b;

    box-shadow:
        0 0 0 3px rgba(100, 116, 139, 0.12);
}

textarea {
    resize: vertical;
}

.form-help {
    margin-top: 7px;

    color: var(--muted);

    font-size: 13px;
}

.example-box {
    margin-top: 13px;

    padding: 14px 16px;

    background: #f8fafc;

    border: 1px solid var(--border);
    border-radius: 10px;

    color: #475569;

    font-size: 13px;
}

.example-box ul {
    margin-bottom: 0;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding-top: 5px;
}

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


/* ALERTS */

.alert {
    border-radius: 10px;

    padding: 13px 15px;

    margin-bottom: 20px;
}

.alert-error {
    background: var(--red-soft);
    color: #991b1b;

    border: 1px solid #fecdd3;
}


/* PLAN */

.plan-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;
}

.plan-card {
    position: relative;

    border: 1px solid var(--border);
    border-radius: 13px;

    padding: 20px;

    background: white;
}

.plan-current {
    border-color: #64748b;

    box-shadow:
        inset 0 0 0 1px #64748b;
}

.plan-current-label {
    position: absolute;

    top: 12px;
    right: 12px;

    background: #111827;
    color: white;

    padding: 4px 8px;

    border-radius: 99px;

    font-size: 11px;
    font-weight: 700;
}

.plan-number {
    margin-top: 20px;

    font-size: 34px;
    font-weight: 800;
}

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

.plan-features {
    min-height: 145px;

    padding-left: 19px;

    color: #475569;

    line-height: 1.8;
}

.settings-stats {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}


/* EXISTING EVENT STYLES */

.card {
    background: white;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 24px;

    margin-top: 24px;
}

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

.error {
    background: var(--red-soft);
    color: #991b1b;

    padding: 13px;

    border-radius: 9px;
}

.stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat {
    flex: 1;
    min-width: 150px;

    background: #f8fafc;

    border: 1px solid var(--border);
    border-radius: 12px;

    padding: 16px;
}

.stat-value {
    font-size: 23px;
}

.monitor {
    border-top: 1px solid var(--border);

    padding: 20px 0;
}

.monitor:first-child {
    border-top: 0;
}

.condition-box {
    padding: 18px;

    background: #f8fafc;

    border: 1px solid var(--border);
    border-radius: 10px;

    font-size: 17px;
}

.change-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 20px;
}

.change-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.change-line {
    display: flex;
    gap: 10px;

    margin-bottom: 8px;

    padding: 12px;

    border-radius: 8px;
}

.removed-line {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.added-line {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.change-symbol {
    font-weight: 800;
}

.diff-box {
    margin-top: 18px;

    padding: 18px;

    border-radius: 10px;

    overflow-x: auto;

    background: #111827;
    color: #f9fafb;

    white-space: pre-wrap;
    word-break: break-word;

    font-family:
        Consolas,
        Monaco,
        monospace;

    line-height: 1.5;
}

.details-summary {
    cursor: pointer;
    font-weight: 700;
}

.summary-text {
    font-size: 18px;
    line-height: 1.6;
}

.footer {
    padding: 35px 0 50px;

    text-align: center;

    color: #94a3b8;
}


/* MOBILE */

@media (max-width: 960px) {

    .stats-grid,
    .plan-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

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

    .monitor-actions {
        justify-content: flex-start;
    }

}


@media (max-width: 680px) {

    .container,
    .narrow-page {
        width: min(100% - 20px, 1180px);
    }

    .topbar-inner {
        padding: 12px 0;

        align-items: flex-start;
        flex-direction: column;
    }

    .topnav {
        width: 100%;

        flex-wrap: wrap;
    }

    .user-email {
        width: 100%;
    }

    .hero-row {
        padding-top: 30px;

        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid,
    .settings-stats,
    .plan-grid,
    .change-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 18px;
    }

    .form-panel {
        padding: 18px;
    }

    .form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .monitor-meta {
        gap: 14px;

        flex-direction: column;
    }

    .telegram-connected {
        align-items: flex-start;
        flex-direction: column;
    }

}


/* =========================================================
   NOTIFICATIONS
   ========================================================= */

.notification-filters {
    display: grid;
    grid-template-columns:
        minmax(180px, 260px)
        minmax(180px, 260px)
        auto;

    gap: 14px;

    align-items: end;

    padding: 18px;

    margin-bottom: 20px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
}

.notification-filters .form-group {
    margin: 0;
}

.notification-list {
    border-top: 1px solid var(--border);
}

.notification-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding: 20px 0;

    border-bottom: 1px solid var(--border);
}

.notification-row:last-child {
    border-bottom: 0;
}

.notification-main {
    min-width: 0;
    flex: 1;
}

.notification-title {
    display: flex;
    flex-direction: column;

    gap: 5px;

    margin-top: 12px;
}

.notification-title a {
    width: fit-content;

    color: var(--text);

    font-weight: 750;
    text-decoration: none;
}

.notification-title a:hover {
    text-decoration: underline;
}

.notification-title span {
    max-width: 760px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--muted);

    font-size: 14px;
}

.notification-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 14px;

    margin-top: 10px;

    color: #94a3b8;

    font-size: 12px;
}

.notification-error {
    max-width: 850px;

    margin-top: 12px;
    padding: 10px 12px;

    border: 1px solid #fecaca;
    border-radius: 8px;

    background: var(--red-soft);
    color: #991b1b;

    font-size: 13px;

    overflow-wrap: anywhere;
}

.notification-badge-error {
    color: #b91c1c;
    background: #fee2e2;
}

.notification-badge-processing {
    color: #1d4ed8;
    background: #dbeafe;
}

.notification-actions {
    display: flex;
    align-items: center;
}

.notification-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding-top: 22px;

    color: var(--muted);

    font-size: 13px;
}

.notification-pagination-actions {
    display: flex;
    gap: 8px;
}


@media (max-width: 680px) {

    .notification-filters {
        grid-template-columns: 1fr;
    }

    .notification-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .notification-title span {
        white-space: normal;
    }

    .notification-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

}


/* =========================================================
   MONITOR DETAIL OVERVIEW
   ========================================================= */

.monitor-overview {
    display: grid;
    grid-template-columns:
        minmax(300px, 1.25fr)
        minmax(420px, 2fr);

    gap: 15px;

    margin-bottom: 24px;
}

.monitor-health-card,
.monitor-overview-details {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.monitor-health-card {
    padding: 20px 22px;
}

.monitor-health {
    display: flex;
    align-items: center;

    gap: 13px;

    min-height: 58px;
}

.monitor-health-dot {
    width: 11px;
    height: 11px;

    flex: 0 0 11px;

    border-radius: 50%;

    background: #94a3b8;
}

.monitor-health > div {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.monitor-health strong {
    font-size: 20px;
    line-height: 1.2;
}

.monitor-health span:not(.monitor-health-dot) {
    color: var(--muted);

    font-size: 13px;
    line-height: 1.4;
}

.monitor-health-good .monitor-health-dot {
    background: var(--green);
}

.monitor-health-good strong {
    color: var(--green);
}

.monitor-health-warning .monitor-health-dot {
    background: #d97706;
}

.monitor-health-warning strong {
    color: #b45309;
}

.monitor-health-error .monitor-health-dot {
    background: #dc2626;
}

.monitor-health-error strong {
    color: #dc2626;
}

.monitor-health-paused .monitor-health-dot,
.monitor-health-waiting .monitor-health-dot {
    background: #94a3b8;
}

.monitor-overview-details {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    overflow: hidden;
}

.monitor-overview-item {
    min-width: 0;

    display: flex;
    flex-direction: column;

    justify-content: center;

    gap: 7px;

    padding: 20px;

    border-right: 1px solid var(--border);
}

.monitor-overview-item:last-child {
    border-right: 0;
}

.monitor-overview-label {
    color: var(--muted);

    font-size: 12px;
    line-height: 1.3;
}

.monitor-overview-item strong {
    overflow-wrap: anywhere;

    font-size: 15px;
    line-height: 1.35;
}


@media (max-width: 960px) {

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

}


@media (max-width: 680px) {

    .monitor-overview-details {
        grid-template-columns: 1fr;
    }

    .monitor-overview-item {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .monitor-overview-item:last-child {
        border-bottom: 0;
    }

}


/* =========================================================
   MONITOR CHECK LIST
   ========================================================= */

.check-list {
    display: flex;
    flex-direction: column;
}

.check-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);

    gap: 15px;

    padding: 18px 0;

    border-bottom: 1px solid var(--border);
}

.check-card:first-child {
    padding-top: 4px;
}

.check-card:last-child {
    padding-bottom: 2px;
    border-bottom: 0;
}

.check-card-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f1f5f9;
    color: #64748b;

    font-size: 14px;
    font-weight: 800;
}

.check-card-changed .check-card-icon {
    background: #eff6ff;
    color: #2563eb;
}

.check-card-recovered .check-card-icon {
    background: var(--green-soft);
    color: var(--green);
}

.check-card-error .check-card-icon {
    background: #fef2f2;
    color: #dc2626;
}

.check-card-body {
    min-width: 0;
}

.check-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}

.check-card-title {
    display: block;

    font-size: 15px;
    line-height: 1.4;
}

.check-card-message {
    margin-top: 5px;

    max-width: 760px;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.5;
}

.check-card-date {
    flex: 0 0 auto;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.4;

    white-space: nowrap;
}

.check-card-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 12px;
}

.check-card-meta > span {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    padding: 5px 9px;

    border: 1px solid var(--border);
    border-radius: 7px;

    background: var(--surface-soft);

    font-size: 12px;
}

.check-card-meta small {
    color: var(--muted);
    font-size: 11px;
}

.check-card-meta strong {
    font-size: 12px;
    font-weight: 700;
}

.check-card-error-code {
    color: #b91c1c;

    background: #fef2f2 !important;
    border-color: #fecaca !important;

    font-family: monospace;
}


@media (max-width: 680px) {

    .check-card {
        grid-template-columns: 30px minmax(0, 1fr);

        gap: 11px;
    }

    .check-card-icon {
        width: 28px;
        height: 28px;

        font-size: 12px;
    }

    .check-card-head {
        flex-direction: column;

        gap: 6px;
    }

    .check-card-date {
        white-space: normal;
    }

}


/* =========================================================
   MONITOR EVENTS
   ========================================================= */

.event-list {
    display: flex;
    flex-direction: column;
}

.event-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);

    gap: 15px;

    padding: 18px 0;

    border-bottom: 1px solid var(--border);
}

.event-card:first-child {
    padding-top: 4px;
}

.event-card:last-child {
    padding-bottom: 2px;
    border-bottom: 0;
}

.event-card-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #eff6ff;

    font-size: 15px;
}

.event-card-body {
    min-width: 0;
}

.event-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}

.event-card-title {
    display: block;

    font-size: 15px;
    line-height: 1.45;
}

.event-card-date {
    margin-top: 5px;

    color: var(--muted);

    font-size: 12px;
}

.event-card-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 12px;
}

.event-card-meta > span {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 5px 9px;

    border: 1px solid var(--border);
    border-radius: 7px;

    background: var(--surface-soft);

    font-size: 12px;
}

.event-card-meta small {
    color: var(--muted);
    font-size: 11px;
}

.event-card-meta strong {
    font-size: 12px;
}

.event-notification-good {
    color: var(--green);
}

.event-notification-error {
    color: #dc2626;
}

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


/* =========================================================
   CONTENT HISTORY
   ========================================================= */

.content-history-list {
    display: flex;
    flex-direction: column;
}

.content-history-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);

    gap: 15px;

    padding: 15px 0;

    border-bottom: 1px solid var(--border);
}

.content-history-row:first-child {
    padding-top: 4px;
}

.content-history-row:last-child {
    padding-bottom: 2px;
    border-bottom: 0;
}

.content-history-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #f1f5f9;
    color: #64748b;

    font-size: 16px;
}

.content-history-body {
    min-width: 0;

    display: flex;
    flex-direction: column;

    justify-content: center;

    gap: 4px;
}

.content-history-body strong {
    font-size: 14px;
}

.content-history-body span {
    color: var(--muted);

    font-size: 12px;
}

.compact-empty-state {
    padding-top: 6px;
    padding-bottom: 6px;
}


/* Small secondary action used inside cards */

.button-small {
    padding: 7px 11px;

    font-size: 12px;
}


@media (max-width: 680px) {

    .event-card,
    .content-history-row {
        grid-template-columns: 30px minmax(0, 1fr);

        gap: 11px;
    }

    .event-card-icon,
    .content-history-icon {
        width: 28px;
        height: 28px;
    }

    .event-card-head {
        flex-direction: column;

        gap: 10px;
    }

}


/* =========================================================
   DASHBOARD MONITOR CARDS
   ========================================================= */

.dashboard-monitor-list {
    display: flex;
    flex-direction: column;
}

.dashboard-monitor-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);

    gap: 22px;

    padding: 22px 0;

    border-bottom: 1px solid var(--border);
}

.dashboard-monitor-card:first-child {
    padding-top: 5px;
}

.dashboard-monitor-card:last-child {
    padding-bottom: 3px;
    border-bottom: 0;
}


/* Status */

.dashboard-monitor-status {
    display: flex;
    align-items: center;

    gap: 9px;

    align-self: start;

    padding-top: 4px;
}

.status-dot {
    flex: 0 0 auto;

    width: 9px;
    height: 9px;

    border-radius: 50%;
}

.status-label {
    font-size: 12px;
    font-weight: 700;
}

.status-dot-good {
    background: #16a34a;
    box-shadow: 0 0 0 4px #dcfce7;
}

.status-label-good {
    color: #15803d;
}

.status-dot-warning {
    background: #d97706;
    box-shadow: 0 0 0 4px #fef3c7;
}

.status-label-warning {
    color: #b45309;
}

.status-dot-error {
    background: #dc2626;
    box-shadow: 0 0 0 4px #fee2e2;
}

.status-label-error {
    color: #b91c1c;
}

.status-dot-waiting {
    background: #2563eb;
    box-shadow: 0 0 0 4px #dbeafe;
}

.status-label-waiting {
    color: #1d4ed8;
}

.status-dot-paused {
    background: #94a3b8;
    box-shadow: 0 0 0 4px #f1f5f9;
}

.status-label-paused {
    color: #64748b;
}


/* Main card content */

.dashboard-monitor-main {
    min-width: 0;
}

.dashboard-monitor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}

.dashboard-monitor-heading {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.dashboard-monitor-title {
    display: block;

    color: var(--text);

    font-size: 16px;
    font-weight: 700;

    line-height: 1.45;

    text-decoration: none;

    overflow-wrap: anywhere;
}

.dashboard-monitor-title:hover {
    text-decoration: underline;
}

.dashboard-monitor-id {
    color: var(--muted);

    font-size: 11px;
}

.dashboard-monitor-url {
    display: block;

    max-width: 760px;

    margin-top: 9px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--muted);

    font-size: 13px;
}

.dashboard-monitor-meta {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(120px, max-content));

    gap: 12px 26px;

    margin-top: 18px;
}

.dashboard-monitor-meta > div {
    display: flex;
    flex-direction: column;

    gap: 4px;
}

.dashboard-monitor-meta span {
    color: var(--muted);

    font-size: 11px;
}

.dashboard-monitor-meta strong {
    font-size: 13px;
    font-weight: 600;
}

.dashboard-monitor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 7px;

    flex-wrap: wrap;

    flex-shrink: 0;
}

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


/* Error preview */

.dashboard-monitor-error {
    display: flex;
    flex-direction: column;

    gap: 4px;

    max-width: 760px;

    margin-top: 15px;
    padding: 10px 12px;

    border: 1px solid #fecaca;
    border-radius: 8px;

    background: #fff7f7;
}

.dashboard-monitor-error strong {
    color: #b91c1c;

    font-size: 11px;
}

.dashboard-monitor-error span {
    color: #7f1d1d;

    font-size: 12px;
    line-height: 1.45;

    overflow-wrap: anywhere;
}


@media (max-width: 960px) {

    .dashboard-monitor-card {
        grid-template-columns: 1fr;

        gap: 12px;
    }

    .dashboard-monitor-status {
        padding-top: 0;
    }

}


@media (max-width: 680px) {

    .dashboard-monitor-head {
        flex-direction: column;
    }

    .dashboard-monitor-actions {
        width: 100%;

        justify-content: flex-start;
    }

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

}


@media (max-width: 430px) {

    .dashboard-monitor-meta {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   DASHBOARD HEALTH SUMMARY
   ========================================================= */

.dashboard-health-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 24px;
}

.dashboard-health-card {
    min-width: 0;

    padding: 18px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
}

.dashboard-health-head {
    display: flex;
    align-items: center;

    gap: 8px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
}

.dashboard-health-dot {
    width: 8px;
    height: 8px;

    flex: 0 0 auto;

    border-radius: 50%;

    background: #94a3b8;
}

.dashboard-health-value {
    display: block;

    margin-top: 12px;

    font-size: 28px;
    line-height: 1;
}

.dashboard-health-value small {
    color: var(--muted);

    font-size: 14px;
    font-weight: 600;
}

.dashboard-health-help {
    margin-top: 9px;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.4;
}


/* Healthy */

.health-card-good .dashboard-health-dot {
    background: #16a34a;

    box-shadow:
        0 0 0 4px #dcfce7;
}

.health-card-good .dashboard-health-value {
    color: #15803d;
}


/* Attention */

.health-card-attention {
    border-color: #fecaca;

    background: #fffafa;
}

.health-card-attention .dashboard-health-dot {
    background: #dc2626;

    box-shadow:
        0 0 0 4px #fee2e2;
}

.health-card-attention .dashboard-health-value {
    color: #b91c1c;
}


/* No problems */

.health-card-neutral .dashboard-health-dot {
    background: #94a3b8;
}


/* Paused */

.health-card-paused .dashboard-health-dot {
    background: #94a3b8;

    box-shadow:
        0 0 0 4px #f1f5f9;
}


/* Total */

.health-card-total .dashboard-health-dot {
    background: #2563eb;

    box-shadow:
        0 0 0 4px #dbeafe;
}


@media (max-width: 960px) {

    .dashboard-health-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 520px) {

    .dashboard-health-grid {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   DASHBOARD MONITOR FILTERS
   ========================================================= */

.dashboard-monitor-filters {
    display: flex;
    align-items: center;

    gap: 7px;

    margin: 6px 0 18px;

    overflow-x: auto;

    padding-bottom: 2px;
}

.dashboard-filter {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    flex: 0 0 auto;

    padding: 8px 11px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface);
    color: var(--muted);

    font-size: 12px;
    font-weight: 700;

    text-decoration: none;
}

.dashboard-filter:hover {
    border-color: #cbd5e1;

    color: var(--text);
}

.dashboard-filter span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 21px;
    height: 21px;

    padding: 0 6px;

    border-radius: 99px;

    background: #f1f5f9;
    color: #64748b;

    font-size: 11px;
}

.dashboard-filter-active {
    border-color: #cbd5e1;

    background: #f8fafc;
    color: var(--text);
}

.dashboard-filter-active span {
    background: #e2e8f0;
    color: #334155;
}


@media (max-width: 680px) {

    .dashboard-monitor-filters {
        margin-left: -2px;
        margin-right: -2px;
    }

}


/* =========================================================
   DASHBOARD USAGE
   ========================================================= */

.dashboard-usage-panel {
    padding: 22px 24px;
}

.dashboard-usage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.dashboard-usage-header h2 {
    margin: 0 0 4px;
}

.dashboard-usage-header p {
    margin: 0;

    color: var(--muted);
    font-size: 13px;
}

.dashboard-plan-badge {
    display: inline-flex;
    align-items: center;

    flex: 0 0 auto;

    padding: 6px 10px;

    border: 1px solid var(--border);
    border-radius: 99px;

    background: #f8fafc;
    color: #475569;

    font-size: 12px;
    font-weight: 750;
}

.dashboard-usage-list {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 28px;
}

.dashboard-usage-item {
    min-width: 0;
}

.dashboard-usage-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 18px;
}

.dashboard-usage-row > div:first-child {
    display: flex;
    flex-direction: column;

    gap: 3px;

    min-width: 0;
}

.dashboard-usage-row > div:first-child strong {
    font-size: 14px;
}

.dashboard-usage-row > div:first-child span {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-usage-value {
    display: flex;
    align-items: baseline;

    gap: 8px;

    flex: 0 0 auto;
}

.dashboard-usage-value strong {
    font-size: 14px;
}

.dashboard-usage-value span {
    color: var(--muted);

    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.dashboard-usage-progress {
    overflow: hidden;

    height: 7px;

    margin-top: 10px;

    border-radius: 99px;

    background: #e9edf3;
}

.dashboard-usage-progress-fill {
    height: 100%;

    border-radius: inherit;

    background: #334155;

    transition: width 0.2s ease;
}

.dashboard-usage-progress-warning
.dashboard-usage-progress-fill {
    background: #d97706;
}

.dashboard-usage-progress-danger
.dashboard-usage-progress-fill {
    background: #dc2626;
}

.dashboard-usage-alert {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    margin-top: 18px;
    padding: 11px 13px;

    border-radius: 9px;

    font-size: 12px;
    line-height: 1.5;
}

.dashboard-usage-alert strong {
    flex: 0 0 auto;
}

.dashboard-usage-alert span {
    color: #64748b;
}

.dashboard-usage-alert-warning {
    border: 1px solid #fde68a;
    background: #fffbeb;
}

.dashboard-usage-alert-warning strong {
    color: #b45309;
}

.dashboard-usage-alert-danger {
    border: 1px solid #fecaca;
    background: #fef2f2;
}

.dashboard-usage-alert-danger strong {
    color: #b91c1c;
}


@media (max-width: 760px) {

    .dashboard-usage-list {
        grid-template-columns: 1fr;

        gap: 22px;
    }

}


@media (max-width: 520px) {

    .dashboard-usage-panel {
        padding: 19px;
    }

    .dashboard-usage-header {
        align-items: flex-start;
    }

    .dashboard-usage-row {
        align-items: flex-start;
    }

    .dashboard-usage-value {
        flex-direction: column;
        align-items: flex-end;

        gap: 2px;
    }

    .dashboard-usage-alert {
        flex-direction: column;

        gap: 3px;
    }

}


/* =========================================================
   DASHBOARD TELEGRAM
   ========================================================= */

.dashboard-telegram-panel {
    padding: 19px 24px;
}

.dashboard-telegram-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;
}

.dashboard-telegram-main {
    display: flex;
    align-items: center;

    gap: 14px;

    min-width: 0;
}

.dashboard-telegram-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 40px;
    height: 40px;

    border-radius: 11px;

    background: #eff6ff;
    color: #2563eb;

    font-size: 20px;
    font-weight: 700;
}

.dashboard-telegram-title-row {
    display: flex;
    align-items: center;

    gap: 10px;

    flex-wrap: wrap;
}

.dashboard-telegram-title-row h2 {
    margin: 0;

    font-size: 18px;
}

.dashboard-telegram-main p {
    margin: 4px 0 0;

    color: var(--muted);
    font-size: 13px;
}

.dashboard-integration-status {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 4px 8px;

    border: 1px solid var(--border);
    border-radius: 99px;

    background: #f8fafc;
    color: #64748b;

    font-size: 11px;
    font-weight: 700;
}

.dashboard-integration-status > span {
    display: block;

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #94a3b8;
}

.dashboard-integration-status-good {
    border-color: #bbf7d0;

    background: #f0fdf4;
    color: #15803d;
}

.dashboard-integration-status-good > span {
    background: #22c55e;
}

.dashboard-integration-status-waiting {
    border-color: #fde68a;

    background: #fffbeb;
    color: #b45309;
}

.dashboard-integration-status-waiting > span {
    background: #f59e0b;
}

.dashboard-telegram-connect {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;
}

.dashboard-telegram-code {
    flex: 0 0 auto;

    padding: 8px 12px;

    border-radius: 8px;

    background: #111827;
    color: #ffffff;

    font-family: monospace;
    font-size: 16px;
    font-weight: 750;

    letter-spacing: 0.08em;
}


@media (max-width: 680px) {

    .dashboard-telegram-row,
    .dashboard-telegram-connect {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-telegram-row form,
    .dashboard-telegram-row form button {
        width: 100%;
    }

    .dashboard-telegram-code {
        width: 100%;

        text-align: center;
    }

}


/* =========================================================
   DASHBOARD MONITOR CARDS V2
   ========================================================= */

.dashboard-monitor-card-v2 {
    padding: 18px 0;

    border-bottom: 1px solid var(--border);
}

.dashboard-monitor-card-v2:first-child {
    padding-top: 4px;
}

.dashboard-monitor-card-v2:last-child {
    padding-bottom: 2px;
    border-bottom: 0;
}


/* Top */

.dashboard-monitor-v2-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;
}

.dashboard-monitor-v2-content {
    min-width: 0;
    flex: 1;
}

.dashboard-monitor-v2-status {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-bottom: 7px;
}

.dashboard-monitor-v2-id {
    color: #94a3b8;

    font-size: 11px;
    font-weight: 600;
}

.dashboard-monitor-v2-title {
    display: block;

    max-width: 850px;

    color: var(--text);

    font-size: 16px;
    font-weight: 750;
    line-height: 1.4;

    text-decoration: none;

    overflow-wrap: anywhere;
}

.dashboard-monitor-v2-title:hover {
    text-decoration: underline;
}

.dashboard-monitor-v2-url {
    display: block;

    max-width: 800px;

    margin-top: 4px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--muted);

    font-size: 12px;
    text-decoration: none;
}

.dashboard-monitor-v2-url:hover {
    color: var(--text);
    text-decoration: underline;
}


/* Open */

.dashboard-monitor-open {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    flex: 0 0 auto;

    padding: 7px 10px;

    border-radius: 8px;

    color: #334155;

    font-size: 12px;
    font-weight: 700;

    text-decoration: none;
}

.dashboard-monitor-open:hover {
    background: #f1f5f9;

    color: var(--text);
}

.dashboard-monitor-open span {
    font-size: 15px;
    line-height: 1;
}


/* Bottom */

.dashboard-monitor-v2-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 13px;
}

.dashboard-monitor-v2-meta {
    display: flex;
    align-items: center;

    gap: 7px;

    min-width: 0;

    color: var(--muted);

    font-size: 11px;

    flex-wrap: wrap;
}

.dashboard-monitor-v2-meta strong {
    color: #475569;

    font-weight: 650;
}

.dashboard-monitor-meta-separator {
    color: #cbd5e1;
}


/* Secondary actions */

.dashboard-monitor-v2-actions {
    display: flex;
    align-items: center;

    gap: 4px;

    flex: 0 0 auto;
}

.dashboard-monitor-v2-actions form {
    margin: 0;
}

.dashboard-monitor-action {
    padding: 4px 7px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #64748b;

    font: inherit;
    font-size: 11px;
    font-weight: 650;

    cursor: pointer;
}

.dashboard-monitor-action:hover {
    background: #f1f5f9;

    color: #334155;
}

.dashboard-monitor-action-danger:hover {
    background: #fef2f2;

    color: #dc2626;
}


/* Error */

.dashboard-monitor-v2-error {
    display: flex;
    align-items: baseline;

    gap: 7px;

    max-width: 850px;

    margin-top: 11px;
    padding: 7px 9px;

    border-left: 3px solid #ef4444;
    border-radius: 0 6px 6px 0;

    background: #fff7f7;

    font-size: 11px;
    line-height: 1.45;
}

.dashboard-monitor-v2-error strong {
    flex: 0 0 auto;

    color: #b91c1c;
}

.dashboard-monitor-v2-error span {
    min-width: 0;

    color: #7f1d1d;

    overflow-wrap: anywhere;
}


@media (max-width: 760px) {

    .dashboard-monitor-v2-top {
        gap: 12px;
    }

    .dashboard-monitor-v2-bottom {
        align-items: flex-start;
        flex-direction: column;

        gap: 8px;
    }

    .dashboard-monitor-v2-actions {
        margin-left: -7px;
    }

}


@media (max-width: 520px) {

    .dashboard-monitor-card-v2 {
        padding: 16px 0;
    }

    .dashboard-monitor-v2-title {
        font-size: 15px;
    }

    .dashboard-monitor-open {
        padding-right: 2px;
    }

    .dashboard-monitor-open {
        font-size: 0;
    }

    .dashboard-monitor-open span {
        font-size: 18px;
    }

    .dashboard-monitor-meta-separator {
        display: none;
    }

    .dashboard-monitor-v2-meta {
        align-items: flex-start;
        flex-direction: column;

        gap: 4px;
    }

    .dashboard-monitor-v2-error {
        align-items: flex-start;
        flex-direction: column;

        gap: 2px;
    }

}


/* =========================================================
   MONITOR FORM V2
   ========================================================= */

.monitor-form-page {
    max-width: 860px;
    margin: 0 auto;
}

.monitor-form-heading {
    margin-bottom: 24px;
}

.monitor-form-heading h1 {
    margin-top: 7px;
    margin-bottom: 8px;
}

.monitor-form-heading p {
    max-width: 650px;

    margin: 0;

    color: var(--muted);

    font-size: 15px;
    line-height: 1.6;
}

.monitor-form-panel {
    padding: 30px 32px;
}

.monitor-form-section {
    display: grid;

    grid-template-columns: 38px minmax(0, 1fr);

    gap: 18px;
}

.monitor-form-number {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f1f5f9;
    color: #475569;

    font-size: 13px;
    font-weight: 800;
}

.monitor-form-field {
    min-width: 0;
}

.monitor-form-field label {
    display: block;

    margin-bottom: 4px;

    font-size: 15px;
    font-weight: 750;
}

.monitor-form-description {
    margin-bottom: 13px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.5;
}

.monitor-form-field textarea {
    min-height: 130px;

    line-height: 1.55;
}

.monitor-form-field select {
    max-width: 340px;
}

.monitor-form-divider {
    height: 1px;

    margin: 2px 0;

    background: var(--border);
}

.monitor-condition-examples {
    display: flex;
    flex-direction: column;

    gap: 5px;

    margin-top: 12px;
    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface-soft);

    color: #475569;

    font-size: 12px;
    line-height: 1.45;
}

.monitor-condition-examples > span {
    margin-bottom: 2px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .04em;
}

.monitor-form-start-note {
    display: grid;

    grid-template-columns: 34px minmax(0, 1fr);

    gap: 13px;

    padding: 16px 18px;

    border: 1px solid #bbf7d0;
    border-radius: 10px;

    background: #f0fdf4;
}

.monitor-form-start-icon {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #dcfce7;
    color: #15803d;

    font-size: 13px;
    font-weight: 800;
}

.monitor-form-start-note strong {
    display: block;

    color: #166534;

    font-size: 13px;
}

.monitor-form-start-note p {
    margin: 4px 0 0;

    color: #3f6250;

    font-size: 13px;
    line-height: 1.5;
}

.monitor-form-actions {
    display: flex;
    align-items: center;

    gap: 10px;

    padding-top: 2px;
}


@media (max-width: 680px) {

    .monitor-form-panel {
        padding: 22px 18px;
    }

    .monitor-form-section {
        grid-template-columns: 28px minmax(0, 1fr);

        gap: 12px;
    }

    .monitor-form-number {
        width: 27px;
        height: 27px;

        font-size: 11px;
    }

    .monitor-form-field select {
        max-width: none;
    }

    .monitor-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .monitor-form-actions .button {
        width: 100%;
        text-align: center;
    }

}
