
:root {
    --bg: #f5f7fb;
    --white: #ffffff;
    --text: #172033;
    --muted: #8993a5;
    --border: #e9edf3;
    --primary: #5267e8;
    --green: #16a36a;
    --red: #e34f5f;
    --sidebar-width: 250px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.app-layout {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    inset: 0 auto 0 0;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 27px 18px 20px;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    margin-bottom: 48px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #5267e8;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 3px;
    padding: 10px;
}

.brand-icon span {
    display: block;
    width: 4px;
    border-radius: 3px;
    background: white;
}

.brand-icon span:nth-child(1) {
    height: 9px;
}

.brand-icon span:nth-child(2) {
    height: 16px;
}

.brand-icon span:nth-child(3) {
    height: 12px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-text strong {
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -0.5px;
}

.brand-text small {
    color: var(--muted);
    font-size: 11px;
}

.sidebar-label {
    padding: 0 10px;
    margin-bottom: 12px;
    color: #a2aaba;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.1px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 12px;
    border-radius: 8px;
    color: #737e91;
    font-size: 13px;
    font-weight: 500;
    transition: .2s ease;
}

.nav-link:hover {
    background: #f5f6fc;
    color: var(--primary);
}

.nav-link.active {
    background: #eef0ff;
    color: var(--primary);
    font-weight: 650;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 19px;
}

.sidebar-bottom {
    margin-top: auto;
}

.system-card {
    background: #f5f8fb;
    border: 1px solid #edf0f5;
    border-radius: 10px;
    padding: 14px 12px;
    margin-bottom: 18px;
}

.system-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.system-dot,
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #19b77a;
    box-shadow: 0 0 0 3px #19b77a1c;
}

.system-card p {
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
}

.admin-link {
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding-top: 13px;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 76px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 38px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
}

.breadcrumb strong {
    color: var(--text);
    font-weight: 600;
}

.breadcrumb-separator {
    color: #c7cdd7;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.monitoring-indicator {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #667185;
    font-size: 12px;
    font-weight: 500;
}

.button {
    height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: .2s;
}

.button-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 3px 8px #5267e82b;
}

.button-primary:hover {
    background: #4055d4;
    transform: translateY(-1px);
}

.page-content {
    width: 100%;
    max-width: 1600px;
    padding: 38px;
    margin: 0 auto;
    flex: 1;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 28px;
}

.eyebrow {
    color: var(--primary);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 1.4px;
    margin-bottom: 10px;
}

.page-heading h1 {
    font-size: 27px;
    letter-spacing: -1px;
    font-weight: 750;
}

.page-heading p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.updated-info {
    color: var(--muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding-bottom: 4px;
}

.updated-icon {
    font-size: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 21px;
    min-width: 0;
    transition: .2s;
}

.stat-card:hover {
    border-color: #d9def7;
    box-shadow: 0 5px 20px #27385c08;
    transform: translateY(-2px);
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: #778195;
    font-size: 12px;
    font-weight: 500;
}

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
}

.icon-blue {
    color: #5267e8;
    background: #eef0ff;
}

.icon-green {
    color: #16a36a;
    background: #e8f8f0;
}

.icon-red {
    color: #e34f5f;
    background: #fff0f1;
}

.icon-purple {
    color: #9161d5;
    background: #f4edff;
}

.stat-value {
    margin-top: 19px;
    font-size: 29px;
    font-weight: 750;
    letter-spacing: -1px;
}

.stat-value small {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0;
}

.stat-description {
    margin-top: 9px;
    color: var(--muted);
    font-size: 10px;
}

.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

.content-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 11px;
    margin-bottom: 25px;
    overflow: hidden;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 23px;
}

.section-heading h2 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.3px;
}

.section-heading p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
}

.section-counter {
    background: #f3f5fa;
    padding: 6px 10px;
    border-radius: 6px;
    color: #778195;
    font-size: 10px;
    font-weight: 600;
}

.table-toolbar {
    padding: 13px 22px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search-form {
    width: 280px;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 0 11px;
}

.search-icon {
    color: #9aa4b4;
    font-size: 19px;
}

.search-form input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    color: var(--text);
    background: transparent;
    font-size: 11px;
}

.search-form input::placeholder {
    color: #a5adba;
}

.filter-form select {
    height: 36px;
    min-width: 140px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: white;
    color: #657084;
    outline: none;
    font-size: 11px;
    cursor: pointer;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.sites-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.sites-table th {
    background: #fafbfd;
    padding: 13px 16px;
    text-align: left;
    color: #9aa3b1;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
}

.sites-table th:first-child,
.sites-table td:first-child {
    padding-left: 23px;
}

.sites-table td {
    padding: 15px 16px;
    border-bottom: 1px solid #f0f2f6;
    font-size: 11px;
}

.sites-table tbody tr:last-child td {
    border-bottom: 0;
}

.sites-table tbody tr {
    transition: background .15s;
}

.sites-table tbody tr:hover {
    background: #fafbff;
}

.site-name {
    display: flex;
    align-items: center;
    gap: 11px;
}

.site-avatar {
    width: 34px;
    height: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 9px;
    background: #eef0ff;
    color: var(--primary);
    font-weight: 750;
    font-size: 13px;
    flex-shrink: 0;
}

.site-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.site-info strong {
    font-size: 11px;
    font-weight: 650;
}

.site-info a {
    color: #98a1b0;
    font-size: 10px;
}

.site-info a:hover {
    color: var(--primary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 650;
}

.status-badge > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.online {
    background: #eaf8f1;
    color: #169b65;
}

.status-badge.online > span {
    background: #19ae73;
}

.status-badge.offline {
    background: #fff0f1;
    color: #d94b5a;
}

.status-badge.offline > span {
    background: #e34f5f;
}

.status-badge.unknown {
    background: #f1f3f6;
    color: #7d8798;
}

.status-badge.unknown > span {
    background: #9ca5b3;
}

.http-code {
    font-weight: 650;
}

.http-success {
    color: var(--green);
}

.http-error {
    color: var(--red);
}

.time-cell {
    font-weight: 600;
    color: #536074;
}

.resource-count {
    color: #657187;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.date-cell {
    color: #8993a5;
    font-size: 10px !important;
}

.table-action {
    width: 27px;
    height: 27px;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #7c8799;
    font-size: 16px;
    transition: .2s;
}

.table-action:hover {
    color: var(--primary);
    border-color: #cdd3fb;
    background: #f5f6ff;
}

.text-link {
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
}

.text-link:hover {
    color: #354ac5;
}

.history-list {
    border-top: 1px solid var(--border);
}

.history-item {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 23px;
    border-bottom: 1px solid #f0f2f6;
}

.history-item:last-child {
    border-bottom: 0;
}

.history-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.history-icon.success {
    background: #e8f8f0;
    color: #16a36a;
}

.history-icon.failure {
    background: #fff0f1;
    color: #e34f5f;
}

.history-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.history-main strong {
    font-size: 11px;
}

.history-main > span {
    color: var(--muted);
    font-size: 10px;
    overflow-wrap: anywhere;
}

.history-metrics {
    display: flex;
    gap: 14px;
    color: #667286;
    font-size: 10px;
}

.history-date {
    color: #9aa3b1;
    font-size: 10px;
    white-space: nowrap;
}

.empty-state {
    padding: 45px 20px;
    text-align: center;
    color: var(--muted);
}

.empty-icon {
    font-size: 30px;
    margin-bottom: 12px;
}

.empty-state strong {
    display: block;
    color: var(--text);
    font-size: 13px;
}

.empty-state p {
    margin-top: 7px;
    font-size: 11px;
}

.footer {
    display: flex;
    justify-content: space-between;
    padding: 18px 38px;
    border-top: 1px solid var(--border);
    color: #a0a9b7;
    font-size: 10px;
}

.menu-toggle {
    display: none;
    background: none;
    border: 0;
    font-size: 22px;
    cursor: pointer;
    color: var(--text);
}

.sidebar-overlay {
    display: none;
}

/* Адаптация */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-content {
        padding: 28px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.visible {
        display: block;
        position: fixed;
        inset: 0;
        background: #11182766;
        z-index: 90;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .topbar {
        padding: 0 22px;
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .topbar {
        height: 65px;
        padding: 0 15px;
    }

    .breadcrumb {
        flex: 1;
    }

    .monitoring-indicator {
        display: none;
    }

    .button-primary {
        width: 36px;
        padding: 0;
        font-size: 0;
    }

    .button-primary span {
        font-size: 20px;
    }

    .page-content {
        padding: 24px 14px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .page-heading h1 {
        font-size: 23px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 24px;
        margin-top: 14px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-description {
        font-size: 9px;
        line-height: 1.5;
    }

    .stat-icon {
        width: 29px;
        height: 29px;
    }

    .section-heading {
        padding: 17px 14px;
    }

    .table-toolbar {
        padding: 12px 14px;
        flex-wrap: wrap;
    }

    .search-form {
        width: 100%;
    }

    .filter-form,
    .filter-form select {
        width: 100%;
    }

    .history-item {
        align-items: flex-start;
        padding: 13px 14px;
        gap: 9px;
    }

    .history-metrics {
        display: none;
    }

    .history-date {
        font-size: 9px;
    }

    .footer {
        padding: 16px 14px;
        gap: 10px;
        flex-wrap: wrap;
    }
}

/* Детальная страница сайта */

.detail-back {
    margin-bottom: 23px;
}

.detail-back a {
    color: #8993a5;
    font-size: 11px;
    transition: color .2s;
}

.detail-back a:hover {
    color: var(--primary);
}

.detail-heading {
    align-items: center;
}

.detail-url {
    display: inline-block;
    margin-top: 9px;
    color: #8993a5;
    font-size: 11px;
}

.detail-url:hover {
    color: var(--primary);
}

.detail-stats {
    margin-top: 25px;
}

.uptime-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 5px 23px 24px;
    gap: 15px;
}

.uptime-item {
    padding: 17px;
    background: #f8f9fc;
    border: 1px solid var(--border);
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.uptime-item span {
    color: #8993a5;
    font-size: 11px;
}

.uptime-item strong {
    font-size: 23px;
    font-weight: 750;
    color: var(--green);
    letter-spacing: -.5px;
}

.chart-container {
    position: relative;
    height: 300px;
    padding: 10px 23px 24px;
}

.error-section {
    border-color: #f5d7da;
}

.error-message {
    margin: 0 23px 22px;
    padding: 15px;
    border-radius: 8px;
    background: #fff5f5;
    color: #c74c58;
    font-size: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.error-table-cell {
    color: #d94b5a;
    white-space: normal !important;
    min-width: 180px;
    max-width: 300px;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .detail-heading {
        align-items: flex-start;
        gap: 16px;
    }

    .detail-heading h1 {
        font-size: 22px;
    }

    .uptime-grid {
        grid-template-columns: 1fr;
        padding: 5px 14px 18px;
    }

    .uptime-item {
        padding: 13px;
        gap: 8px;
    }

    .uptime-item strong {
        font-size: 20px;
    }

    .chart-container {
        height: 240px;
        padding: 10px 12px 18px;
    }
}

/* Ручная проверка */

.detail-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-actions form {
    margin: 0;
}

#manualCheckButton {
    border: none;
    cursor: pointer;
    min-width: 165px;
}

#manualCheckButton:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}

#checkButtonIcon {
    font-size: 17px;
    line-height: 1;
}

#checkButtonText {
    font-size: 12px;
}

@media (max-width: 600px) {
    .detail-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    #manualCheckButton {
        min-width: 145px;
    }
}
