:root {
  --bg: #111318;
  --surface: #181c24;
  --surface-2: #202632;
  --line: #343b49;
  --text: #f4f7fb;
  --muted: #aab3c3;
  --brand: #4aa3ff;
  --brand-strong: #1f75d6;
  --accent: #ff4d5f;
  --success: #49c78d;
  --warning: #f3b84e;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 72px);
  background: rgba(17, 19, 24, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.brand-mark,
.profile-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #174d91, #b83242);
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
}

.brand strong,
.profile-block strong {
  display: block;
  line-height: 1.1;
}

.brand small,
.profile-block small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main-nav a,
.tab-button {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  padding: 10px 12px;
}

.main-nav a:hover,
.main-nav a.is-active,
.tab-button:hover,
.tab-button.is-active {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero {
  position: relative;
  min-height: min(680px, calc(100vh - 128px));
  background:
    linear-gradient(90deg, rgba(12, 14, 18, 0.94), rgba(12, 14, 18, 0.58) 44%, rgba(12, 14, 18, 0.18)),
    url("../images/metro-hero.png") center / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 130px;
  background: linear-gradient(180deg, rgba(17, 19, 24, 0), var(--bg));
}

.hero-overlay {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 36px));
  padding: clamp(96px, 16vh, 180px) 0 140px;
  margin-left: clamp(18px, 7vw, 96px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.4rem, 8vw, 7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.hero-copy {
  max-width: 580px;
  color: #d8dfeb;
  font-size: 1.18rem;
  line-height: 1.65;
}

.hero-actions,
.dashboard-heading,
.field-row.two-columns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--text);
  cursor: pointer;
}

.button.primary {
  border-color: transparent;
  background: var(--brand);
  color: #07111f;
  font-weight: 800;
}

.button.primary:hover {
  background: #72b9ff;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.08);
}

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

.content-band {
  padding: clamp(56px, 8vw, 104px) clamp(18px, 5vw, 72px);
}

.content-band:nth-of-type(odd) {
  background: #151922;
}

.section-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.info-grid,
.rank-grid,
.metric-grid,
.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.info-card,
.panel,
.login-card,
.metric-card,
.rank-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.info-card,
.panel,
.metric-card,
.rank-card {
  padding: 22px;
}

.info-card p,
.rank-card p,
.metric-card p,
.panel p {
  color: var(--muted);
  line-height: 1.55;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 28px;
  margin-bottom: 18px;
  border-radius: 6px;
  background: rgba(74, 163, 255, 0.16);
  color: #9fd0ff;
  font-size: 0.78rem;
  font-weight: 800;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 28px;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.application-form,
.login-card {
  display: grid;
  gap: 16px;
}

.field-row {
  display: grid;
  gap: 8px;
}

.field-row.two-columns > span {
  flex: 1 1 220px;
}

label {
  color: #d9e2ef;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f131a;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(74, 163, 255, 0.18);
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--success);
  font-weight: 700;
}

.check-list {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 26px;
  color: #d7deeb;
}

.check-list li::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--success);
}

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

.rank-card {
  position: relative;
  overflow: hidden;
  min-height: 128px;
}

.rank-card::before {
  content: attr(data-index);
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: rgba(255, 255, 255, 0.06);
  font-size: 3.8rem;
  font-weight: 900;
  line-height: 1;
}

.rank-card h3 {
  position: relative;
  margin-bottom: 18px;
}

.rank-stripe {
  position: relative;
  width: 72px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.role-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.role-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #dfe7f3;
  padding: 0 12px;
  font-size: 0.84rem;
  font-weight: 700;
}

.role-cloud.compact {
  margin-top: 0;
}

.login-view {
  min-height: calc(100vh - 73px);
  padding: clamp(42px, 8vw, 90px) 18px;
  background:
    linear-gradient(rgba(17, 19, 24, 0.86), rgba(17, 19, 24, 0.94)),
    url("../images/metro-hero.png") center / cover no-repeat;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 210px);
}

.login-card {
  width: min(460px, 100%);
  padding: 28px;
}

.dashboard {
  min-height: calc(100vh - 73px);
  display: none;
  grid-template-columns: 292px minmax(0, 1fr);
}

.dashboard.is-active {
  display: grid;
}

.dashboard-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #121720;
  padding: 22px;
}

.profile-block {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.dashboard-tabs {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.tab-button {
  width: 100%;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.dashboard-main {
  padding: clamp(22px, 4vw, 48px);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.dashboard-heading {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.dashboard-heading h2 {
  margin-bottom: 0;
}

.metric-grid {
  margin-bottom: 18px;
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  font-size: 2.4rem;
  font-weight: 900;
}

.application-list {
  display: grid;
  gap: 12px;
}

.application-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--surface);
}

.application-item h3 {
  margin-bottom: 6px;
}

.application-item p {
  margin-bottom: 8px;
  color: var(--muted);
}

.application-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
}

.mini-button.approve {
  border-color: rgba(73, 199, 141, 0.5);
  color: #9af0c3;
}

.mini-button.reject {
  border-color: rgba(255, 77, 95, 0.5);
  color: #ff9da8;
}

.empty-state {
  padding: 34px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.permission-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.permission-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--surface);
}

.permission-table th,
.permission-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
  text-align: left;
}

.permission-table th {
  color: #dce6f4;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.permission-table td {
  color: var(--muted);
}

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

.permission-mark {
  color: var(--success);
  font-weight: 900;
}

.permission-empty {
  color: #647086;
}

@media (max-width: 920px) {
  .site-header,
  .split,
  .form-layout,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .site-header {
    display: grid;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .info-grid,
  .rank-grid,
  .metric-grid,
  .document-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard.is-active {
    display: grid;
  }

  .dashboard-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 620px) {
  .brand {
    min-width: 0;
  }

  .main-nav {
    gap: 6px;
  }

  .main-nav a {
    padding: 9px 10px;
    font-size: 0.9rem;
  }

  .hero {
    min-height: min(640px, calc(100vh - 118px));
  }

  .hero-overlay {
    width: calc(100% - 36px);
    padding-top: 92px;
    margin-left: 18px;
  }

  h1 {
    font-size: 3.6rem;
  }

  .info-grid,
  .rank-grid,
  .metric-grid,
  .document-grid {
    grid-template-columns: 1fr;
  }

  .application-item {
    grid-template-columns: 1fr;
  }

  .application-actions {
    justify-content: flex-start;
  }
}
