/* ZANMEDIA CRM — рабочий интерфейс.
   Та же гамма, что у лендинга, но плотнее: это инструмент, а не витрина. */

:root {
    --ink:       #121D2B;
    --ink-2:     #35485C;
    --muted:     #6E7F8E;
    --bg:        #F4F6F8;
    --surface:   #FFFFFF;
    --line:      #DDE3E9;
    --line-soft: #EDF1F4;
    --accent:    #A8191B;
    --accent-bg: #FBEFEE;
    --ok:        #1B6B4A;
    --ok-bg:     #EAF5F0;
    --radius:    5px;
    --shadow:    0 1px 2px rgba(18,29,43,.06), 0 6px 18px -10px rgba(18,29,43,.2);
    --sans:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono:      ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 23px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }

.wrap { max-width: 1320px; margin-inline: auto; padding-inline: 20px; }

/* ── Шапка ── */
.top {
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
}
.top__bar { display: flex; align-items: center; gap: 26px; height: 54px; }
.top__brand { font-weight: 700; font-size: 16px; letter-spacing: .02em; text-decoration: none; color: #fff; }
.top__brand span { color: #8FA0B0; font-weight: 500; }
.top nav { display: flex; gap: 20px; margin-inline-end: auto; }
.top nav a {
    color: #B9C5D0; text-decoration: none; font-size: 14px; font-weight: 500;
    padding: 4px 0; border-bottom: 2px solid transparent;
}
.top nav a:hover { color: #fff; }
.top nav a.is-active { color: #fff; border-bottom-color: var(--accent); }
.top__user { font-size: 13.5px; color: #B9C5D0; display: flex; align-items: center; gap: 14px; }
.top__user a { color: #B9C5D0; text-decoration: none; }
.top__user a:hover { color: #fff; text-decoration: underline; }

.main { padding: 26px 0 60px; }

/* ── Карточки и панели ── */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card__head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.card__head h2 { margin: 0; }
.card__body { padding: 18px; }

.notice {
    padding: 11px 15px; border-radius: var(--radius); margin-bottom: 18px;
    background: var(--ok-bg); color: var(--ok); border: 1px solid #CBE5DA; font-size: 14px;
}
.notice--error { background: var(--accent-bg); color: var(--accent); border-color: #EBD6D5; }

/* ── Сводка ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile dt { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0; }
.tile dd { margin: 4px 0 0; font-size: 25px; font-weight: 700; line-height: 1; }

/* ── Фильтры ── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink-2);
    font-size: 13.5px; font-weight: 500; text-decoration: none;
    transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--ink-2); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip b { font-weight: 600; opacity: .7; }

/* ── Формы ── */
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="date"], input[type="number"], select, textarea {
    width: 100%; font-family: var(--sans); font-size: 14.5px; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 8px 11px; -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18,29,43,.09);
}
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1.2;
    padding: 9px 17px; border-radius: var(--radius); border: 1px solid transparent;
    cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #1D2E42; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { padding: 5px 11px; font-size: 13px; }
.btn--danger { background: var(--accent); color: #fff; }

/* ── Таблицы ── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFC; }
.table a.row-link { text-decoration: none; font-weight: 600; font-family: var(--mono); font-size: 13px; }
.table a.row-link:hover { color: var(--accent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .dim { color: var(--muted); font-size: 13px; }

.badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap;
}
.badge--urgent { background: var(--accent); }
.badge--soft { background: var(--line-soft); color: var(--ink-2); font-weight: 500; }

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

.pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 34px; text-align: center; padding: 6px 9px; border-radius: var(--radius);
    border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: 13.5px;
}
.pager .is-current { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

/* ── Карточка заявки ── */
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.props { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0; font-size: 14px; }
.props dt { color: var(--muted); padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.props dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line-soft); word-break: break-word; }
.props dt:last-of-type, .props dd:last-of-type { border-bottom: 0; }

.adtext {
    font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.6;
    background: #FBF8F2; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.adtext + .adtext { margin-top: 12px; }
.adtext__label {
    font-family: var(--sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); font-weight: 600; margin-bottom: 7px;
}

.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.files a {
    display: flex; align-items: center; gap: 9px; padding: 8px 11px; font-size: 13.5px;
    border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; background: var(--surface);
}
.files a:hover { border-color: var(--ink); }
.files .size { margin-inline-start: auto; color: var(--muted); font-size: 12.5px; }

.timeline { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.timeline li { padding: 9px 0 9px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before {
    content: ""; position: absolute; left: -5px; top: 15px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--line); border: 2px solid var(--surface);
}
.timeline li:first-child::before { background: var(--accent); }
.timeline time { color: var(--muted); font-size: 12.5px; display: block; }
.timeline .payload { color: var(--ink-2); font-size: 12.5px; word-break: break-word; }

/* ── Вход ── */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--ink); }
.login-box { width: 100%; max-width: 380px; background: var(--surface); border-radius: 8px; padding: 32px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); }
.login-box h1 { font-size: 21px; margin-bottom: 4px; }
.login-box .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.login-box label { margin-top: 14px; }
.login-box .btn { width: 100%; margin-top: 22px; padding: 12px; }

@media (max-width: 980px) {
    .lead-grid { grid-template-columns: 1fr; }
    .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .top nav { gap: 14px; overflow-x: auto; }
}
@media (max-width: 640px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .table-scroll { overflow-x: auto; }
    .table { min-width: 720px; }
    .props { grid-template-columns: 1fr; }
    .props dt { padding-bottom: 0; border-bottom: 0; }
}
