:root {
  --charcoal: #151515;
  --graphite: #242528;
  --panel: #303136;
  --orange: #f47a20;
  --amber: #ffb15c;
  --white: #ffffff;
  --muted: #b9b9b9;
  --line: rgba(255, 255, 255, 0.12);
  --light: #f2f2f2;
  --ink: #171717;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    linear-gradient(140deg, rgba(244, 122, 32, 0.14), transparent 35%),
    radial-gradient(circle at top right, rgba(255, 177, 92, 0.13), transparent 30%),
    var(--charcoal);
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfcfcf;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  outline-color: var(--orange);
}
textarea { min-height: 86px; resize: vertical; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--orange);
  background: #000;
  color: var(--orange);
  font-weight: 900;
}
.eyebrow {
  margin: 0;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 12px;
  font-weight: 800;
}
.brand h1 { margin: 2px 0 0; font-size: 20px; }
.muted { color: var(--muted); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--orange);
  color: white;
  padding: 12px 18px;
  font-weight: 800;
}
.btn:hover { background: #df6815; }
.btn.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: white;
}
.btn.dark {
  border: 1px solid #bcbcbc;
  background: transparent;
  color: var(--ink);
}
.btn.small { padding: 8px 10px; font-size: 12px; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-grid {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 28px;
  width: min(1160px, 100%);
}
.hero, .card, .panel, .metric {
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}
.hero {
  background: rgba(0, 0, 0, .3);
  padding: 32px;
}
.hero-copy { margin-top: 86px; max-width: 680px; }
.hero-copy h2 {
  margin: 14px 0 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.04;
}
.hero-copy p:not(.eyebrow) {
  color: #d5d5d5;
  line-height: 1.7;
  font-size: 18px;
}
.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 48px;
}
.chips span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  padding: 12px;
  color: #ddd;
}
.login-card {
  background: var(--light);
  color: var(--ink);
  padding: 32px;
}
.login-card .eyebrow { color: #666; letter-spacing: 0; text-transform: none; }
.login-card h2 { margin: 28px 0 16px; font-size: 34px; }
.form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; }
.login-links {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid #d2d2d2;
  padding-top: 18px;
}
.link-btn {
  border: 0;
  background: transparent;
  color: #555;
  text-align: left;
  padding: 0;
}
.link-btn.strong {
  color: #111;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  font-weight: 800;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 282px 1fr;
}
.sidebar {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--charcoal);
  padding: 24px 20px;
}
.nav { margin-top: 38px; display: grid; gap: 8px; }
.nav button {
  border: 1px solid transparent;
  background: transparent;
  color: #d0d0d0;
  text-align: left;
  padding: 11px 12px;
  font-weight: 800;
}
.nav button.active, .nav button:hover {
  border-color: rgba(244, 122, 32, .55);
  background: rgba(244, 122, 32, .11);
  color: white;
}
.contact {
  margin-top: 42px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: #aaa;
  font-size: 12px;
  line-height: 1.7;
}
.main { padding: 32px; overflow: auto; }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}
.title { margin: 8px 0 8px; font-size: 42px; }
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.metric, .panel { background: var(--panel); padding: 20px; }
.metric p { margin: 0; color: #bdbdbd; font-size: 14px; }
.metric strong { display: block; margin-top: 8px; font-size: 34px; }
.section { margin-top: 30px; }
.grid { display: grid; gap: 18px; }
.two { grid-template-columns: 1fr 1fr; }
.three { grid-template-columns: repeat(3, 1fr); }
.filters {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: var(--graphite);
}
th {
  background: rgba(0, 0, 0, .35);
  color: #aaa;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  padding: 13px 14px;
}
td { border-top: 1px solid var(--line); padding: 15px 14px; font-size: 14px; vertical-align: top; }
tr:hover td { background: rgba(255, 255, 255, .035); }
.case-id { color: var(--amber); font-weight: 900; }
.badge {
  display: inline-flex;
  border: 1px solid;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}
.green { color: #d9ffe4; border-color: rgba(95, 232, 132, .45); background: rgba(61, 186, 96, .14); }
.yellow { color: #fff3bd; border-color: rgba(255, 221, 90, .45); background: rgba(255, 211, 69, .14); }
.red { color: #ffdada; border-color: rgba(255, 110, 110, .45); background: rgba(255, 71, 71, .15); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--graphite);
  padding: 22px;
}
.wide { grid-column: 1 / -1; }
.checkrow {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .22);
  padding: 13px;
}
.checkrow input { width: auto; accent-color: var(--orange); }
.case-detail dl {
  display: grid;
  gap: 9px;
  margin: 15px 0 0;
  font-size: 14px;
}
.case-detail div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}
.case-detail dt { color: #aaa; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  border: 1px solid rgba(244, 122, 32, .45);
  background: #111;
  color: white;
  padding: 14px 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.72);
  padding: 20px;
}
.modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  background: #f7f7f7;
  color: #111;
  padding: 22px;
}
.ticket-preview {
  width: 612px;
  max-width: 100%;
  margin: 0 auto;
  background: white;
  color: #000;
  padding: 36px;
  aspect-ratio: 612 / 792;
  transform-origin: top center;
}
.ticket-title {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 11px;
  font-size: 18px;
  font-weight: 900;
}
.ticket-case {
  margin-top: 0;
  background: #666;
  color: #fff;
  text-align: center;
  padding: 9px;
  font-size: 14px;
  font-weight: 900;
}
.ticket-table {
  margin: 16px auto 0;
  width: 500px;
  min-width: 0;
  border: 1px solid #000;
}
.ticket-table td {
  border: 1px solid #000;
  padding: 7px 8px;
  font-size: 12px;
}
.ticket-table td:first-child {
  width: 180px;
  background: #444;
  color: white;
}
.ticket-table td:last-child { background: #f3f3f3; color: #000; }
.ticket-notes {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.4;
}
.barcode {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 42px;
  margin-top: 26px;
}
.barcode span { display: block; background: #000; height: 100%; }
.ticket-rule { border-top: 1px solid #d3d3d3; margin-top: 18px; padding-top: 14px; }
.status-line { font-size: 13px; }
.status-line strong:last-child { color: #ff9f00; }

@media print {
  body * { visibility: hidden; }
  .ticket-preview, .ticket-preview * { visibility: visible; }
  .ticket-preview {
    position: absolute;
    inset: 0;
    width: 612px;
    margin: 0;
    padding: 36px;
    box-shadow: none;
  }
}

@media (max-width: 980px) {
  .login-grid, .shell { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .metrics, .filters, .form-grid, .two, .three, .chips { grid-template-columns: 1fr; }
  .main { padding: 22px; }
}
