:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #657181;
    --line: #d7dde5;
    --primary: #1d4f91;
    --primary-hover: #173f73;
    --danger: #b42318;
    --success: #027a48;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
}

label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
}

button,
.button {
    display: inline-block;
    padding: 10px 14px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    background: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

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

.button.secondary {
    color: var(--text);
    background: #e8edf3;
}

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

.login-panel {
    width: min(100%, 420px);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
}

.login-panel.wide {
    width: min(100%, 520px);
}

.login-panel button {
    width: 100%;
    margin-top: 18px;
}

.muted,
.help {
    color: var(--muted);
}

.help {
    margin: 6px 0 0;
    font-size: 0.92rem;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.brand {
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.topbar nav a,
.session-info a {
    text-decoration: none;
}

.session-info {
    display: flex;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto;
}

.page-title,
.panel {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
}

.definition-list {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 16px;
}

.definition-list dt {
    font-weight: 700;
}

.definition-list dd {
    margin: 0;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.module-card {
    display: block;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    background: #fff;
}

.module-card strong,
.module-card span {
    display: block;
}

.module-card span {
    margin-top: 8px;
    color: var(--muted);
}

.alert {
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 4px;
    background: #eef4ff;
}

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

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

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

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

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 16px;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-row label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin: 0;
    font-weight: 400;
}

.checkbox-row input,
.inline-check input {
    width: auto;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.danger-text {
    color: var(--danger);
}

@media (max-width: 760px) {
    .topbar,
    .session-info {
        align-items: flex-start;
        flex-direction: column;
    }

    .definition-list {
        grid-template-columns: 1fr;
    }
}
