/* CRM ПСК «Стандарт» — фирменный синий #0066CC, градиент логотипа #3051A0 → #77BDE9 */
:root {
  --brand: #0066cc;
  --brand-dark: #0a4c99;
  --brand-deep: #3051a0;
  --brand-light: #77bde9;
  --brand-weak: #e8f1fb;
  --brand-grad: linear-gradient(90deg, #3051a0, #0066cc 55%, #77bde9);
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #16202e;
  --muted: #64748b;
  --danger: #d63939;
  --danger-weak: #fdecec;
  --warn: #c76a00;
  --warn-weak: #fff4e5;
  --success: #2b8a3e;
  --success-weak: #e8f6ec;
  --violet: #6741d9;
  --violet-weak: #f0ebff;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 1px 3px rgba(16, 32, 64, .06);
  --shadow-lg: 0 10px 30px rgba(16, 32, 64, .14);
  --sidebar-w: 248px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
p { margin: 0 0 8px; }
.i { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; }
.text-danger { color: var(--danger); font-weight: 600; }
.text-warn { color: var(--warn); font-weight: 600; }
.clamp-1, .clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40;
}
.sidebar::before { content: ""; height: 4px; background: var(--brand-grad); flex: none; }
.brand { display: flex; align-items: flex-end; gap: 8px; padding: 16px 18px 14px; border-bottom: 1px solid var(--border); }
.brand img { height: 40px; width: auto; }
.brand span { font-weight: 700; color: var(--brand); font-size: 13px; letter-spacing: .12em; padding-bottom: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--radius-sm);
  color: #334155; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.nav a span { flex: 1; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; padding: 14px 12px 4px; }
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.count.danger { background: var(--danger); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); }
.sidebar-user .who { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar-user .who b { display: block; font-size: 13px; }
.sidebar-user .who small { color: var(--muted); font-size: 12px; }
.sidebar-user form { margin: 0; }
.sidebar-backdrop { display: none; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.burger { display: none; }
.search { flex: 1; max-width: 620px; display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; color: var(--muted); }
.search:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-weak); }
.search input { flex: 1; border: 0; background: transparent; padding: 9px 0; font: inherit; color: var(--text); outline: none; }
.bell { position: relative; margin-left: auto; }
.bell .dot { position: absolute; top: 0; right: -2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.content { padding: 22px 24px 40px; max-width: 1440px; width: 100%; }

/* ---------- elements ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: #94a3b8; color: var(--text); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost-danger { border-color: transparent; background: transparent; color: var(--danger); }
.btn-ghost-danger:hover { background: var(--danger-weak); border-color: transparent; color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.input {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; font: inherit; color: var(--text); transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 8px 11px; resize: vertical; min-height: 70px; }
select.input { padding-right: 28px; }
select[multiple].input { height: auto; padding: 6px; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.input-sm { height: 30px; font-size: 13px; width: auto; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.back { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h3 { margin: 0; }
.section-head.mt { margin-top: 22px; }
.link { font-size: 13px; font-weight: 550; }
.empty { color: var(--muted); padding: 12px 0; margin: 0; }
.card.empty { padding: 24px; }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px;
  font-weight: 600; white-space: nowrap; background: #eef2f6; color: #475569; }
.st-in_progress, .st-active, .st-construction, .st-design { background: var(--brand-weak); color: var(--brand); }
.st-review, .st-submitted, .st-approval, .st-signing, .st-expertise, .st-handover { background: var(--warn-weak); color: var(--warn); }
.st-done, .st-paid, .st-accepted, .st-completed, .st-warranty { background: var(--success-weak); color: var(--success); }
.st-cancelled, .st-terminated, .st-paused { background: var(--danger-weak); color: var(--danger); }
.st-preparation { background: var(--violet-weak); color: var(--violet); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 12px;
  background: #eef2f6; color: #475569; font-weight: 500; white-space: nowrap; }
.tag-blue { background: var(--brand-weak); color: var(--brand); }
.tag-orange { background: var(--warn-weak); color: var(--warn); }
.pr-tag-high { background: var(--warn-weak); color: var(--warn); }
.pr-tag-urgent { background: var(--danger-weak); color: var(--danger); }
.prio { display: inline-flex; width: 17px; height: 17px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800;
  align-items: center; justify-content: center; vertical-align: 1px; }
.pr-high { background: var(--warn); }
.pr-urgent { background: var(--danger); }
.date-pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; background: #eef2f6; color: #475569; white-space: nowrap; }
.date-pill.danger { background: var(--danger-weak); color: var(--danger); }
.date-pill.warn { background: var(--warn-weak); color: var(--warn); }
.dot-new { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }

.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff;
  font-weight: 700; flex: none; letter-spacing: .02em; vertical-align: middle; }
.avatar-sys { background: #cbd5e1; }

.flash-wrap { padding: 14px 24px 0; }
.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid; font-weight: 500; }
.flash-success { background: var(--success-weak); border-color: #b2dfbf; color: #1f6b30; }
.flash-error { background: var(--danger-weak); border-color: #f5c2c2; color: #a61e1e; }
.flash-info, .flash-warning { background: var(--brand-weak); border-color: #bcd6f3; color: var(--brand-dark); }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); color: var(--text); display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-grad); }
a.stat:hover { border-color: var(--brand-light); color: var(--text); }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.stat b.money { font-size: 19px; }
.stat small { color: var(--muted); }
.stat-danger::after { background: var(--danger); }
.stat-danger b { color: var(--danger); }
.stat-warn::after { background: var(--warn); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.line { display: flex; align-items: center; gap: 10px; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); }
.line + .line { border-top: 1px solid #f1f5f9; }
a.line:hover { background: var(--surface-2); color: var(--text); }
.line.unread { font-weight: 600; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-click tbody tr { cursor: pointer; }
.table-click tbody tr:hover td { background: var(--surface-2); }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; white-space: nowrap; }
.row-actions form { margin: 0; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding-top: 14px; }

/* ---------- filters & tabs ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 150px; }
.filters .input.grow { flex: 1; min-width: 220px; }
.seg { display: inline-flex; gap: 2px; background: #e9eef4; padding: 3px; border-radius: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 7px; color: #475569; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; }
.seg a.active { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.seg-icons { margin-bottom: 0; }
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab-bar button { border: 0; background: none; font: inherit; font-weight: 550; color: #475569; padding: 10px 14px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab-bar button.active { color: var(--brand); border-bottom-color: var(--brand); }
.quick { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; padding: 12px 18px; margin-bottom: 14px; }
.quick a, .quick span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- details ---------- */
.props { display: grid; grid-template-columns: 210px 1fr; gap: 9px 16px; margin: 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; min-width: 0; }
.props-narrow { grid-template-columns: 150px 1fr; }
.subject { white-space: normal; margin-bottom: 16px; }
.req-block { white-space: pre-wrap; font-family: inherit; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; line-height: 1.6; }
.person-inline { display: flex; align-items: center; gap: 8px; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.contact-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.contact-card a { display: inline-flex; align-items: center; gap: 6px; }
.contact-top { display: flex; align-items: center; gap: 6px; }
.contact-top .row-actions { margin-left: auto; }
.upload-box { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; }

/* ---------- forms ---------- */
.form-card { max-width: 980px; }
.fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.fieldset legend { font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); padding: 0; margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-weight: 550; font-size: 13px; color: #334155; }
.field.full { grid-column: 1 / -1; }
.field-check { justify-content: flex-end; }
.req { color: var(--danger); }
.help { color: var(--muted); font-size: 12px; }
.error { color: var(--danger); font-size: 12px; font-weight: 500; }
.has-error .input { border-color: var(--danger); }
.chips > div { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border-strong);
  border-radius: 999px; cursor: pointer; font-size: 13px; background: #fff; }
.chips label:has(input:checked) { background: var(--brand-weak); border-color: var(--brand); color: var(--brand); }
.chips input { accent-color: var(--brand); margin: 0; }
.form-actions { display: flex; gap: 8px; padding-top: 6px; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }

/* ---------- people & objects ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.person { display: flex; gap: 14px; align-items: flex-start; }
.person .contacts { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 13px; }
.person .contacts a { display: inline-flex; align-items: center; gap: 6px; }
.person-actions { display: flex; flex-direction: column; gap: 6px; }
.object-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.object-card { color: var(--text); display: flex; flex-direction: column; gap: 6px; transition: border-color .12s, transform .12s; }
.object-card:hover { border-color: var(--brand-light); color: var(--text); transform: translateY(-1px); }
.object-top { display: flex; justify-content: space-between; align-items: center; }
.object-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #475569; margin-top: auto; }
.object-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 8px; font-weight: 600; }

/* ---------- tasks ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.kan-col { background: #e9eef4; border-radius: var(--radius); padding: 10px; min-height: 300px; display: flex; flex-direction: column; }
.kan-col.drag-over { background: var(--brand-weak); outline: 2px dashed var(--brand-light); }
.kan-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; }
.kan-list { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kan-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text);
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; cursor: grab; }
.kan-card:hover { border-color: var(--brand-light); color: var(--text); }
.kan-card.overdue { border-left: 3px solid var(--danger); }
.kan-card.dragging { opacity: .5; }
.kan-title { font-weight: 550; }
.kan-foot { display: flex; justify-content: space-between; align-items: center; }
.check-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.check-item form { margin: 0; }
.check-item.done span { text-decoration: line-through; color: var(--muted); }
#checklist .inline-form { margin-top: 10px; }
.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.comment { display: flex; gap: 10px; }
.comment-head { margin-bottom: 2px; }
.comment-sys { font-size: 12px; color: var(--muted); text-align: center; background: var(--surface-2); border-radius: 6px; padding: 4px 8px; }
.comment-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* ---------- chat ---------- */
.page-chat .content { padding: 0; max-width: none; }
.page-chat .flash-wrap { display: none; }
.chat-layout { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 57px); }
.chat-list { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.chat-items { flex: 1; overflow-y: auto; padding: 6px; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); }
.chat-item:hover { background: var(--surface-2); color: var(--text); }
.chat-item.active { background: var(--brand-weak); }
.chat-item-title { font-weight: 600; }
.chat-item .grow { display: flex; flex-direction: column; }
.chat-ava { background: var(--brand-grad); }
.chat-object { background: linear-gradient(135deg, #3051a0, #0066cc); }
.chat-general { background: linear-gradient(135deg, #0066cc, #77bde9); }
.chat-list-foot { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.chat-room { display: flex; flex-direction: column; min-height: 0; background: #f6f8fb; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 72%; }
.msg.own { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: #fff; border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 7px 12px 6px; position: relative; min-width: 120px; }
.msg.own .bubble { background: #dcebfb; border-color: #c4dcf5; border-radius: 14px 14px 4px 14px; }
.msg-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.msg-head b { color: var(--brand); }
.msg-head span { color: var(--muted); }
.msg-text { white-space: normal; word-wrap: break-word; overflow-wrap: anywhere; }
.msg-img { display: block; max-width: 320px; max-height: 240px; border-radius: 8px; margin: 6px 0 2px; }
.msg-file { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 13px; }
.msg-task { display: none; position: absolute; top: -10px; right: 8px; background: #fff; border: 1px solid var(--border);
  border-radius: 6px; font-size: 11px; padding: 1px 7px; box-shadow: var(--shadow); align-items: center; gap: 4px; }
.msg:hover .msg-task { display: inline-flex; }
.msg-date { text-align: center; margin: 10px 0 4px; }
.msg-date span { background: #e2e8f0; color: #475569; font-size: 12px; padding: 3px 10px; border-radius: 10px; }
.msg-sys { text-align: center; font-size: 12px; color: var(--muted); }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--border); }
.composer-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.composer textarea { width: 100%; resize: none; border: 1px solid var(--border-strong); border-radius: 18px; padding: 9px 14px;
  font: inherit; max-height: 160px; outline: none; }
.composer textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.composer .send { width: 42px; height: 40px; padding: 0; border-radius: 50%; }
.attach { cursor: pointer; height: 40px; }
.attach-name { font-size: 12px; color: var(--brand); }
.mobile-only { display: none !important; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(circle at 20% 10%, #dcebfb, transparent 45%), radial-gradient(circle at 90% 90%, #d6ecfa, transparent 40%), var(--bg); }
.login-art { position: fixed; inset: 0 0 auto 0; height: 5px; background: var(--brand-grad); }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 32px 30px; display: flex; flex-direction: column; gap: 14px; }
.login-card form { margin: 0; }
.login-logo { width: 220px; max-width: 100%; align-self: center; margin-bottom: 4px; }
.login-card h1 { text-align: center; font-size: 20px; }
.login-card .muted { text-align: center; margin: -8px 0 4px; font-size: 13px; }
.login-card .field span { font-weight: 550; font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-wide-left { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 35; }
  .main { margin-left: 0; }
  .burger { display: inline-flex; }
  .topbar { padding: 8px 16px; }
  .content { padding: 16px 16px 32px; }
  .flash-wrap { padding: 12px 16px 0; }
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 53px); }
  .chat-list { display: none; }
  .mobile-only { display: block !important; }
  .hide-mobile { display: none; }
  .chat-head { padding: 10px 16px; flex-wrap: wrap; }
  .chat-switch { font-weight: 600; }
  .props, .props-narrow { grid-template-columns: 1fr; gap: 2px; }
  .props dd { margin-bottom: 8px; }
  .msg { max-width: 92%; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat b { font-size: 20px; }
  .stat b.money { font-size: 15px; }
  .people { grid-template-columns: 1fr; }
  .person { flex-wrap: wrap; }
  .card { padding: 14px 14px; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .kanban { grid-template-columns: repeat(4, 82vw); }
}
