:root {
  /* Типографика */
  --font-display: "SB Sans Display", "Helvetica Neue", Arial, sans-serif;
  --font-text: "SB Sans Text", "Helvetica Neue", Arial, sans-serif;

  /* Текст */
  --color-heading: #061b36;
  --color-body: #333f48;
  --color-muted: #8b95a3;
  --color-nav: #6b7683;

  /* Акценты */
  --color-green: #21ba72;
  --color-green-hover: #1ca363;
  --color-blue: #0050b2;

  /* Фоны */
  --bg-page: #f2f5f9;
  --bg-card: #ffffff;

  /* Бордеры */
  --border-soft: #f0f2f5;
  --border: #e8ecf1;
  --border-strong: #d5dae1;

  /* Бейджи */
  --badge-blue-bg: #e8f0fe;
  --badge-blue-fg: #1a56db;
  --badge-green-bg: #e6f7ee;
  --badge-green-fg: #1b8c4a;
  --badge-orange-bg: #fff6e5;
  --badge-orange-fg: #c2650a;

  /* Тени / радиусы */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 6px 20px rgba(52, 64, 75, 0.10);
  --radius-card: 16px;
  --radius-pill: 32px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-text);
  color: var(--color-body);
  background: var(--bg-page);
  min-height: 100vh;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Header ---------- */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--color-heading);
  text-decoration: none;
  white-space: nowrap;
}
.logo-mark {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
}
.logo-sub {
  font-weight: 400;
  color: var(--color-muted);
  margin-left: 6px;
}
.nav-tabs {
  display: flex;
  gap: 0;
}
.nav-tabs a {
  padding: 20px 16px;
  font-family: var(--font-text);
  font-size: 14px;
  color: var(--color-nav);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-tabs a.active,
.nav-tabs a:hover,
.nav-tabs a:focus-visible {
  color: var(--color-heading);
  border-bottom-color: var(--color-green);
  outline: none;
}
.user-area {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--color-nav);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ---------- Main ---------- */
.container {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 24px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 8px;
  line-height: 1.3;
}
.page-subtitle {
  font-size: 15px;
  color: var(--color-muted);
  margin-bottom: 28px;
}

/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.card-header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-heading);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-green { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.badge-blue { background: var(--badge-blue-bg); color: var(--badge-blue-fg); }
.badge-orange { background: var(--badge-orange-bg); color: var(--badge-orange-fg); }

/* ---------- Ticket list ---------- */
.ticket-item {
  display: flex;
  align-items: flex-start;
  padding: 18px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ticket-item:last-child { border-bottom: none; }
.ticket-item:hover {
  background: var(--bg-page);
  transform: translateX(2px);
}
.ticket-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 16px;
  flex-shrink: 0;
}
.ticket-icon.blue { background: var(--badge-blue-bg); }
.ticket-icon.green { background: var(--badge-green-bg); }
.ticket-icon.orange { background: var(--badge-orange-bg); }
.ticket-body { flex: 1; min-width: 0; }
.ticket-body h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 4px;
}
.ticket-body p {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.5;
}
.ticket-meta {
  text-align: right;
  flex-shrink: 0;
  margin-left: 20px;
}
.ticket-meta .date {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 6px;
  white-space: nowrap;
}

/* ---------- Info grid ---------- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 40px;
}
.info-item { padding: 4px 0; }
.info-label {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 2px;
}
.info-value {
  font-size: 15px;
  color: var(--color-heading);
  font-weight: 500;
}

/* ---------- Status banner (Главная) ---------- */
.status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--badge-green-bg);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 14px;
  color: #1a6b3d;
  margin-bottom: 24px;
  line-height: 1.5;
}
.status-banner strong { color: var(--badge-green-fg); }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(33, 186, 114, 0.18);
}

/* ---------- Tiles (Главная) ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.tile {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.tile:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.tile-icon.blue { background: var(--badge-blue-bg); }
.tile-icon.green { background: var(--badge-green-bg); }
.tile-icon.orange { background: var(--badge-orange-bg); }
.tile h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 6px;
}
.tile p {
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}
.tile-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-green);
}

/* Тикет-элемент как ссылка (База знаний) */
a.ticket-item {
  text-decoration: none;
  color: inherit;
}

/* ---------- Request list (Заявки) ---------- */
.request-list { display: flex; flex-direction: column; }
a.request-item { text-decoration: none; color: inherit; cursor: pointer; }
.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 10px;
  transition: background 0.2s ease;
}
.request-item:last-child { border-bottom: none; }
.request-item:hover { background: var(--bg-page); }
.request-main { min-width: 0; }
.request-id {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}
.request-main h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 2px;
}
.request-cat { font-size: 13px; color: var(--color-muted); }
.request-meta {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* ---------- Detail pages ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-nav);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.2s ease;
}
.back-link:hover { color: var(--color-green); }
.detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.detail-head .page-title { margin-bottom: 0; }

.request-description {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.request-description p {
  font-size: 15px;
  color: var(--color-body);
  line-height: 1.55;
  margin-top: 4px;
}

/* Таймлайн истории заявки */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding: 6px 0 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 0 3px var(--badge-green-bg);
}
.timeline-date { font-size: 13px; color: var(--color-muted); margin-bottom: 2px; }
.timeline-text { font-size: 15px; color: var(--color-heading); }

/* Тело статьи базы знаний */
.article-block { margin-bottom: 24px; }
.article-block:last-child { margin-bottom: 0; }
.article-block h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 10px;
}
.article-block p {
  font-size: 15px;
  color: var(--color-body);
  line-height: 1.55;
}
.steps {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.steps li {
  font-size: 15px;
  color: var(--color-body);
  line-height: 1.5;
  padding-left: 4px;
}
.steps li::marker { color: var(--color-green); font-weight: 600; }

/* Пустое состояние */
.empty-state { text-align: center; padding: 24px 0; }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 6px;
}
.empty-state p { font-size: 14px; color: var(--color-muted); }

/* ---------- Notice ---------- */
.notice {
  background: var(--badge-blue-bg);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--badge-blue-fg);
  margin-top: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.5;
}
.notice-icon { font-size: 20px; flex-shrink: 0; line-height: 1.3; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: #b0b8c1;
  font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .nav-tabs { display: none; }
  .user-label { display: none; }
  .container { padding: 0 16px; margin: 20px auto; }
  .card { padding: 24px 20px; }
  .info-grid { grid-template-columns: 1fr; }
  .tile-grid { grid-template-columns: 1fr; }
  .request-item { flex-wrap: wrap; gap: 10px; }
  .request-meta { text-align: left; align-items: flex-start; flex-direction: row; }
  .ticket-item { flex-wrap: wrap; }
  .ticket-meta {
    text-align: left;
    margin-left: 56px;
    margin-top: 8px;
  }
}
