* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background: #eef2f6;
    color: #1f2933;
}

a {
    color: #22577a;
}

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

.app-shell {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid #d8e0e8;
    border-radius: 8px;
}

.brand {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.user {
    margin: 4px 0 0;
    color: #667085;
    font-size: 14px;
}

.app-nav {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.app-nav a {
    padding: 9px 12px;
    border: 1px solid #d8e0e8;
    border-radius: 6px;
    background: #ffffff;
    color: #344054;
    text-decoration: none;
}

.app-nav a.active {
    border-color: #22577a;
    background: #e8f2f7;
    color: #16364d;
}

.app-content {
    display: grid;
    gap: 16px;
}

.card,
.login form,
.login section {
    width: 100%;
    max-width: 640px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #d8e0e8;
    border-radius: 8px;
}

.card.narrow,
.login form,
.login section {
    max-width: 420px;
}

.card.page-management {
    max-width: none;
}

h1 {
    margin: 0 0 14px;
    font-size: 24px;
}

h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

p {
    line-height: 1.5;
}

.muted {
    color: #667085;
}

.stack-form {
    max-width: 420px;
    padding: 0;
    border: 0;
    background: transparent;
}

label {
    display: block;
    margin-bottom: 16px;
    color: #344054;
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 11px;
    border: 1px solid #b8c0cc;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
}

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

button,
.button-link {
    display: inline-block;
    width: auto;
    padding: 10px 14px;
    border: 0;
    border-radius: 6px;
    background: #22577a;
    color: #ffffff;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.login button,
.stack-form button {
    width: 100%;
}

button.secondary {
    background: #344054;
}

button.danger {
    background: #b42318;
}

.inline-form {
    margin: 12px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.logout-form {
    width: auto;
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
}

.error,
.success {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 6px;
}

.error {
    border: 1px solid #f3b6ad;
    background: #fff1ef;
    color: #b42318;
}

.success {
    border: 1px solid #a6d8bd;
    background: #ecfdf3;
    color: #067647;
}

.summary {
    margin: 18px 0;
}

.summary div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid #e4e7ec;
}

.summary dt {
    color: #667085;
}

.summary dd {
    margin: 0;
    font-weight: 700;
}

.application-card h1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 999px;
    background: #12b76a;
}

.filter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.filter-link {
    padding: 8px 12px;
    border: 1px solid #d8e0e8;
    border-radius: 6px;
    background: #ffffff;
    color: #344054;
    text-decoration: none;
}

.filter-link.active {
    border-color: #22577a;
    background: #e8f2f7;
    color: #16364d;
    font-weight: 700;
}

.table-wrap {
    width: 100%;
    margin-top: 18px;
    overflow-x: auto;
}

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

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

.page-table th {
    color: #667085;
    font-size: 13px;
}

.page-content {
    margin: 18px 0;
    line-height: 1.6;
}

.recovery-code {
    padding: 14px;
    border: 1px solid #b8c0cc;
    border-radius: 6px;
    background: #f8fafc;
    font-family: Consolas, monospace;
    font-size: 20px;
    text-align: center;
}

@media (max-width: 640px) {
    .app-shell {
        padding: 16px;
    }

    .app-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-nav {
        flex-direction: column;
    }
}

@media print {
    button,
    a,
    .app-nav,
    .app-header {
        display: none;
    }

    body {
        background: #ffffff;
    }
}
