/* ---------- Самохостинг шрифтов (Google Fonts, subsets: cyrillic+latin) ---------- */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jost-400-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jost-400-lat.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jost-500-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jost-500-lat.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/jost-600-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/jost-600-lat.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jost-700-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jost-700-lat.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/roboto-300-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/roboto-300-lat.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/roboto-400-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/roboto-400-lat.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/roboto-500-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/roboto-500-lat.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/roboto-700-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/roboto-700-lat.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   Green Finance LK — дизайн-система в стиле greenfinance.ru
   Палитра: #009c3b (акцент), #095c37 (тёмно-зелёный), #058246 (логотип),
   #ff8562 (коралловый акцент ссылок), #f7f7f7/#f8f8f8 (фоны)
   Шрифты: Jost (заголовки, uppercase), Roboto (текст)
   ============================================================ */
:root {
    --gf-green: #009c3b;
    --gf-green-dark: #095c37;
    --gf-green-logo: #058246;
    --gf-coral: #ff8562;
    --gf-ink: #111111;
    --gf-text: #000000;
    --gf-gray: #777777;
    --gf-gray-2: #757575;
    --gf-bg: #f7f7f7;
    --gf-bg-2: #f8f8f8;
    --gf-border: #eeeeee;
    --gf-border-2: #dddddd;
    --gf-white: #ffffff;
    --gf-red: #d84a35;
    --gf-amber: #e8a020;
    --font-head: 'Jost', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius: 14px;
    --radius-pill: 30px;
    --shadow: 0 2px 10px rgba(9, 92, 55, .08);
    --shadow-lg: 0 8px 30px rgba(9, 92, 55, .14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--gf-text);
    background: var(--gf-bg);
}
a { color: var(--gf-coral); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--gf-ink); margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 700; text-transform: uppercase; }
h2 { font-size: 20px; font-weight: 600; text-transform: uppercase; color: var(--gf-green-dark); }
h3 { font-size: 17px; font-weight: 600; }

/* ---------- Шапка ---------- */
.topbar {
    background: var(--gf-white);
    border-bottom: 3px solid var(--gf-green);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 40px; height: 40px; }
.brand-text {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 21px;
    letter-spacing: .06em;
    color: var(--gf-green-dark);
    text-transform: uppercase;
}
.brand-text span { color: var(--gf-green); }
.brand-auth { justify-content: center; margin-bottom: 6px; }
.topnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topnav a {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gf-ink);
    padding: 9px 12px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.topnav a:hover { background: var(--gf-bg-2); text-decoration: none; }
.topnav a.active { background: var(--gf-green); color: var(--gf-white); }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar-phone { font-weight: 700; color: var(--gf-green-dark); white-space: nowrap; }
.userchip { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.userchip-phone { font-weight: 500; color: var(--gf-ink); }
.userchip-link { font-size: 13px; color: var(--gf-coral); }

/* ---------- Каркас ---------- */
.shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px 16px 90px;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
    align-items: start;
}
.sidebar { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.side-block {
    background: var(--gf-white);
    border: 1px solid var(--gf-border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
}
.side-title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gf-gray);
    margin-bottom: 8px;
}
.side-link {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--gf-ink);
    font-weight: 500;
}
.side-link:hover { background: var(--gf-bg-2); text-decoration: none; }
.side-link.active { background: var(--gf-green-dark); color: var(--gf-white); }
.content { min-width: 0; }

/* ---------- Нижняя навигация (мобильные) ---------- */
.bottomnav {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--gf-white);
    border-top: 1px solid var(--gf-border);
    box-shadow: 0 -4px 16px rgba(0,0,0,.06);
    z-index: 60;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px 7px;
    color: var(--gf-gray);
    font-size: 11px;
    font-weight: 500;
}
.bottomnav a svg { width: 22px; height: 22px; fill: currentColor; }
.bottomnav a.active { color: var(--gf-green); }
.bottomnav a:hover { text-decoration: none; }

/* ---------- Баннер импersonации ---------- */
.imp-banner {
    background: #3a2b6d;
    color: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 14px;
}
.imp-form { margin: 0; }

/* ---------- Формы ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 5px; color: var(--gf-ink); }
.field input[type=text], .field input[type=password], .field input[type=email],
.field input[type=tel], .field input[type=number], .field input[type=date],
.field select, .field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--gf-border-2);
    border-radius: 10px;
    font: inherit;
    background: var(--gf-white);
    color: var(--gf-text);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--gf-green);
    outline-offset: -1px;
    border-color: var(--gf-green);
}
.field small.hint { color: var(--gf-gray); display: block; margin-top: 3px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 15px; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--gf-green); }
.validation-summary-errors {
    background: #fdecea;
    border: 1px solid var(--gf-red);
    color: var(--gf-red);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 15px;
}
.field-validation-error, span.text-danger { color: var(--gf-red); font-size: 13px; display: block; }
.input-validation-error { border-color: var(--gf-red) !important; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: var(--radius-pill);
    padding: 12px 26px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s ease, transform .05s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gf-green); color: var(--gf-white); }
.btn-primary:hover { background: var(--gf-green-dark); color: var(--gf-white); }
.btn-outline { background: transparent; color: var(--gf-green-dark); border: 2px solid var(--gf-green); }
.btn-outline:hover { background: var(--gf-green); color: var(--gf-white); }
.btn-ghost { background: transparent; color: var(--gf-ink); border: 1px solid var(--gf-border-2); }
.btn-ghost:hover { background: var(--gf-bg-2); }
.btn-danger { background: var(--gf-red); color: var(--gf-white); }
.btn-light { background: var(--gf-white); color: var(--gf-green-dark); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Карточки и уведомления ---------- */
.card {
    background: var(--gf-white);
    border: 1px solid var(--gf-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.alert {
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 15px;
    border: 1px solid;
}
.alert-success { background: #e9f8ef; border-color: var(--gf-green); color: #0b5d2c; }
.alert-error { background: #fdecea; border-color: var(--gf-red); color: var(--gf-red); }
.alert-warning { background: #fdf4e3; border-color: var(--gf-amber); color: #8a5b00; }

/* ---------- Главная ---------- */
.hero {
    background: linear-gradient(120deg, var(--gf-green-dark), var(--gf-green-logo));
    color: #fff;
    border-radius: var(--radius);
    padding: 30px 26px;
    margin-bottom: 20px;
}
.hero .overline {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 13px;
    opacity: .85;
}
.hero h1 { color: #fff; font-size: 30px; margin: 6px 0 4px; }
.hero .tagline { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .08em; font-size: 15px; opacity: .92; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile {
    background: var(--gf-white);
    border: 1px solid var(--gf-border);
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: inherit;
    transition: box-shadow .15s ease, transform .1s ease;
}
.tile:hover { box-shadow: var(--shadow-lg); text-decoration: none; transform: translateY(-2px); }
.tile-icon { font-size: 30px; }
.tile-title { font-family: var(--font-head); font-weight: 700; text-transform: uppercase; font-size: 17px; color: var(--gf-green-dark); }
.tile-text { color: var(--gf-gray); font-size: 14px; }

/* ---------- Статусы ---------- */
.badge {
    display: inline-block;
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font-head);
    letter-spacing: .02em;
    white-space: nowrap;
}
.st-saved { background: #eef1f4; color: #455a64; }
.st-review { background: #fdf4e3; color: #8a5b00; }
.st-rework { background: #fdecea; color: var(--gf-red); }
.st-preapproved { background: #e3f2fd; color: #1565c0; }
.st-approved { background: #e9f8ef; color: #0b5d2c; }
.st-rejected { background: #fdecea; color: var(--gf-red); }
.st-contract { background: var(--gf-green-dark); color: #fff; }

/* ---------- Таблицы/списки ---------- */
.list-row {
    background: var(--gf-white);
    border: 1px solid var(--gf-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}
.list-row .grow { flex: 1; min-width: 200px; }
.list-title { font-weight: 600; color: var(--gf-ink); }
.list-sub { color: var(--gf-gray); font-size: 14px; }
.money { font-weight: 700; color: var(--gf-green-dark); white-space: nowrap; }

/* ---------- Мастер заявки ---------- */
.wizard-progress { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.wizard-progress span {
    flex: 1;
    min-width: 60px;
    height: 6px;
    border-radius: 3px;
    background: var(--gf-border-2);
}
.wizard-progress span.on { background: var(--gf-green); }
.step-missing {
    background: #fdf4e3;
    border: 1px dashed var(--gf-amber);
    border-radius: 10px;
    padding: 10px 14px;
    color: #8a5b00;
    font-size: 14px;
    margin-bottom: 14px;
}
.spec { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec th { text-align: left; color: var(--gf-gray); font-weight: 400; padding: 6px 12px 6px 0; width: 46%; vertical-align: top; }
.spec td { padding: 6px 0; font-weight: 500; color: var(--gf-ink); }

/* ---------- Чат статусов ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-msg {
    max-width: 86%;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 15px;
    box-shadow: var(--shadow);
}
.chat-msg.client { align-self: flex-end; background: #e9f8ef; border: 1px solid var(--gf-green); }
.chat-msg.system { align-self: flex-start; background: var(--gf-white); border: 1px solid var(--gf-border); }
.chat-msg .chat-meta { font-size: 12.5px; color: var(--gf-gray); margin-top: 4px; }

/* ---------- Файлы ---------- */
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--gf-border); }
.file-row:last-child { border-bottom: 0; }
.file-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--gf-border); }

/* ---------- Экраны входа ---------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(1000px 500px at 20% -10%, rgba(0, 156, 59, .18), transparent),
        radial-gradient(800px 400px at 110% 110%, rgba(9, 92, 55, .16), transparent),
        var(--gf-bg);
}
.auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--gf-white);
    border: 1px solid var(--gf-border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 30px 28px;
}
.auth-tagline {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 13px;
    color: var(--gf-green);
    text-align: center;
    margin-bottom: 18px;
}
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14.5px; }

/* ---------- Футер ---------- */
.footer {
    border-top: 1px solid var(--gf-border);
    background: var(--gf-white);
    color: var(--gf-gray);
    font-size: 13.5px;
    padding: 14px 16px 80px;
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Мобильная адаптация ---------- */
@media (max-width: 1080px) {
    .sidebar { display: none; }
    .shell { grid-template-columns: 1fr; padding-bottom: 96px; }
}
@media (max-width: 900px) {
    .topnav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
    .topbar-phone { display: none; }
}
@media (max-width: 760px) {
    .bottomnav { display: flex; }
    body { font-size: 15.5px; }
    h1 { font-size: 22px; }
    .hero { padding: 22px 18px; }
    .hero h1 { font-size: 24px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .card { padding: 16px 14px; }
    .list-row { padding: 13px 12px; }
    .chat-msg { max-width: 96%; }
    .topbar-inner { padding: 8px 12px; gap: 10px; }
    .brand-text { font-size: 17px; }
    .userchip { display: none; }
    .spec th { width: 52%; }
}
@media (max-width: 420px) {
    .tiles { grid-template-columns: 1fr; }
    .btn { width: 100%; }
    .btn-sm { width: auto; }
}

/* ---------- Печать ---------- */
@media print {
    .topbar, .sidebar, .bottomnav, .footer, .imp-banner, .btn, form { display: none !important; }
    .card { box-shadow: none; border: 0; }
}
