:root { --ink: #1d2733; --muted: #5d6b7a; --line: #d9e0e7; --bg: #f5f7f9; --card: #ffffff; --brand: #1f4e79; --error: #a12622; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--brand); }
.brand span { font-weight: 400; color: var(--muted); }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.staging { background: #fff4d6; color: #6b4e00; text-align: center; font-size: 14px; padding: 4px 16px; }
main { padding-top: 32px; padding-bottom: 32px; }
h1 { font-size: 24px; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 24px; margin-bottom: 16px; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
label { display: block; font-weight: 600; margin: 16px 0 6px; }
input[type=email], input[type=text], textarea { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 6px; }
button, .button { display: inline-block; margin-top: 16px; padding: 10px 18px; font: inherit; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; }
button.primary, .button { background: var(--brand); border-color: var(--brand); color: #fff; width: 100%; text-align: center; }
button.link { margin: 0; padding: 0; border: 0; background: none; color: var(--brand); text-decoration: underline; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--error); font-weight: 600; }
.foot { color: var(--muted); font-size: 13px; padding-bottom: 32px; }
a { color: var(--brand); }
[hidden] { display: none !important; }
h2 { font-size: 18px; margin: 24px 0 12px; }
textarea { min-height: 120px; resize: vertical; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input { flex: 1 1 240px; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 6px; }
.filters select { padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.filters button { margin-top: 0; }
.tickets { list-style: none; margin: 0; padding: 0; }
.tickets li a { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 12px; align-items: baseline; padding: 14px 16px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.tickets li a:hover { border-color: var(--brand); }
.tickets .summary { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.tickets .meta { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
.key { font-weight: 700; color: var(--brand); white-space: nowrap; }
.status { font-size: 13px; padding: 2px 8px; border-radius: 10px; background: #e8eef4; white-space: nowrap; }
.status.is-new { background: #e6effa; } .status.is-active { background: #fff1d6; } .status.is-waiting { background: #f1e6fa; } .status.is-closed { background: #e3f3e6; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 14px; align-items: center; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.msg.from-tytec { border-left: 4px solid var(--brand); }
.msg header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .file { margin: 8px 0 0; font-size: 14px; }
@media (max-width: 560px) { .tickets li a { grid-template-columns: auto 1fr; } .tickets .summary { grid-column: 1 / -1; } }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin: 0; }
.button.small { width: auto; margin: 0; padding: 8px 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
select { width: 100%; padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
input[type=date] { padding: 9px 12px; font: inherit; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
fieldset.checks { border: 1px solid var(--line); border-radius: 6px; margin: 16px 0 0; padding: 8px 12px 12px; }
fieldset.checks legend { font-weight: 600; padding: 0 4px; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 6px 16px 0 0; }
.notice { background: #e3f3e6; border: 1px solid #b9dfc0; border-radius: 6px; padding: 10px 14px; }
.nav { display: flex; gap: 16px; font-size: 14px; }
.nav a { text-decoration: none; }
h3 { font-size: 16px; margin: 20px 0 8px; }
label.inline { display: inline; margin: 0; align-self: center; font-weight: 600; }
.filters input[type=month] { padding: 9px 10px; font: inherit; border: 1px solid var(--line); border-radius: 6px; }
.chart { width: 100%; height: auto; max-height: 220px; display: block; margin: 8px 0; }
.chart .bar-a { fill: var(--brand); } .chart .bar-b { fill: #8fb3d6; }
.chart .axis { font-size: 10px; fill: var(--muted); } .chart .base { stroke: var(--line); }
.legend { font-size: 13px; color: var(--muted); }
.legend span { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 12px; vertical-align: middle; }
.legend .key-a { background: var(--brand); } .legend .key-b { background: #8fb3d6; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
table.data th, table.data td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; }
details summary { cursor: pointer; color: var(--brand); margin-top: 8px; }
.card { overflow-x: auto; }
