:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f9;
  color: #1d252c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #143331;
}

.auth-panel {
  width: min(100%, 520px);
  border-radius: 8px;
  background: #ffffff;
  padding: 28px;
  box-shadow: 0 18px 48px rgba(9, 25, 24, 0.22);
}

.auth-panel h1 {
  color: #1d252c;
  margin-bottom: 20px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  min-height: 40px;
  border: 1px solid #cfd9d8;
  border-radius: 7px;
  background: #ffffff;
  cursor: pointer;
  font-weight: 800;
}

.auth-tabs button.is-active {
  background: #143331;
  border-color: #143331;
  color: #ffffff;
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr;
}

.form-error {
  min-height: 22px;
  margin: 10px 0 0;
  color: #a73521;
  font-weight: 700;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: #143331;
  color: #eef8f5;
}

.eyebrow {
  margin: 0 0 6px;
  color: #6f8f8a;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #8ed8c6;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.05;
}

.side-note {
  margin: 10px 0 0;
  color: #b6cfca;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  font-size: 1.7rem;
}

.filters {
  display: grid;
  gap: 8px;
}

.filter {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.filter.is-active,
.filter:hover {
  background: #f3c45f;
  border-color: #f3c45f;
  color: #1c2525;
}

.stats {
  display: grid;
  gap: 10px;
  margin: auto 0 0;
}

.stats div {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 10px;
}

.stats dt {
  color: #b6cfca;
}

.stats dd {
  margin: 0;
  font-weight: 800;
}

.workbench {
  min-width: 0;
  padding: 26px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.primary-action,
.secondary-action {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 750;
}

.primary-action {
  background: #d94f30;
  color: white;
}

.secondary-action {
  background: #dde5e5;
  color: #1f2f35;
}

.composer {
  margin-bottom: 18px;
  border: 1px solid #d9e2e1;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #4a5c61;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd9d8;
  border-radius: 7px;
  background: #fff;
  color: #1d252c;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.wide,
.form-actions {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ticket-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 130px);
}

.seat-layout {
  display: grid;
  gap: 18px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.config-panel {
  border: 1px solid #d9e2e1;
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
}

.config-panel h3 {
  margin-bottom: 8px;
}

.copy-value {
  border: 1px solid #cfd9d8;
  border-radius: 7px;
  background: #f7fbfa;
  color: #1f2f35;
  margin: 14px 0;
  padding: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dns-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ticket-list,
.ticket-detail {
  min-width: 0;
  border: 1px solid #d9e2e1;
  border-radius: 8px;
  background: #ffffff;
}

.ticket-list {
  overflow: auto;
}

.ticket-row {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 112px;
  border: 0;
  border-bottom: 1px solid #edf1f1;
  background: #ffffff;
  color: inherit;
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.ticket-row:hover,
.ticket-row.is-selected {
  background: #f7fbfa;
}

.ticket-row strong {
  overflow-wrap: anywhere;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: #5c6d72;
  font-size: 0.84rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #e8efef;
  color: #253438;
  padding: 2px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
}

.badge.high,
.badge.urgent {
  background: #ffe0d5;
  color: #8c2b1a;
}

.ticket-detail {
  padding: 22px;
  overflow: auto;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #edf1f1;
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.detail-header h3 {
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.status-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  justify-content: flex-end;
}

.status-controls button {
  min-height: 34px;
  border: 1px solid #cfd9d8;
  border-radius: 7px;
  background: white;
  cursor: pointer;
  padding: 6px 10px;
  text-transform: capitalize;
}

.message {
  border-bottom: 1px solid #edf1f1;
  padding: 14px 0;
}

.message:last-child {
  border-bottom: 0;
}

.reply-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border-top: 1px solid #edf1f1;
  margin-top: 18px;
  padding-top: 18px;
}

.reply-form textarea {
  min-height: 128px;
}

.seat-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #edf1f1;
  padding: 14px 0;
}

.seat-row:last-child {
  border-bottom: 0;
}

.seat-row div {
  display: grid;
  gap: 4px;
}

.seat-row span {
  color: #5c6d72;
}

.message pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #27363a;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 320px;
  color: #627478;
  text-align: center;
}

@media (max-width: 920px) {
  .app-shell,
  .ticket-layout,
  .config-grid,
  form {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .stats {
    margin-top: 0;
  }

  .toolbar,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .status-controls {
    justify-content: flex-start;
  }
}
