:root { --accent: #B83D63; --accent-soft: #F9E4EA; --bg: #FAF9F7; --card: #fff; --text: #1F1F1F; --muted: #6F6F6F; --line: #E6E4E1; --ok: #16834B; --warn: #B7791F; --bad: #C0392B; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
header.bar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
header.bar .brand { font-weight: 700; font-size: 20px; color: var(--accent); }
header.bar .sub { color: var(--muted); }
header.bar .spacer { flex: 1; }
main { max-width: 1100px; margin: 0 auto; padding: 24px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 14px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:disabled { opacity: .6; cursor: default; }
button.big { padding: 12px 28px; font-size: 16px; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
textarea { width: 100%; min-height: 160px; resize: vertical; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fcfbfa; }
tr.item { cursor: pointer; }
tr.item:hover { background: var(--accent-soft); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line); color: var(--text); }
.badge.new { background: var(--accent-soft); color: var(--accent); }
.badge.in_progress { background: #FFF3CD; color: #7a5b00; }
.badge.answered, .badge.sent, .badge.accepted { background: #DFF3E7; color: var(--ok); }
.badge.closed, .badge.rejected { background: #ECECEC; color: var(--muted); }
.badge.pending, .badge.retrying { background: #FFF3CD; color: #7a5b00; }
.badge.failed { background: #FBE3E0; color: var(--bad); }
.error { color: var(--bad); }
.notice { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; }
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.msg { max-width: 80%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.msg.staff { align-self: flex-end; background: var(--accent-soft); border-color: #F0C7D3; }
.msg .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.delivery { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
dl { display: grid; grid-template-columns: 160px 1fr; gap: 4px 16px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.attachments { display: flex; gap: 12px; flex-wrap: wrap; }
.attachments img, .attachments video { max-width: 220px; max-height: 180px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.login { max-width: 360px; margin: 80px auto; }
.login input { width: 100%; margin-bottom: 12px; }
.counter { text-align: right; }
.filters input[type=search] { min-width: 220px; }
