* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f7fb;
    color: #1f2937;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.form-card {
    max-width: 760px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
}

.stat-label {
    color: #6b7280;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
}

.muted {
    color: #6b7280;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

.btn:hover {
    text-decoration: none;
    background: #1d4ed8;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-light {
    background: #e5e7eb;
    color: #111827;
}

.btn-light:hover {
    background: #d1d5db;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

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

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

.status-unknown {
    background: #e5e7eb;
    color: #374151;
}

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

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.notes-box {
    margin-top: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.actions-row {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.details-block summary,
.card summary {
    cursor: pointer;
    margin-bottom: 12px;
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    background: #0f172a;
    color: #e2e8f0;
    padding: 14px;
    border-radius: 8px;
    overflow: auto;
}

.integration-box ul {
    margin-top: 10px;
}

.sortable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sortable-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}

.sortable-index {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.sortable-content {
    flex: 1;
}

.sortable-title {
    font-weight: 700;
}

.sortable-meta {
    font-size: 12px;
    color: #6b7280;
}

.sortable-handle {
    cursor: grab;
    font-size: 22px;
    color: #6b7280;
    user-select: none;
}

@media (max-width: 900px) {
    .grid-3,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
    }

    .table {
        display: block;
        overflow-x: auto;
    }
}