:root {
    --ink: #1b2027;
    --steel: #2f3944;
    --steel-light: #55636f;
    --line: #dfe3e8;
    --bg: #f4f6f8;
    --card: #ffffff;
    --accent: #e2610a;
    --accent-dark: #c25208;
    --ok: #1f8a4c;
    --warn: #b8860b;
    --danger: #c0392b;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(27, 32, 39, .06), 0 6px 20px rgba(27, 32, 39, .06);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; font-weight: 650; }
h1 { font-size: 30px; }
h2 { font-size: 23px; }
h3 { font-size: 19px; }

p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 18px; }
.container--narrow { max-width: 720px; }

.site-header {
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 30;
}

.site-header a { color: #fff; text-decoration: none; }

.site-header__row {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 62px;
    flex-wrap: wrap;
    padding: 8px 0;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; }
.logo__mark {
    width: 30px; height: 30px; border-radius: 7px;
    background: linear-gradient(160deg, var(--accent), #8a3c05);
    display: grid; place-items: center; font-size: 15px;
}
.logo__text small { display: block; font-size: 11px; font-weight: 400; opacity: .7; letter-spacing: .4px; }

.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.site-nav a {
    padding: 8px 12px; border-radius: 8px; font-size: 15px;
    color: #d6dce3;
}
.site-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.site-nav a.is-active { background: rgba(255, 255, 255, .12); color: #fff; }
.page-konstruktor .site-nav a {
    color: #000;
    background: #d7efff;
    border: 1px solid #a9c4d6;
    box-shadow: none;
}
.page-konstruktor .site-nav a:hover,
.page-konstruktor .site-nav a.is-active { color: #002d87; background: #c3e4fa; }

.main { padding: 28px 0 56px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 20px;
}
.card--flat { box-shadow: none; }
.card__title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__title h2, .card__title h3 { margin: 0; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
    background: var(--accent); color: #fff; font-size: 15px; font-weight: 600;
    cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: #eef1f4; color: var(--ink); }
.btn--dark { background: var(--steel); }
.btn--dark:hover { background: var(--ink); }
.btn--danger { background: var(--danger); }
.btn--sm { padding: 6px 12px; font-size: 14px; }
.btn--block { display: flex; width: 100%; justify-content: center; }

.hero {
    background: linear-gradient(150deg, #232b34 0%, #171c22 60%, #2a1a0f 100%);
    color: #fff;
    border-radius: 14px;
    padding: 44px 34px;
    margin-bottom: 26px;
}
.hero h1 { font-size: 34px; max-width: 30ch; }
.hero p { color: #c7cfd8; max-width: 62ch; font-size: 17px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero__actions .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero__actions .btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.audience { margin-bottom: 26px; }
.audience__block { display: flex; flex-direction: column; margin: 0; }
.audience__list { margin: 0 0 18px; padding-left: 20px; color: var(--steel); }
.audience__list li { margin-bottom: 8px; line-height: 1.5; }
.audience__block .btn { margin-top: auto; align-self: flex-start; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature h3 { font-size: 17px; }
.feature p { color: var(--steel-light); font-size: 15px; margin: 0; }
.feature__num { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .1em; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat__value { font-size: 26px; font-weight: 700; }
.stat__label { color: var(--steel-light); font-size: 14px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--card); }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: #eef1f4; font-weight: 600; font-size: 14px; white-space: nowrap; }
table.data tr:hover td { background: #fafbfc; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }

.badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 12.5px; font-weight: 600; background: #eef1f4; color: var(--steel);
}
.badge--ok { background: #e4f4ea; color: var(--ok); }
.badge--warn { background: #fdf3dc; color: var(--warn); }
.badge--off { background: #f6e7e5; color: var(--danger); }

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; color: var(--steel); }
.form-row .hint { font-size: 13px; color: var(--steel-light); margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=file], select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(226, 97, 10, .35); border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .form-row { margin: 0; min-width: 150px; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 15px; border: 1px solid transparent; }
.alert--error { background: #fdecea; border-color: #f5c6c2; color: #922; }
.alert--ok { background: #e6f6ec; border-color: #bfe6cd; color: #175f36; }
.alert--info { background: #eaf1f8; border-color: #cadcee; color: #1c4a75; }

.notice-strip {
    background: #fdf3dc; border: 1px solid #f0dfae; color: #6b5312;
    border-radius: var(--radius); padding: 12px 16px; font-size: 15px; margin-bottom: 20px;
}

.layout-admin { display: grid; grid-template-columns: 224px 1fr; gap: 22px; align-items: start; }
.layout-admin > * { min-width: 0; }
.side-nav { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 78px; }
.side-nav a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--steel); font-size: 15px; }
.side-nav a:hover { background: #eef1f4; text-decoration: none; }
.side-nav a.is-active { background: var(--ink); color: #fff; }
.side-nav__group { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--steel-light); padding: 12px 12px 4px; }

.pager-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager-nav a, .pager-nav span {
    padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 14px; color: var(--steel);
}
.pager-nav span.is-current { background: var(--ink); color: #fff; border-color: var(--ink); }

.el-preview { width: 74px; height: 74px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; place-items: center; }

.kv { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--steel-light); }
.kv dd { margin: 0; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sum-line {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center;
    border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px;
}
.input-sm { max-width: 130px; text-align: right; }

.muted { color: var(--steel-light); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-right { text-align: right; }

.site-footer { background: var(--ink); color: #9aa6b2; padding: 26px 0; font-size: 14px; }
.site-footer a { color: #c7cfd8; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs a { padding: 9px 14px; font-size: 15px; color: var(--steel); text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--accent); }
.tabs a.is-active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

.form-row .hint { display: block; }
.inline-form { display: inline-block; margin: 0; }

.ops { list-style: none; margin: 10px 0 0; padding: 0; font-size: 15px; }
.ops li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ops li:last-child { border-bottom: 0; }
.ops__date { color: var(--steel-light); font-size: 13px; white-space: nowrap; }
.ops__text { flex: 1; min-width: 120px; }
.ops__sum { font-weight: 600; white-space: nowrap; }
.is-minus { color: #b3261e; }
.is-plus { color: #1c7a3e; }

.logo-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo-row__preview { width: 160px; min-height: 80px; display: flex; align-items: center; justify-content: center;
    border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px; background: #fff; }
.logo-row__preview img { max-width: 140px; max-height: 90px; }


@media (max-width: 900px) {
    .layout-admin { grid-template-columns: 1fr; }
    .side-nav { position: static; }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dd { margin-bottom: 8px; }
}

@media (max-width: 620px) {
    body { font-size: 15px; }
    h1, .hero h1 { font-size: 25px; }
    .hero { padding: 28px 20px; }
    .grid--4, .grid--2 { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    .site-nav { width: 100%; margin-left: 0; }
    .site-nav a { padding: 7px 10px; font-size: 14px; }
}

@media (max-width: 620px) {
    .tabs { overflow-x: auto; flex-wrap: nowrap; }
    .tabs a { white-space: nowrap; }
    .logo-row__preview { width: 100%; }
}

.upload-form { border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0 20px; background: #fbfcfd; }
.upload-form .form-row { margin-bottom: 10px; }
.attach-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

.files { list-style: none; margin: 10px 0 20px; padding: 0; display: grid; gap: 14px; }
.files--photo { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.file-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.file-card__shot { display: block; background: #eef1f4; }
.file-card__shot img { display: block; width: 100%; height: 150px; object-fit: cover; }
.file-card__body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.file-card__name { font-weight: 600; word-break: break-word; }

.asm-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.asm { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.asm__preview { width: 92px; height: 92px; object-fit: contain; background: #eef1f4; border-radius: 6px; flex: none; }
.asm__body { min-width: 0; flex: 1; }
.asm__name { font-weight: 600; word-break: break-word; }
.asm__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.events { list-style: none; margin: 10px 0 0; padding: 0; font-size: 15px; }
.events__item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.events__item:last-child { border-bottom: 0; }
.events__date { color: var(--steel-light); font-size: 13px; white-space: nowrap; }
.events__text { flex: 1; min-width: 160px; }
.events__who { font-size: 13px; }

@media (max-width: 620px) {
    .files--photo { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .asm { flex-direction: column; }
    .asm__preview { width: 100%; height: 120px; }
}

.el-pic-col { width: 68px; }
.el-pic { display: block; background: #f4f6f8; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.el-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.el-pic--sm { width: 56px; height: 56px; }
.el-pic--lg { width: 100%; max-width: 420px; aspect-ratio: 1 / 1; margin: 0 auto 16px; }
.el-pic--xs { width: 40px; height: 40px; }

@media (max-width: 620px) {
    .el-pic-col { width: 52px; }
    .el-pic--sm { width: 44px; height: 44px; }
}

.chat { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.chat__msg { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fff; max-width: 640px; }
.chat__msg.is-mine { background: #f4f8fb; border-color: #cfdbe6; margin-left: auto; }
.chat__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 4px; }
.chat__who { font-weight: 600; font-size: 14px; }
.chat__date { color: var(--steel-light); font-size: 13px; }
.chat__body { word-break: break-word; }

@media (max-width: 620px) {
    .chat__msg { max-width: none; }
}

.contact-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; word-break: break-word; }

.howto-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 22px; }
.howto-toc a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--steel); font-size: 14px; text-decoration: none; }
.howto-toc a:hover { border-color: var(--accent); color: var(--accent-dark); }
.howto-section { scroll-margin-top: 16px; margin-bottom: 22px; }
.howto-section#video { scroll-margin-top: 80px; }
.howto-title { margin-bottom: 4px; }
.howto-lead { margin-top: 0; }
.howto-steps { list-style: none; counter-reset: howto; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.howto-steps li { counter-increment: howto; position: relative; padding: 16px 16px 16px 58px; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfcfd; }
.howto-steps li::before { content: counter(howto); position: absolute; left: 16px; top: 15px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.howto-steps h3 { font-size: 16px; margin: 4px 0 6px; }
.howto-steps p { margin: 0; color: var(--steel-light); font-size: 15px; }
.howto-note { margin: 16px 0 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: #fff8f2; border-radius: 0 8px 8px 0; font-size: 15px; }
.howto-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.howto-sale { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; padding: 0; }
.howto-sale li { padding: 10px 16px; border-radius: var(--radius); background: #fff8f2; border: 1px solid #f3d3bb; font-size: 16px; }
.howto-sale strong { color: var(--accent-dark); font-size: 22px; margin-right: 4px; }
.howto-list { margin: 0 0 12px; padding-left: 20px; }
.howto-list li + li { margin-top: 6px; }
.howto-tips { display: grid; grid-template-columns: 220px 1fr; gap: 10px 18px; margin: 0; }
.howto-tips dt { font-weight: 700; }
.howto-tips dd { margin: 0; color: var(--steel-light); }
.howto-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #111; }
.howto-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 6px 0 10px; }

@media (max-width: 900px) {
    .howto-section#video { scroll-margin-top: 160px; }
}

@media (max-width: 620px) {
    .howto-tips { grid-template-columns: 1fr; gap: 2px; }
    .howto-tips dd { margin-bottom: 10px; }
    .howto-steps li { padding-left: 54px; }
    .howto-section#video { scroll-margin-top: 220px; }
}
