:root {
    --blue-900: #071d33;
    --blue-800: #0b2e4f;
    --blue-700: #123f68;
    --orange: #ff7a1a;
    --orange-dark: #d95f06;
    --bg: #f4f7fb;
    --card: #ffffff;
    --border: #dfe7f1;
    --text: #10243a;
    --muted: #687789;
    --danger: #b42318;
    --success: #137333;
    --wait: #8a5a00;
    --shadow: 0 12px 30px rgba(8, 32, 55, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; }
.brand img { height: 56px; display: block; }
.top-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.top-nav a { padding: 8px 10px; border-radius: 12px; color: var(--blue-800); font-weight: 650; font-size: 14px; }
.top-nav a:hover { background: #eef4fb; text-decoration: none; }
.main { padding: 28px 0 50px; }
.site-footer { border-top: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); padding: 24px; margin-bottom: 22px; }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.hero { padding: 34px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr); gap: 30px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.02; margin: 8px 0 16px; letter-spacing: -0.04em; color: var(--blue-900); }
.lead { font-size: 19px; color: #435468; max-width: 760px; }
.eyebrow { color: var(--orange-dark); font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px; margin: 0; }
.hero-panel { background: linear-gradient(160deg, var(--blue-900), var(--blue-700)); color: #fff; border-radius: 20px; padding: 24px; }
.hero-panel h2 { margin-top: 0; }
.hero-panel .check-list li::before { background: var(--orange); }

h1, h2, h3 { color: var(--blue-900); line-height: 1.15; }
h1 { margin-top: 0; font-size: 32px; letter-spacing: -0.02em; }
h2 { margin-top: 0; font-size: 22px; }
hr { border: 0; border-top: 1px solid var(--border); width: 100%; }
code { background: #eef4fb; padding: 3px 6px; border-radius: 8px; font-size: 12px; word-break: break-all; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.75fr); gap: 22px; align-items: start; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mini-card h2 { font-size: 19px; }
.hint-card { background: #fbfdff; }
.stats .stat { margin-bottom: 0; text-align: center; padding: 18px; }
.stat strong { display: block; font-size: 34px; color: var(--orange-dark); line-height: 1; }
.stat span { color: var(--muted); font-weight: 650; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.btn { border: 1px solid var(--border); background: #fff; color: var(--blue-800); border-radius: 14px; padding: 10px 16px; font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; font-size: 14px; }
.btn:hover { background: #eef4fb; text-decoration: none; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dark); }
.btn.small { padding: 6px 9px; min-height: 32px; border-radius: 10px; font-size: 12px; }
.btn.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: not-allowed; }
.link-danger { border: 0; background: none; color: var(--danger); cursor: pointer; padding: 0; font-weight: 700; }

.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--blue-900); }
label small, .field-card small { color: var(--muted); font-weight: 500; display: block; margin-bottom: 4px; }
input, textarea, select { width: 100%; border: 1px solid var(--border); border-radius: 14px; padding: 11px 12px; font: inherit; background: #fff; color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(255, 122, 26, 0.18); border-color: var(--orange); }
.check { flex-direction: row; align-items: center; gap: 8px; }
.check input { width: auto; }
.checkbox-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.checkbox-list label { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; background: #f6f9fc; border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.checkbox-list input { width: auto; }

.flash { border-radius: 16px; padding: 13px 16px; margin-bottom: 18px; border: 1px solid var(--border); background: #eef4fb; }
.flash-success { background: #e9f7ef; border-color: #bfe6cd; color: #0f5c2a; }
.flash-error { background: #fff0ef; border-color: #ffd1cc; color: var(--danger); }

.event-badge { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; background: var(--blue-900); color: #fff; border-radius: 18px; padding: 14px 18px; margin-bottom: 22px; }
.event-badge span { color: #c7d7e7; }
.section-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 18px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f6f9fc; color: var(--blue-900); font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: 0; }
.compact-table th, .compact-table td { padding: 8px 10px; font-size: 13px; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; min-width: 230px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 800; background: #eef4fb; color: var(--blue-800); white-space: nowrap; }
.pill.ok { background: #e9f7ef; color: var(--success); }
.pill.bad { background: #fff0ef; color: var(--danger); }
.pill.wait { background: #fff8e6; color: var(--wait); }
.pill.owner { background: #fff0df; color: var(--orange-dark); }

.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 26px; }
.check-list li::before { content: ''; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }

.item-list { display: grid; gap: 10px; }
.item-row { display: grid; grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.2fr) auto; gap: 14px; align-items: center; border: 1px solid var(--border); border-radius: 16px; padding: 12px; background: #fbfdff; }
.item-main { display: flex; flex-direction: column; gap: 3px; }
.item-checks { display: flex; flex-wrap: wrap; gap: 7px; }
.item-checks label { flex-direction: row; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); padding: 5px 8px; border-radius: 999px; font-size: 12px; }
.item-checks input { width: auto; }
.delete-line { text-align: right; margin: -6px 10px 8px; }

.matrix-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--border); border-radius: 16px; }
.matrix-table { min-width: 900px; }
.matrix-table th, .matrix-table td { padding: 7px 8px; font-size: 12px; vertical-align: middle; }
.matrix-table th { position: sticky; top: 0; z-index: 5; }
.matrix-table th span { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
.sticky-left { position: sticky; left: 0; z-index: 6; background: #fff; box-shadow: 6px 0 12px rgba(8, 32, 55, 0.05); }
th.sticky-left { background: #f6f9fc; z-index: 8; }
.row-title { min-width: 280px; }
.row-title span { color: var(--muted); }
.matrix-cell { text-align: center; min-width: 92px; }
.matrix-check { display: inline-flex; align-items: center; justify-content: center; width: 100%; }
.matrix-check input { width: 18px; height: 18px; }
.own-cell { background: #eef1f5; }
.own-cell input { opacity: .55; }
.matrix-actions { position: sticky; bottom: 0; background: #fff; padding-top: 14px; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { border: 1px solid var(--border); background: #fff; padding: 10px 14px; border-radius: 999px; font-weight: 800; }
.tabs a.active { background: var(--blue-900); color: #fff; border-color: var(--blue-900); }
.field-card { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: #fbfdff; }
.field-card em { font-style: normal; background: #fff0df; color: var(--orange-dark); border-radius: 999px; padding: 2px 7px; font-size: 12px; margin-left: 4px; }
.current-file { display: block; margin: 8px 0; font-weight: 600; color: var(--muted); }

@media (max-width: 900px) {
    .header-inner { align-items: flex-start; flex-direction: column; }
    .top-nav { justify-content: flex-start; }
    .hero-grid, .grid-2, .grid-2.wide-left, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
    .checkbox-list { grid-template-columns: 1fr; }
    .item-row { grid-template-columns: 1fr; }
    .brand img { height: 46px; }
    .hero { padding: 24px; }
}
