@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

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

:root {
  --bg: #050505;
  --bg-2: #0a0a0a;
  --surface: #101010;
  --surface-2: #181818;
  --surface-3: #202020;
  --text: #f8fafc;
  --text-2: #c7c7c7;
  --text-3: #858585;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 196, 0, 0.34);
  --accent: #ffc400;
  --accent-2: #f5a800;
  --accent-soft: rgba(255, 196, 0, 0.13);
  --accent-hover: #ffd84a;
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.13);
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, 0.13);
  --warn: #f59e0b;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar-w: 258px;
  --font: 'Outfit', system-ui, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.55;
  background:
    linear-gradient(180deg, rgba(255, 196, 0, 0.05), transparent 240px),
    linear-gradient(135deg, #020202 0%, #080808 42%, #111 100%);
}

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

a:hover {
  color: var(--accent-hover);
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    linear-gradient(180deg, rgba(255, 196, 0, 0.1), transparent 32%),
    linear-gradient(135deg, #000 0%, #090909 48%, #151515 100%);
}

.login-card {
  width: 100%;
  max-width: 410px;
  padding: 2.35rem 2rem 2rem;
  overflow: hidden;
  position: relative;
  background: rgba(16, 16, 16, 0.96);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 196, 0, 0.12), transparent 42%);
  opacity: 0.42;
}

.login-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.login-brand .mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #050505;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent-2));
  border-radius: var(--radius);
  box-shadow: 0 0 0 4px rgba(255, 196, 0, 0.1);
}

.login-brand h1 {
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--text);
}

/* Layout */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 200;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: #050505;
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 38px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s var(--ease);
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255, 196, 0, 0.45), transparent);
}

.sidebar-head {
  min-height: 76px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.72rem;
  border-bottom: 1px solid var(--line);
}

.sidebar-head .mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #050505;
  background: var(--accent);
  border-radius: var(--radius);
}

.sidebar-head span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  list-style: none;
  flex: 1;
  padding: 0.85rem 0.65rem;
  overflow-y: auto;
}

.nav li a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 42px;
  margin-bottom: 3px;
  padding: 0.64rem 0.85rem;
  color: var(--text-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.91rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.nav li a i,
.nav li a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.82;
}

.nav li a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line);
  text-decoration: none;
}

.nav li a.active {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(255, 196, 0, 0.17), rgba(255, 196, 0, 0.04));
  border-color: rgba(255, 196, 0, 0.24);
}

.nav li a.active::before {
  content: '';
  width: 4px;
  height: 22px;
  position: absolute;
  left: -0.65rem;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.nav li a.active i,
.nav li a.active svg {
  opacity: 1;
}

.nav-divider {
  height: 1px;
  margin: 0.7rem 0.85rem;
  padding: 0;
  list-style: none;
  background: var(--line);
}

.sidebar-foot {
  padding: 1rem 1.25rem;
  color: var(--text-3);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 66px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(7, 7, 7, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.topbar-left h1 {
  overflow: hidden;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: none;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.icon-btn:hover {
  color: var(--accent);
  background: var(--surface-3);
  border-color: var(--line-2);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 210px;
  padding: 0.35rem 0.78rem 0.35rem 0.35rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
}

.user-chip .avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #050505;
  background: var(--accent);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
}

.page {
  width: 100%;
  max-width: 1280px;
  flex: 1;
  padding: 1.5rem;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 1.12rem 1.2rem;
  background: linear-gradient(180deg, #151515, #0f0f0f);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.stat::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.stat:hover {
  border-color: rgba(255, 196, 0, 0.3);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.stat-label {
  color: var(--text-3);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 0.18rem;
  color: var(--text);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
}

/* Cards */
.card {
  margin-bottom: 1rem;
  overflow: hidden;
  background: rgba(16, 16, 16, 0.98);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-head {
  min-height: 58px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: linear-gradient(90deg, rgba(255, 196, 0, 0.08), transparent 45%);
  border-bottom: 1px solid var(--line);
}

.card-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
}

.card-head h2::before {
  content: '';
  width: 4px;
  height: 22px;
  display: inline-block;
  background: var(--accent);
  border-radius: 3px;
}

.card-body {
  padding: 1.25rem;
}

.card-body.flush {
  padding: 0;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
}

.field-wide {
  grid-column: span 2;
}

.field-help {
  display: block;
  margin-top: 0.38rem;
  color: var(--text-3);
  font-size: 0.78rem;
}

.qr-preview-field {
  max-width: 190px;
}

.qr-preview {
  display: block;
  width: 132px;
  height: 132px;
  margin-bottom: 0.65rem;
  padding: 0.42rem;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
}

.input-wrap {
  position: relative;
}

.input-wrap i,
.input-wrap svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--text-3);
  pointer-events: none;
  transform: translateY(-50%);
}

.input-wrap input {
  padding-left: 2.5rem !important;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.64rem 0.85rem;
  color: var(--text);
  background: #0b0b0b;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #6f6f6f;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: #101010;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.14);
}

input[type="file"] {
  padding: 0.52rem;
  color: var(--text-2);
  font-size: 0.85rem;
}

input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.42rem 0.68rem;
  color: #050505;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 38px;
  padding: 0.58rem 1.08rem;
  cursor: pointer;
  color: #050505;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  border: 1px solid rgba(255, 196, 0, 0.26);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px rgba(255, 196, 0, 0.12);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}

.btn:hover {
  color: #050505;
  background: var(--accent-hover);
  border-color: rgba(255, 216, 74, 0.55);
  box-shadow: 0 12px 28px rgba(255, 196, 0, 0.2);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  min-height: 32px;
  padding: 0.38rem 0.74rem;
  font-size: 0.8rem;
}

.btn-ghost {
  color: var(--text-2);
  background: #111;
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-ghost:hover {
  color: var(--accent);
  background: #181818;
  border-color: var(--line-2);
  box-shadow: none;
}

.btn-danger {
  color: #fff;
  background: #d92d3a;
  border-color: rgba(239, 68, 68, 0.34);
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.12);
}

.btn-danger:hover {
  color: #fff;
  background: #ef4444;
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.2);
}

.btn-icon {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.btn svg,
.btn i {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Tables */
.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th {
  padding: 0.78rem 1.25rem;
  color: var(--text-3);
  background: #0b0b0b;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 0.88rem 1.25rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

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

tbody tr {
  transition: background 0.12s;
}

tbody tr:hover td {
  background: rgba(255, 196, 0, 0.045);
}

.empty {
  padding: 2.5rem 1rem !important;
  color: var(--text-3);
  text-align: center;
}

code,
.url-chip {
  padding: 0.2rem 0.45rem;
  color: var(--accent);
  background: #0b0b0b;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.8rem;
  word-break: break-all;
}

.url-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.2rem 0.58rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.badge-ok {
  color: #86efac;
  background: var(--ok-soft);
  border-color: rgba(34, 197, 94, 0.24);
}

.badge-bad {
  color: #fca5a5;
  background: var(--bad-soft);
  border-color: rgba(239, 68, 68, 0.24);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.toolbar input[type="text"],
.toolbar input[type="search"] {
  flex: 1;
  min-width: 180px;
}

.thumb {
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.preview-img {
  display: block;
  max-height: 78px;
  margin-top: 0.65rem;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

/* Overlay */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  opacity: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(3px);
  transition: opacity 0.25s;
}

.backdrop.show {
  display: block;
  opacity: 1;
}

/* Toast */
.toast-stack {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  max-width: 340px;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
  color: var(--text);
  background: #171717;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 600;
  animation: toastIn 0.35s var(--ease);
}

.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }

.toast.hide {
  animation: toastOut 0.3s var(--ease) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px); }
}

/* Responsive */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }

  .main {
    margin-left: 0;
  }

  .icon-btn {
    display: grid;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .field-wide {
    grid-column: auto;
  }

  .qr-preview-field {
    max-width: none;
  }

  .page {
    padding: 1rem;
  }

  .topbar {
    padding: 0 1rem;
  }

  .card-body,
  .card-head {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  th,
  td {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 520px) {
  .login-wrap {
    padding: 1rem;
  }

  .login-card {
    padding: 2rem 1.25rem 1.35rem;
  }

  .user-chip span:not(.avatar) {
    display: none;
  }
}

/* FIX V3 - mantém os botões Editar/Remover visíveis na página DNS */
.row-actions .btn {
  white-space: nowrap;
}


/* PLAY MAX - visual profissional sem mexer na lógica do formulário */
.playmax-login-wrap {
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 196, 0, 0.18), transparent 30%),
    radial-gradient(circle at 86% 14%, rgba(255, 216, 74, 0.10), transparent 24%),
    linear-gradient(135deg, #020202 0%, #090806 48%, #171005 100%);
}

.playmax-login-card {
  max-width: 420px;
  border: 1px solid rgba(255, 196, 0, 0.24);
  border-top: 4px solid var(--accent);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(7, 7, 7, 0.98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 196, 0, 0.05) inset;
}

.playmax-login-card::before {
  pointer-events: none;
}

.playmax-login-brand {
  justify-content: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.playmax-login-mark {
  width: 76px !important;
  height: 76px !important;
  padding: 0;
  overflow: visible;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.playmax-login-logo {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.55));
}

.playmax-login-brand h1 {
  color: #fff;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.playmax-login-subtitle {
  margin-bottom: 1.25rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-error {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bad-soft);
  color: var(--bad);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.playmax-login-btn {
  min-height: 48px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  color: #050505;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(255, 196, 0, 0.18);
}

.playmax-sidebar-head {
  min-height: 86px;
  background: linear-gradient(180deg, rgba(255, 196, 0, 0.075), transparent);
}

.playmax-sidebar-logo-wrap {
  width: 46px !important;
  height: 46px !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.playmax-sidebar-logo {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.sidebar {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 196, 0, 0.10), transparent 35%),
    linear-gradient(180deg, #050505 0%, #080806 100%);
}

.nav li a.active {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(255, 196, 0, 0.17), rgba(255, 196, 0, 0.045));
  border-color: rgba(255, 196, 0, 0.26);
}

.topbar {
  background:
    linear-gradient(90deg, rgba(255, 196, 0, 0.055), transparent 38%),
    rgba(7, 7, 7, 0.92);
}

@media (max-width: 520px) {
  .playmax-login-card {
    padding: 1.75rem 1.25rem;
  }
  .playmax-login-mark,
  .playmax-login-logo {
    width: 64px !important;
    height: 64px !important;
  }
  .playmax-login-brand h1 {
    font-size: 1.45rem;
  }
}
