@font-face {
  font-family: "TT Moscow Economy";
  src: url("assets/TT-Moscow-Economy-Normal.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "TT Moscow Economy";
  src: url("assets/TT-Moscow-Economy-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700 900;
}

:root {
  --accent: #c8102e;
  --accent-dark: #9f1028;
  --ink: #20242b;
  --muted: #6c737d;
  --line: #d8dde3;
  --panel: #f4f6f8;
  --paper: #fff;
  font-family: "TT Moscow Economy", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--panel);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--panel);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.shell-eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-layout {
  display: grid;
  width: min(920px, 100%);
  min-height: 520px;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 44px rgba(32, 36, 43, 0.12);
}

.auth-brand {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 38px;
  background: var(--accent);
}

.auth-pattern {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 190px;
  object-fit: cover;
  opacity: 0.88;
}

.shell-brand-logo {
  position: relative;
  z-index: 1;
  width: min(290px, 100%);
  height: auto;
}

.shell-analytics-logo {
  position: relative;
  display: block;
  width: 255px;
  height: 76px;
  overflow: hidden;
}

.shell-analytics-logo img {
  position: absolute;
  top: -28px;
  left: -25px;
  width: 316px;
  height: auto;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 48px;
}

.login-form-wrap {
  width: min(360px, 100%);
}

.login-form-wrap h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
}

.login-caption {
  margin: 12px 0 28px;
  color: var(--muted);
  font-size: 16px;
}

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

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  outline: 0;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.login-form button,
.primary-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 9px 16px;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.login-form button:hover,
.primary-action:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.alert {
  margin: 0 0 18px;
  border-left: 4px solid var(--line);
  padding: 11px 13px;
  background: #fff;
  font-size: 14px;
}

.alert-error {
  border-color: var(--accent);
  background: #fff3f5;
}

.alert-success {
  border-color: #23845d;
  background: #eff9f4;
}

.site-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(24px, calc((100vw - 1240px) / 2));
  color: #fff;
  background: var(--accent);
}

.site-brand img {
  display: block;
  width: 230px;
  height: auto;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.role-badge {
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 4px;
  padding: 4px 7px;
}

.header-button {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 5px;
  padding: 6px 10px;
  color: #fff;
  background: transparent;
}

.header-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.dashboard-shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.dashboard-heading h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.08;
}

.dashboard-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.issues-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.issues-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.issues-table th,
.issues-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

.issues-table th {
  color: var(--muted);
  background: #f8f9fa;
  font-size: 12px;
  text-transform: uppercase;
}

.issues-table th:nth-child(1) { width: 20%; }
.issues-table th:nth-child(2) { width: 14%; }
.issues-table th:nth-child(3) { width: 31%; }
.issues-table th:nth-child(4) { width: 21%; }
.issues-table th:nth-child(5) { width: 14%; }

.issues-table tbody tr:last-child td {
  border-bottom: 0;
}

.issues-table tbody tr:hover {
  background: #fbfcfd;
}

.issues-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.issue-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}

.open-action,
.delete-action {
  border: 0;
  padding: 4px 0;
  color: var(--accent);
  background: transparent;
  font-weight: 900;
  text-decoration: none;
}

.delete-action {
  color: #7b3b45;
}

.open-action:hover,
.delete-action:hover {
  text-decoration: underline;
}

.empty-state {
  border-top: 3px solid var(--accent);
  padding: 42px 0;
  background: #fff;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.error-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.error-panel {
  width: min(520px, 100%);
  border-top: 6px solid var(--accent);
  padding: 36px;
  background: #fff;
  text-align: center;
}

.error-code {
  margin: 0;
  color: var(--accent);
  font-size: 56px;
  font-weight: 900;
}

.error-panel h1 {
  margin: 8px 0 26px;
  font-size: 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .auth-page {
    padding: 0;
  }

  .auth-layout {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
  }

  .auth-brand {
    min-height: 180px;
    padding: 24px;
  }

  .shell-brand-logo {
    width: 230px;
  }

  .shell-analytics-logo {
    display: none;
  }

  .login-panel {
    padding: 36px 24px;
  }

  .site-header {
    align-items: flex-start;
    padding: 14px 18px;
  }

  .site-brand img {
    width: 180px;
  }

  .user-menu {
    align-items: flex-end;
    flex-direction: column;
    gap: 5px;
  }

  .role-badge,
  .user-menu strong {
    display: none;
  }

  .dashboard-shell {
    width: min(100% - 28px, 1240px);
    padding-top: 26px;
  }

  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-heading h1 {
    font-size: 31px;
  }

  .dashboard-heading form,
  .primary-action {
    width: 100%;
  }

  .issues-table-wrap {
    border: 0;
    background: transparent;
  }

  .issues-table,
  .issues-table tbody,
  .issues-table tr,
  .issues-table td {
    display: block;
    width: 100%;
  }

  .issues-table thead {
    display: none;
  }

  .issues-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    background: #fff;
  }

  .issues-table td {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }

  .issues-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .issue-actions {
    display: flex !important;
    justify-content: flex-end;
  }

  .issue-actions::before {
    display: none;
  }
}
