:root {
    color-scheme: light;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f3f5f9;
    color: #172033;
}

a {
    color: #275efe;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 34px;
    background: #ffffff;
    border: 1px solid #e4e8f0;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(21, 32, 56, 0.1);
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.auth-card .subtitle {
    margin: 0 0 28px;
    color: #657089;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #ccd3df;
    border-radius: 10px;
    background: #ffffff;
    color: #172033;
    font: inherit;
    outline: none;
}

.form-control:focus {
    border-color: #275efe;
    box-shadow: 0 0 0 4px rgba(39, 94, 254, 0.12);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 10px;
    background: #275efe;
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.button:hover {
    background: #1648d8;
}

.button-block {
    width: 100%;
}

.button-secondary {
    background: #e8edf7;
    color: #172033;
}

.button-secondary:hover {
    background: #dce3ef;
}

.alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 10px;
    line-height: 1.5;
}

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

.alert-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.password-help {
    margin-top: 7px;
    color: #657089;
    font-size: 13px;
    line-height: 1.5;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 28px;
    background: #ffffff;
    border-bottom: 1px solid #e4e8f0;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 22px;
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logout-form {
    margin: 0;
}

.dashboard-container {
    width: min(1180px, calc(100% - 40px));
    margin: 36px auto;
}

.welcome-card {
    margin-bottom: 26px;
    padding: 28px;
    border: 1px solid #e4e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.welcome-card h2 {
    margin-top: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.stat-card {
    padding: 24px;
    border: 1px solid #e4e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.stat-label {
    margin-bottom: 10px;
    color: #657089;
    font-weight: 700;
}

.stat-number {
    font-size: 36px;
    font-weight: 900;
}

@media (max-width: 720px) {
    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-user {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 25px;
    }
}




.admin-topbar {
    background: #ffffff;
    border-bottom: 1px solid #e4e8f0;
}

.admin-topbar-inner {
    display: flex;
    align-items: center;
    width: min(1280px, calc(100% - 40px));
    min-height: 72px;
    margin: 0 auto;
    gap: 30px;
}

.admin-brand {
    color: #172033;
    font-size: 21px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.admin-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav-link {
    padding: 10px 14px;
    border-radius: 9px;
    color: #657089;
    font-weight: 700;
    text-decoration: none;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: #edf2ff;
    color: #275efe;
}

.admin-account {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.admin-account form {
    margin: 0;
}

.admin-account-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.admin-account-info span {
    color: #657089;
    font-size: 13px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.page-header p {
    margin: 0;
    color: #657089;
}

.table-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e4e8f0;
    border-radius: 16px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1050px;
}

.data-table th,
.data-table td {
    padding: 17px 18px;
    border-bottom: 1px solid #e8ebf1;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: #f8f9fc;
    color: #59647a;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.site-url {
    display: block;
    max-width: 300px;
    margin-top: 6px;
    overflow: hidden;
    color: #657089;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-up {
    background: #dcfce7;
    color: #166534;
}

.status-down {
    background: #fee2e2;
    color: #991b1b;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-pending {
    background: #e0e7ff;
    color: #3730a3;
}

.status-disabled {
    background: #e5e7eb;
    color: #4b5563;
}

.table-note {
    display: block;
    margin-top: 5px;
    color: #657089;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.table-actions form {
    margin: 0;
}

.button-small {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 13px;
}

.button-danger {
    background: #dc2626;
}

.button-danger:hover {
    background: #b91c1c;
}

.error-detail-row td {
    background: #fff7f7;
    color: #991b1b;
    font-size: 13px;
}

.form-card {
    max-width: 920px;
    padding: 30px;
    background: #ffffff;
    border: 1px solid #e4e8f0;
    border-radius: 18px;
}

.form-card-header {
    margin-bottom: 28px;
}

.form-card-header h1 {
    margin: 0 0 8px;
}

.form-card-header p {
    margin: 0;
    color: #657089;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-top: 8px;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 17px;
    border: 1px solid #dbe1eb;
    border-radius: 12px;
    cursor: pointer;
}

.checkbox-card:hover {
    background: #f8faff;
    border-color: #b9c7ec;
}

.checkbox-card input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
}

.checkbox-card span {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.checkbox-card small {
    color: #657089;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e4e8f0;
}

.errors-list {
    margin: 10px 0 0;
    padding-left: 20px;
}

.empty-state {
    padding: 60px 30px;
    background: #ffffff;
    border: 1px solid #e4e8f0;
    border-radius: 16px;
    text-align: center;
}

.empty-state h2 {
    margin-top: 0;
}

.empty-state p {
    margin-bottom: 24px;
    color: #657089;
}

.muted {
    color: #8a94a8;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 26px;
}

@media (max-width: 950px) {
    .admin-topbar-inner {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 16px 0;
    }

    .admin-account {
        width: 100%;
        margin-left: 0;
    }

    .admin-account-info {
        text-align: left;
    }

    .checkbox-grid,
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

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

    .admin-navigation {
        width: 100%;
        order: 3;
    }

    .form-grid,
    .checkbox-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 22px;
    }

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

    .form-actions .button {
        width: 100%;
    }
}



.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    color: #7a8498;
    font-size: 13px;
}

.breadcrumb a {
    color: #53617a;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #275efe;
}

.page-subtitle {
    margin: 8px 0 0;
    color: #657089;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header-actions form {
    margin: 0;
}

.site-history-url {
    display: inline-block;
    max-width: 700px;
    overflow: hidden;
    color: #657089;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-number-small {
    font-size: 25px;
}

.filter-card {
    margin-bottom: 22px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #e4e8f0;
    border-radius: 14px;
}

.filter-form {
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.filter-field {
    width: min(280px, 100%);
}

.filter-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.filter-actions {
    display: flex;
    gap: 9px;
}

.history-table {
    min-width: 1250px;
}

.nowrap {
    white-space: nowrap;
}

.truncated-text,
.truncated-error {
    display: block;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncated-error {
    max-width: 310px;
    color: #991b1b;
}

.result-positive {
    color: #166534;
    font-weight: 800;
}

.result-negative {
    color: #991b1b;
    font-weight: 800;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 24px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 15px;
    background: #ffffff;
    border: 1px solid #dbe1eb;
    border-radius: 9px;
    color: #27354d;
    font-weight: 700;
    text-decoration: none;
}

.pagination-link:hover {
    border-color: #275efe;
    color: #275efe;
}

.pagination-link.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination-current {
    color: #657089;
    font-size: 14px;
}

.detail-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 22px;
    padding: 26px;
    background: #ffffff;
    border: 1px solid #e4e8f0;
    border-radius: 16px;
}

.detail-status-card h2 {
    margin: 14px 0 7px;
}

.detail-status-metrics {
    display: flex;
    gap: 40px;
}

.detail-status-metrics div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.detail-status-metrics span {
    color: #657089;
    font-size: 13px;
    font-weight: 700;
}

.detail-status-metrics strong {
    font-size: 26px;
}

.detail-error {
    margin-bottom: 22px;
}

.detail-error p {
    margin: 8px 0 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.detail-card {
    padding: 25px;
    background: #ffffff;
    border: 1px solid #e4e8f0;
    border-radius: 16px;
}

.detail-card h2 {
    margin: 0 0 22px;
    font-size: 20px;
}

.detail-card-full {
    margin-bottom: 20px;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid #edf0f5;
}

.detail-list > div:first-child {
    padding-top: 0;
}

.detail-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-list dt {
    color: #657089;
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
}

.break-word {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.code-output {
    max-height: 500px;
    margin: 0;
    padding: 18px;
    overflow: auto;
    background: #101827;
    color: #e5e7eb;
    border-radius: 10px;
    font-family: monospace;
    line-height: 1.6;
    white-space: pre-wrap;
}

.check-screenshot {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #dbe1eb;
    border-radius: 10px;
}

.screenshot-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 30px;
    background: #f7f8fb;
    border: 2px dashed #d5dbe6;
    border-radius: 12px;
    color: #657089;
    text-align: center;
}

@media (max-width: 1100px) {
    .history-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .page-header-actions,
    .filter-form,
    .filter-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .page-header-actions form,
    .page-header-actions .button,
    .filter-actions .button {
        width: 100%;
    }

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

    .detail-status-metrics {
        width: 100%;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .history-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .detail-status-metrics {
        flex-direction: column;
        gap: 18px;
    }

    .detail-list > div {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .pagination {
        flex-wrap: wrap;
    }
}