:root {
  --ink: #1a1714;
  --muted: #6b645c;
  --line: #e6e0d8;
  --paper: #f6f1ea;
  --cream: #fffcf7;
  --rust: #c45c26;
  --ok: #2f6b4f;
  --sidebar: #161311;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.app { display: flex; min-height: 100%; }
.nav {
  width: 210px;
  background: var(--sidebar);
  color: #efe8de;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}
.logo { display: flex; gap: 10px; align-items: center; }
.mark {
  width: 32px; height: 32px; background: var(--rust); color: #fff;
  display: grid; place-items: center; border-radius: 8px; font-weight: 700;
}
.logo small { display: block; color: #b7aea3; font-size: 11px; }
.op { background: #221e1a; border-radius: 10px; padding: 10px; font-size: 12px; color: #cfc6bf; }
.op strong { display: block; color: #fff; font-size: 13px; }
.nav nav a, .logout button {
  display: block; width: 100%; text-align: left;
  color: #d8d0c6; padding: 8px 10px; border-radius: 8px; border: 0; background: transparent; cursor: pointer;
}
.nav nav a:hover, .logout button:hover { background: #2a1f1a; }
.logout { margin-top: auto; }
.main { flex: 1; min-width: 0; min-height: 0; background: var(--cream); }
.login-body { display: grid; place-items: center; padding: 24px; }
.card-login {
  width: 100%; max-width: 420px; background: var(--cream);
  border: 1px solid var(--line); border-radius: 16px; padding: 28px;
}
.logo-row { display: flex; gap: 12px; margin-bottom: 18px; }
.card-login h1 { font-size: 18px; }
.card-login p { color: var(--muted); font-size: 13px; }
label { display: block; font-size: 14px; margin-bottom: 10px; }
input, textarea, select {
  width: 100%; margin-top: 4px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.btn, .dhl {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--rust); color: #fff; font-weight: 600;
  padding: 8px 12px; border-radius: 8px; font-size: 13px;
}
.dhl { background: #f0c400; color: #111; width: 100%; margin-top: 8px; font-weight: 700; }
.dhl:disabled { opacity: .4; }
.ghost { background: #efe6dc; border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 600; }
.err { background: #f8dcdc; padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.pad { padding: 16px; }
.ok { color: var(--ok); font-size: 12px; margin-bottom: 8px; }
.bar {
  min-height: 56px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; gap: 8px;
}
.bar h1, .bar h2 { font-size: 14px; }
.bar p { font-size: 12px; color: var(--muted); }
.page { display: flex; flex-direction: column; height: 100%; }
.cards { display: grid; gap: 12px; padding: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.card h2 { font-size: 16px; margin-bottom: 4px; }
.form { max-width: 460px; padding: 16px; display: grid; gap: 10px; }
.inbox { display: flex; height: 100%; min-height: 0; }
.queue { width: 260px; border-right: 1px solid var(--line); display: flex; flex-direction: column; flex-shrink: 0; }
.list { overflow: auto; }
.ticket { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ticket:hover, .ticket.active { background: #f3e3d6; }
.ticket .row { display: flex; justify-content: space-between; gap: 8px; }
.who { font-size: 13px; font-weight: 600; }
.time { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
.preview { font-size: 12px; color: #5f574f; margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 99px;
  background: #efe6dc; color: #4d433b; display: inline-flex;
}
.tag.amz { background: #f3ead3; color: #7a5408; }
.tag.ebay { background: #dce8f5; color: #1d4f8c; }
.tag.kauf { background: #e2f0d8; color: #2f5d16; }
.tag.metro { background: #f8dcdc; color: #8a1f1f; }
.tag.otto { background: #f5e0ee; color: #7a2158; }
.tag.mail { background: #e7e7e7; color: #333; }
.tag.chat { background: #d9efe8; color: #1b5c43; }
.tag.api { background: #e8e4f5; color: #3d2f78; }
.tag.ok { background: #d9efe8; color: #1b5c43; }
.tag.warn { background: #f3ead3; color: #7a5408; }
.dot { display: inline-block; width: 7px; height: 7px; background: var(--rust); border-radius: 99px; margin-left: 6px; }
.thread-wrap { display: flex; flex: 1; min-width: 0; min-height: 0; }
.thread { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.side { width: 300px; border-left: 1px solid var(--line); background: #fbf7f2; padding: 14px; overflow: auto; flex-shrink: 0; }
.order-mobile { display: none; margin: 10px 14px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fbf7f2; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; }
.msgs { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 78%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; width: fit-content; }
.in { background: #f1ebe4; align-self: flex-start; }
.out { background: #243028; color: #f4f1ea; align-self: flex-end; }
.bubble img { max-width: 180px; border-radius: 8px; display: block; margin-top: 8px; }
.att { margin-top: 6px; }
.att a { color: var(--rust); font-size: 12px; }
.sys { align-self: center; font-size: 11px; color: var(--muted); background: #efe8de; padding: 4px 8px; border-radius: 99px; }
.composer { border-top: 1px solid var(--line); padding: 12px; }
.composer.solve { max-height: 46vh; overflow: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  width: auto; border: 1px solid var(--line); background: #fff; border-radius: 99px;
  padding: 5px 10px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.chip.suggest { border-color: var(--rust); color: var(--rust); }
.chip.on { background: var(--rust); color: #fff; border-color: var(--rust); }
.checks { display: grid; gap: 4px; margin: 8px 0; }
.checks label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.checks input[type=checkbox] { width: auto; margin: 0; }
.label-grid { background: #fbf7f2; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; }
.label-grid strong { display: block; font-size: 12px; margin-bottom: 4px; }
.addr { line-height: 1.4; }
.right { display: flex; justify-content: flex-end; margin-top: 8px; }
.empty { display: grid; place-items: center; padding: 32px; color: var(--muted); text-align: center; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0 14px; font-size: 13px; }
.kv { display: grid; grid-template-columns: 72px 1fr; gap: 6px; margin-bottom: 6px; }
.kv span { color: var(--muted); }
.item { display: flex; justify-content: space-between; border-top: 1px dashed var(--line); padding: 6px 0; }
.side h3, .order-mobile h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: ui-monospace, monospace; font-size: 12px; }
.slot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 10px; }
.nested { max-width: none; padding: 12px 0 0; }
.row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.linkish { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; }
.tiny-btn { font-size: 11px; padding: 5px 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); padding: 8px 16px; }
.table td { padding: 10px 16px; border-top: 1px solid var(--line); }
.split { display: flex; height: 100%; min-height: 0; }
.grow { flex: 1; min-width: 0; overflow: auto; }
.side-form { width: 300px; border-left: 1px solid var(--line); padding: 16px; }
.matrix-wrap { overflow: auto; padding: 0 16px 24px; }
.matrix { border-collapse: collapse; font-size: 12px; min-width: 720px; }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 6px; text-align: center; background: #fff; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--cream); }
.chk { min-width: 36px; min-height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.chk.on { background: #d9efe8; }
.chk.dis { display: inline-block; padding: 6px; opacity: .7; }
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .nav { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .logout { margin-top: 0; }
  .queue { width: 100%; max-height: 40vh; }
  .inbox, .thread-wrap, .split { flex-direction: column; }
  .side, .side-form { width: 100%; }
  .side { display: none; }
  .order-mobile { display: block; }
}
