:root {
    --bg: #f5f7fb;
    --card: #fff;
    --text: #14161a;
    --muted: #596274;
    --line: #dfe3eb;
    --dark: #111827;
    --accent: #175cd3;
    --accent-hover: #124cae;
    --success: #067647;
    --danger: #b42318;
    --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    min-width: 320px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--accent); }
.skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--dark);
    color: #fff;
}
.skip-link:focus { top: 16px; }
.container { max-width: 1240px; margin: 0 auto; padding: 24px 20px 40px; }
.topbar, .toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
}
.nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 24px; }
.nav .btn[aria-current="page"] { border-color: #84adff; background: #eef4ff; color: #173f8a; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 22px; margin-bottom: 10px; }
h3 { font-size: 18px; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card, .form-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .06);
}
.form-card { border-radius: 22px; padding: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #84adff;
    outline-offset: 2px;
}
.btn-dark { background: var(--dark); }
.btn-dark:hover { background: #293244; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #05603a; }
.btn-light { background: #fff; color: var(--text); border-color: var(--line); }
.btn-light:hover { background: #f7f8fa; }
.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: #173f8a;
    font-size: 12px;
    font-weight: 700;
}
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 30px rgba(16, 24, 40, .06); }
table { width: 100%; border-collapse: collapse; background: #fff; }
caption { padding: 14px 16px; text-align: left; font-weight: 700; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; text-align: left; vertical-align: top; }
th { background: #f8fafc; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group.full { grid-column: 1 / -1; }
label, legend { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
input, select, textarea {
    width: 100%;
    min-height: 47px;
    padding: 12px 14px;
    border: 1px solid #aeb5c2;
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}
input[type="checkbox"] { width: auto; min-height: auto; }
.field-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.error, .success {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
}
.error { background: #fff1f2; color: var(--danger); border: 1px solid #fda29b; }
.success { background: #ecfdf3; color: #05603a; border: 1px solid #75e0a7; }
.checks { display: grid; gap: 14px; }
.check-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fafcff; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.checkbox-line { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.login-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: 0 18px 40px rgba(16, 24, 40, .08); }
.login-card .muted { margin: 5px 0 20px; }
.login-card .form-group + .form-group { margin-top: 16px; }
.submit { width: 100%; margin-top: 18px; }
.actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.inline-form { display: inline; margin: 0; }
.section-gap { height: 20px; }
.summary-number { margin-top: 6px; }
.empty-state { padding: 24px; color: var(--muted); }

@media (max-width: 860px) {
    .form-grid { grid-template-columns: 1fr; }
    .topbar, .toolbar { flex-direction: column; }
}
@media (max-width: 520px) {
    .container { padding: 16px 12px 28px; }
    .login-wrap { min-height: calc(100vh - 32px); padding: 10px; }
    .login-card { padding: 22px; }
    h1 { font-size: 28px; }
    .btn { width: 100%; }
    .nav, .nav .inline-form { width: 100%; }
}

