:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e4e6ef;
  --text: #151826;
  --muted: #6b7085;
  --primary: #4f46e5;
  --primary-2: #4338ca;
  --primary-soft: #eef0ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --side: #12141f;
  --side-text: #a7abc0;
  --side-active: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 20, 40, .04), 0 2px 8px rgba(16, 20, 40, .04);
  --shadow-lg: 0 10px 30px rgba(16, 20, 40, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1018;
    --surface: #171a25;
    --surface-2: #1d2130;
    --border: #2a2f40;
    --text: #e8eaf2;
    --muted: #9095ab;
    --primary: #7c74ff;
    --primary-2: #6b62f5;
    --primary-soft: #23244a;
    --danger: #f87171;
    --danger-soft: #3a1a1d;
    --ok: #4ade80;
    --ok-soft: #142a1d;
    --warn: #fbbf24;
    --warn-soft: #33270e;
    --side: #0a0b11;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.hidden { display: none !important; }
.svg-i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.app > .sidebar { align-self: flex-start; }
.sidebar {
  width: 240px; flex: none; background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 15px; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #6d5dfc, #ec4899); display: grid; place-items: center; color: #fff; font-weight: 800; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; color: #636780; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(124, 116, 255, .18); color: var(--side-active); }
.nav a .badge-n { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; padding: 0 7px; border-radius: 10px; font-weight: 700; }
.side-user { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 10px; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who b { color: #fff; display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user a { color: var(--side-text); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-right: auto; }
.page-head .sub { flex-basis: 100%; color: var(--muted); margin-top: -6px; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
  .topbar b { font-size: 15px; }
  .content { padding: 16px 16px 40px; }
  .backdrop.open { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
}

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-h h2 { margin-right: auto; }
.card-b { padding: 16px; }
.card + .card { margin-top: 16px; }
.grid > .card, .split > .card, .g2 > .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.req::after { content: " *"; color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  color: var(--text); font: inherit; outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input.sm { height: 32px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c6 { grid-column: span 6; } .c4 { grid-column: span 4; } .c3 { grid-column: span 3; } .c2 { grid-column: span 2; }
@media (max-width: 700px) { .c8, .c6, .c4, .c3 { grid-column: span 12; } .c2 { grid-column: span 6; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.hint { font-size: 12px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status { border: 0; }
.badge.urgent { background: #fee2e2; color: #b91c1c; border-color: transparent; }
.badge.late { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.okb { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
@media (prefers-color-scheme: dark) { .badge.urgent { background: #3f1518; color: #fca5a5; } }

.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: #8b5cf6; flex: none; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.person { display: inline-flex; align-items: center; gap: 8px; }

.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.alert { padding: 10px 14px; border-radius: 10px; border: 1px solid; font-weight: 500; }
.alert.ok { background: var(--ok-soft); border-color: rgba(22,163,74,.25); color: var(--ok); }
.alert.error { background: var(--danger-soft); border-color: rgba(220,38,38,.25); color: var(--danger); }
.alert.info { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.alert.warn { background: var(--warn-soft); border-color: rgba(217,119,6,.25); color: var(--warn); }

table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.row-link { color: var(--text); font-weight: 600; }
.job-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); font-size: 10px; font-weight: 700; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.filters .input { width: auto; min-width: 140px; }
.filters .search { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 550; }
.tabs a:hover { background: var(--surface-2); text-decoration: none; }
.tabs a.active { background: var(--primary-soft); color: var(--primary); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 6px; }

.pager { display: flex; gap: 6px; justify-content: center; padding: 14px; }

/* ---------- stats ---------- */
.stat { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat .k { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.stat .v.red { color: var(--danger); }
.stat .v.green { color: var(--ok); }
.stat a { color: inherit; }
.pipeline { display: flex; flex-direction: column; gap: 9px; }
.pipe-row { display: grid; grid-template-columns: 150px 1fr 36px; align-items: center; gap: 10px; color: var(--text); }
.pipe-row:hover { text-decoration: none; }
.pipe-row .bar { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.pipe-row .bar i { display: block; height: 100%; border-radius: 6px; min-width: 2px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }

/* ---------- kanban ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; }
.col { flex: 0 0 280px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; font-weight: 650; border-top: 3px solid var(--c); border-radius: var(--radius) var(--radius) 0 0; }
.col-h .cdot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.col-h .n { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface); border: 1px solid var(--border); padding: 0 8px; border-radius: 10px; }
.col-b { padding: 4px 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 80px; flex: 1; }
.col.drag-over { outline: 2px dashed var(--primary); outline-offset: -2px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; cursor: grab; box-shadow: var(--shadow); color: var(--text); display: block; }
.kcard:hover { text-decoration: none; border-color: var(--primary); }
.kcard.dragging { opacity: .45; }
.kcard img.cover { width: 100%; height: 110px; object-fit: cover; border-radius: 7px; margin-bottom: 8px; background: var(--surface-2); }
.kcard .t { font-weight: 650; margin: 2px 0 4px; word-break: break-word; }
.kcard .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
.kcard .foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kcard .foot .avatar { width: 24px; height: 24px; font-size: 10px; }

/* ---------- job detail ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; }
.kv dt { color: var(--muted); font-weight: 550; }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 10px; } }
.comment-box { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; border: 1px solid var(--border); }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.file { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); position: relative; display: flex; flex-direction: column; }
.file .prev { height: 110px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.file .prev img { width: 100%; height: 100%; object-fit: cover; }
.file .prev .ext { font-weight: 800; font-size: 18px; color: var(--muted); letter-spacing: .04em; }
.file .nm { padding: 7px 9px 2px; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .sz { padding: 0 9px 7px; font-size: 11px; color: var(--muted); }
.file .acts { position: absolute; top: 6px; right: 6px; display: none; gap: 4px; }
.file:hover .acts { display: flex; }
.file .acts .btn { background: rgba(255,255,255,.95); color: #111; border-color: transparent; box-shadow: var(--shadow); }
.status-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.status-btns button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.status-btns button:hover { border-color: var(--c); }
.status-btns button.cur { background: var(--c); color: #fff; border-color: var(--c); }
.status-btns .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.status-btns button.cur .dot { background: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .body { flex: 1; min-width: 0; }
.timeline .body .txt { white-space: pre-wrap; word-break: break-word; }
.timeline li.comment .txt { background: var(--primary-soft); padding: 8px 11px; border-radius: 4px 10px 10px 10px; margin-top: 4px; color: var(--text); }
.ev-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; font-size: 13px; }

/* ---------- price calc ---------- */
.price-table { width: 100%; border-collapse: collapse; }
.price-table th { font-size: 12px; color: var(--muted); text-align: left; font-weight: 600; padding: 6px 6px; }
.price-table td { padding: 4px 6px; vertical-align: middle; }
.price-table select.input { min-width: 96px; }
.price-table td.sum { font-weight: 650; white-space: nowrap; text-align: right; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; max-width: 420px; margin-left: auto; margin-top: 12px; align-items: center; }
.totals .grand { font-size: 18px; font-weight: 750; }
.totals .debt { color: var(--danger); font-weight: 700; }
@media (max-width: 700px) {
  .price-table thead { display: none; }
  .price-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .price-table td { padding: 0; }
  .price-table td:first-child { grid-column: span 2; }
}

/* ---------- dropzone ---------- */
.drop { display: block; border: 2px dashed var(--border); border-radius: 12px; padding: 18px; text-align: center; cursor: pointer; transition: border-color .12s, background .12s; background: var(--surface-2); }
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop input[type=file] { display: none; }
.drop .t { font-weight: 600; }
.drop-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; font-size: 12px; max-width: 220px; }
.chip img, .chip .ext { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: 9px; font-weight: 800; color: var(--muted); flex: none; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, rgba(109,93,252,.18), transparent), radial-gradient(900px 500px at 110% 110%, rgba(236,72,153,.14), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 380px; padding: 28px; }
.auth-card .brand { color: var(--text); padding: 0 0 18px; }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 120px); min-height: 420px; overflow: hidden; }
.inbox .chats { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.inbox .chats-h { padding: 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.acc-filter { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.acc-filter button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.acc-filter button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.acc-filter .dot { width: 8px; height: 8px; border-radius: 50%; }
.chat-list { overflow-y: auto; flex: 1; }
.chat-item { display: flex; gap: 10px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border); align-items: center; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--primary-soft); }
.chat-item .av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; position: relative; }
.chat-item .av .acc-dot { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface); }
.chat-item .mid { flex: 1; min-width: 0; }
.chat-item .top { display: flex; gap: 6px; align-items: baseline; }
.chat-item .top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-weight: 650; }
.chat-item .top time { font-size: 11px; color: var(--muted); flex: none; }
.chat-item .bot { display: flex; gap: 6px; align-items: center; }
.chat-item .bot span.prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; color: var(--muted); font-size: 13px; }
.chat-item .unread { background: var(--primary); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 0 7px; flex: none; }
.chat-item .acc-name { font-size: 10.5px; font-weight: 600; padding: 0 6px; border-radius: 4px; color: #fff; flex: none; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.conv-h { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conv-h .info { flex: 1; min-width: 0; }
.conv-h .info b, .conv-h .info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); }
.day-sep { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 1px 10px; border-radius: 10px; margin: 8px 0; }
.msg { max-width: min(560px, 82%); padding: 7px 11px 5px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); align-self: flex-start; position: relative; word-break: break-word; }
.msg.out { align-self: flex-end; background: var(--primary-soft); border-color: transparent; }
.msg .sn { font-size: 12px; font-weight: 650; color: var(--primary); }
.msg .tx { white-space: pre-wrap; }
.msg .tm { font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 2px; }
.msg img.media { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; margin: 4px 0; cursor: zoom-in; }
.msg video, .msg audio { max-width: 100%; display: block; margin: 4px 0; }
.msg .doc { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.msg .doc .ext { width: 40px; height: 40px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.msg .m-acts { position: absolute; top: 4px; right: -34px; display: none; }
.msg.out .m-acts { right: auto; left: -34px; }
.msg:hover .m-acts { display: block; }
.composer { border-top: 1px solid var(--border); padding: 10px; display: flex; gap: 8px; align-items: flex-end; background: var(--surface); }
.composer textarea { flex: 1; min-height: 40px; max-height: 160px; height: 40px; resize: none; padding: 9px 12px; }
.composer .att { font-size: 12px; color: var(--muted); padding: 0 4px 6px; }
.conv-empty { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-chat .chats { display: none; }
  .inbox:not(.has-chat) .conv { display: none; }
}
.only-mobile { display: none; }
@media (max-width: 900px) { .only-mobile { display: inline-flex; } }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 100; cursor: zoom-out; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* modal */
dialog.modal { border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(10,12,20,.45); }
dialog.modal .card-b { display: flex; flex-direction: column; gap: 12px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 200; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.error { background: #b91c1c; }
