/* UnitV Pro — painel admin (dark + cores vivas + texto branco) */
:root {
  --bg-root: #05060a;
  --bg-surface: #0c0f16;
  --bg-elevated: #121722;
  --bg-input: #181f2c;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.62);
  --accent: #fbbf24;
  --accent-dim: rgba(251, 191, 36, 0.18);
  --accent-hover: #fcd34d;
  --success: #4ade80;
  --success-dim: rgba(74, 222, 128, 0.14);
  --danger: #fb7185;
  --danger-dim: rgba(251, 113, 133, 0.14);
  --info: #38bdf8;
  --info-dim: rgba(56, 189, 248, 0.14);
  --violet: #a78bfa;
  --violet-dim: rgba(167, 139, 250, 0.2);
  --magenta: #f472b6;
  --magenta-dim: rgba(244, 114, 182, 0.18);
  --cyan-bright: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.15);
  --lime: #bef264;
  --sidebar-w: 280px;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-root);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.app-body {
  min-height: 100vh;
  height: 100%;
  background-image:
    radial-gradient(ellipse 100% 90% at 0% 0%, rgba(167, 139, 250, 0.12), transparent 45%),
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(251, 191, 36, 0.1), transparent 50%),
    radial-gradient(ellipse 70% 50% at 80% 100%, rgba(34, 211, 238, 0.08), transparent 45%),
    radial-gradient(ellipse 60% 40% at 10% 90%, rgba(244, 114, 182, 0.06), transparent 40%);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}

/* Layout — tela inteira */
.app-shell {
  display: flex;
  min-height: 100vh;
  height: 100%;
  width: 100%;
}

.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(18, 23, 34, 0.98) 0%, var(--bg-surface) 40%, #0a0d12 100%);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.app-sidebar__brand {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.app-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.app-sidebar__logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, #d97706 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #0c0a08;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.app-sidebar__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.app-sidebar__logo-text strong {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-sidebar__logo-text span {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

.app-sidebar__nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.app-sidebar__label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  padding: 0.5rem 0.75rem 0.35rem;
  margin-top: 0.25rem;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.app-nav-link i {
  font-size: 1.1rem;
  opacity: 0.85;
}

.app-nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.app-nav-link.is-active {
  color: #fff;
  background: linear-gradient(90deg, var(--accent-dim), rgba(167, 139, 250, 0.12));
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: inset 3px 0 0 var(--accent);
}

.app-sidebar__footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border);
}

.app-sidebar__hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  padding: 0 0.5rem 0.75rem;
  line-height: 1.4;
}

.app-sidebar__hint code {
  color: var(--accent);
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100%;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(8, 10, 18, 0.92) 0%, rgba(8, 10, 18, 0.78) 100%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-topbar__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.app-topbar__subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.72);
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: #fff;
}

.app-user-pill__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--info), #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
}

.app-content {
  flex: 1;
  padding: 1.25rem 1.5rem 2rem;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 0;
}

/* Cards */
.app-card {
  background: linear-gradient(165deg, rgba(22, 28, 40, 0.95) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.app-card--padded {
  padding: 1.35rem 1.5rem;
}

.app-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.app-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.app-card__desc {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.68);
  max-width: 48ch;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  position: relative;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(30, 38, 55, 0.6) 0%, var(--bg-elevated) 100%);
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-bar, var(--accent));
  opacity: 0.9;
}

.stat-card--amber {
  --stat-bar: var(--accent);
}
.stat-card--emerald {
  --stat-bar: var(--success);
}
.stat-card--sky {
  --stat-bar: var(--info);
}
.stat-card--rose {
  --stat-bar: var(--danger);
}

.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.85rem;
  background: var(--stat-icon-bg, var(--accent-dim));
  color: var(--stat-icon, var(--accent));
}

.stat-card--emerald .stat-card__icon {
  --stat-icon-bg: var(--success-dim);
  --stat-icon: var(--success);
}
.stat-card--sky .stat-card__icon {
  --stat-icon-bg: var(--info-dim);
  --stat-icon: var(--info);
}
.stat-card--rose .stat-card__icon {
  --stat-icon-bg: var(--danger-dim);
  --stat-icon: var(--danger);
}

.stat-card__label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.stat-card__value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #ffffff;
}

.stat-card__foot {
  margin-top: 0.65rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Forms */
.app-form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.form-control.app-input,
textarea.form-control.app-input {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-strong) !important;
  color: #ffffff !important;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
}

.form-control.app-input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.form-control.app-input:focus {
  border-color: rgba(251, 191, 36, 0.55) !important;
  box-shadow: 0 0 0 3px var(--accent-dim) !important;
}

.btn-app-primary {
  background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 100%);
  border: none;
  color: #1a1006;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.15rem;
  transition: filter 0.15s, transform 0.1s;
}

.btn-app-primary:hover {
  filter: brightness(1.06);
  color: #1a1006;
}

.btn-app-accent {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.95) 0%, #0891b2 100%);
  border: none;
  color: #042f2e;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  transition: filter 0.15s, transform 0.1s;
}

.btn-app-accent:hover {
  filter: brightness(1.08);
  color: #042f2e;
}

.btn-app-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.btn-app-ghost:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.btn-app-danger {
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--danger);
  background: var(--danger-dim);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.btn-app-danger:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}

/* Table */
.app-table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-elevated);
}

.table.app-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  margin: 0;
  font-size: 0.88rem;
}

.table.app-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
  border-bottom-color: var(--border-strong);
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.08), rgba(0, 0, 0, 0.25));
}

.table.app-table tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  color: rgba(255, 255, 255, 0.95);
}

.table.app-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

.table.app-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.badge-app {
  padding: 0.28em 0.65em;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-app--ok {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.badge-app--off {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.mac-cell {
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: #fde68a;
  font-size: 0.82rem;
}

/* Utilitários texto */
.text-dim {
  color: rgba(255, 255, 255, 0.55) !important;
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.55) !important;
}

.border-violet {
  border-color: #8b5cf6 !important;
}

.badge-pill-cyan {
  background: var(--cyan-dim);
  color: var(--cyan-bright);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.badge-pill-magenta {
  background: var(--magenta-dim);
  color: #fbcfe8;
  border: 1px solid rgba(244, 114, 182, 0.35);
}

.badge-pill-lime {
  background: rgba(190, 242, 100, 0.15);
  color: var(--lime);
  border: 1px solid rgba(190, 242, 100, 0.35);
}

/* Lista DNS (config) */
.dns-add-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.dns-add-row .form-control {
  flex: 1;
  min-width: 200px;
}

.dns-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dns-empty {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  text-align: center;
  font-size: 0.88rem;
}

.dns-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.22);
}

.dns-chip__text {
  flex: 1;
  font-size: 0.9rem;
  color: #ffffff;
  word-break: break-all;
}

.dns-chip__remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(251, 113, 133, 0.2);
  color: #fecdd3;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.dns-chip__remove:hover {
  background: rgba(251, 113, 133, 0.35);
  color: #fff;
}

.alert-app--success {
  background: var(--success-dim);
  border-color: rgba(74, 222, 128, 0.35);
  color: #bbf7d0;
}

/* Modal escuro */
.modal-content.app-modal-dark {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: #fff;
  border-radius: var(--radius);
}

.modal-content.app-modal-dark .modal-header {
  border-bottom-color: var(--border);
}

.modal-content.app-modal-dark .modal-footer {
  border-top-color: var(--border);
}

.modal-content.app-modal-dark .btn-close {
  filter: invert(1);
  opacity: 0.7;
}

.info-dl dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.15rem;
}

.info-dl dd {
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
  word-break: break-all;
}

.info-dl dd:last-child {
  margin-bottom: 0;
}

.dns-replace-card {
  border-left: 4px solid var(--accent);
}

/* Alerts */
.alert-app {
  border-radius: var(--radius-sm);
  border: 1px solid;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.alert-app--danger {
  background: var(--danger-dim);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--bg-root);
  font-family: var(--font);
}

.login-page__aside {
  flex: 0 0 42%;
  max-width: 520px;
  background: linear-gradient(160deg, #1a1510 0%, var(--bg-surface) 45%, #0d1118 100%);
  border-right: 1px solid var(--border);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-page__aside::before {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
  top: -80px;
  right: -80px;
  pointer-events: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.login-brand__mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #b45309);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #0c0a08;
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
}

.login-aside-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  position: relative;
  z-index: 1;
}

.login-aside-list {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
  z-index: 1;
}

.login-aside-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.78);
}

.login-aside-list i {
  color: var(--accent);
  margin-top: 3px;
}

.login-page__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-image: radial-gradient(ellipse 80% 60% at 70% 20%, rgba(56, 189, 248, 0.06), transparent);
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-card__inner {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2rem 1.75rem;
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  letter-spacing: -0.03em;
}

.login-card .lead-in {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 991.98px) {
  .login-page__aside {
    display: none;
  }
  .app-shell {
    flex-direction: column;
  }
  .app-sidebar {
    position: relative;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
  }
  .app-sidebar__brand {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }
  .app-sidebar__nav {
    display: flex;
    flex-wrap: wrap;
    flex: 1;
    gap: 0.25rem;
    padding: 0.75rem;
  }
  .app-sidebar__label {
    width: 100%;
  }
  .app-sidebar__footer {
    width: 100%;
    border-top: 1px solid var(--border);
  }
  .app-sidebar__hint {
    display: none;
  }
  .app-main {
    margin-left: 0;
  }
}
