:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #07111f;
  color: #eef7ff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 10%, rgba(23, 191, 202, 0.26), transparent 28rem),
    linear-gradient(135deg, #07111f 0%, #0b2135 52%, #07111f 100%);
}

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

.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.hero img {
  width: 54px;
  height: 54px;
}

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

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

.hero p,
.workspace-head p {
  color: #9fb3c8;
  margin-top: 4px;
}

.home-link {
  margin-left: auto;
  border: 1px solid rgba(97, 213, 255, 0.36);
  border-radius: 999px;
  background: rgba(16, 36, 58, 0.76);
  color: #b7eff6;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.home-link:hover {
  background: rgba(46, 230, 214, 0.14);
  color: #ffffff;
}

.card {
  background: rgba(9, 24, 42, 0.88);
  border: 1px solid rgba(121, 178, 218, 0.24);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  padding: 24px;
}

.grid.two {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
  gap: 28px;
  align-items: start;
}

.auth-intro {
  display: grid;
  gap: 16px;
  padding: 8px 0;
}

.auth-intro h2 {
  font-size: 26px;
}

.auth-intro p {
  color: #a8bfd6;
  line-height: 1.7;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.auth-tab {
  background: rgba(24, 49, 72, 0.9);
  border: 1px solid rgba(148, 180, 210, 0.26);
  color: #c8d8e8;
}

.auth-tab.active {
  background: linear-gradient(90deg, #168fe3, #19c5c0);
  color: #fff;
}

.auth-panel {
  min-width: 0;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: #c8d8e8;
  font-weight: 700;
  font-size: 13px;
}

.remember-line {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  color: #b7d0e6;
  cursor: pointer;
}

.remember-line input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: #19c5c0;
}

.wide {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(148, 180, 210, 0.35);
  border-radius: 7px;
  background: #10243a;
  color: #eef7ff;
  padding: 11px 12px;
  font: inherit;
}

textarea::placeholder,
input::placeholder {
  color: rgba(200, 216, 232, 0.48);
}

button,
.upload a,
.tool-card a {
  border: 0;
  border-radius: 7px;
  background: linear-gradient(90deg, #168fe3, #19c5c0);
  color: #fff;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
}

button.secondary {
  background: #1b3148;
}

button.link-button {
  background: transparent;
  color: #61d5ff;
  padding: 0;
  font-weight: 800;
}

button:disabled {
  cursor: default;
  opacity: 0.62;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: rgba(47, 214, 144, 0.14);
  color: #9dffd3;
  font-weight: 800;
  padding: 9px 12px;
  white-space: nowrap;
}

.status-pill.muted {
  background: rgba(148, 180, 210, 0.14);
  color: #c8d8e8;
}

.status-pill.brand {
  background: rgba(97, 213, 255, 0.16);
  color: #b9edff;
  padding: 7px 10px;
}

.status-pill.brand.katyusha {
  background: rgba(255, 206, 101, 0.16);
  color: #ffe2a3;
}

.message {
  min-height: 20px;
  color: #ffd37a;
}

.register-success {
  align-self: stretch;
  border: 1px solid rgba(47, 214, 144, 0.42);
  border-radius: 10px;
  background: rgba(47, 214, 144, 0.12);
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 10px;
}

.register-success p {
  color: #b7d0e6;
  line-height: 1.6;
}

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

.workspace-head.slim {
  margin-bottom: 12px;
}

.admin-panel {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 180, 210, 0.2);
}

.section-note {
  color: #9fb3c8;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.password-panel {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
  border: 1px solid rgba(121, 178, 218, 0.18);
  border-radius: 9px;
  background: rgba(16, 36, 58, 0.48);
  padding: 18px;
}

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

.database-panel {
  border-top: 0;
  border: 1px solid rgba(46, 230, 214, 0.28);
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(25, 197, 192, 0.13), rgba(22, 143, 227, 0.08)),
    rgba(16, 36, 58, 0.62);
  padding: 18px;
}

.database-panel h3 {
  color: #d9fbff;
}

.compact-table {
  min-width: 680px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions button,
.actions .status-pill {
  padding: 8px 10px;
  font-size: 12px;
}

.qr-cell {
  display: grid;
  grid-template-columns: 74px minmax(180px, 1fr);
  gap: 8px;
  align-items: center;
  max-width: 460px;
}

.qr-cell img {
  width: 74px;
  height: 74px;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
}

.qr-cell input {
  grid-column: 2;
  min-width: 0;
}

.qr-cell button {
  grid-column: 2;
  justify-self: start;
  padding: 8px 12px;
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #f2b94d;
  background: rgba(242, 185, 77, 0.13);
  border-radius: 8px;
  color: #ffe3a1;
  font-weight: 700;
}

.notice.compact {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.upload {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(148, 180, 210, 0.22);
}

.upload p {
  color: #9fb3c8;
}

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

.tool-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 150px;
  border: 1px solid rgba(121, 178, 218, 0.22);
  border-radius: 9px;
  background: rgba(16, 36, 58, 0.72);
  padding: 18px;
}

.tool-card h4 {
  margin: 0;
  font-size: 17px;
}

.tool-card form {
  gap: 12px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 180, 210, 0.18);
  text-align: left;
  vertical-align: top;
}

th {
  color: #a9c3dc;
  font-size: 12px;
}

td a {
  color: #61d5ff;
  font-weight: 800;
}

.portal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: center;
  padding: 20px 12px 4px;
  color: #8fa8c0;
  font-size: 12px;
}

.portal-footer a {
  color: #b7eff6;
  font-weight: 800;
  text-decoration: none;
}

.portal-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 860px) {
  .hero {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .home-link {
    margin-left: 70px;
  }

  .auth-card,
  .grid.two,
  .fields,
  .tool-grid,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
