:root {
    --bg: #f3efe6;
    --panel: #fffaf0;
    --panel-strong: #fff;
    --line: #d8cfbf;
    --text: #2f2a24;
    --muted: #6c655d;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --danger: #b42318;
    --shadow: 0 18px 40px rgba(73, 54, 34, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
        linear-gradient(180deg, #f7f2e9 0%, #efe7d8 100%);
}

.page-shell { max-width: 1200px; margin: 0 auto; padding: 32px 20px 48px; }
.topbar,
.hero, .card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.topbar {
    margin-bottom: 20px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.hero { margin-bottom: 24px; padding: 28px 30px; }
.card { padding: 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 20px; }
.stack { display: grid; gap: 14px; }
.compact-stack { gap: 10px; margin-top: 10px; }
.action-stack { display: grid; gap: 10px; }
.warning-card { margin-bottom: 20px; background: linear-gradient(180deg, #fffaf0 0%, #fff6e4 100%); }
.login-shell { min-height: calc(100vh - 120px); display: grid; place-items: center; }
.login-card {
    width: min(100%, 430px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 250, 240, 0.98);
    box-shadow: var(--shadow);
    padding: 30px;
}
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; color: var(--accent-strong); }
.subtle, .hint { color: var(--muted); }

label span { display: block; margin-bottom: 6px; font-size: 0.92rem; }
input {
    width: 100%;
    border: 1px solid #cbbda7;
    border-radius: 14px;
    background: var(--panel-strong);
    padding: 12px 14px;
    color: var(--text);
    font-size: 1rem;
}

button {
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    padding: 12px 18px;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button.secondary { background: #7c5c2b; }
button.danger { background: var(--danger); }
button.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}
button:disabled { opacity: 0.8; cursor: wait; }
.button-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    border-radius: 50%;
    display: none;
}
.is-loading .button-spinner {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}
.is-loading input {
    opacity: 0.7;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
code { font-family: "Courier New", monospace; }
.status { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 0.83rem; text-transform: capitalize; }
.status-active { background: rgba(15, 118, 110, 0.12); color: var(--accent-strong); }
.status-disabled { background: rgba(124, 92, 43, 0.12); color: #7c5c2b; }
.status-failed, .status-deleted { background: rgba(180, 35, 24, 0.12); color: var(--danger); }
.status-blocked { background: rgba(180, 83, 9, 0.12); color: #9a4d0a; }
.status-pending, .status-provisioning { background: rgba(124, 92, 43, 0.12); color: #7c5c2b; }
.flash { margin-bottom: 20px; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.flash-success { background: rgba(15, 118, 110, 0.12); }
.flash-error { background: rgba(180, 35, 24, 0.12); }
.error-row td { color: var(--danger); font-size: 0.92rem; }
.wipe-form input {
    min-width: 220px;
}
.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
}
.modal-shell[hidden] {
    display: none !important;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(47, 42, 36, 0.52);
}
.modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 560px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: 24px;
}
.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.modal-warning {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(180, 35, 24, 0.08);
    border: 1px solid rgba(180, 35, 24, 0.18);
}
.wipe-summary {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid #e2c9bf;
    background: linear-gradient(180deg, #fff7f4 0%, #fff1ec 100%);
}
.wipe-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text);
}
.wipe-list li + li {
    margin-top: 8px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
body.modal-open {
    overflow: hidden;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
    .page-shell { padding: 20px 14px 32px; }
    .topbar {
        padding: 16px;
        border-radius: 18px;
        align-items: flex-start;
        flex-direction: column;
    }
    .hero, .card { padding: 18px; border-radius: 18px; }
    .login-card { padding: 22px; border-radius: 22px; }
    .modal-card { padding: 18px; border-radius: 18px; }
    .modal-head,
    .modal-actions { flex-direction: column; }
}
