body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

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

.topbar {
    background: #111827;
    color: #fff;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
}

.brand {
    font-size: 20px;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 16px;
}

.nav a {
    color: #fff;
    text-decoration: none;
}

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

.muted {
    color: #6b7280;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.card,
.table-card,
.form-card,
.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.card,
.table-card,
.form-card {
    padding: 20px;
}

.card-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

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

.stats div {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
}

.stats span {
    display: block;
    color: #6b7280;
    margin-bottom: 6px;
    font-size: 14px;
}

.stats strong {
    font-size: 18px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

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

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

.button-link,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
}

.button-link.secondary {
    background: #374151;
}

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

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

.actions {
    display: flex;
    gap: 12px;
}

.multi-line-actions {
    flex-wrap: wrap;
}

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

.empty-row,
.empty-state {
    text-align: center;
    color: #6b7280;
}

.form-page {
    padding-bottom: 32px;
}

.server-form label,
.login-card label,
.form-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.server-form input,
.server-form select,
.server-form textarea,
.login-card input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 16px;
}

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

.install-grid {
    margin-bottom: 24px;
}

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

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

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

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(420px, calc(100% - 32px));
    padding: 28px;
}

.narrow-card {
    max-width: 560px;
}

.readonly-box,
.command-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.command-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow-x: auto;
}

.break-all {
    word-break: break-all;
}

.remark {
    margin-top: 12px;
}

.inline-detail {
    margin: 0 0 12px;
}

code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .page-header,
    .topbar-inner,
    .form-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

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

    .table-card {
        overflow-x: auto;
    }
}
