:root {
  --bg: #030711;
  --bg-soft: #070c17;
  --panel: rgba(18, 25, 39, 0.82);
  --panel-dark: rgba(8, 13, 23, 0.94);
  --line: #263244;
  --line-bright: rgba(56, 255, 20, 0.45);
  --text: #f4f7f6;
  --muted: #778292;
  --muted-2: #4d5868;
  --green: #26ff16;
  --green-soft: rgba(38, 255, 22, 0.12);
  --red: #ff4f67;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--text);
  background: var(--bg);
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 13%, rgba(38, 255, 22, 0.12), transparent 26rem),
    linear-gradient(rgba(38, 255, 22, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 255, 22, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 0 0, rgba(33, 119, 255, 0.12), transparent 24rem),
    var(--bg);
  background-size: auto, 72px 72px, 72px 72px, auto, auto;
}

.grid-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(3, 7, 17, 0.08), rgba(3, 7, 17, 0.7)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.012) 3px 4px);
  pointer-events: none;
}

.screen,
.login-view,
.app-view {
  min-height: 100vh;
}

.hidden {
  display: none;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid rgba(54, 70, 96, 0.22);
  background: linear-gradient(to bottom, rgba(3, 7, 17, 0.76), rgba(3, 7, 17, 0.08));
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--green);
  text-decoration: none;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(38, 255, 22, 0.7);
}

.prompt,
.terminal-mark,
.section-title {
  color: var(--green);
  text-shadow: 0 0 18px rgba(38, 255, 22, 0.7);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.nav-right strong {
  color: var(--green);
}

.divider {
  color: #263244;
}

.logout {
  height: 32px;
  min-height: 32px;
  border: 1px solid rgba(56, 255, 20, 0.3);
  background: transparent;
  color: var(--green);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.nav-action {
  height: 32px;
  min-height: 32px;
  border: 1px solid #324258;
  background: rgba(18, 25, 39, 0.72);
  color: #a5afbd;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.nav-action.active {
  border-color: rgba(56, 255, 20, 0.44);
  color: var(--green);
  background: rgba(38, 255, 22, 0.08);
}

.login-wrap {
  width: min(500px, calc(100vw - 40px));
  margin: 0 auto;
  padding-top: clamp(104px, 13vh, 140px);
}

.login-wrap .face {
  text-align: center;
  font-size: clamp(34px, 3.4vw, 46px);
  margin-bottom: 22px;
}

.login-wrap h1 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.18;
  font-weight: 1000;
  letter-spacing: 0;
}

.subline {
  width: 100%;
  max-width: 440px;
  margin: 0 0 28px;
  color: #9aa5b4;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 800;
}

.login-form {
  display: grid;
  gap: 16px;
  width: 100%;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: #c3ccd8;
  font-size: 14px;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #304054;
  border-radius: 2px;
  outline: none;
  background: rgba(5, 9, 16, 0.76);
  color: var(--text);
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
}

input::placeholder {
  color: rgba(140, 150, 166, 0.55);
}

input:focus {
  border-color: var(--line-bright);
  box-shadow: 0 0 0 4px rgba(38, 255, 22, 0.08), 0 0 28px rgba(38, 255, 22, 0.12);
}

button {
  font-family: inherit;
}

.execute {
  min-height: 52px;
  border: 0;
  border-radius: 2px;
  background: var(--green);
  color: #041007;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(38, 255, 22, 0.18);
}

.execute.wide {
  width: 100%;
  margin-top: 8px;
}

.execute:disabled {
  opacity: 0.55;
  cursor: wait;
}

.bolt {
  display: inline-block;
  margin-left: 8px;
  font-size: 24px;
  line-height: 1;
}

.message {
  min-height: 22px;
  color: var(--red);
  font-size: 15px;
  font-weight: 800;
}

.hero {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding-top: clamp(98px, 11vh, 126px);
  text-align: center;
}

.face {
  color: var(--green);
  font-size: clamp(34px, 3.4vw, 50px);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0 18px rgba(38, 255, 22, 0.8), 0 0 54px rgba(38, 255, 22, 0.45);
  user-select: none;
}

.hero h1 {
  margin: 16px auto 0;
  max-width: 820px;
  font-size: clamp(26px, 2.5vw, 42px);
  line-height: 1.15;
}

.search-console {
  width: min(940px, 100%);
  margin: 36px auto 0;
  display: grid;
  grid-template-columns: 96px minmax(300px, 1fr) 124px 52px 52px;
  gap: 8px;
  align-items: stretch;
}

.search-console .execute {
  min-height: 52px;
  padding: 0 24px;
  font-size: 18px;
}

.field-select {
  min-height: 52px;
  border: 1px solid #324258;
  background: rgba(18, 25, 39, 0.92);
}

.field-select select {
  width: 100%;
  height: 100%;
  min-height: 50px;
  border: 0;
  outline: 0;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #6c788b 50%) right 20px center / 7px 7px no-repeat,
    linear-gradient(135deg, #6c788b 50%, transparent 50%) right 14px center / 7px 7px no-repeat,
    transparent;
  color: #a5afbd;
  padding: 0 30px 0 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.terminal-input {
  min-height: 52px;
  border: 1px solid #324258;
  background: rgba(18, 25, 39, 0.92);
  display: grid;
  grid-template-columns: 24px 1fr 104px;
  align-items: center;
  padding-left: 16px;
}

.terminal-input input {
  min-height: 48px;
  border: 0;
  background: transparent;
  padding: 0 12px;
  font-size: 16px;
}

.terminal-input input:focus {
  box-shadow: none;
}

.terminal-mark {
  font-size: 20px;
  font-weight: 1000;
}

.exact {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding-right: 12px;
  color: #566175;
  font-size: 12px;
  font-weight: 900;
}

.toggle-on {
  width: 42px;
  height: 24px;
  border: 1px solid var(--green);
  background: transparent;
  padding: 0;
  position: relative;
  cursor: default;
}

.toggle-on::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(38, 255, 22, 0.55);
}

.icon-btn {
  min-height: 52px;
  border: 1px solid #324258;
  background: rgba(34, 44, 60, 0.88);
  color: var(--green);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.muted-icon {
  color: #6f7a8c;
}

.quota-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
  font-size: 13px;
  color: #606c7d;
  font-weight: 900;
}

.filter-panel {
  width: min(940px, 100%);
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.6fr) 148px 148px auto 76px;
  gap: 8px;
  align-items: center;
}

.filter-panel input {
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.sort-group {
  min-height: 40px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #324258;
  background: rgba(18, 25, 39, 0.72);
}

.sort-btn,
.clear-filters {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #8d98aa;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.sort-btn.active {
  color: var(--green);
  background: rgba(38, 255, 22, 0.08);
}

.clear-filters {
  border: 1px solid #324258;
  background: rgba(18, 25, 39, 0.72);
}

.quota-bar {
  display: inline-flex;
  width: 92px;
  height: 7px;
  background: #1f2938;
  border-radius: 99px;
  overflow: hidden;
}

.quota-bar i {
  display: block;
  width: 100%;
  background: #344156;
}

kbd {
  min-width: 40px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #324258;
  border-radius: 6px;
  background: #172133;
  color: #a7b2c1;
  font: inherit;
}

.results-card {
  width: min(1180px, calc(100vw - 40px));
  margin: clamp(30px, 4.5vh, 48px) auto 80px;
  border: 1px solid rgba(50, 66, 88, 0.82);
  background: rgba(7, 12, 22, 0.82);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

.admin-card {
  width: min(1180px, calc(100vw - 40px));
  margin: clamp(98px, 12vh, 130px) auto 86px;
  border: 1px solid rgba(50, 66, 88, 0.82);
  background: rgba(7, 12, 22, 0.86);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

.admin-body {
  padding: 22px 24px 26px;
}

.admin-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(150px, 1fr) 104px minmax(150px, 1fr) 96px 104px 126px 96px 112px;
  gap: 12px;
  align-items: end;
}

.admin-form select {
  width: 100%;
  min-height: 50px;
  border: 1px solid #304054;
  border-radius: 2px;
  outline: none;
  background: rgba(5, 9, 16, 0.76);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
}

.check-line {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-line input {
  width: 16px;
  min-height: 16px;
}

.check-line span {
  margin: 0;
  font-size: 13px;
  color: #a5afbd;
}

.admin-submit {
  min-height: 50px;
  font-size: 15px;
}

.admin-secret {
  margin-top: 16px;
  border: 1px solid rgba(56, 255, 20, 0.36);
  background: rgba(38, 255, 22, 0.07);
  color: #bdf9b7;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 900;
  word-break: break-all;
}

.admin-table-wrap {
  margin-top: 22px;
  border: 1px solid rgba(50, 66, 88, 0.42);
}

.admin-table {
  min-width: 1360px;
}

.admin-password {
  color: #ffe08a;
}

.quota-control {
  display: grid;
  grid-template-columns: 92px auto;
  gap: 8px;
  align-items: center;
}

.quota-control input {
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.quota-control span {
  color: #9aa5b4;
  font-size: 12px;
  font-weight: 900;
}

.validity-control {
  display: grid;
  grid-template-columns: 88px minmax(132px, 1fr);
  gap: 8px;
  align-items: center;
}

.validity-control select {
  min-height: 32px;
  border: 1px solid #304054;
  background: rgba(5, 9, 16, 0.76);
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.validity-control span {
  color: #9aa5b4;
  font-size: 12px;
  font-weight: 900;
}

.expired-text {
  color: var(--red) !important;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(56, 255, 20, 0.28);
  color: var(--green);
  font-size: 12px;
}

.state-pill.off {
  border-color: rgba(255, 79, 103, 0.32);
  color: var(--red);
}

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

.small-action {
  min-height: 30px;
  border: 1px solid #324258;
  background: rgba(18, 25, 39, 0.72);
  color: #a5afbd;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.small-action.warn {
  border-color: rgba(255, 79, 103, 0.38);
  color: #ff8b9a;
}

.small-action.danger {
  border-color: rgba(255, 79, 103, 0.52);
  color: #ff6f83;
}

.small-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.results-head {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid rgba(50, 66, 88, 0.55);
  color: #758195;
  font-weight: 900;
}

.results-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-tools button {
  min-height: 30px;
  border: 1px solid #324258;
  background: rgba(18, 25, 39, 0.72);
  color: var(--green);
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid rgba(50, 66, 88, 0.42);
  text-align: left;
  word-break: break-all;
}

th {
  color: var(--green);
  font-size: 13px;
  letter-spacing: 0.08em;
  background: rgba(38, 255, 22, 0.045);
}

td {
  color: #dce4e1;
  font-size: 13px;
}

.password {
  color: #ffe08a;
}

.expand-row {
  width: 22px;
  min-height: 22px;
  margin-right: 8px;
  border: 0;
  background: transparent;
  color: #7f8ba0;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.detail-row td {
  padding: 0;
  background: rgba(9, 15, 26, 0.72);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 12px 16px 14px 46px;
}

.detail-item {
  min-height: 46px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 8px 10px;
  background: rgba(18, 25, 39, 0.58);
}

.detail-item span {
  color: #667286;
  font-size: 11px;
  font-weight: 900;
}

.detail-item strong {
  color: #c8d2df;
  font-size: 12px;
  font-weight: 900;
  word-break: break-all;
}

.empty {
  text-align: center;
  color: #687486;
}

.load-more-row {
  display: flex;
  justify-content: center;
  padding: 22px 16px 28px;
}

.load-more {
  min-width: 190px;
  min-height: 44px;
  border: 1px solid rgba(56, 255, 20, 0.58);
  background: rgba(3, 7, 17, 0.64);
  color: var(--green);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(38, 255, 22, 0.08);
}

.load-more:disabled {
  opacity: 0.55;
  cursor: wait;
}

.statusbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 54px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(50, 66, 88, 0.58);
  background: rgba(4, 8, 15, 0.88);
  color: #667286;
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.statusbar strong {
  color: #cbd4dd;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.online {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(38, 255, 22, 0.9);
}

@media (max-width: 980px) {
  .search-console {
    grid-template-columns: 1fr 1fr;
  }

  .field-select,
  .terminal-input,
  .search-console .execute {
    grid-column: span 2;
  }

  .icon-btn {
    min-height: 58px;
  }

  .statusbar {
    position: static;
    grid-template-columns: 1fr;
    text-align: center;
    padding: 16px;
  }

  .footer-links {
    justify-content: center;
  }

  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .sort-group,
  .clear-filters {
    grid-column: span 1;
  }

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

  .admin-form {
    grid-template-columns: 1fr 1fr;
  }

  .admin-submit {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .nav {
    height: 64px;
    padding: 0 16px;
  }

  .brand {
    font-size: 22px;
  }

  .nav-right {
    font-size: 12px;
    gap: 8px;
  }

  .login-wrap {
    width: min(100vw - 28px, 500px);
    padding-top: 84px;
  }

  .login-wrap .face {
    font-size: 34px;
    margin-bottom: 18px;
  }

  .login-wrap h1 {
    font-size: clamp(26px, 8vw, 32px);
  }

  .subline {
    font-size: 13px;
    margin-bottom: 22px;
  }

  .hero {
    width: min(100vw - 24px, 820px);
    padding-top: 86px;
  }

  .hero h1 {
    font-size: clamp(26px, 9vw, 34px);
  }

  .terminal-input {
    grid-template-columns: 26px 1fr;
  }

  .exact {
    grid-column: 1 / -1;
    min-height: 44px;
    justify-content: flex-end;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    padding-left: 16px;
  }

  .admin-card {
    width: min(100vw - 24px, 820px);
    margin-top: 84px;
  }

  .admin-body {
    padding: 16px;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }

  .admin-submit {
    grid-column: span 1;
  }
}
