:root {
    color-scheme: light;
    --ink: #1c2430;
    --muted: #697386;
    --line: #d9dee8;
    --soft: #f3f5f8;
    --paper: #ffffff;
    --accent: #145c55;
    --accent-dark: #0d403b;
    --danger: #b42318;
    --success: #177245;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: #eef1f5;
    font-family: Arial, Helvetica, sans-serif;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 420px);
    padding: 32px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(28, 36, 48, 0.12);
}

.login-header {
    display: grid;
    justify-items: center;
    margin-bottom: 24px;
    text-align: center;
}

.login-logo {
    display: block;
    width: min(230px, 80%);
    height: auto;
    margin-bottom: 18px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 30px;
}

h2 {
    margin-bottom: 10px;
    font-size: 18px;
}

p {
    color: var(--muted);
    line-height: 1.5;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 28px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--accent);
    font-weight: 700;
}

.brand a,
.nav-links a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.brand-logo {
    display: block;
    width: 150px;
    max-width: 42vw;
    height: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-links .logout {
    color: var(--danger);
}

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

.install-page {
    width: min(760px, calc(100% - 40px));
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.card,
.empty-state,
.panel,
.form-panel,
.table-wrap,
.list-item {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.card,
.empty-state,
.panel,
.form-panel,
.list-item {
    padding: 22px;
}

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

table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    background: var(--soft);
    font-size: 13px;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.list {
    display: grid;
    gap: 12px;
}

.list-item h2 {
    margin-bottom: 8px;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.meta strong,
.meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    background: var(--soft);
    border-radius: 6px;
    font-size: 13px;
}

.meta strong {
    color: var(--accent);
}

.login-form,
.form-grid,
.field {
    display: grid;
}

.login-form,
.field {
    gap: 10px;
}

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

.field-wide {
    grid-column: span 2;
}

label {
    font-weight: 700;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    font: inherit;
}

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

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(20, 92, 85, 0.18);
    border-color: var(--accent);
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-top: 10px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: var(--accent);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--accent-dark);
}

.button.secondary {
    color: var(--accent);
    background: #e7f0ee;
}

.button.secondary:hover {
    background: #d6e6e3;
}

.text-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.alert {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
}

.alert.error {
    color: var(--danger);
    background: #fff0ee;
}

.alert.success {
    color: var(--success);
    background: #edf8f2;
}

@media (max-width: 760px) {
    .topbar,
    .nav-links,
    .page-header,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar {
        gap: 12px;
        padding: 16px 20px;
    }

    .dashboard-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: span 1;
    }
}
