:root {
  --bg: #060b12;
  --bg2: #09131f;
  --line: #21405a;
  --text: #e4f4ff;
  --muted: #88aac5;
  --accent: #35f8b2;
  --accent2: #00d0ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(0, 208, 255, 0.09), transparent 40%),
    linear-gradient(220deg, rgba(53, 248, 178, 0.08), transparent 35%),
    repeating-linear-gradient(
      0deg,
      rgba(136, 170, 197, 0.05) 0,
      rgba(136, 170, 197, 0.05) 1px,
      transparent 1px,
      transparent 28px
    ),
    linear-gradient(var(--bg), var(--bg2));
  font-family: "JetBrains Mono", "Cascadia Code", "Noto Sans SC", monospace;
}

.shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.console,
.card {
  background: rgba(6, 15, 24, 0.86);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  backdrop-filter: blur(3px);
  box-shadow: 0 0 0 1px rgba(53, 248, 178, 0.05) inset;
}

.console-head h1,
.card h2 {
  margin: 0;
}

.console-head {
  display: grid;
  gap: 10px;
}

.head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chip {
  display: inline-block;
  margin: 0;
  color: var(--accent);
  background: rgba(53, 248, 178, 0.12);
  border: 1px solid rgba(53, 248, 178, 0.5);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.sub {
  margin: 0;
  color: var(--muted);
}

.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quota-text {
  margin: 0;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(53, 248, 178, 0.42);
  background: rgba(53, 248, 178, 0.08);
  color: #b8ffe6;
  font-size: 12px;
  white-space: nowrap;
}

.auth-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 460px);
  min-height: 38px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 208, 255, 0.4);
  background:
    linear-gradient(90deg, rgba(0, 208, 255, 0.14), rgba(12, 36, 48, 0.7)),
    rgba(5, 14, 22, 0.86);
  box-shadow: 0 0 0 1px rgba(53, 248, 178, 0.08) inset;
}

.auth-text {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(8, 25, 37, 0.75);
  color: #d6efff;
  border: 1px solid rgba(116, 182, 214, 0.34);
  font-size: 12px;
  white-space: nowrap;
  max-width: 265px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-link,
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #2f92b8;
  background: linear-gradient(135deg, #0c2430, #153644);
  color: #c8eeff;
  text-decoration: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}

.auth-btn {
  height: 28px;
}

.auth-link:hover,
.auth-btn:hover {
  filter: brightness(1.08);
}

.hidden {
  display: none !important;
}

.flow-tip {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 208, 255, 0.45);
  background:
    linear-gradient(90deg, rgba(0, 208, 255, 0.14) 0, rgba(0, 208, 255, 0.05) 20%),
    rgba(6, 20, 31, 0.9);
  box-shadow:
    0 0 0 1px rgba(53, 248, 178, 0.08) inset,
    0 10px 24px rgba(0, 0, 0, 0.2);
}

.flow-title {
  margin: 0 0 6px;
  color: #79d8ff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
}

.flow-text {
  margin: 0;
  color: #d5edff;
  line-height: 1.6;
  font-size: 14px;
}

.admin-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(53, 248, 178, 0.35);
  background:
    linear-gradient(100deg, rgba(53, 248, 178, 0.09), rgba(7, 22, 33, 0.8)),
    rgba(6, 16, 26, 0.92);
}

.admin-title {
  margin: 0 0 8px;
  color: #b5ffe3;
  font-size: 13px;
  font-weight: 700;
}

.admin-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 8px;
}

.admin-hint {
  margin: 8px 0 0;
  color: #91b2c6;
  font-size: 12px;
}

.form-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(260px, 420px);
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #081120;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #00d0ff 50%),
    linear-gradient(135deg, #00d0ff 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 17px,
    calc(100% - 12px) 17px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px rgba(0, 208, 255, 0.2);
}

.bar {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

button {
  border: 1px solid #1ecf97;
  border-radius: 10px;
  height: 42px;
  padding: 0 16px;
  background: linear-gradient(135deg, #0a3327, #155438);
  color: #c8ffe9;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.1);
}

button.secondary {
  border-color: #219dc3;
  background: linear-gradient(135deg, #0c2430, #163a46);
  color: #b9ecff;
}

button.danger {
  border-color: #c44f63;
  background: linear-gradient(135deg, #3a1420, #512232);
  color: #ffd5de;
}

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

#statusText {
  color: var(--muted);
}

.result-grid {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(53, 248, 178, 0.06) inset;
}

.result-head,
.result-row {
  display: grid;
  grid-template-columns: 1.9fr 0.8fr 0.8fr 2.7fr;
  gap: 0;
}

.result-rows {
  display: grid;
}

.result-rows .result-row {
  border-top: 1px solid var(--line);
}

.result-rows .result-row:first-child {
  border-top: 0;
}

.result-head > div {
  padding: 12px;
  color: var(--muted);
  background: rgba(11, 26, 40, 0.8);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.result-row > div {
  padding: 12px;
  background:
    linear-gradient(
      180deg,
      rgba(16, 31, 47, 0.82) 0%,
      rgba(8, 16, 28, 0.78) 100%
    );
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.result-row > div:last-child {
  border-right: 0;
}

.empty-row {
  color: var(--muted);
}

.mono {
  font-family: "JetBrains Mono", "Cascadia Code", monospace;
  color: var(--accent);
}

.phone-cell {
  gap: 9px;
  min-width: 0;
}

.country-pill {
  display: inline-block;
  max-width: 72px;
  color: #8fb1c7;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  border: 1px solid #294e61;
  background: #0d1d2b;
  color: #8fb5ca;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #8b97a3;
  border-radius: 9px;
  color: #d6e2ea;
  background: rgba(140, 154, 166, 0.15);
  margin-right: 10px;
}

.badge.ok {
  border-color: #28d29a;
  color: #afffe1;
  background: rgba(40, 210, 154, 0.14);
}

.badge.warn {
  border-color: #dcb24f;
  color: #ffe8b8;
  background: rgba(220, 178, 79, 0.14);
}

.badge.expired {
  border-color: #ff6f86;
  color: #ffd5de;
  background: rgba(255, 111, 134, 0.16);
}

.status-cell {
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.sms-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.code-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  color: #fff;
  background: #202a35;
  border: 1px solid #313f50;
}

@media (max-width: 640px) {
  .shell {
    padding: 14px;
  }

  .head-top {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-bar {
    max-width: 100%;
    flex-wrap: wrap;
    border-radius: 12px;
  }

  .auth-text {
    max-width: 100%;
    flex: 1 1 auto;
  }

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

  .result-head {
    display: none;
  }

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

  .result-row > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .result-row > div:last-child {
    border-bottom: 0;
  }

  .status-cell {
    flex-wrap: wrap;
  }
}
