:root {
  --primary: #07111c;
  --accent: #7ccbff;
  --secondary: #6dc59b;
  --warm: #f0c97a;
  --paper: #f4f7f9;
  --surface: #ffffff;
  --surface-soft: #edf3f6;
  --line: #d9e3e8;
  --muted: #61717b;
  --text: #12202a;
  --danger: #b74747;
  --success: #2b7a5b;
  --radius: 8px;
  font-family:
    Inter,
    "SF Pro Display",
    "SF Pro Text",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: var(--text);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.boot-screen,
.service-error {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  background: #07111c;
  color: #f4f8fb;
}

.service-error p {
  max-width: 520px;
  color: #b8c6d1;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  box-shadow: 0 0 0 3px rgba(124, 203, 255, 0.35);
}

.ph {
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 19px;
  line-height: 1;
}

.login-page {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(390px, 0.55fr);
  overflow: hidden;
  background: #02070c;
}

.login-visual {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background: #02070c;
}

.login-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 1;
}

.login-visual::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: rgba(1, 6, 11, 0.14);
  pointer-events: none;
}

.login-visual.poster-mode {
  background: #02060c;
}

.login-visual.poster-mode .login-media {
  object-fit: cover;
  object-position: center center;
}

.login-visual.poster-mode::after {
  display: none;
}

.login-visual-content {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 42px 48px 38px;
}

.login-brand,
.sidebar-brand,
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 740;
}

.login-brand span,
.sidebar-brand span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: rgba(5, 15, 25, 0.74);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  flex: 0 0 auto;
}

.logo-mark.large {
  width: 52px;
  height: 52px;
  background: rgba(5, 15, 25, 0.58);
}

.logo-image {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
}

.logo-image.large {
  width: 52px;
  height: 52px;
}

.login-copy {
  width: min(640px, 88%);
  margin-top: auto;
  margin-bottom: 56px;
}

.login-eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.login-copy h1 {
  margin: 0;
  max-width: 720px;
  font-size: 48px;
  line-height: 1.08;
  font-weight: 720;
  letter-spacing: 0;
}

.login-slogan {
  margin: 12px 0 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 540;
}

.login-message {
  max-width: 590px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.75;
}

.human-values {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 28px;
}

.human-values span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.human-values .ph {
  color: var(--secondary);
}

.login-principle {
  margin: 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
}

.login-panel {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 48px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(247, 250, 252, 0.96);
  backdrop-filter: blur(24px);
}

.login-panel-inner {
  width: min(420px, 100%);
  margin: 0 auto;
}

.panel-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 30px;
}

.security-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--success);
  font-size: 12px;
  font-weight: 750;
}

.panel-heading h2,
.topbar h1,
.panel-title h2,
.module-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.panel-heading h2 {
  font-size: 30px;
  line-height: 1.2;
}

.panel-heading p,
.topbar p,
.panel-title p,
.module-card p,
.content-band p,
.sync-card p,
.hint {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.panel-heading p {
  max-width: 340px;
  font-size: 14px;
}

.primary-action,
.secondary-action,
.text-button,
.icon-button,
.nav-item {
  border: 0;
  cursor: pointer;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: var(--radius);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 720;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

.primary-action {
  width: 100%;
  background: var(--primary);
  color: #fff;
}

.primary-action:hover {
  background: #102437;
}

.primary-action.small {
  min-height: 40px;
  width: fit-content;
}

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

.secondary-action:hover {
  border-color: #9bb2bf;
}

.secondary-action.full {
  width: 100%;
}

.divider {
  margin: 26px 0;
  border-top: 1px solid var(--line);
  position: relative;
}

.divider span {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0 12px;
  white-space: nowrap;
  background: #f7fafc;
  color: var(--muted);
  font-size: 12px;
}

.login-form,
.form-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #324852;
  font-size: 13px;
  font-weight: 720;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input:hover,
select:hover {
  border-color: #a9bbc4;
}

input:focus,
select:focus {
  border-color: #72bce8;
}

.otp-row,
.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hint {
  font-size: 12px;
}

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

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

.login-trust {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.login-trust .ph {
  margin-top: 2px;
  color: var(--secondary);
}

.login-trust p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
}

.login-trust a {
  color: #245f82;
  text-decoration: none;
  font-weight: 700;
}

.dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 24px 80px rgba(5, 16, 25, 0.3);
}

.dialog::backdrop {
  background: rgba(3, 11, 18, 0.66);
}

.dialog-card {
  width: min(440px, calc(100vw - 32px));
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dialog-card h3,
.dialog-card p {
  margin: 0;
}

.dialog-card p {
  color: var(--muted);
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.text-button {
  background: transparent;
  color: #245f82;
  font-weight: 720;
  padding: 6px 0;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--primary);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-brand {
  padding: 0 6px;
}

.sidebar-brand strong {
  display: block;
  font-size: 14px;
}

.sidebar .logo-mark {
  border-color: rgba(124, 203, 255, 0.32);
  color: var(--accent);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(124, 203, 255, 0.12);
  color: #fff;
}

.nav-item.active .ph {
  color: var(--accent);
}

.sidebar-note {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 18px 8px 4px;
}

.sidebar-note strong {
  color: var(--warm);
  font-size: 13px;
}

.sidebar-note span {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
  line-height: 1.55;
}

.main {
  min-width: 0;
  padding: 26px 30px 40px;
}

.topbar {
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar p {
  font-size: 12px;
}

.topbar h1 {
  margin-top: 4px;
  font-size: 25px;
}

.user-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 7px 7px 13px;
  box-shadow: 0 5px 18px rgba(20, 44, 59, 0.05);
}

.user-chip span {
  font-size: 13px;
  font-weight: 700;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--primary);
}

.grid,
.module-grid,
.split-layout {
  display: grid;
  gap: 14px;
}

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

.stat,
.module-card,
.page-panel,
.content-band,
.sync-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 5px 18px rgba(20, 44, 59, 0.035);
}

.stat {
  min-height: 112px;
  padding: 18px;
  border-top: 3px solid #c7d9e2;
}

.stat:nth-child(1) {
  border-top-color: var(--secondary);
}

.stat:nth-child(2) {
  border-top-color: #d48787;
}

.stat:nth-child(3) {
  border-top-color: var(--accent);
}

.stat:nth-child(4) {
  border-top-color: var(--warm);
}

.stat span,
.sync-card span,
.doc-row span {
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  font-weight: 650;
}

.module-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
}

.module-card {
  min-height: 214px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(20, 44, 59, 0.09);
}

.module-card h3 {
  font-size: 16px;
}

.module-card p {
  font-size: 13px;
}

.module-card .text-button {
  margin-top: auto;
  width: fit-content;
}

.module-status {
  width: fit-content;
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.module-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: #e9f5fb;
  color: #2775a1;
}

.content-band {
  margin-top: 14px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 18px;
}

.content-band h2 {
  margin: 0;
  font-size: 18px;
}

.sync-card {
  padding: 16px;
  background: #f8fbfc;
}

.sync-card strong {
  display: block;
  margin: 8px 0;
}

.page-panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-title h2 {
  font-size: 18px;
}

.panel-title p {
  max-width: 500px;
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 13px 12px;
  white-space: nowrap;
}

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

th {
  background: #f4f8fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

td {
  font-size: 13px;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f7fafb;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #eaf5f0;
  color: var(--success);
  font-size: 12px;
  font-weight: 720;
}

.status.disabled {
  background: #f8e9e7;
  color: var(--danger);
}

.status.pending {
  background: #f8f0df;
  color: #8b661e;
}

.split-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: start;
}

.doc-list,
.integration-list {
  display: grid;
  gap: 10px;
}

.doc-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  color: inherit;
  text-decoration: none;
}

.doc-row:hover {
  border-color: #9bb2bf;
  background: #f8fbfc;
}

.integration-list div {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.integration-list span {
  color: var(--muted);
}

.audit {
  margin-top: 22px;
}

.audit h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.audit p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .login-page {
    grid-template-columns: minmax(0, 1.1fr) minmax(370px, 0.9fr);
  }

  .login-copy {
    width: 94%;
  }

  .login-copy h1 {
    font-size: 40px;
  }

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

  .content-band,
  .split-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .login-page {
    display: block;
    min-height: 100svh;
    overflow: visible;
  }

  .login-visual {
    min-height: 390px;
  }

  .login-visual-content {
    min-height: 390px;
    padding: 24px;
  }

  .login-copy {
    width: 100%;
    margin-bottom: 18px;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-slogan {
    font-size: 20px;
  }

  .login-message {
    margin-top: 14px;
    font-size: 14px;
  }

  .human-values,
  .login-principle {
    display: none;
  }

  .login-panel {
    min-height: auto;
    padding: 36px 24px 44px;
    border-left: 0;
    border-top: 1px solid var(--line);
    background: #f7fafc;
  }
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    height: auto;
    padding: 10px 12px;
  }

  .sidebar-brand,
  .sidebar-note {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(56px, 1fr));
    overflow-x: auto;
  }

  .nav-item {
    justify-content: center;
    min-width: 56px;
    padding: 0 8px;
  }

  .nav-item span {
    display: none;
  }

  .main {
    padding: 16px 14px 30px;
  }

  .topbar {
    align-items: flex-start;
  }

  .stats-grid,
  .module-grid,
  .otp-row,
  .inline-fields {
    grid-template-columns: 1fr;
  }

  .doc-row {
    grid-template-columns: 1fr auto;
  }

  .doc-row span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .login-visual {
    min-height: 350px;
  }

  .login-visual.poster-mode {
    min-height: 520px;
  }

  .login-visual.poster-mode .login-media {
    object-fit: contain;
  }

  .login-visual-content {
    min-height: 350px;
    padding: 20px;
  }

  .login-brand .logo-mark,
  .login-brand .logo-image {
    width: 44px;
    height: 44px;
  }

  .login-copy h1 {
    font-size: 29px;
  }

  .login-slogan {
    font-size: 18px;
  }

  .login-message {
    max-width: 92%;
    line-height: 1.6;
  }

  .login-panel {
    padding: 30px 20px 40px;
  }

  .panel-heading h2 {
    font-size: 26px;
  }

  .topbar {
    flex-direction: column;
  }

  .stats-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .content-band,
  .page-panel {
    padding: 16px;
  }
}
