:root {
  --primary: #1677ff;
  --text-main: #1f1f1f;
  --text-secondary: #6b6b6b;
  --text-meta: #9a9a9a;
  --bg-page: #f1f4f8;
  --bg-card: #ffffff;
  --line: #eeeeee;
  --success: #1f8f55;
  --success-bg: #e9f7ef;
  --danger: #c4514a;
  --danger-bg: #fbeeed;
  --pending: #9a7a2e;
  --pending-bg: #fbf5e7;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: var(--bg-page);
}

.hero-header {
  height: 64px;
  width: 100%;
  position: fixed;
  top: 0;
  z-index: 20;
  background: #e8edf4;
  border-bottom: 1px solid #dfe6ef;
}

.hero-header-inner {
  height: 100%;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.hero-logo {
  height: 36px;
}

.hero-logo-desktop {
  display: none;
}

.hero-logo-adaptive {
  display: block;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-main);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
}

.header-pill-hidden {
  display: none;
}

.shell {
  width: min(800px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 88px 0 32px;
}

.hidden {
  display: none !important;
}

.view {
  width: 100%;
}

.auth-card {
  width: min(680px, 100%);
  margin: 32px auto 0;
}

.login-title {
  margin: 0 0 12px;
  font-size: 48px;
  line-height: 1.05;
  font-weight: 600;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
}

.field input,
.field textarea,
.search,
.select {
  width: 100%;
  min-height: 42px;
  height: 42px;
  border: 1px solid #dedede;
  border-radius: 14px;
  background: #fff;
  padding: 0 14px;
  color: var(--text-main);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
}

.field textarea {
  height: auto;
  min-height: 104px;
  padding: 12px 14px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.search::placeholder {
  color: var(--text-meta);
}

.field input:focus,
.field textarea:focus,
.search:focus,
.select:focus {
  outline: 2px solid rgba(22, 119, 255, 0.22);
  outline-offset: 1px;
}

.button {
  height: 42px;
  min-height: 42px;
  border-radius: 12px;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.button-primary {
  border: 1px solid var(--primary);
  color: #fff;
  background: var(--primary);
}

.button-secondary {
  border: 1px solid var(--line);
  color: var(--text-main);
  background: #fff;
}

.button-danger {
  border: 1px solid #f3d5d2;
  color: var(--danger);
  background: #fff5f5;
}

.form-error,
.form-success {
  min-height: 20px;
  margin: 0;
  font-size: 13px;
  line-height: 18px;
}

.form-error {
  color: var(--danger);
}

.form-success {
  color: var(--success);
}

.app {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hero,
.panel,
.metric-card,
.modal-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.hero {
  padding: var(--space-4);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-meta);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
}

.lead {
  margin: var(--space-1) 0 0;
  max-width: 74ch;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.hero-callout {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: var(--space-2);
  align-self: start;
  min-width: 180px;
}

.hero-callout-label {
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-meta);
}

.hero-callout-value {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-word;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.tab {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 16px;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
  cursor: pointer;
}

.tab.is-active {
  border-color: #d6e6ff;
  background: #edf4ff;
  color: var(--primary);
}

.grid {
  display: grid;
  gap: var(--space-3);
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-3);
}

.metric-card,
.panel,
.modal-panel {
  padding: var(--space-3);
}

.metric-card span {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
}

.metric-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  color: var(--text-main);
}

.metric-card small {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-meta);
}

.panel-head {
  margin-bottom: var(--space-3);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head-wrap {
  flex-wrap: wrap;
}

.panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

.muted {
  margin: var(--space-1) 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
}

.toolbar,
.actions-row,
.list-row,
.list-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.list-meta span {
  display: inline-flex;
  align-items: center;
}

.list-meta span + span::before {
  content: "•";
  margin: 0 8px 0 0;
  color: #b1b1b1;
  font-size: 11px;
  line-height: 1;
}

.toolbar {
  margin-bottom: var(--space-3);
}

.search {
  min-width: 280px;
}

.list {
  display: grid;
  gap: var(--space-3);
}

.list-item {
  border: 0;
  border-radius: 14px;
  background: #f8f8f9;
  padding: var(--space-3);
}

.list-row {
  justify-content: space-between;
}

.tech-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: start;
}

.request-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.tech-main,
.request-main {
  min-width: 0;
}

.tech-side,
.request-side {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.request-side {
  min-width: 0;
  align-items: stretch;
}

.request-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.request-main .list-meta {
  flex-wrap: nowrap;
  overflow: hidden;
}

.request-main .list-meta span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--text-main);
}

.list-meta {
  margin-top: var(--space-1);
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
}

.list-note {
  margin-top: var(--space-1);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-meta);
}

.summary-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: 84px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-1);
  min-height: 84px;
}

.summary-title {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--text-main);
}

.summary-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.summary-link {
  text-decoration: none;
}

.summary-link:hover {
  text-decoration: underline;
}

#recentRequests .list-item {
  min-height: 84px;
  background: #f8f8f9;
  border: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.status-pending {
  color: var(--pending);
  background: var(--pending-bg);
}

.status-active,
.status-approved {
  color: var(--success);
  background: var(--success-bg);
}

.status-rejected,
.status-disabled {
  color: var(--danger);
  background: var(--danger-bg);
}

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

.field-wide,
.actions-row {
  grid-column: 1 / -1;
}

.actions-row {
  margin-top: var(--space-2);
}

.actions-row-compact {
  margin-top: 0;
  justify-content: flex-end;
}

.request-actions {
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
}

.request-actions .button {
  min-width: 220px;
}

.actions-spacer {
  flex: 1;
}

.button-hidden {
  display: none;
}

.modal {
  width: min(760px, calc(100vw - 24px));
  border: none;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(31, 31, 31, 0.2);
}

@media (min-width: 901px) {
  .hero-logo-desktop {
    display: block;
  }

  .hero-logo-adaptive {
    display: none;
  }
}

@media (max-width: 980px) {
  .shell {
    width: calc(100vw - 24px);
    padding-top: 80px;
  }

  .hero,
  .metrics,
  .split,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .login-title {
    font-size: 32px;
    line-height: 40px;
  }

  .hero h1 {
    font-size: 28px;
    line-height: 36px;
  }

  .tech-card {
    grid-template-columns: 1fr;
  }

  .tech-side,
  .request-side {
    min-width: 0;
    align-items: flex-start;
  }

  .actions-row-compact {
    justify-content: flex-start;
  }

  .actions-spacer {
    display: none;
  }

  .request-main .list-meta {
    flex-wrap: wrap;
    overflow: visible;
  }

  .request-main .list-meta span {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .request-actions .button {
    min-width: 0;
    width: 100%;
  }
}
