/* ==========================================================================
   GrFlix — painel administrativo
   ========================================================================== */

:root {
  --bg: #07070a;
  --bg-soft: #0b0b10;
  --panel: #111117;
  --panel-2: #16161e;
  --panel-3: #1e1e28;
  --text: #f6f6f8;
  --muted: #a7a7b2;
  --dim: #71717f;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #ff5a3c;
  --accent-2: #ff8a3d;
  --accent-3: #ff4757;
  --accent-soft: rgba(255, 90, 60, 0.14);
  --gold: #ffc857;
  --green: #49d38a;
  --danger: #ff5b6e;
  --brand-gradient: linear-gradient(104deg, #ff4757 0%, #ff5a3c 45%, #ff8a3d 100%);
  --shadow-lg: 0 32px 80px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 18px 46px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --font-sans: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

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

html {
  background: var(--bg);
  scrollbar-color: #3a3a46 var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 620px at 88% -12%, rgba(255, 90, 60, 0.08), transparent 60%),
    radial-gradient(900px 520px at -8% 12%, rgba(80, 40, 160, 0.055), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: rgba(255, 90, 60, 0.35);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

h1, h2, h3, h4, p, dl, dd, dt, figure, ol, ul {
  margin: 0;
}

ol, ul {
  padding: 0;
  list-style: none;
}

[hidden],
.hidden {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: -0.01em;
}

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

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #08080b;
}

::-webkit-scrollbar-thumb {
  background: #2c2c36;
  border-radius: 99px;
  border: 2px solid #08080b;
}

::-webkit-scrollbar-thumb:hover {
  background: #44444f;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Botões, pills e componentes básicos
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--panel-3);
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650;
  font-size: 14px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--brand-gradient);
  color: #190805;
  box-shadow: 0 10px 28px rgba(255, 90, 60, 0.24);
}

.btn-primary:hover {
  box-shadow: 0 14px 36px rgba(255, 90, 60, 0.34);
  filter: brightness(1.04);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-danger-ghost {
  background: rgba(255, 91, 110, 0.06);
  border-color: rgba(255, 91, 110, 0.28);
  color: #ffb3bd;
}

.btn-danger-ghost:hover {
  background: rgba(255, 91, 110, 0.13);
  border-color: rgba(255, 91, 110, 0.5);
}

.btn-sm {
  min-height: 36px;
  padding: 0 15px;
  font-size: 13px;
}

.btn-sm .icon {
  width: 16px;
  height: 16px;
}

.btn.is-busy {
  pointer-events: none;
  opacity: 0.7;
}

.btn.is-busy::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.75s linear infinite;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--line-strong);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-btn.is-active {
  color: var(--accent-2);
  border-color: rgba(255, 138, 61, 0.35);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill-soft {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.pill.is-ok {
  border-color: rgba(73, 211, 138, 0.28);
  background: rgba(73, 211, 138, 0.1);
  color: #9cecc0;
}

.pill.is-warn {
  border-color: rgba(255, 200, 87, 0.26);
  background: rgba(255, 200, 87, 0.09);
  color: #ffdc93;
}

.pill.is-error {
  border-color: rgba(255, 91, 110, 0.3);
  background: rgba(255, 91, 110, 0.1);
  color: #ffb3bd;
}

.pill.is-live {
  border-color: rgba(255, 138, 61, 0.3);
  background: rgba(255, 138, 61, 0.1);
  color: #ffc29c;
}

.pill.is-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 1.4s ease-in-out infinite;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
}

.spinner-sm {
  width: 22px;
  height: 22px;
  border-width: 2px;
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  display: inline-block;
  flex: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* --------------------------------------------------------------------------
   Boot e bloqueio de acesso
   -------------------------------------------------------------------------- */

.admin-boot {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(680px 420px at 50% 46%, rgba(255, 90, 60, 0.14), transparent 65%),
    radial-gradient(800px 500px at 50% 100%, rgba(90, 20, 40, 0.18), transparent 60%),
    #060608;
}

.admin-boot img {
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(255, 90, 60, 0.22);
}

.admin-boot-word {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
}

.admin-boot p {
  color: var(--muted);
  font-size: 13px;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(760px 460px at 50% 30%, rgba(255, 90, 60, 0.12), transparent 65%),
    #060608;
}

.gate-card {
  width: min(500px, 100%);
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)), var(--panel);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.gate-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 90, 60, 0.28);
  color: var(--accent-2);
}

.gate-icon .icon {
  width: 27px;
  height: 27px;
}

.gate-card h1 {
  margin-top: 8px;
  font-size: clamp(26px, 3.5vw, 34px);
  line-height: 1.15;
}

.gate-card #gate-text {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.gate-hint {
  margin-top: 18px;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.55;
}

.gate-hint:empty {
  display: none;
}

.gate-login {
  margin-top: 22px;
  text-align: left;
}

.gate-login-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gate-login .field {
  margin-top: 0;
}

.gate-login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gate-login-or::before,
.gate-login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.gate-login .btn {
  width: 100%;
  margin-top: 16px;
}

.gate-login .form-error {
  text-align: left;
}

@media (max-width: 560px) {
  .gate-login-fields {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Estrutura
   -------------------------------------------------------------------------- */

.admin-shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 16px 20px;
  background:
    radial-gradient(420px 260px at 30% 0%, rgba(255, 90, 60, 0.08), transparent 70%),
    rgba(9, 9, 13, 0.94);
  border-right: 1px solid var(--line);
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 9px 24px;
}

.sidebar-brand img {
  border-radius: 11px;
  box-shadow: 0 6px 20px rgba(255, 90, 60, 0.24);
}

.sidebar-brand > span {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-gr {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-flix {
  color: #fff;
}

.sidebar-label {
  padding: 0 12px 8px;
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease;
}

.side-link .icon {
  width: 18px;
  height: 18px;
  color: var(--dim);
  transition: color 0.18s ease;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}

.side-link.is-active {
  background: linear-gradient(90deg, rgba(255, 90, 60, 0.17), rgba(255, 90, 60, 0.045));
  color: #fff;
}

.side-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-gradient);
}

.side-link.is-active .icon {
  color: var(--accent-2);
}

.side-count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: auto;
  padding: 18px 9px 0;
  border-top: 1px solid var(--line);
}

.access-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.access-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.access-badge.is-remote::before {
  background: var(--gold);
}

.side-open {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: color 0.18s ease;
}

.side-open .icon {
  width: 15px;
  height: 15px;
  color: var(--accent-2);
}

.side-open:hover {
  color: #fff;
}

.side-version {
  color: var(--dim);
  font-size: 11px;
}

.main {
  min-width: 0;
  padding: 0 clamp(20px, 3.2vw, 48px) 46px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 18px;
  background: linear-gradient(180deg, rgba(7, 7, 10, 0.97) 62%, rgba(7, 7, 10, 0));
  backdrop-filter: blur(12px);
}

.topbar-head h1 {
  margin-top: 3px;
  font-size: clamp(25px, 2.8vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

#page-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13.5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-bottom: 4px;
}

.server-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12px;
  max-width: 230px;
}

.server-pill strong {
  color: var(--text);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#server-pill-version {
  color: var(--dim);
  font-size: 10.5px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(73, 211, 138, 0.1);
  flex: none;
}

.view {
  padding-top: 6px;
}

.view > * + * {
  margin-top: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-2 > * {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   Avisos, painéis e estatísticas
   -------------------------------------------------------------------------- */

.admin-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 200, 87, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 200, 87, 0.065);
  color: #ffe5ab;
}

.admin-alert > .icon {
  color: var(--gold);
  margin-top: 1px;
}

.admin-alert strong {
  display: block;
  font-size: 13.5px;
}

.admin-alert p {
  margin-top: 3px;
  color: rgba(255, 229, 171, 0.78);
  font-size: 12.5px;
  line-height: 1.5;
}

.alert-close {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: rgba(255, 229, 171, 0.65);
}

.alert-close .icon {
  width: 16px;
  height: 16px;
}

.panel {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.012)),
    var(--panel);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

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

.panel-head h3 {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.panel-sub {
  margin-top: 3px;
  color: var(--dim);
  font-size: 12px;
}

.panel-copy {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 13px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 60px);
  overflow: hidden;
  padding: clamp(26px, 3.4vw, 42px);
  background:
    radial-gradient(620px 300px at 92% 18%, rgba(255, 90, 60, 0.16), transparent 70%),
    radial-gradient(420px 260px at 8% 110%, rgba(255, 71, 87, 0.1), transparent 70%),
    linear-gradient(135deg, #15141a, #0f0f14 62%);
}

.overview-hero::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -70px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 138, 61, 0.13);
  border-radius: 50%;
  pointer-events: none;
}

.overview-copy h2 {
  margin-top: 7px;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

#ov-server-meta {
  margin-top: 10px;
  font-size: 13.5px;
}

.overview-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.overview-side {
  position: relative;
  min-width: 160px;
  padding-left: clamp(20px, 3vw, 38px);
  border-left: 1px solid var(--line);
}

.mini-label {
  display: block;
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#ov-uptime {
  display: block;
  margin-top: 5px;
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 750;
  letter-spacing: -0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mini-note {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 11.5px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.012)), var(--panel);
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 90, 60, 0.18);
  color: var(--accent-2);
}

.stat-icon .icon {
  width: 20px;
  height: 20px;
}

.stat-card strong {
  display: block;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-card span {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   Scan / progresso
   -------------------------------------------------------------------------- */

.scan-snapshot {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scan-state {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.scan-dot {
  width: 9px;
  height: 9px;
  flex: none;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03);
}

.scan-dot.is-live {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.12);
  animation: pulse 1.4s ease-in-out infinite;
}

.scan-dot.is-ok { background: var(--green); box-shadow: 0 0 0 4px rgba(73, 211, 138, 0.1); }
.scan-dot.is-warn { background: var(--gold); box-shadow: 0 0 0 4px rgba(255, 200, 87, 0.1); }
.scan-dot.is-error { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 91, 110, 0.1); }
.scan-dot.is-idle { background: var(--dim); }

.scan-copy {
  min-width: 0;
}

.scan-copy strong {
  display: block;
  font-size: 13.5px;
}

.scan-copy p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.scan-path {
  display: block;
  max-width: 100%;
  margin-top: 7px;
  padding: 5px 9px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.scan-meta-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.scan-meta-item strong {
  font-size: 18px;
  line-height: 1.1;
}

.scan-meta-item span {
  color: var(--dim);
  font-size: 10.5px;
}

.scan-warning {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(255, 200, 87, 0.06);
  color: #e9c77c;
  font-size: 12px;
  line-height: 1.45;
}

.scan-warning .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.progress-track-sm {
  height: 5px;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-gradient);
  transition: width 0.45s ease;
}

.progress-bar.is-indeterminate {
  width: 34%;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(310%); }
}

.info-list {
  display: flex;
  flex-direction: column;
}

.info-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.info-list > div:first-child {
  padding-top: 2px;
}

.info-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.info-list dt {
  color: var(--dim);
  font-size: 12px;
  flex: none;
}

.info-list dd {
  min-width: 0;
  max-width: 70%;
  text-align: right;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-list dd.is-bad {
  color: #ff9ca8;
}

.info-list.compact > div {
  padding: 7px 0;
}

.info-list.compact dt,
.info-list.compact dd {
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   Endereços
   -------------------------------------------------------------------------- */

.url-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.url-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.url-iface {
  flex: none;
  max-width: 150px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-value {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #ffd2c5;
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-copy {
  width: 32px;
  height: 32px;
  flex: none;
}

.url-copy .icon {
  width: 15px;
  height: 15px;
}

.empty-inline {
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.55;
}

.warning-panel {
  border-color: rgba(255, 200, 87, 0.2);
  background: linear-gradient(180deg, rgba(255, 200, 87, 0.045), rgba(255, 200, 87, 0.01)), var(--panel);
}

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

.warning-list li {
  position: relative;
  padding-left: 18px;
  color: #e8cc8b;
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.warning-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

/* --------------------------------------------------------------------------
   Bibliotecas
   -------------------------------------------------------------------------- */

.section-head-admin {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 8px;
}

.section-head-admin h2 {
  font-size: clamp(23px, 2.4vw, 29px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-head-admin p {
  max-width: 640px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.lib-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)), var(--panel);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.lib-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.lib-card.is-offline {
  border-color: rgba(255, 193, 90, 0.26);
  background: linear-gradient(180deg, rgba(255, 193, 90, 0.045), rgba(255, 255, 255, 0.012)), var(--panel);
}

.lib-card.is-offline .lib-icon {
  border-color: rgba(255, 193, 90, 0.26);
  background: rgba(255, 193, 90, 0.09);
  color: #ffd89b;
}

.lib-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 13px;
  background: rgba(255, 138, 61, 0.09);
  border: 1px solid rgba(255, 138, 61, 0.18);
  color: var(--accent-2);
}

.lib-icon .icon {
  width: 22px;
  height: 22px;
}

.lib-main {
  min-width: 0;
  flex: 1;
}

.lib-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lib-title-row h3 {
  font-size: 15.5px;
  line-height: 1.25;
}

.lib-path {
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-meta {
  margin-top: 3px;
  color: var(--dim);
  font-size: 11px;
}

.lib-warning {
  color: #ffd89b;
}

.lib-relink {
  white-space: nowrap;
}

.lib-relink .icon {
  width: 14px;
  height: 14px;
}

.lib-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.lib-remove:hover {
  color: #ffb3bd;
  border-color: rgba(255, 91, 110, 0.35);
  background: rgba(255, 91, 110, 0.09);
}

.empty-admin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-admin-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--dim);
}

.empty-admin-icon .icon {
  width: 25px;
  height: 25px;
}

.empty-admin h3 {
  font-size: 18px;
}

.empty-admin p {
  max-width: 460px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.empty-admin .btn {
  margin-top: 18px;
}

.empty-sessions {
  margin-bottom: 0;
}

.tip-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 138, 61, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 138, 61, 0.045);
}

.tip-panel > .icon {
  margin-top: 1px;
  color: var(--accent-2);
}

.tip-panel strong {
  display: block;
  font-size: 12.5px;
}

.tip-panel p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.tip-panel code,
.bullets code,
.steps code,
.folder-empty code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* --------------------------------------------------------------------------
   Catálogo
   -------------------------------------------------------------------------- */

.btn-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.panel-ddns {
  margin-bottom: 18px;
}

.ddns-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  align-items: start;
  gap: 24px;
}

.ddns-main .field {
  margin-top: 0;
}

.ddns-result {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.ddns-result p {
  margin: 5px 0 0;
}

.ddns-result code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.ddns-result.is-ok {
  border-color: rgba(73, 211, 138, 0.28);
  background: rgba(73, 211, 138, 0.06);
}

.ddns-result.is-warn {
  border-color: rgba(255, 193, 90, 0.3);
  background: rgba(255, 193, 90, 0.06);
}

.ddns-result.is-error {
  border-color: rgba(255, 91, 110, 0.3);
  background: rgba(255, 91, 110, 0.07);
}

.ddns-switch {
  margin-top: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
}

@media (max-width: 980px) {
  .ddns-layout {
    grid-template-columns: 1fr;
  }
}

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

.bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.6;
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
}

.bullets strong {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Rede
   -------------------------------------------------------------------------- */

.notice {
  margin: 13px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.notice strong {
  display: block;
  font-size: 12.5px;
}

.notice p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.notice.is-warn {
  border-color: rgba(255, 200, 87, 0.24);
  background: rgba(255, 200, 87, 0.055);
}

.notice.is-warn strong { color: #ffe0a3; }
.notice.is-warn p { color: rgba(255, 224, 163, 0.78); }

.notice.is-ok {
  border-color: rgba(73, 211, 138, 0.22);
  background: rgba(73, 211, 138, 0.05);
}

.notice.is-ok strong { color: #b3f5cf; }
.notice.is-ok p { color: rgba(179, 245, 207, 0.75); }

.steps {
  display: flex;
  flex-direction: column;
  gap: 11px;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 32px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.55;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 138, 61, 0.28);
  background: rgba(255, 138, 61, 0.09);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 750;
}

.steps strong {
  color: var(--text);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.option-card {
  position: relative;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.option-card h4 {
  margin-top: 8px;
  font-size: 14.5px;
}

.option-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.option-card a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  color: var(--accent-2);
  font-size: 11.5px;
  font-weight: 650;
}

.option-card a .icon {
  width: 13px;
  height: 13px;
}

.option-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.option-card.warning {
  border-color: rgba(255, 91, 110, 0.16);
}

.option-card.warning .option-tag {
  background: rgba(255, 91, 110, 0.1);
  color: #ffb3bd;
}

/* --------------------------------------------------------------------------
   Formulários
   -------------------------------------------------------------------------- */

.field {
  display: block;
  margin-top: 16px;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field > span small,
.field > small,
.switch-copy small {
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}

.field > small {
  display: block;
  margin-top: 6px;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.45;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.field input::placeholder {
  color: var(--dim);
}

.field input:hover,
.field select:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(255, 138, 61, 0.55);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 3px rgba(255, 90, 60, 0.1);
}

.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
  cursor: pointer;
}

.pin-field {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pin-field input {
  flex: 1;
  min-width: 0;
}

.pin-field .icon-btn {
  flex: none;
}

.pin-field .btn {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
}

.field-hint {
  display: block;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.45;
}

.field-hint.is-ok { color: #9cecc0; }
.field-hint.is-error { color: #ffb3bd; }

.link-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.link-inline .icon {
  width: 13px;
  height: 13px;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
  margin-top: 1px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #8a8a96;
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch-row input:checked + .switch-ui {
  border-color: rgba(255, 138, 61, 0.5);
  background: linear-gradient(90deg, rgba(255, 71, 87, 0.8), rgba(255, 138, 61, 0.8));
}

.switch-row input:checked + .switch-ui::after {
  transform: translateX(18px);
  background: #fff;
}

.switch-row input:focus-visible + .switch-ui {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.switch-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.switch-copy small {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.45;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.inline-field > span:first-child {
  flex: 1;
  min-width: 170px;
  margin: 0;
}

.inline-field input {
  width: 82px;
  flex: none;
}

.inline-suffix {
  color: var(--muted);
  font-size: 12.5px;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.inline-suffix small {
  color: var(--dim);
  font-size: 10.5px;
}

.settings-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 17px 2px 0;
  border-top: 1px solid var(--line);
}

.save-note {
  color: #9cecc0;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.save-note.is-visible {
  opacity: 1;
}

.form-error {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 91, 110, 0.1);
  border: 1px solid rgba(255, 91, 110, 0.28);
  color: #ffb3bd;
  font-size: 13px;
  line-height: 1.4;
}

.settings-error {
  margin-top: 18px;
}

/* --------------------------------------------------------------------------
   Usuários
   -------------------------------------------------------------------------- */

.user-summary {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.user-stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--dim);
  font-size: 11px;
}

.user-stat strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
}

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

.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)), var(--panel);
}

.user-card.is-blocked {
  opacity: 0.68;
  border-color: rgba(255, 91, 110, 0.22);
}

.user-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.24), rgba(255, 138, 61, 0.16));
  border: 1px solid rgba(255, 138, 61, 0.2);
  color: #ffc29c;
  font-size: 16px;
  font-weight: 750;
  text-transform: uppercase;
}

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

.user-main strong {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.user-main .user-login {
  color: var(--dim);
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.user-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.user-tag {
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--dim);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-tag.is-admin {
  border-color: rgba(255, 138, 61, 0.28);
  background: rgba(255, 138, 61, 0.09);
  color: #ffc9a3;
}

.user-tag.is-ok {
  border-color: rgba(80, 220, 140, 0.24);
  background: rgba(80, 220, 140, 0.07);
  color: #9cecc0;
}

.user-tag.is-warn {
  border-color: rgba(255, 193, 90, 0.26);
  background: rgba(255, 193, 90, 0.08);
  color: #ffd89b;
}

.user-tag.is-danger {
  border-color: rgba(255, 91, 110, 0.3);
  background: rgba(255, 91, 110, 0.09);
  color: #ffb3bd;
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: none;
  max-width: 280px;
}

.user-panel {
  position: relative;
  width: min(700px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #0c0c11;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s ease both;
}

.user-form {
  padding: 0 24px 24px;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.user-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Sessões
   -------------------------------------------------------------------------- */

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.session-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)), var(--panel);
}

.session-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.24), rgba(255, 138, 61, 0.16));
  border: 1px solid rgba(255, 138, 61, 0.2);
  color: #ffc29c;
  font-size: 16px;
  font-weight: 750;
}

.session-main {
  min-width: 0;
  flex: 1;
}

.session-main strong {
  display: block;
  overflow: hidden;
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-main span {
  color: var(--dim);
}

.session-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--dim);
  font-size: 11px;
  text-align: right;
  flex: none;
}

/* --------------------------------------------------------------------------
   Rodapé
   -------------------------------------------------------------------------- */

.admin-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
}

.admin-footer a {
  color: var(--muted);
}

.admin-footer a:hover {
  color: var(--accent-2);
}

/* --------------------------------------------------------------------------
   Modal de pastas
   -------------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 6, 0.74);
  backdrop-filter: blur(8px);
}

.folder-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  height: min(88vh, 880px);
  max-height: 88vh;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #0c0c11;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s ease both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.folder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex: none;
  padding: 22px 24px 14px;
}

.folder-head h2 {
  margin-top: 3px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.modal-close-inline {
  flex: none;
}

.folder-roots {
  display: flex;
  gap: 8px;
  flex: none;
  overflow-x: auto;
  padding: 0 24px 14px;
  scrollbar-width: thin;
}

.folder-roots-empty {
  color: var(--dim);
  font-size: 12px;
  padding: 6px 0;
}

.drive-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  max-width: 250px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.drive-chip:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.drive-chip.is-active {
  border-color: rgba(255, 138, 61, 0.4);
  background: rgba(255, 138, 61, 0.08);
  color: #ffd2c5;
}

.drive-chip .icon {
  width: 17px;
  height: 17px;
  color: var(--accent-2);
}

.drive-copy {
  min-width: 0;
}

.drive-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-copy small {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 10px;
  white-space: nowrap;
}

.folder-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.folder-toolbar input {
  min-width: 0;
  flex: 1;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
}

.folder-toolbar input:focus {
  outline: none;
  border-color: rgba(255, 138, 61, 0.5);
}

.folder-toolbar .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.folder-toolbar .btn {
  min-height: 38px;
}

.folder-current {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  min-height: 38px;
  padding: 8px 24px;
  color: var(--muted);
  font-size: 12px;
}

.folder-current .icon {
  width: 16px;
  height: 16px;
  color: var(--accent-2);
}

.folder-current code {
  min-width: 0;
  overflow: hidden;
  color: #ffd2c5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-entries {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 12px 10px;
}

.folder-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 190px;
  color: var(--dim);
  font-size: 12px;
}

.folder-empty {
  padding: 46px 22px;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

.folder-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 43px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.folder-entry:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.folder-entry .icon {
  width: 17px;
  height: 17px;
  color: var(--accent-2);
}

.folder-entry-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-entry .folder-chevron {
  width: 14px;
  height: 14px;
  color: var(--dim);
}

.folder-foot {
  flex: none;
  padding: 15px 24px 19px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.folder-name-field {
  margin-top: 0;
}

.folder-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.folder-selected {
  min-width: 0;
  flex: 1;
  color: var(--dim);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-foot .form-error {
  margin-top: 11px;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 500;
  transform: translateX(-50%);
  max-width: min(92vw, 480px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(24, 24, 31, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: var(--shadow-md);
  color: #f2f2f4;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  backdrop-filter: blur(16px);
  animation: toast-in 0.24s ease both;
}

.toast.is-success {
  border-color: rgba(73, 211, 138, 0.38);
  background: rgba(18, 39, 28, 0.97);
  color: #bdf5d8;
}

.toast.is-error {
  border-color: rgba(255, 91, 110, 0.4);
  background: rgba(46, 18, 23, 0.97);
  color: #ffc2ca;
}

/* --------------------------------------------------------------------------
   Responsivo
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .admin-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 8, 12, 0.94);
    backdrop-filter: blur(14px);
  }

  .sidebar-brand {
    flex: none;
    padding: 0;
  }

  .sidebar-brand img {
    width: 32px;
    height: 32px;
  }

  .sidebar-brand > span {
    display: none;
  }

  .sidebar-label,
  .sidebar-foot {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .side-link {
    width: auto;
    min-height: 38px;
    padding: 0 11px;
    flex: none;
    font-size: 12px;
    border-radius: 9px;
  }

  .side-link.is-active::before {
    display: none;
  }

  .side-count {
    display: none;
  }

  .main {
    padding-top: 0;
  }

  .topbar {
    position: static;
    padding-top: 22px;
    background: none;
    backdrop-filter: none;
  }

  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .overview-side {
    padding-left: 0;
    padding-top: 16px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .option-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .folder-panel {
    width: 100%;
    max-height: 94vh;
  }
}

@media (max-width: 700px) {
  .main {
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 30px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 0;
  }

  .server-pill {
    max-width: 190px;
  }

  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel {
    padding: 18px;
  }

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

  .section-head-admin .btn {
    width: 100%;
  }

  .scan-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 11px;
  }

  .lib-card {
    align-items: flex-start;
  }

  .lib-icon {
    width: 40px;
    height: 40px;
  }

  .lib-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .session-card {
    flex-wrap: wrap;
  }

  .session-meta {
    width: 100%;
    flex-direction: row;
    gap: 12px;
    text-align: left;
    padding-left: 56px;
  }

  .folder-head {
    padding: 17px 16px 11px;
  }

  .folder-head h2 {
    font-size: 19px;
  }

  .folder-roots {
    padding: 0 16px 11px;
  }

  .folder-toolbar {
    padding: 10px 16px;
  }

  .folder-current {
    padding: 7px 16px;
  }

  .folder-entries {
    padding: 3px 6px 8px;
  }

  .folder-foot {
    padding: 13px 16px 15px;
  }

  .folder-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .folder-selected {
    white-space: normal;
  }

  .folder-actions .btn {
    width: 100%;
  }

  .modal {
    padding: 0;
  }

  .folder-panel {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .url-iface {
    display: none;
  }

  .admin-footer {
    margin-top: 24px;
  }
}

@media (max-width: 480px) {
  .side-link {
    padding: 0 9px;
  }

  .side-link span:not(.side-count) {
    display: none;
  }

  .side-link .icon {
    width: 19px;
    height: 19px;
  }

  .sidebar {
    gap: 8px;
  }

  .overview-pills .pill {
    font-size: 10.5px;
  }

  .url-row {
    min-height: 44px;
  }

  .pin-field {
    flex-wrap: wrap;
  }

  .pin-field input {
    flex-basis: 100%;
  }

  .grid-2 {
    gap: 14px;
  }

  .view > * + * {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
