:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --panel: #ffffff;
  --line: #d9e0e7;
  --text: #1f2933;
  --muted: #66788a;
  --accent: #176b87;
  --accent-strong: #0e4f63;
  --danger: #b42318;
  --ok: #237a3b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--accent-strong);
}

.brand-logo {
  width: auto;
  max-width: 170px;
  max-height: 34px;
  height: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text);
}

.userbar {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

.auth-page {
  max-width: 460px;
  margin: 64px auto;
  padding: 0 20px;
}

.login-brand {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.login-logo {
  width: 100%;
  max-width: 280px;
  max-height: 96px;
  height: auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.metric {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: 26px;
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid var(--line);
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #edf2f6;
  font-size: 13px;
  color: #405261;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #b9c5cf;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: #ffffff;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.check input {
  width: auto;
  min-height: auto;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  background: #ffffff;
  color: var(--accent);
}

button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.error,
.warning {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.error {
  background: #fde7e5;
  color: var(--danger);
}

.success {
  background: #e8f5ee;
  color: #12643b;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.warning {
  background: #fff3cd;
  color: #73510d;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e9f3f7;
  color: #17495a;
  font-size: 12px;
}

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

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

.comment {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #ffffff;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 8px 0;
  color: var(--text);
}

.ticket-text,
.comment-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-text {
  margin: 8px 0;
}

.check-list {
  display: grid;
  gap: 6px;
  margin: 6px 0 14px;
}

@media (max-width: 820px) {
  .topbar,
  .toolbar,
  .split {
    display: block;
  }

  .nav,
  .userbar {
    margin-top: 12px;
  }

  .page {
    padding: 18px;
  }
}
