:root {
  color-scheme: light;
  font-family: Inter, system-ui, sans-serif;
  background: #eef3f8;
  color: #183047;
}

body {
  margin: 0;
}

.container {
  width: min(720px, calc(100% - 32px));
  margin: 48px auto;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 18px 0 8px;
}

.lead {
  color: #52677b;
}

.card {
  margin-top: 28px;
  padding: 28px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 16px 40px rgb(30 64 100 / 12%);
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

input,
textarea,
select {
  box-sizing: border-box;
  width: 100%;
  padding: 12px;
  border: 1px solid #c8d4df;
  border-radius: 8px;
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  background: #1769e0;
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.captcha-field {
  margin: 20px 0;
  overflow-x: auto;
}

.errorlist {
  padding-left: 20px;
  color: #991b1b;
}

.success code {
  display: block;
  overflow-wrap: anywhere;
  margin: 16px 0;
  font-size: 1.05rem;
}

.container-wide {
  width: min(1180px, calc(100% - 32px));
}

.page-header,
.operator-nav,
.form-actions,
.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.operator-nav {
  flex-wrap: wrap;
}

.operator-nav form {
  margin: 0;
}

.button-link,
.button-secondary {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #e6edf5;
  color: #183047;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.messages {
  margin-top: 20px;
}

.message {
  padding: 12px 16px;
  border-radius: 8px;
  background: #dcfce7;
  color: #166534;
}

.login-card {
  max-width: 460px;
}

.filter-grid,
.detail-grid {
  display: grid;
  gap: 18px;
}

.filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #52677b;
  font-size: 0.85rem;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 4px;
  color: #64748b;
}

.ticket-link {
  font-weight: 700;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 700;
}

.status-new,
.priority-high {
  background: #fef3c7;
  color: #92400e;
}

.status-in_progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-resolved,
.status-closed {
  background: #dcfce7;
  color: #166534;
}

.priority-urgent {
  background: #fee2e2;
  color: #991b1b;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 18px;
}

.empty-state {
  color: #64748b;
  text-align: center;
}

.detail-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

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

.ticket-meta div {
  min-width: 0;
}

.ticket-meta dt {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
}

.ticket-meta dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.description {
  overflow-wrap: anywhere;
}

.comment {
  padding: 16px 0;
  border-bottom: 1px solid #e2e8f0;
}

.comment-header time {
  color: #64748b;
}

.comment-form {
  margin-top: 24px;
}

@media (max-width: 820px) {
  .page-header,
  .detail-grid {
    display: block;
  }

  .operator-nav {
    justify-content: flex-start;
    margin-top: 18px;
  }

  .filter-grid,
  .ticket-meta {
    grid-template-columns: 1fr;
  }
}

.button-primary {
  display: inline-block;
  border-radius: 8px;
  padding: 12px 18px;
  background: #1769e0;
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.login-microsoft {
  box-sizing: border-box;
  width: 100%;
  text-align: center;
}

.login-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: #64748b;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.login-separator::before,
.login-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #dbe3ea;
}
