/* Sarmat Broker — панель заявок. */

:root {
    --brand: #1257c7;
    --brand-dark: #0e4099;
    --brand-soft: #eaf1fd;
    --ink: #0b1b33;
    --text: #3a4a63;
    --muted: #6e7f99;
    --bg: #f4f8fd;
    --line: #e3eaf4;
    --red: #d64545;
    --green: #17a06a;
    --amber: #d98a1a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--brand); text-decoration: none; }

/* ── Вход ──────────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.login {
    width: 320px;
    max-width: calc(100% - 32px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(11, 27, 51, .08);
}

.login__title { margin: 0; font-size: 19px; letter-spacing: .06em; color: var(--ink); }
.login__sub { margin: 4px 0 20px; font-size: 13px; color: var(--muted); }

.login input {
    width: 100%;
    font: inherit;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    margin-bottom: 10px;
}

.login input:focus { outline: none; border-color: var(--brand); }

.login button {
    width: 100%;
    font: 600 15px inherit;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
}

.alert {
    margin: 0 0 14px;
    padding: 9px;
    border-radius: 8px;
    background: #fdecec;
    border: 1px solid #f3c2c2;
    color: #a52c2c;
    font-size: 13px;
}

/* ── Шапка ─────────────────────────────────────────────────────────────── */
.ahdr { background: var(--ink); color: #cfe0f8; position: sticky; top: 0; z-index: 10; }

.ahdr__in {
    max-width: 1000px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ahdr__logo { font-weight: 700; letter-spacing: .06em; font-size: 14px; text-transform: uppercase; }
.ahdr__right { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.ahdr__right a { color: #cfe0f8; }
.ahdr__right a:hover { color: #fff; }

.badge { background: var(--red); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }

/* ── Фильтры ───────────────────────────────────────────────────────────── */
.filters { background: #fff; border-bottom: 1px solid var(--line); }

.filters__in {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.chip {
    padding: 6px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
    color: var(--text);
}

.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.filters input {
    margin-left: auto;
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 11px;
    min-width: 200px;
}

.filters input:focus { outline: none; border-color: var(--brand); }

.filters button {
    font: inherit;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

/* ── Заявки ────────────────────────────────────────────────────────────── */
.list { max-width: 1000px; margin: 0 auto; padding: 18px 16px 60px; display: grid; gap: 14px; }

.empty { color: var(--muted); text-align: center; padding: 60px 0; }

.lead {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
}

.lead_new { border-left-color: var(--red); }
.lead_in_work { border-left-color: var(--amber); }
.lead_done { border-left-color: var(--green); }
.lead_rejected { opacity: .6; }

.lead__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lead__no { font-weight: 700; color: var(--ink); }
.lead__date { color: var(--muted); font-size: 13px; margin-left: 10px; }

.lead__lang {
    margin-left: 8px;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 600;
}

.warn { color: var(--red); font-size: 13px; }

.lead__grid {
    margin-top: 12px;
    display: grid;
    gap: 8px 18px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.lead__field span { display: block; font-size: 12px; color: var(--muted); }
.lead__field b { color: var(--ink); font-weight: 600; }

.lead__comment {
    margin: 12px 0 0;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 9px;
    font-size: 14px;
}

.lead__note { display: block; margin-top: 12px; }
.lead__note span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }

.lead__note textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 11px;
    resize: vertical;
}

.lead__note textarea:focus { outline: none; border-color: var(--brand); }

.lead__foot {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.lead__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.lead__saved { font-size: 13px; color: var(--green); }

.st {
    font: inherit;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.st:hover { border-color: var(--brand); color: var(--brand); }
.st.is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

@media (max-width: 640px) {
    .filters input { margin-left: 0; width: 100%; }
    .lead__actions { width: 100%; }
}
