:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #b60000;
  --brand-dark: #8f0000;
  --ok: #067647;
  --warn: #b54708;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--brand); font-weight: 800; text-decoration: none; font-size: 1.2rem; }
.brand span { color: var(--muted); font-weight: 500; }
.userbox { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: .9rem; }
.userbox a { color: var(--brand); text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 28px; }
.hero { margin: 12px 0 24px; }
.hero h1 { margin: 0 0 8px; font-size: 2rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.card.narrow { max-width: 640px; }
.muted-card { background: #fbfcfe; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) {
  .grid.two { grid-template-columns: 1fr; }
  .container { padding: 16px; }
  .topbar { padding: 12px 16px; }
}

h1, h2 { line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
p { margin: 8px 0; }

.ticket-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.ticket-actions { flex-shrink: 0; }
.meta { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  font-size: .78rem;
  font-weight: 700;
}
.kind-reply { background: #e8f1ff; color: #175cd3; }
.kind-note { background: #fff4e5; color: var(--warn); }
.kind-status { background: #f4e8ff; color: #6941c6; }
.status-pending { background: #fff4e5; color: var(--warn); }
.status-approved { background: #e7f6ec; color: var(--ok); }
.status-rejected { background: #fee4e2; color: var(--danger); }

.button {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  padding: 9px 14px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--brand-dark); }
.button.secondary { background: #eef2f7; color: #344054; }
.button.danger { background: var(--danger); }
.button.danger:hover { background: #912018; }

.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
label { font-weight: 600; font-size: .9rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd6e4;
  border-radius: 9px;
  padding: 9px 11px;
  font: inherit;
  background: white;
}
textarea { resize: vertical; }
.inline-form input, .inline-form select { width: auto; min-width: 160px; }

.alert { border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.alert.error { background: #fee4e2; color: #912018; border: 1px solid #fecdca; }

.suggestion { border-top: 1px solid var(--line); padding: 16px 0; }
.suggestion:first-of-type { border-top: 0; }
.suggestion header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.result { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
