:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --tint: #f7f9fd;
  --border: #e1e7f0;
  --text: #16233d;
  --muted: #6b7890;
  --primary: #1570ef;
  --primary-soft: #e4eefc;
  --primary-line: #b9cdee;
  --text-2: #3b4760;
  --line: #edf1f7;
  --track: #e3e8ef;
  --box: #c9d2df;
  --hover: #e9eff8;
  --overlay: rgba(255, 255, 255, 0.78);
  --glass: rgb(255 255 255 / 0.82);
  --sea-top: #d6e5fb;
  --sea-bottom: #eef4fd;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0b1220;
  --surface: #121b2d;
  --tint: #172238;
  --border: #24324c;
  --text: #e6ecf7;
  --muted: #8c9ab3;
  --primary: #3b8bff;
  --primary-soft: #1a2c4d;
  --primary-line: #2f5594;
  --text-2: #c3cde0;
  --line: #1d2a42;
  --track: #2a3853;
  --box: #3a4a68;
  --hover: #18243b;
  --overlay: rgba(18, 27, 45, 0.82);
  --glass: rgb(18 27 45 / 0.86);
  --sea-top: #16294a;
  --sea-bottom: #0f1b31;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 'Segoe UI', 'Inter', system-ui, Arial, 'Liberation Sans', sans-serif;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

ul {
  list-style: none;
}

svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.fill {
  fill: currentColor;
  stroke: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.hidden {
  display: none !important;
}

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

/* ---------- Barra de título ---------- */
.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 12px 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  -webkit-app-region: drag;
  flex-shrink: 0;
}

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

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.brand-name {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.brand-version {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.2;
}

.win-controls {
  display: flex;
  gap: 4px;
  -webkit-app-region: no-drag;
}

.win-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 36px;
  border-radius: 6px;
  color: var(--text-2);
}

.win-btn:hover {
  background: var(--bg);
}

.win-btn[data-win='close']:hover {
  background: #e81123;
  color: var(--surface);
}

/* ---------- Estrutura ---------- */
.shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 190px;
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  text-align: left;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.nav-item span {
  flex: 1;
}

.nav-item:hover {
  background: var(--hover);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.nav-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  visibility: hidden;
}

.nav-item.active .nav-dot {
  visibility: visible;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-top: 1px solid var(--border);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--surface);
  font-size: 14px;
  font-weight: 600;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  line-height: 1.3;
}

.user-role {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.3;
}

#userClock {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.icon-only {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--muted);
}

.icon-only:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 12px 12px 14px;
}

.content.scroll {
  overflow: auto;
}

.view {
  display: none;
}

.view.active {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.log {
  contain: size;
  flex: 1 1 0;
  min-height: 90px;
}

.modal[open] {
  max-height: calc(100vh - 32px);
  overflow: auto;
}

/* ---------- Cards ---------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
}

.card.pad {
  padding: 16px;
}

.card.grow {
  flex: 1;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
}

.card-head svg {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.card-head h2 {
  font-size: 17px;
  font-weight: 600;
}

.card-body {
  display: flex;
  flex-direction: column;
  padding: 10px 14px 14px;
}

/* ---------- Dashboard ---------- */
.dash {
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(270px, 1fr) minmax(300px, 1.05fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.toggle-list li {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 46px;
  padding: 0 6px 0 12px;
}

.toggle-list li svg {
  width: 24px;
  height: 24px;
  color: var(--text-2);
}

.toggle-list label {
  flex: 1;
  font-size: 16px;
  cursor: pointer;
}

.switch {
  appearance: none;
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--track);
  box-shadow: inset 0 1px 2px rgb(22 35 61 / 0.12);
  cursor: pointer;
  transition: background 0.2s;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(22 35 61 / 0.25);
  transition: transform 0.2s;
}

.switch:checked {
  background: var(--primary);
}

.switch:checked::after {
  transform: translateX(20px);
}

/* ---------- Checkbox ---------- */
.check {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
}

.check input {
  appearance: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--box);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}

.check input:checked {
  background: var(--primary)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 16px 16px no-repeat;
  border-color: var(--primary);
}

.check-list {
  display: flex;
  flex-direction: column;
  padding: 2px 8px 10px;
}

.check-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}

.help {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-2);
  cursor: help;
  padding: 0 6px;
}

.qr-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 12px 18px;
}

.qr-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.qr-head svg {
  color: var(--primary);
  width: 24px;
  height: 24px;
}

.qr-head h3 {
  font-size: 16px;
  font-weight: 600;
}

.qr-head .qr-help {
  width: 20px;
  height: 20px;
  color: var(--primary);
  margin-left: -6px;
}

.qr-empty {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}

.btn:active:not(:disabled),
.icon-action:active,
.step-btn:active,
.nav-item:active,
.win-btn:active,
.icon-only:active {
  transform: scale(0.95);
}

.icon-action,
.step-btn,
.nav-item,
.win-btn,
.icon-only {
  transition-property: background, border-color, color, transform;
  transition-duration: 0.15s, 0.15s, 0.15s, 0.12s;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn.outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn.outline svg {
  color: var(--primary);
}

.btn.outline:hover {
  border-color: var(--primary-line);
  background: var(--tint);
}

.btn.primary {
  background: var(--primary);
  color: var(--surface);
}

.btn.primary:hover {
  background: #0f62d6;
}

.btn.danger {
  background: #e5484d;
  color: #ffffff;
}

.btn.danger:hover {
  background: #cd2b31;
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn.block {
  width: 100%;
  margin-top: 8px;
  color: var(--primary);
  font-size: 17px;
}

.btn.sm {
  height: 42px;
  padding: 0 12px;
  gap: 8px;
  font-size: 15px;
}

.btn.lg {
  height: 50px;
  padding: 0 18px;
  font-size: 16px;
}

/* ---------- Ajustes ---------- */
.card-body > .check {
  padding: 8px 4px 0;
}

.field-label {
  margin: 18px 4px 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.stepper {
  display: flex;
  gap: 10px;
}

.step-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--primary);
  background: var(--surface);
}

.step-btn:hover {
  background: var(--tint);
}

.stepper input,
.pair input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-size: 17px;
  background: var(--surface);
  appearance: textfield;
  -moz-appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.pair input::-webkit-inner-spin-button {
  appearance: none;
}

.pair {
  display: flex;
  gap: 14px;
}

.pair input {
  height: 46px;
}

/* ---------- Log ---------- */
.log-card {
  padding: 14px 12px 12px;
}

.account {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 6px;
  font-size: 15px;
}

.account-row {
  display: flex;
  align-items: center;
  min-height: 26px;
  gap: 12px;
  white-space: nowrap;
}

.account dt {
  color: var(--muted);
}

.account .push {
  margin-left: auto;
  margin-right: -6px;
}

.account .strong {
  font-weight: 500;
}

.account .accent {
  color: var(--primary);
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 0 14px;
  padding-left: 6px;
}

.log-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.log-actions {
  display: flex;
  gap: 6px;
}

.log {
  flex: 1;
  min-height: 160px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(var(--overlay), var(--overlay)),
    url('logo.png') center / min(75%, 280px) no-repeat,
    var(--surface);
  font: 13px/1.6 Consolas, 'Cascadia Mono', monospace;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-all;
  overflow: auto;
}

/* ---------- Barra de link ---------- */
.launch {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.launch-label {
  font-size: 17px;
  font-weight: 600;
}

.launch input {
  flex: 1;
  min-width: 140px;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}

.launch .play {
  min-width: 150px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* ---------- Outras telas ---------- */
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 4px 0;
}

.view-head h1 {
  font-size: 22px;
  font-weight: 600;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.field.grow {
  flex: 1;
}

.field.narrow {
  min-width: 90px;
  width: 90px;
}

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

.field input,
.field select,
.field textarea {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.field textarea {
  height: auto;
  padding: 10px 12px;
  font-family: Consolas, monospace;
  resize: vertical;
}

#importForm {
  gap: 12px;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  padding: 0 4px;
}

.summary {
  font-size: 14px;
  color: var(--muted);
  padding: 0 4px;
}

.summary strong {
  color: var(--primary);
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty-card {
  flex: 1;
  justify-content: center;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--tint);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.mono {
  font-family: Consolas, monospace;
}

.icon-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.icon-btn.on {
  background: var(--primary-soft);
  border-color: transparent;
  color: var(--primary);
}

.icon-btn.danger:hover {
  color: #d92d20;
  border-color: #f4c7c3;
}

.preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  height: 240px;
}

.preview-cell {
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
}

.screen-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.screen-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.screen-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.screen-name {
  font-weight: 600;
}

.screen-ip {
  font-size: 13px;
  color: var(--primary);
}

.screen-ip.err,
.screen-ip.off {
  color: #d92d20;
  font-weight: 600;
}

.screen-ip.on {
  color: #16a34a;
  font-weight: 600;
}

.screen-proxy {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-actions {
  display: flex;
  gap: 6px;
}

.btn.small {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
  background: var(--surface);
  border-color: var(--border);
}

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .sidebar {
    width: 60px;
  }

  .nav-item span,
  .nav-dot,
  .user-info,
  .user-card .avatar {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .user-card {
    justify-content: center;
    padding: 14px 0;
  }


  .launch {
    flex-wrap: wrap;
  }

  .launch input {
    flex-basis: 100%;
    order: 1;
  }

  .launch-label {
    flex-basis: 100%;
  }

  .launch .btn {
    order: 2;
    flex: 1;
  }
}

/* Logo de fundo */
.bg-logo {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('logo.png') center / min(60vh, 60vw) no-repeat;
  opacity: 0.22;
  mix-blend-mode: multiply;
}
.titlebar,
.shell {
  position: relative;
  z-index: 1;
}
.card,
.launch {
  background-color: var(--glass);
}

/* Status da proxy */
.status-badge {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.status-badge.off {
  color: #d92d20;
  background: #fde8e7;
}
.status-badge.on {
  color: #079455;
  background: #e3f8ee;
}
#proxyToggleLabel:has(input:disabled) {
  cursor: not-allowed;
}
#proxyToggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bloqueio por key vencida */
body.locked .shell,
body.locked .titlebar ~ .bg-logo {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}
.lock {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgb(22 35 61 / 0.45);
  backdrop-filter: blur(4px);
}
.lock[hidden] {
  display: none;
}
.lock-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(440px, 100%);
  padding: 28px 28px 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  box-shadow: 0 24px 60px rgb(22 35 61 / 0.28);
  animation: modal-in 0.18s ease-out;
}
.lock-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: var(--primary-soft);
  color: var(--primary);
}
.lock-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lock-box h2 {
  margin: 4px 0 0;
  font-size: 19px;
}
.lock-box p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-wrap: pretty;
}
.lock-box form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}
.lock-box input,
.form-modal input[data-key-input] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}
.lock-box input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}
.lock-box .form-error:empty,
.form-modal .form-error:empty {
  display: none;
}
.lock-box .btn.primary {
  color: var(--surface);
}
.lock-links {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 6px;
}
.link-btn {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.link-btn:hover {
  text-decoration: underline;
}
.acc-left {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}
.account.is-active #accPlan,
.account.is-active #accExpire {
  color: var(--primary);
}

/* Modal "em breve" */
.modal {
  margin: auto;
  width: min(360px, calc(100vw - 32px));
  padding: 28px 24px 22px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  box-shadow: 0 24px 60px rgb(22 35 61 / 0.18);
}
.modal::backdrop {
  background: rgb(22 35 61 / 0.35);
  backdrop-filter: blur(2px);
}
.modal[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: modal-in 0.18s ease-out;
}
.modal-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}
.modal-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.modal h2 {
  margin: 4px 0 0;
  font-size: 18px;
}
.modal p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.modal form {
  width: 100%;
}
.modal .btn.primary {
  margin-top: 0;
  color: var(--surface);
  font-size: 15px;
}
.modal .btn,
.modal input,
.modal-icon {
  border-radius: 0;
}

/* Modal de formulário */
.form-modal {
  width: min(460px, calc(100vw - 32px));
  text-align: left;
}
.form-modal[open] {
  align-items: stretch;
}
.form-modal form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-modal input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.form-modal input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}
.form-error {
  margin: 0;
  color: #d92d20 !important;
  font-size: 13px !important;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.form-modal .btn.primary {
  font-size: 14px;
}

/* Acesso em vermelho */
.account .danger {
  color: #d92d20;
}

.btn.danger-outline {
  color: #d92d20;
  border-color: #f5b5b0;
}
.btn.danger-outline:hover {
  background: #fde8e7;
}
.btn.success-outline {
  color: #16a34a;
  border-color: #9fdcb5;
}
.btn.success-outline:hover {
  background: #e3f6ea;
}
:root[data-theme='dark'] .btn.danger-outline:hover {
  background: #3a1a1c;
}
:root[data-theme='dark'] .btn.success-outline:hover {
  background: #12301f;
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.25s ease, visibility 0.25s;
}
.splash.done {
  opacity: 0;
  visibility: hidden;
}
.splash-stage {
  perspective: 700px;
  animation: splash-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.splash-logo {
  display: block;
  width: 140px;
  height: 140px;
  object-fit: contain;
  transform-style: preserve-3d;
  animation: splash-spin3d 1.4s linear infinite;
}
@keyframes splash-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes splash-spin3d {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}
.splash-stage {
  position: relative;
  z-index: 1;
}

/* Ondas */
.sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: linear-gradient(180deg, var(--sea-top), var(--sea-bottom));
  pointer-events: none;
}
.sea-low {
  height: 24%;
}
.wave {
  position: absolute;
  left: 0;
  bottom: 100%;
  width: 200%;
  height: 56px;
  margin-bottom: -1px;
  animation: wave-drift 9s linear infinite;
}
.wave path {
  fill: var(--sea-top);
  stroke: none;
}
.wave-1 {
  opacity: 0.45;
  height: 72px;
  animation-duration: 14s;
}
.wave-2 {
  opacity: 0.7;
  height: 62px;
  animation-duration: 10s;
  animation-direction: reverse;
}
.wave-3 {
  animation-duration: 7s;
}
@keyframes wave-drift {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Login */
.auth {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px 32px;
  background: var(--bg);
  overflow: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.auth.hidden {
  opacity: 0;
  visibility: hidden;
}
.auth-intro,
.auth-card {
  position: relative;
  z-index: 1;
}
.auth-intro {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  max-width: 360px;
}
.auth-title {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
  text-wrap: balance;
}
.auth-lead {
  color: var(--muted);
  line-height: 1.5;
  text-wrap: pretty;
}
.auth-perks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  padding-top: 4px;
}
.auth-perks li {
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth-perks svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-perks div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.auth-perks strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.auth-perks span {
  font-size: 13px;
  color: var(--muted);
}
.auth-hero {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 12px;
  mix-blend-mode: multiply;
}
:root[data-theme='dark'] .brand-logo,
:root[data-theme='dark'] .bg-logo {
  mix-blend-mode: normal;
}
:root[data-theme='dark'] .bg-logo {
  opacity: 0.12;
}
:root[data-theme='dark'] .auth-hero {
  mix-blend-mode: normal;
  opacity: 0.9;
}
.auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 380px;
  flex-shrink: 0;
  padding: 26px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px -24px rgb(21 112 239 / 0.35);
}
.auth-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-head img {
  object-fit: contain;
}
.auth-brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding-top: 6px;
}
.auth-form[hidden] {
  display: none;
}
.auth-sub {
  text-align: center;
  color: var(--muted);
  padding-bottom: 6px;
}
.auth-field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.auth-field > svg,
.eye-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.auth-field input::placeholder {
  color: var(--muted);
}
.eye-btn {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.6;
}
.eye-btn.on {
  opacity: 1;
}
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-check {
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
}
.auth-check input {
  width: 20px;
  height: 20px;
}
.auth-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.auth-link:hover {
  text-decoration: underline;
}
.auth-error {
  min-height: 0;
  font-size: 13px;
  color: #d92d20;
  text-align: center;
}
.auth-error:empty {
  display: none;
}
.auth-submit,
.auth-alt {
  width: 100%;
  height: 46px;
  font-size: 15px;
  font-weight: 600;
}
.auth-submit svg,
.auth-alt svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-alt {
  height: 42px;
  border-color: var(--border);
  background: var(--surface);
  color: var(--primary);
}
.auth-alt:hover {
  border-color: var(--primary-line);
}
.auth-switch-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.logout-link {
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .wave {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-stage,
  .splash-logo {
    animation-duration: 0.01s;
    animation-iteration-count: 1;
  }
}

/* Proxies */
.proxy-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.proxy-title svg {
  width: 26px;
  height: 26px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.proxy-table-card {
  padding: 0;
  overflow: auto;
}
.proxy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.proxy-table th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--tint);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.proxy-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}
.proxy-table tr:last-child td {
  border-bottom: 0;
}
.proxy-table tr.inactive td:not(:first-child) {
  opacity: 0.55;
}
.proxy-table .col-status,
.proxy-table .col-actions {
  width: 1%;
}
.proxy-label {
  font-weight: 600;
}
.proxy-proto,
.proxy-country,
.proxy-auth {
  color: var(--muted);
}
.proxy-auth.ok {
  color: #079455;
}
.proxy-auth svg {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.proxy-addr {
  font: 13px Consolas, 'Cascadia Mono', monospace;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}
.icon-action {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-action:hover {
  background: var(--hover);
  color: var(--text);
}
.icon-action.on {
  color: #079455;
}
.icon-action.del {
  color: #d92d20;
}
.icon-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Tema */
.theme-dd {
  display: flex;
  align-items: center;
  align-self: center;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.theme-btn svg {
  color: var(--primary);
  transition: transform 0.25s;
}

.theme-btn:hover svg {
  transform: rotate(20deg);
}

.theme-btn:active svg {
  transform: scale(0.85);
}

.theme-btn,
.theme-btn:focus-within,
.theme-btn input:focus {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.theme-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-btn .icon-sun,
:root[data-theme='dark'] .theme-btn .icon-moon {
  display: none;
}

:root[data-theme='dark'] .theme-btn .icon-sun {
  display: block;
}

.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;
}

/* Sem barra de rolagem visível (a área continua rolável) */
.content,
.log,
.proxy-table-card,
.form-modal textarea {
  scrollbar-width: none;
}
.content::-webkit-scrollbar,
.log::-webkit-scrollbar,
.proxy-table-card::-webkit-scrollbar,
.form-modal textarea::-webkit-scrollbar {
  display: none;
}

.form-modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font: 13px Consolas, 'Cascadia Mono', monospace;
  line-height: 1.5;
  resize: vertical;
}
.form-modal textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}
.check input:disabled,
.check:has(input:disabled) {
  cursor: not-allowed;
}
.check:has(input:disabled) {
  opacity: 0.55;
}

/* Operação */
.op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.op-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.op-stack select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.op-stack .btn.block {
  width: 100%;
  justify-content: center;
}
.op-stack .btn.primary {
  color: var(--surface);
  font-weight: 600;
}
.speed {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.speed-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.speed-row input {
  flex: 1;
  accent-color: var(--primary);
}
.speed-row output {
  min-width: 32px;
  color: var(--primary);
  font-weight: 700;
  text-align: right;
}
.op-bottom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.op-bottom .card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.op-bottom input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.op-inline {
  display: flex;
  gap: 8px;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Contas ---------- */
#view-contas.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.acc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.acc-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.acc-search:focus-within {
  border-color: var(--primary);
}
.acc-search svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.acc-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.acc-table td,
.acc-table th {
  padding: 11px 12px;
}
.acc-date,
.acc-proxy {
  color: var(--muted);
  font-size: 13px;
}
.acc-casa {
  font-weight: 600;
}
.acc-copy {
  padding: 2px 6px;
  margin: -2px -6px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px Consolas, 'Cascadia Mono', monospace;
  cursor: copy;
}
.acc-copy:hover {
  background: var(--hover);
}
.acc-copy.copied {
  background: var(--primary-soft);
  color: var(--primary);
}
.acc-input {
  width: 110px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--primary-line);
  background: var(--surface);
  color: var(--text);
  font: 13px Consolas, 'Cascadia Mono', monospace;
}
.acc-table input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.acc-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
