:root {
  color-scheme: dark;
  --bg: #0b0e11;
  --panel: #151a20;
  --panel-2: #1c232b;
  --text: #edf2f7;
  --muted: #a9b4c0;
  --line: #303a46;
  --accent: #64d2a4;
  --warn: #e6b45c;
  --danger: #ee6f72;
  --blue: #7ab7ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.shell.narrow {
  width: min(780px, calc(100% - 32px));
}

.login-shell {
  width: min(460px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  align-items: center;
  margin-top: 0;
  margin-bottom: 0;
}

.login-panel {
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.small-link {
  color: var(--blue);
  text-decoration: none;
  font-size: .9rem;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: clamp(1.7rem, 2.8vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.eyebrow,
.label {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.lead {
  font-size: 1.1rem;
  color: #dbe5ef;
  margin-bottom: 10px;
}

.muted,
.fineprint {
  color: var(--muted);
}

.fineprint {
  font-size: .86rem;
  text-align: center;
  margin-top: 10px;
}

.summary-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.summary-grid > div,
.detail-grid > div,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 16px;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

.panel + .panel {
  margin-top: 12px;
}

.panel h2:not(:first-child) {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head p {
  color: var(--muted);
}

.ticket-list {
  display: grid;
  gap: 10px;
}

.ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 14px;
}

.row-title {
  font-weight: 700;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: .86rem;
  margin-top: 4px;
}

.row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.score {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.status-chip,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  white-space: nowrap;
}

.badge.pending {
  color: #ffe2aa;
  border-color: rgba(230, 180, 92, .45);
  background: rgba(230, 180, 92, .12);
}

.badge.approved,
.badge.executed {
  color: #bdf4d9;
  border-color: rgba(100, 210, 164, .45);
  background: rgba(100, 210, 164, .12);
}

.badge.rejected {
  color: #ffc1c3;
  border-color: rgba(238, 111, 114, .45);
  background: rgba(238, 111, 114, .12);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.button {
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #07100d;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button.approve {
  background: var(--accent);
}

.button.reject {
  background: #2a1114;
  color: #ffc1c3;
  border-color: rgba(238, 111, 114, .55);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .9rem;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f141a;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

.login-form input:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(122, 183, 255, .2);
}

.auth-error {
  margin-top: 14px;
  border: 1px solid rgba(238, 111, 114, .5);
  border-radius: 8px;
  background: rgba(238, 111, 114, .12);
  color: #ffc1c3;
  padding: 10px 12px;
}

@media (max-width: 640px) {
  .topbar,
  .ticket-row {
    align-items: stretch;
    flex-direction: column;
  }

  .row-right {
    justify-content: space-between;
  }

  .actions {
    grid-template-columns: 1fr;
  }
}
