:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef5ff;
  --text: #0d1b2b;
  --muted: #56585e;
  --line: #d8e4f2;
  --primary: #2e3192;
  --primary-strong: #1f236f;
  --primary-soft: #eaf2ff;
  --accent: #68acff;
  --accent-strong: #357df9;
  --focus: #68acff;
  --radius: 8px;
  --shadow: 0 14px 34px rgba(13, 27, 43, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 360px),
    var(--bg);
  color: var(--text);
  font-family: "Roboto", Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

h1,
h2,
h3,
.brand strong,
.button,
.eyebrow,
th {
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
}

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

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 128px;
  height: 52px;
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong {
  color: var(--primary);
  font-size: 16px;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.topnav form {
  margin: 0;
}

.topnav a,
.link-button {
  color: var(--primary);
  font-weight: 700;
}

.link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.sidebar {
  position: fixed;
  top: 75px;
  bottom: 0;
  left: 0;
  width: 220px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text);
}

.sidebar a:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.main.with-sidebar {
  width: auto;
  margin-left: 220px;
  padding: 28px 28px 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 28px;
  align-items: stretch;
  min-height: 520px;
  padding: 34px 0 28px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-visual {
  position: relative;
  min-height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(13, 27, 43, 0.58), rgba(46, 49, 146, 0.12)),
    url("/brand/rodoluki-banner.jpg") center / cover no-repeat;
  box-shadow: var(--shadow);
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 9px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.hero h1,
.page-head h1,
.auth-box h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--primary);
}

.page-head h1 {
  font-size: 34px;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-panel,
.panel,
.side-panel,
.auth-box,
.form-shell,
.credential-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 4px;
  max-width: 300px;
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(13, 27, 43, 0.82);
  color: #fff;
  box-shadow: none;
}

.hero-panel span {
  color: rgba(255, 255, 255, 0.82);
}

.band {
  padding: 24px 0;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.card-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #fff, #f8fbff);
  color: var(--text);
}

.card-link strong {
  color: var(--primary);
}

.card-link span,
.muted,
small {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.button:hover {
  text-decoration: none;
  background: var(--surface-2);
}

.button.primary {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--accent-strong));
  color: #fff;
}

.button.primary:hover {
  background: var(--primary-strong);
}

.button.small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 13px;
}

.button.full,
.full {
  width: 100%;
}

.page-head {
  margin-bottom: 22px;
  border-left: 5px solid var(--accent);
  padding-left: 16px;
}

.page-head p {
  max-width: 760px;
  color: var(--muted);
}

.form-shell,
.auth-box,
.panel,
.side-panel {
  padding: 20px;
}

.auth-box {
  width: min(430px, 100%);
  margin: 48px auto;
}

.auth-logo {
  display: block;
  width: 210px;
  height: auto;
  margin: 0 auto 18px;
}

form {
  display: grid;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus {
  outline: 3px solid rgba(242, 183, 5, 0.45);
  outline-offset: 2px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

legend {
  padding: 0 8px;
  font-weight: 700;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
}

.muted-block {
  opacity: 0.55;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef6ff;
}

.notice.error {
  border-color: #fecdca;
  background: #fef3f2;
  color: #912018;
}

.credential-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
}

.credential-box span {
  display: block;
  color: var(--muted);
}

.credential-box strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  letter-spacing: 0;
}

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

.split.wide {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.stack {
  display: grid;
  gap: 16px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.message,
.internal-comment,
.history-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.message.mine {
  background: #eef6ff;
}

.message p,
.internal-comment p,
.history-row p {
  margin: 6px 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metrics article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #fff, #f8fbff);
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  color: var(--primary);
}

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

.panel h2,
.side-panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.filters {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) 180px 160px 100px;
  gap: 10px;
  margin-bottom: 16px;
}

.details {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px 14px;
}

.details dt {
  color: var(--muted);
  font-weight: 700;
}

.details dd {
  margin: 0;
}

.preline {
  white-space: pre-wrap;
}

.inline-form {
  margin-top: 12px;
}

.inline-tight {
  display: flex;
  gap: 8px;
}

.row-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.file-row {
  display: block;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.prose {
  max-width: 820px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

@media (max-width: 900px) {
  .topbar,
  .topnav {
    align-items: flex-start;
    flex-direction: column;
  }

  .sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main.with-sidebar,
  .main {
    width: min(100% - 24px, 1180px);
    margin: 0 auto;
    padding: 24px 0 48px;
  }

  .hero,
  .split,
  .split.wide,
  .grid.three,
  .form-grid,
  .credential-box,
  .metrics,
  .filters,
  .row-form {
    grid-template-columns: 1fr;
  }
}
