:root {
  --bg: #06080d;
  --bg-2: #0a0f18;
  --surface-2: #0f141f;
  --border: rgba(255,255,255,.10);
  --ink: #f5f7fb;
  --muted: #9aa5b5;
  --accent: #2ea8ff;
  --accent-2: #16e0b3;
  --danger: #ff5470;
  --ok: #45e77e;
  --warn: #ffd166;
  --shadow: 0 18px 45px rgba(0,0,0,.45);
  --radius: 16px;
  --font-body: "Manrope","Segoe UI";
  --font-head: "Russo One","Segoe UI";
  --font-mono: "JetBrains Mono","Consolas";
}

* {
  box-sizing: border-box;
}

html,body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body), sans-serif;
  background:
    radial-gradient(1200px 700px at 0% -10%, rgba(46,168,255,.16), transparent 68%) left top / cover no-repeat fixed,
    radial-gradient(980px 620px at 100% -8%, rgba(22,224,179,.10), transparent 64%) left top / cover no-repeat fixed,
    linear-gradient(180deg,var(--bg-2),var(--bg)) left top / cover no-repeat fixed;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
  opacity: .92;
}

code {
  font-family: var(--font-mono), monospace;
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.28);
  color: #d6ebff;
}

.page .container {
  width: min(1240px,94vw);
  margin: 30px auto 52px;
}

.container.narrow {
  width: min(540px,92vw);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-avatar {
  display: block;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid rgba(223,132,169,.38);
  border-radius: 50%;
  background: #080709;
  box-shadow: 0 4px 16px rgba(0,0,0,.28);
}

.brand-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.75);
}

.brand-text {
  min-width: 0;
}

.brand-text .eyebrow {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  font-family: var(--font-head), sans-serif;
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 14px;
  margin: 14px 0;
}

.stack-section {
  margin-top: 14px;
}

.card {
  background: linear-gradient(180deg,rgba(17,26,40,.95),rgba(14,22,34,.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #dbe8fb;
}

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

.section-head h2 {
  margin: 0;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-label {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  font-family: var(--font-head), sans-serif;
  font-size: 24px;
  color: #f8fbff;
}

.kpi-meta {
  font-size: 12px;
  color: var(--muted);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.label {
  font-size: 12px;
  color: var(--muted);
}

input,
.form select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input:focus,
.form select:focus {
  border-color: rgba(46,168,255,.65);
  box-shadow: 0 0 0 3px rgba(46,168,255,.18);
}

input::placeholder {
  color: #7e8b9d;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 8px;
}

.type-pills {
  display: flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  max-width: 520px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  background: linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.025));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.type-pill {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

.type-pill input {
  position: absolute;
  inline-size: 1px !important;
  block-size: 1px !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  appearance: none;
}

.type-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #aebbd0;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}

.type-pill input:checked + span {
  border-color: rgba(46,168,255,.55);
  background: linear-gradient(135deg,rgba(46,168,255,.95),rgba(22,224,179,.85));
  color: #06111d;
  box-shadow: 0 8px 20px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.35);
}

.type-pill input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(46,168,255,.22);
}

.type-pill span:hover {
  color: #f5fbff;
  background: rgba(255,255,255,.06);
}

.type-pill input:checked + span:hover {
  color: #06111d;
}

.upload-destination {
  display: contents;
}

.upload-destination-pills {
  flex-wrap: wrap;
}

.upload-destination-pills .type-pill {
  flex: 1 0 auto;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(46,168,255,.35);
  background: rgba(46,168,255,.14);
  color: #d8efff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.file-btn:hover {
  background: rgba(46,168,255,.2);
  border-color: rgba(46,168,255,.55);
  transform: translateY(-1px);
}

.file-name {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

.actions > * {
  flex: 0 0 auto;
}

.actions form {
  margin: 0;
}

.actions .action-form {
  display: inline-flex;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.16);
  background: #1a2433;
  color: #f2f8ff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
  text-decoration: none;
}

.btn.primary {
  border: none;
  background: linear-gradient(135deg,var(--accent),#1d7dff 55%,var(--accent-2));
  color: #031421;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.24);
  color: #d9e8fa;
}

.btn.danger {
  background: rgba(255,84,112,.12);
  border-color: rgba(255,84,112,.45);
  color: #ffc7d1;
}

.flash {
  margin: 10px 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,84,112,.35);
  background: rgba(255,84,112,.1);
  color: #ffd6de;
  font-size: 13px;
}

.blocked-ip-page {
  max-width: 820px;
}

.blocked-ip-card {
  padding: 20px;
}

.blocked-ip-add {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
}

.blocked-ip-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.blocked-ip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 13px;
  background: rgba(5,14,25,.22);
}

.blocked-ip-row form {
  margin: 0;
}

body.modal-open {
  overflow: hidden;
}

.delete-confirm-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2,5,10,.76);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .16s ease;
}

.delete-confirm-backdrop[hidden] {
  display: none;
}

.delete-confirm-backdrop.is-open {
  opacity: 1;
}

.delete-confirm-card {
  position: relative;
  isolation: isolate;
  width: min(480px,100%);
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255,84,112,.3);
  border-radius: 22px;
  background: linear-gradient(145deg,rgba(23,31,46,.98),rgba(10,15,24,.99));
  box-shadow: 0 30px 90px rgba(0,0,0,.68),0 0 0 1px rgba(255,255,255,.035) inset;
  transform: translateY(12px) scale(.98);
  transition: transform .2s cubic-bezier(.2,.8,.2,1);
}

.delete-confirm-backdrop.is-open .delete-confirm-card {
  transform: translateY(0) scale(1);
}

.delete-confirm-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg,transparent,var(--danger),#ff9b54,transparent);
}

.delete-confirm-glow {
  position: absolute;
  z-index: -1;
  top: -110px;
  right: -90px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255,84,112,.14);
  filter: blur(12px);
  pointer-events: none;
}

.delete-confirm-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.delete-confirm-icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255,84,112,.42);
  border-radius: 15px;
  background: linear-gradient(145deg,rgba(255,84,112,.24),rgba(255,84,112,.08));
  box-shadow: 0 10px 28px rgba(255,84,112,.16);
  color: #ffd6de;
  font: 800 25px/1 var(--font-head), sans-serif;
}

.delete-confirm-eyebrow {
  margin-bottom: 4px;
  color: #ff8da0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.delete-confirm-head h2 {
  margin: 0;
  color: #fff;
  font-family: var(--font-head), sans-serif;
  font-size: 20px;
  letter-spacing: .01em;
}

.delete-confirm-target {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 20px 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #dce8f7;
  font-size: 12px;
  font-weight: 700;
}

#delete-confirm-list-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-confirm-target-separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #67778c;
}

#delete-confirm-proxy-count,
#delete-confirm-created-at {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 600;
}

.delete-confirm-question {
  display: flex;
  min-height: 82px;
  margin: 0 0 20px;
  align-items: center;
  color: #f8fbff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
}

.delete-confirm-question.is-changing {
  animation: delete-question-in .22s ease;
}

.delete-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.delete-confirm-actions .btn {
  min-height: 44px;
}

.delete-confirm-next {
  border: 1px solid transparent;
  background: linear-gradient(135deg,#ff5470,#e82f50);
  box-shadow: 0 12px 28px rgba(255,84,112,.28);
  color: #fff;
}

@keyframes delete-question-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(10,15,24,.8);
}

.table th {
  padding: 12px;
  text-align: left;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #95a3b8;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.04);
}

.table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  vertical-align: top;
  font-size: 13px;
}

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

.proxy-lists-toolbar {
  justify-content: flex-end;
}

.proxy-lists-table {
  min-width: 860px;
}

.proxy-lists-table td {
  vertical-align: middle;
}

.proxy-lists-table th:first-child {
  width: 56px;
}

.proxy-lists-table th:nth-child(3) {
  width: 100px;
}

.proxy-lists-table th:nth-child(4) {
  width: 150px;
}

.proxy-lists-table th:nth-child(5) {
  width: 174px;
}

.proxy-lists-table th:last-child {
  width: 200px;
  text-align: right;
}

.proxy-lists-table th:nth-child(3),
.proxy-lists-table th:nth-child(4),
.proxy-list-counts,
.proxy-list-traffic {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.proxy-list-id,
.proxy-list-created {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.proxy-list-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.api-users-table td {
  padding-block: 14px;
  vertical-align: middle;
}

.api-users-table tbody tr:hover {
  background: rgba(46,168,255,.035);
}

.api-row-label {
  display: none;
}

.api-proxies-cell {
  width: 9rem;
}

.api-proxy-summary {
  display: grid;
  gap: 4px;
}

.api-proxy-summary .small,
.api-proxy-summary a {
  font-size: 12px;
  text-wrap: balance;
}

.api-users-table .api-balance-cell {
  text-align: right;
}

.api-balance {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.form.api-list-assignment {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.api-list-assignment .btn {
  width: auto;
  flex-shrink: 0;
}

.api-price-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 8px;
}

.api-price-form,
.api-credit-form {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
}

.api-price-form .api-price-fields {
  flex: 1;
  grid-template-columns: repeat(3,minmax(5.125rem,1fr));
}

.api-credit-amount {
  flex: 1 1 7.5rem;
  min-width: 7.5rem;
}

.api-price-form .label,
.api-credit-amount .label {
  display: block;
  margin-bottom: 5px;
  white-space: nowrap;
}

.api-users-table input:not([type="hidden"]),
.api-users-table .btn {
  height: 38px;
  padding-inline: 10px;
  font-size: 13px;
}

.api-users-table input:not([type="hidden"]) {
  font-variant-numeric: tabular-nums;
}

.api-users-table .btn {
  width: auto;
  flex-shrink: 0;
}

@media (max-width:1180px) {
  .api-users-wrap {
    overflow: visible;
  }

  .api-users-table,
  .api-users-table tbody {
    display: block;
  }

  .api-users-table {
    border: 0;
    background: transparent;
  }

  .api-users-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .api-users-table tbody tr {
    display: grid;
    grid-template-columns: repeat(6,minmax(0,1fr));
    align-items: start;
    gap: 12px 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-2);
  }

  .api-users-table tbody tr + tr {
    margin-top: 8px;
  }

  .api-users-table td {
    grid-column: span 2;
    width: auto;
    padding: 0;
    border: 0;
  }

  .api-users-table .api-prices-cell,
  .api-users-table .api-actions-cell {
    grid-column: span 3;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .api-users-table .empty {
    grid-column: 1 / -1;
  }

  .api-row-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
}

@media (max-width:840px) {
  .api-users-table .api-prices-cell,
  .api-users-table .api-actions-cell {
    grid-column: 1 / -1;
  }
}

@media (max-width:480px) {
  .api-users-table .api-id-cell,
  .api-users-table .api-balance-cell {
    grid-column: span 3;
  }

  .api-users-table .api-proxies-cell {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .api-price-form {
    flex-direction: column;
    align-items: stretch;
  }

  .api-price-form .api-price-fields {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }

  .api-price-form .btn {
    align-self: flex-end;
  }

  .api-credit-form {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
  }

  .api-credit-amount {
    min-width: 0;
  }
}

@media (max-width:374px) {
  .api-credit-form {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .api-credit-amount {
    grid-column: 1 / -1;
  }
}

.proxy-line-wrap {
  max-width: 100%;
  overflow: auto;
}

.proxy-line {
  display: inline-block;
  white-space: nowrap;
  color: #d8efff;
  border-color: rgba(46,168,255,.4);
  background: rgba(46,168,255,.1);
}

.empty {
  padding: 10px;
  color: var(--muted);
  text-align: center;
}

.traffic-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.last-access {
  margin-top: 7px;
}

.metric {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.05);
  color: #e3ebf6;
}

.metric.total {
  border-color: rgba(46,168,255,.5);
  background: rgba(46,168,255,.12);
  color: #d8efff;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.04);
  font-size: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #8d99aa;
}

.status.on .dot {
  background: var(--ok);
}

.status.off .dot {
  background: var(--danger);
}

.status.wait .dot {
  background: var(--warn);
}

.login-card {
  padding: 18px;
}

@media (max-width:980px) {
  .kpi-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width:740px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-avatar {
    width: 48px;
    height: 48px;
  }

  h1 {
    font-size: 22px;
  }

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

}

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

  .btn {
    width: 100%;
  }

  .type-pills {
    width: 100%;
  }

  .type-pill span {
    padding: 9px 6px;
    font-size: 12px;
  }

  .actions > .btn,
  .actions > a.btn,
  .actions > form {
    flex: 1 1 100%;
  }

  .delete-confirm-card {
    padding: 20px;
    border-radius: 18px;
  }

  .delete-confirm-question {
    min-height: 92px;
    font-size: 19px;
  }

  .delete-confirm-actions {
    grid-template-columns: 1fr;
  }

  .blocked-ip-add {
    grid-template-columns: 1fr;
  }

  .blocked-ip-row .btn {
    width: auto;
  }
}

@media (max-width:740px) {
  .proxy-lists-toolbar {
    justify-content: flex-start;
  }
}

@media (max-width:620px) {
  .proxy-list-actions > form,
  .proxy-list-actions > a {
    flex: 0 0 auto;
  }

  .proxy-list-actions .btn {
    width: auto;
  }
}

@media (prefers-reduced-motion:reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
