:root {
    --bg: #f6f3ee;
    --surface: #fffdfa;
    --surface-2: #f4eee5;
    --text: #1f1e1b;
    --muted: #6d665d;
    --brand: #0b5d5b;
    --brand-2: #d26a2e;
    --ok: #1d7b3a;
    --danger: #b61f2f;
    --border: #e4d8c7;
    --shadow: 0 10px 30px rgba(40, 34, 23, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 0% 0%, #f7d5bd 0%, transparent 45%),
        radial-gradient(circle at 100% 100%, #cae5d8 0%, transparent 40%),
        var(--bg);
}

.app-shell {
    max-width: 1140px;
    margin: 32px auto;
    padding: 0 20px 40px;
}

.page-title {
    margin: 0;
    font-family: "Merriweather", Georgia, serif;
    letter-spacing: 0.2px;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.card {
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.stack {
    display: grid;
    gap: 18px;
}

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

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

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

a.btn,
button {
    border: 0;
    border-radius: 11px;
    padding: 10px 14px;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.btn:hover,
button:hover {
    transform: translateY(-1px);
}

.btn-primary,
button {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 18px rgba(11, 93, 91, 0.25);
}

.btn-secondary {
    background: #fff;
    color: var(--brand);
    border: 1px solid #b8d7d6;
}

.btn-danger {
    background: #fff;
    color: var(--danger);
    border: 1px solid #efb6bc;
}

.alert {
    border-radius: 12px;
    padding: 11px 13px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.alert-success {
    border-color: #a8d8b4;
    color: var(--ok);
    background: #eef9f0;
}

.alert-error {
    border-color: #f0bac0;
    color: var(--danger);
    background: #fff0f2;
}

form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input,
textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #d9c9b4;
    background: #fff;
    padding: 10px 12px;
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.field {
    margin-bottom: 14px;
}

.field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: #fff;
}

th,
td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid #efe4d5;
    vertical-align: top;
}

th {
    background: #fbf7f2;
    color: #473f35;
}

td code {
    font-size: 0.78rem;
    background: #f6f0e6;
    padding: 3px 6px;
    border-radius: 6px;
    word-break: break-all;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-ok {
    background: var(--ok);
}

.status-bad {
    background: var(--danger);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: min(450px, 100%);
}

.muted-link {
    color: var(--brand);
    text-decoration: none;
}

.muted-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .app-shell {
        margin-top: 18px;
        padding: 0 14px 28px;
    }

    .card {
        padding: 18px;
        border-radius: 14px;
    }

    .actions {
        width: 100%;
    }

    .actions .btn {
        flex: 1;
    }
}