* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #1e1f26;
    color: #eaeaea;
}

main {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 1rem;
}

main > * {
    margin: auto;
}

.auth-card {
    background: #2a2b33;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.auth-card h1 {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    text-align: center;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: #b7b9c4;
}

.field input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #3a3b45;
    border-radius: 8px;
    background: #1e1f26;
    color: #eaeaea;
    font-size: 1rem;
}

.field input:focus {
    outline: none;
    border-color: #5b8def;
}

.field select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #3a3b45;
    border-radius: 8px;
    background: #1e1f26;
    color: #eaeaea;
    font-size: 1rem;
}

.field select:focus {
    outline: none;
    border-color: #5b8def;
}

.btn {
    display: block;
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 8px;
    background: #5b8def;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.btn:hover {
    background: #4a7ce0;
}

.btn-secondary {
    background: #3a3b45;
}

.btn-secondary:hover {
    background: #484a56;
}

.btn-danger {
    background: #b04343;
}

.btn-danger:hover {
    background: #9c3838;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error {
    color: #ff7b7b;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.field .error {
    display: block;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.success {
    color: #7fe08a;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 0.75rem;
}

.muted {
    color: #8b8d98;
    font-size: 0.85rem;
    text-align: center;
    margin-top: 1rem;
}

.muted a {
    color: #5b8def;
    text-decoration: none;
}

.muted a:hover {
    text-decoration: underline;
}

.dashboard-card {
    max-width: 420px;
}

.dashboard-card .muted {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.logout-form {
    margin-top: 1.5rem;
}

.logout-form .btn {
    margin-bottom: 0;
}

.download-box {
    margin-bottom: 0.75rem;
}

.download-box code {
    color: #5b8def;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
}

.logs-card {
    background: #2a2b33;
    padding: 1.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 960px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logs-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.logs-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logs-actions form {
    margin: 0;
}

.btn-inline {
    display: inline-block;
    width: auto;
    margin-bottom: 0;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
}

.logs-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.logs-filter select {
    padding: 0.45rem 0.75rem;
    border: 1px solid #3a3b45;
    border-radius: 8px;
    background: #1e1f26;
    color: #eaeaea;
    font-size: 0.9rem;
    min-width: 200px;
}

.logs-filter select:focus {
    outline: none;
    border-color: #5b8def;
}

.manage-form-title {
    margin: 1.5rem 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.manage-form {
    max-width: 400px;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.logs-table th,
.logs-table td {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #3a3b45;
    word-break: break-all;
}

.logs-table th {
    color: #b7b9c4;
    font-weight: 600;
    background: #22232b;
}

.logs-table td.ok {
    color: #7fe08a;
}

.logs-table td.fail {
    color: #ff7b7b;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.pager .muted {
    margin-top: 0;
}

.server-card {
    background: #2a2b33;
    padding: 1.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 960px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.server-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.server-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid #3a3b45;
    border-radius: 10px;
    background: #22232b;
    margin-bottom: 1rem;
}

.server-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.server-meta {
    color: #b7b9c4;
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-on {
    background: #57c46b;
    box-shadow: 0 0 8px rgba(87, 196, 107, 0.7);
}

.dot-off {
    background: #8b8d98;
}

.dot-failed {
    background: #d9534f;
    box-shadow: 0 0 8px rgba(217, 83, 79, 0.7);
}

.dot-unknown {
    background: #e0a63f;
    box-shadow: 0 0 8px rgba(224, 166, 63, 0.7);
}

.server-actions {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.server-actions .btn {
    width: auto;
    flex: 1;
    margin-bottom: 0;
}

.action-status {
    min-height: 1.25rem;
    margin: 0.25rem 0 0.75rem;
    color: #b7b9c4;
    font-size: 0.85rem;
}

.btn-start {
    background: #57a957;
}

.btn-start:hover {
    background: #4a934a;
}

.server-command {
    margin-bottom: 1rem;
}

.server-command label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: #b7b9c4;
}

.command-row {
    display: flex;
    gap: 0.6rem;
}

.command-row input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 1px solid #3a3b45;
    border-radius: 8px;
    background: #1e1f26;
    color: #eaeaea;
    font-size: 0.95rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.command-row input:focus {
    outline: none;
    border-color: #5b8def;
}

.command-output {
    margin: 0.6rem 0 0;
    padding: 0.6rem 0.75rem;
    background: #1e1f26;
    border: 1px solid #3a3b45;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 140px;
    overflow: auto;
    min-height: 2.5rem;
    color: #d7d9e0;
}

.server-console {
    display: flex;
    flex-direction: column;
    height: 420px;
}

.console-title {
    color: #b7b9c4;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.console {
    flex: 1;
    margin: 0;
    padding: 0.75rem;
    background: #121317;
    border: 1px solid #3a3b45;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
    overflow: auto;
    color: #c9ccd6;
}
