/* ===== RESET ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #000 !important; min-height: 100%; }

:root {
  --panel: #05070c;
  --panel-2: #0a0e17;
  --border: #101828;
  --border-soft: #0a1220;
  --text: #e8edf7;
  --muted: #7b8aa5;
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --blue-bright: #93c5fd;
  --blue-glow: rgba(59, 130, 246, .55);
  --danger: #f87171;
  --success: #4ade80;
  --warning: #facc15;
  --radius: 14px;
  --sidebar-w: 230px;
  --sidebar-w-collapsed: 68px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: #000;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
code { background: rgba(59,130,246,.12); padding: .12em .4em; border-radius: 5px; font-family: ui-monospace, monospace; font-size: .85em; color: var(--blue-bright); }

.glow {
  position: fixed; top: 0; left: 0;
  width: 900px; height: 900px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle closest-side,
    rgba(96, 165, 250, .55) 0%,
    rgba(59, 130, 246, .35) 20%,
    rgba(37, 99, 235, .18) 45%,
    rgba(37, 99, 235, .06) 70%,
    rgba(0, 0, 0, 0) 100%);
  will-change: transform;
  transition: opacity .4s ease;
}
body.mouse-out .glow { opacity: 0; }

/* ===== APP ===== */
.app { display: flex; min-height: 100vh; position: relative; z-index: 2; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(5, 7, 12, .65);
  border-right: 1px solid var(--border-soft);
  padding: 1rem .85rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  backdrop-filter: blur(14px);
  transition: width .25s cubic-bezier(.2,.8,.2,1), transform .3s cubic-bezier(.2,.8,.2,1);
  z-index: 60;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .15rem .1rem .85rem;
  border-bottom: 1px solid var(--border-soft);
}

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); min-width: 0; flex: 1; }
.brand-logo {
  width: 38px !important; height: 38px !important;
  max-width: 38px !important; max-height: 38px !important;
  border: none !important; outline: none !important;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 0 10px rgba(96, 165, 250, .55));
  transition: filter .3s, transform .3s;
}
.brand:hover .brand-logo { filter: drop-shadow(0 0 16px rgba(96, 165, 250, .9)); transform: scale(1.05); }
.brand-text {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .2s;
}
.brand-text .accent { color: var(--blue-2); }

.sidebar-toggle {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(59, 130, 246, .08);
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all .15s;
}
.sidebar-toggle:hover { background: rgba(59, 130, 246, .18); border-color: rgba(96, 165, 250, .35); color: var(--blue-bright); }
.sidebar-toggle svg { width: 15px; height: 15px; }
.sidebar-toggle .ico-expand { display: none; }

body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .brand-text { opacity: 0; width: 0; }
body.sidebar-collapsed .sidebar-toggle .ico-collapse { display: none; }
body.sidebar-collapsed .sidebar-toggle .ico-expand { display: block; }
body.sidebar-collapsed .nav-item span { display: none; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: .7rem; }
body.sidebar-collapsed .sidebar-footer .stat-line { display: none; }
body.sidebar-collapsed .user-meta { display: none; }
body.sidebar-collapsed .user-info { flex-direction: column; gap: .4rem; }
body.sidebar-collapsed .sidebar-head { flex-direction: column; gap: .5rem; padding-bottom: .75rem; }
body.sidebar-collapsed .brand { justify-content: center; }

.nav { display: flex; flex-direction: column; gap: .25rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem .8rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  white-space: nowrap;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: rgba(59, 130, 246, .08); color: var(--text); }
.nav-item.active {
  background: rgba(59, 130, 246, .14);
  border-color: rgba(96, 165, 250, .35);
  color: var(--blue-bright);
  box-shadow: 0 0 20px -8px var(--blue-glow);
}
.nav-item.admin-only.active {
  background: rgba(59, 130, 246, .14);
  border-color: rgba(96, 165, 250, .35);
  color: var(--blue-bright);
  box-shadow: 0 0 20px -8px var(--blue-glow);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .75rem;
  color: var(--muted);
}
.stat-line strong { color: var(--blue-bright); font-weight: 600; margin-right: .25rem; }

.user-info {
  margin-top: .55rem;
  padding-top: .7rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: all .2s;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 0 16px -4px var(--blue-glow);
}
.user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.user-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-role {
  font-size: .65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  position: relative;
  display: inline-block;
  width: fit-content;
}
.user-role.is-admin { color: var(--blue-bright); text-shadow: 0 0 12px var(--blue-glow); }
.user-role.is-admin::before, .user-role.is-admin::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 8px var(--blue-bright), 0 0 14px var(--blue);
  opacity: 0;
  pointer-events: none;
}
.user-role.is-admin::before { right: -10px; animation: sparkleUp 2.4s ease-in-out infinite; }
.user-role.is-admin::after { right: -18px; animation: sparkleUp 3.2s ease-in-out .6s infinite; }
@keyframes sparkleUp {
  0% { transform: translateY(0) scale(.3); opacity: 0; }
  20% { opacity: 1; }
  80% { transform: translateY(-14px) scale(1); opacity: .8; }
  100% { transform: translateY(-22px) scale(.2); opacity: 0; }
}

.content { flex: 1; min-width: 0; padding: 2rem 1.75rem 3rem; max-width: 1200px; position: relative; }

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 55;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(10, 14, 23, .9);
  border: 1px solid rgba(96, 165, 250, .35);
  color: var(--blue-bright);
  cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.8), 0 0 24px -8px var(--blue-glow);
  backdrop-filter: blur(8px);
}
.mobile-menu-btn svg { width: 18px; height: 18px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
  z-index: 50;
  opacity: 0;
  transition: opacity .25s ease;
}
body.sidebar-mobile-open .sidebar-overlay { opacity: 1; }

kbd {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: .1em .45em;
  font-family: ui-monospace, monospace;
  font-size: .8em;
  color: var(--text);
  vertical-align: middle;
}

.btn {
  background: rgba(59, 130, 246, .08);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .42rem .6rem;
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: all .15s;
  font-family: inherit;
  text-decoration: none;
}
.btn svg { width: 13px; height: 13px; }
.btn:hover { background: rgba(59, 130, 246, .16); border-color: rgba(96, 165, 250, .4); }
.btn:disabled { opacity: .4; cursor: not-allowed; background: rgba(59, 130, 246, .04); }
.btn:disabled:hover { border-color: transparent; }
.btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 22px -8px var(--blue-glow);
}
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger {
  background: transparent;
  color: var(--danger);
  margin-left: auto;
  padding: .42rem .5rem;
}
.btn.danger:hover { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.25); }
a.btn { text-decoration: none; }

.icon-btn {
  width: 36px; height: 36px;
  padding: 0;
  display: grid; place-items: center;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(59, 130, 246, .08);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: rgba(59, 130, 246, .2); }
.icon-btn.tiny { width: 30px; height: 30px; }
.icon-btn.tiny svg { width: 14px; height: 14px; }

/* ===== SCREENS ===== */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.screen-head { text-align: center; margin-bottom: 2rem; padding: .5rem 0; }
.screen-head h1 { font-family: 'Cinzel', serif; font-weight: 700; font-size: clamp(1.6rem, 3.5vw, 2.3rem); line-height: 1.2; margin-bottom: .6rem; }
.screen-head p { color: var(--muted); line-height: 1.6; max-width: 640px; margin: 0 auto; font-size: .92rem; }
.screen-head p strong { color: var(--text); font-weight: 600; }

/* ===== IMAGENS ===== */
.dropzone {
  position: relative;
  border: 1.5px dashed rgba(59, 130, 246, .3);
  border-radius: 20px;
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .25s ease;
  background: rgba(0, 0, 0, .55);
  outline: none;
  overflow: hidden;
  backdrop-filter: blur(2px);
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: rgba(96, 165, 250, .65);
  background: rgba(10, 20, 40, .6);
  box-shadow: 0 0 60px -20px var(--blue-glow) inset, 0 0 40px -18px var(--blue-glow);
}
.dropzone.dragover {
  border-color: var(--blue-bright);
  background: rgba(20, 40, 80, .7);
  box-shadow: 0 0 80px -20px var(--blue-glow) inset;
}
.dropzone.uploading { pointer-events: none; }
.dz-content { position: relative; z-index: 1; transition: opacity .2s; }
.dropzone.dragover .dz-content, .dropzone.uploading .dz-content { opacity: .15; }
.dz-icon {
  width: 58px; height: 58px;
  margin: 0 auto .9rem;
  display: grid; place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(59, 130, 246, .2), rgba(29, 78, 216, .1));
  border: 1px solid rgba(96, 165, 250, .45);
  color: var(--blue-bright);
  box-shadow: 0 0 40px -10px var(--blue-glow);
}
.dz-icon svg { width: 28px; height: 28px; }
.dz-title { font-family: 'Cinzel', serif; font-size: 1.3rem; font-weight: 500; margin-bottom: .35rem; }
.dz-sub { color: var(--muted); font-size: .9rem; }
.link { background: none; border: none; color: var(--blue-bright); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; padding: 0; }
.link:hover { color: #fff; }

.badges { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-top: 1.15rem; }
.badge {
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .08em;
  padding: .28rem .55rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, .06);
  border: 1px solid rgba(59, 130, 246, .2);
  color: var(--muted);
}
.badge.hot {
  background: rgba(59, 130, 246, .18);
  border-color: rgba(96, 165, 250, .6);
  color: var(--blue-bright);
  box-shadow: 0 0 16px -4px var(--blue-glow);
}

.dz-overlay {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(6px);
  z-index: 2;
}
.dropzone.dragover .dz-overlay { display: flex; }
.dz-overlay-inner {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  color: var(--blue-bright);
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  letter-spacing: .04em;
}
.dz-overlay-inner svg { width: 38px; height: 38px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.dz-spinner {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(6px);
  z-index: 3;
  color: var(--muted);
  font-size: .88rem;
}
.dropzone.uploading .dz-spinner { display: flex; }
.dz-spinner .ring {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(59, 130, 246, .15);
  border-top-color: var(--blue-bright);
  border-right-color: var(--blue);
  animation: spin .9s linear infinite;
  box-shadow: 0 0 24px -4px var(--blue-glow);
}
@keyframes spin { to { transform: rotate(360deg); } }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-top: 2rem; }
.empty { text-align: center; padding: 3rem 1rem 1rem; color: var(--muted); font-size: .88rem; font-style: italic; }
.empty.hidden { display: none; }

.card {
  background: linear-gradient(180deg, rgba(10, 14, 23, .85), rgba(0, 0, 0, .9));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  animation: cardIn .35s cubic-bezier(.2,.8,.2,1);
  backdrop-filter: blur(4px);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.card:hover { transform: translateY(-3px); border-color: rgba(96, 165, 250, .5); box-shadow: 0 12px 46px -14px var(--blue-glow); }

.thumb {
  position: relative;
  background: repeating-conic-gradient(#050a14 0% 25%, #000 0% 50%) 50% / 16px 16px;
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; transition: transform .3s; }
.card:hover .thumb img { transform: scale(1.03); }
.badge-type {
  position: absolute;
  top: .5rem; left: .5rem;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .1em;
  padding: .25rem .5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, .85);
  border: 1px solid rgba(96, 165, 250, .4);
  color: var(--blue-bright);
  text-transform: uppercase;
}
.meta { padding: .7rem .85rem .55rem; display: flex; flex-direction: column; gap: .15rem; font-size: .78rem; }
.name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--text); }
.size { color: var(--muted); font-size: .72rem; }
.actions { display: flex; gap: .35rem; padding: .55rem .7rem .7rem; border-top: 1px solid var(--border-soft); align-items: center; }

/* ===== PDF ===== */
.pdf-toolbar {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .65rem .8rem;
  background: rgba(10, 14, 23, .8);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
  position: sticky;
  top: 1rem;
  z-index: 5;
  margin-bottom: 1.5rem;
}
.pdf-toolbar .btn { padding: .5rem .8rem; font-size: .78rem; }
.pdf-toolbar .btn.danger { margin-left: 0; }
.pdf-zoom {
  display: flex; align-items: center; gap: .3rem;
  background: rgba(59, 130, 246, .06);
  border: 1px solid rgba(59, 130, 246, .2);
  border-radius: 10px;
  padding: .2rem .35rem;
  margin-left: auto;
}
.pdf-zoom span { font-size: .75rem; color: var(--blue-bright); min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.pdf-zoom .btn { padding: .3rem .55rem; font-size: .85rem; }
.pdf-color {
  background: rgba(59, 130, 246, .06);
  border: 1px solid rgba(59, 130, 246, .25);
  color: var(--text);
  border-radius: 8px;
  padding: 0;
  width: 34px; height: 32px;
  cursor: pointer;
}
.pdf-color::-webkit-color-swatch-wrapper { padding: 2px; }
.pdf-color::-webkit-color-swatch { border: none; border-radius: 5px; }
.pdf-color::-moz-color-swatch { border: none; border-radius: 5px; }
.pdf-divider { width: 1px; height: 22px; background: rgba(96, 165, 250, .2); margin: 0 .15rem; }

.pdf-drop {
  border: 1.5px dashed rgba(59, 130, 246, .3);
  border-radius: 20px;
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, .55);
  transition: all .25s ease;
  margin-bottom: 1.5rem;
}
.pdf-drop:hover, .pdf-drop.dragover {
  border-color: var(--blue-bright);
  background: rgba(20, 40, 80, .5);
  box-shadow: 0 0 60px -20px var(--blue-glow) inset;
}
.pdf-drop.hidden { display: none; }

.pdf-pages { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; padding: .5rem 0; }
.pdf-pages:empty { display: none; }

.pdf-page {
  position: relative;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  max-width: 100%;
  box-shadow: 0 20px 60px -12px rgba(0, 0, 0, .8), 0 0 0 1px rgba(96, 165, 250, .15), 0 0 60px -20px var(--blue-glow);
}
.pdf-page canvas { display: block; image-rendering: -webkit-optimize-contrast; }

.pdf-text-layer { position: absolute; inset: 0; pointer-events: auto; overflow: hidden; background: transparent; }

.pdf-text-item {
  position: absolute;
  pointer-events: auto;
  color: transparent;
  background: transparent;
  cursor: text;
  white-space: pre;
  font-family: Arial, Helvetica, sans-serif;
  outline: none;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0;
  margin: 0;
  caret-color: var(--blue);
  transition: background .12s, color .12s, outline-color .12s;
  z-index: 1;
}
.pdf-text-item:hover { background: rgba(59, 130, 246, .12); outline-color: rgba(96, 165, 250, .5); }
.pdf-text-item:focus {
  background: rgba(255, 255, 255, .96);
  color: #000;
  outline: 2px solid var(--blue-2);
  z-index: 20;
  box-shadow: 0 4px 20px -4px rgba(59, 130, 246, .55);
}
.pdf-text-item.changed { background: #ffffff !important; outline-color: rgba(250, 204, 21, .8) !important; box-shadow: 0 0 0 2px rgba(250, 204, 21, .25); }
.pdf-text-item.deleted {
  background: rgba(248, 113, 113, .18) !important;
  outline: 1px dashed rgba(248, 113, 113, .6);
  color: rgba(248, 113, 113, .9) !important;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.pdf-text-new {
  position: absolute;
  pointer-events: auto;
  background: rgba(255, 255, 255, .96);
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  white-space: pre;
  outline: 2px solid var(--blue-2);
  border-radius: 2px;
  padding: 0 2px;
  z-index: 15;
  box-shadow: 0 4px 20px -4px rgba(59, 130, 246, .55);
  caret-color: var(--blue);
  min-width: 40px;
}

.pdf-image-overlay {
  position: absolute;
  border: 1.5px solid var(--blue-2);
  box-shadow: 0 4px 20px -4px rgba(59, 130, 246, .55);
  cursor: move;
  background: rgba(255, 255, 255, .02);
  z-index: 10;
  user-select: none;
}
.pdf-image-overlay img { width: 100%; height: 100%; object-fit: fill; display: block; pointer-events: none; }
.pdf-image-overlay .pdf-image-del {
  position: absolute;
  top: -10px; right: -10px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(248,113,113,.6);
  z-index: 2;
}
.pdf-image-overlay .pdf-image-handle {
  position: absolute;
  bottom: -7px; right: -7px;
  width: 16px; height: 16px;
  background: var(--blue-2);
  border: 2px solid #fff;
  border-radius: 3px;
  cursor: nwse-resize;
  box-shadow: 0 2px 8px rgba(59,130,246,.6);
}

.pdf-image-detected {
  position: absolute;
  border: 1.5px dashed rgba(96, 165, 250, .55);
  background: rgba(59, 130, 246, .08);
  pointer-events: auto;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  z-index: 3;
  border-radius: 2px;
}
.pdf-image-detected:hover { background: rgba(59, 130, 246, .22); border-color: var(--blue-bright); }
.pdf-image-detected.selected {
  border-color: var(--blue-bright);
  border-style: solid;
  background: rgba(59, 130, 246, .18);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .3), 0 0 30px -8px var(--blue-glow);
  z-index: 4;
}
.pdf-image-detected.deleted { background: rgba(248, 113, 113, .28); border-color: var(--danger); border-style: dashed; }
.pdf-image-detected .pdf-image-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(248,113,113,.55);
  opacity: .85;
}
.pdf-image-detected .pdf-image-del:hover { opacity: 1; }
.pdf-image-detected.deleted .pdf-image-del { background: var(--success); }

.pdf-image-detected .pdf-image-resize-handle {
  position: absolute;
  bottom: -7px; right: -7px;
  width: 14px; height: 14px;
  background: var(--blue-2);
  border: 2px solid #fff;
  border-radius: 3px;
  cursor: nwse-resize;
  box-shadow: 0 2px 8px rgba(59, 130, 246, .6);
  display: none;
}
.pdf-image-detected.selected .pdf-image-resize-handle { display: block; }

.pdf-text-resize-handle {
  position: fixed;
  width: 16px; height: 16px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  border: 2px solid #fff;
  border-radius: 4px;
  cursor: nwse-resize;
  z-index: 9999;
  box-shadow: 0 2px 12px rgba(59, 130, 246, .8), 0 0 20px rgba(59, 130, 246, .5);
  display: none;
  transition: transform .12s ease;
}
.pdf-text-resize-handle:hover { transform: scale(1.2); }
.pdf-text-resize-handle::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 6px;
  border: 1px solid rgba(147, 197, 253, .4);
}

.pdf-pages.add-mode .pdf-text-layer { cursor: crosshair; }
.pdf-pages.add-mode .pdf-text-item { pointer-events: none; }
.pdf-pages.add-mode .pdf-image-detected { pointer-events: none; }
.pdf-pages.add-image-mode .pdf-text-layer { cursor: copy; }
.pdf-pages.add-image-mode .pdf-text-item,
.pdf-pages.add-image-mode .pdf-image-detected { pointer-events: none; }

/* ===== VÍDEOS ===== */
.video-warning {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1rem;
  background: rgba(250, 204, 21, .08);
  border: 1px solid rgba(250, 204, 21, .35);
  border-radius: 12px;
  color: rgba(250, 204, 21, .95);
  font-size: .82rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.video-warning svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

.video-drop {
  border: 1.5px dashed rgba(59, 130, 246, .3);
  border-radius: 20px;
  padding: 1.25rem;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color .25s, background .25s, box-shadow .25s;
  outline: none;
  margin-bottom: 1.5rem;
}
.video-drop:hover, .video-drop:focus-within {
  border-color: rgba(96, 165, 250, .65);
  background: rgba(10, 20, 40, .6);
  box-shadow: 0 0 60px -20px var(--blue-glow) inset, 0 0 40px -18px var(--blue-glow);
}
.video-drop.dragover {
  border-color: var(--blue-bright);
  background: rgba(20, 40, 80, .7);
  box-shadow: 0 0 80px -20px var(--blue-glow) inset;
}

.video-drop-input-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(0, 0, 0, .45);
  border: 1.5px solid rgba(59, 130, 246, .2);
  border-radius: 12px;
  padding: .3rem .3rem .3rem 1rem;
  transition: border-color .18s, box-shadow .18s;
}
.video-drop-input-row:focus-within {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
.video-input-icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; transition: color .18s; }
.video-input-icon svg { width: 100%; height: 100%; }
.video-input-icon.detected { color: var(--blue-bright); }

.video-input {
  flex: 1; min-width: 0;
  background: transparent;
  border: none;
  padding: .7rem .35rem;
  color: var(--text);
  font-size: .92rem;
  font-family: inherit;
  outline: none;
}
.video-input::placeholder { color: var(--muted); }

.video-drop-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr auto;
  gap: .65rem;
  align-items: end;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  margin-top: .25rem;
}
.video-go { padding: .65rem 1.25rem; font-size: .82rem; justify-content: center; height: 40px; align-self: end; }

.video-status {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: rgba(59, 130, 246, .08);
  border: 1px solid rgba(96, 165, 250, .35);
  border-radius: 12px;
  color: var(--blue-bright);
  font-size: .88rem;
  margin-bottom: 1.5rem;
  animation: fadeIn .25s ease;
}
.video-status.hidden { display: none; }
.video-status-spinner {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(96, 165, 250, .2);
  border-top-color: var(--blue-bright);
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

.video-result {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background: rgba(10, 14, 23, .85);
  border: 1px solid rgba(96, 165, 250, .45);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  margin-bottom: 1.5rem;
  animation: fadeIn .35s ease;
  flex-wrap: wrap;
}
.video-result.hidden { display: none; }
.video-result-media {
  flex: 1 1 300px;
  max-width: 460px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 180px;
  box-shadow: 0 0 40px -10px var(--blue-glow);
}
.video-result-media video, .video-result-media audio { width: 100%; max-height: 340px; display: block; }
.video-result-media.audio {
  min-height: auto;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, .12), rgba(0, 0, 0, .5));
}
.video-result-info { flex: 1 1 220px; display: flex; flex-direction: column; gap: .85rem; justify-content: center; min-width: 0; }
.video-result-info h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.video-result-meta { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.video-result-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.video-result-actions .btn { padding: .7rem 1rem; font-size: .82rem; }
.video-result-hint { font-size: .75rem; color: var(--muted); line-height: 1.4; opacity: .85; }

/* ---- cofre de videos (hospedagem) ---- */
.host-panel { margin-top: 1.5rem; }
.host-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.host-panel-head h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  margin: 0;
}
.host-panel-head h2 svg { width: 17px; height: 17px; }
.host-quota { color: var(--muted); font-size: .74rem; }
.host-hint { color: var(--muted); font-size: .78rem; margin: .5rem 0 1rem; }
.host-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 1.25rem 0 .7rem; }
.host-row .video-input { flex: 1 1 260px; }
.host-row .btn { padding: .65rem 1rem; font-size: .8rem; }
.host-row .btn svg { width: 15px; height: 15px; }
.host-file-name { color: var(--muted); font-size: .75rem; flex: 1 1 140px; word-break: break-all; }
.host-status {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .6rem 0;
  color: var(--muted);
  font-size: .78rem;
}
.host-status.hidden { display: none; }
.host-list { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.host-empty { color: var(--muted); font-size: .78rem; padding: 1rem; text-align: center; }
.host-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: .85rem;
  background: rgba(10, 14, 23, .6);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}
.host-player {
  width: 260px;
  max-width: 100%;
  border-radius: 10px;
  background: #000;
  display: block;
}
.host-info { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.host-name { color: var(--text); font-size: .82rem; font-weight: 600; word-break: break-all; }
.host-meta { color: var(--muted); font-size: .72rem; }
.host-origin {
  color: var(--muted);
  font-size: .68rem;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.host-link {
  margin-top: .3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  color: var(--blue-bright);
  background: rgba(59, 130, 246, .08);
  border: 1px solid rgba(96, 165, 250, .25);
  border-radius: 8px;
  padding: .35rem .5rem;
  word-break: break-all;
}
.host-actions { display: flex; gap: .35rem; align-self: center; }
.host-actions .btn.icon-btn { width: 30px; height: 30px; }
.host-actions .btn.icon-btn svg { width: 14px; height: 14px; }
.host-actions .btn.icon-btn:last-child { color: var(--danger); }
.host-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.video-history { display: flex; flex-direction: column; gap: .5rem; }
.video-history-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .9rem;
  background: rgba(10, 14, 23, .6);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-size: .82rem;
  animation: cardIn .3s ease;
}
.video-history-item .platform-badge {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  padding: .25rem .5rem;
  border-radius: 6px;
  background: rgba(59, 130, 246, .18);
  border: 1px solid rgba(96, 165, 250, .4);
  color: var(--blue-bright);
  text-transform: uppercase;
  flex-shrink: 0;
}
.video-history-item .hist-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.video-history-item .hist-status { font-size: .7rem; color: var(--muted); flex-shrink: 0; }
.video-history-item .hist-status.ok { color: var(--success); }
.video-history-item .hist-status.err { color: var(--danger); }

/* ===== VSELECT ===== */
.vselect {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}
.vselect-label {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.vselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  background: rgba(59, 130, 246, .06);
  border: 1.5px solid rgba(59, 130, 246, .22);
  border-radius: 10px;
  padding: 0 .75rem;
  height: 40px;
  color: var(--text);
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  text-align: left;
}
.vselect-trigger:hover { border-color: rgba(96, 165, 250, .5); background: rgba(59, 130, 246, .1); }
.vselect.open .vselect-trigger {
  border-color: var(--blue-bright);
  background: rgba(59, 130, 246, .12);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
.vselect-value {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: .55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vselect-chevron {
  width: 14px; height: 14px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .22s, color .15s;
}
.vselect.open .vselect-chevron { transform: rotate(180deg); color: var(--blue-bright); }

.vselect-menu {
  position: absolute;
  top: calc(100% + .35rem);
  left: 0; right: 0;
  background: #070c16;
  border: 1px solid rgba(96, 165, 250, .35);
  border-radius: 12px;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .95), 0 0 30px -10px var(--blue-glow);
  padding: .35rem;
  z-index: 50;
  display: none;
  flex-direction: column;
  gap: .1rem;
  max-height: 280px;
  overflow-y: auto;
  backdrop-filter: blur(14px);
}
.vselect.open .vselect-menu { display: flex; animation: vselectDrop .18s cubic-bezier(.2,.8,.2,1); }
@keyframes vselectDrop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.vselect-menu::-webkit-scrollbar { width: 6px; }
.vselect-menu::-webkit-scrollbar-track { background: transparent; }
.vselect-menu::-webkit-scrollbar-thumb { background: rgba(96, 165, 250, .3); border-radius: 3px; }

.vselect-option {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .7rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
  width: 100%;
  min-height: 36px;
}
.vselect-option:hover { background: rgba(59, 130, 246, .14); }
.vselect-option.selected { background: rgba(59, 130, 246, .2); color: var(--blue-bright); font-weight: 600; }
.vselect-option.selected::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue-bright);
  margin-left: auto;
  box-shadow: 0 0 10px var(--blue-bright);
}

.vselect-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  flex-shrink: 0;
  transition: transform .18s;
}
.vselect-logo svg { width: 100%; height: 100%; display: block; }
.vselect-option:hover .vselect-logo { transform: scale(1.08); }
.vselect-logo.tiktok { color: #fff; }
.vselect-logo.instagram { color: #E1306C; }
.vselect-logo.pinterest { color: #E60023; }
.vselect-logo.youtube { color: #FF0000; }
.vselect-logo.tumblr { color: #7BA0C9; }
.vselect-logo.twitter { color: #fff; }

.pdf-compact-vselect { flex-direction: row; align-items: center; min-width: 130px; }
.pdf-compact-vselect .vselect-trigger { height: 32px; padding: 0 .65rem; font-size: .78rem; border-radius: 8px; min-width: 130px; }
.pdf-compact-vselect[data-select="font-size"] { min-width: 70px; }
.pdf-compact-vselect[data-select="font-size"] .vselect-trigger { min-width: 70px; }
.pdf-compact-vselect .vselect-menu { min-width: 160px; max-height: 260px; }
.pdf-compact-vselect[data-select="font-size"] .vselect-menu { min-width: 80px; }

.audio-model-select {
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 260px;
}
.audio-model-select .vselect-trigger { height: 40px; font-size: .82rem; }
.audio-model-select .vselect-menu { min-width: 240px; }
.audio-model-select .vselect-opt-name { font-size: .82rem; }

/* ===== ADMIN ===== */
.admin-card {
  background: rgba(10, 14, 23, .8);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}
.admin-card-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
  font-family: 'Cinzel', serif;
}
.admin-card-title svg { width: 20px; height: 20px; color: var(--blue-bright); flex-shrink: 0; }
.admin-create-form { display: flex; flex-direction: column; gap: 1rem; }
.admin-grid { display: grid; grid-template-columns: 1.5fr 1.5fr 1fr; gap: .85rem; }
.admin-field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.admin-field > span { font-size: .72rem; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.admin-field input,
.admin-field textarea {
  background: rgba(0, 0, 0, .5);
  border: 1.5px solid rgba(59, 130, 246, .25);
  border-radius: 10px;
  padding: .7rem .85rem;
  color: var(--text);
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.admin-field input:focus,
.admin-field textarea:focus { border-color: var(--blue-bright); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }

.admin-perms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.admin-perms-label { font-size: .78rem; color: var(--muted); font-weight: 600; margin-right: .25rem; }

.perm-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .42rem .85rem .42rem .5rem;
  background: rgba(59, 130, 246, .05);
  border: 1.5px solid rgba(59, 130, 246, .18);
  border-radius: 999px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  transition: all .18s;
  user-select: none;
}
.perm-toggle:hover { border-color: rgba(96, 165, 250, .5); color: var(--text); background: rgba(59, 130, 246, .1); }
.perm-toggle input { display: none; }
.perm-toggle-box {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(96, 165, 250, .4);
  background: rgba(0, 0, 0, .4);
  display: grid; place-items: center;
  transition: all .18s;
  flex-shrink: 0;
  position: relative;
}
.perm-toggle-box::after {
  content: "";
  width: 5px; height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px) scale(0);
  transition: transform .18s cubic-bezier(.2,.8,.2,1);
  margin-top: -2px;
  opacity: 0;
}
.perm-toggle input:checked + .perm-toggle-box {
  border-color: var(--blue-bright);
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 0 14px -2px var(--blue-glow);
}
.perm-toggle input:checked + .perm-toggle-box::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); opacity: 1; }
.perm-toggle:has(input:checked) { background: rgba(59, 130, 246, .14); border-color: rgba(96, 165, 250, .55); color: var(--text); }
.perm-toggle input:disabled + .perm-toggle-box { opacity: .6; }

.admin-users-list { display: flex; flex-direction: column; gap: .75rem; }
.admin-user-row {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1rem 1.15rem;
  background: rgba(0, 0, 0, .45);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
  animation: cardIn .3s ease;
}
.admin-user-row:hover { border-color: rgba(96, 165, 250, .35); box-shadow: 0 0 30px -14px var(--blue-glow); }
.admin-user-row.is-admin { border-color: rgba(96, 165, 250, .5); background: linear-gradient(180deg, rgba(59, 130, 246, .06), rgba(0, 0, 0, .45)); }
.admin-user-row.is-admin:hover { border-color: var(--blue-bright); box-shadow: 0 0 30px -14px var(--blue-glow); }

.admin-user-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.admin-user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: .95rem;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 0 16px -4px var(--blue-glow);
}
.admin-user-row.is-admin .admin-user-avatar { background: linear-gradient(135deg, var(--blue-2), var(--blue-bright)); }
.admin-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.admin-user-name { font-size: .95rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-meta { font-size: .72rem; color: var(--muted); }

.admin-role-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: .35rem .6rem;
  border-radius: 999px;
  text-transform: uppercase;
  background: rgba(59, 130, 246, .15);
  border: 1px solid rgba(96, 165, 250, .4);
  color: var(--blue-bright);
  flex-shrink: 0;
}
.admin-role-badge.is-admin {
  background: rgba(59, 130, 246, .25);
  border-color: var(--blue-bright);
  color: var(--blue-bright);
  box-shadow: 0 0 14px -4px var(--blue-glow);
}
.admin-user-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: .75rem;
  border-top: 1px solid var(--border-soft);
}
.admin-user-actions .btn { padding: .5rem .85rem; font-size: .78rem; }
.admin-role-pick { display: flex; align-items: center; gap: .5rem; }
.admin-role-pick > span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.admin-role-vselect { width: 170px; }
.admin-role-vselect .vselect-trigger { height: 34px; font-size: .78rem; }
.admin-user-actions .btn.danger { margin-left: auto; }

/* ===== MODAIS ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.open { display: flex; animation: fadeIn .2s ease; }

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

.modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(10, 14, 23, .98), rgba(0, 0, 0, .98));
  border: 1px solid rgba(96, 165, 250, .35);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .95), 0 0 60px -20px var(--blue-glow);
  animation: modalIn .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .35rem; }
.modal-head h3 { font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.modal-sub { color: var(--muted); font-size: .85rem; margin-bottom: 1.25rem; }
.modal-sub strong { color: var(--blue-bright); font-weight: 600; }

#pass-modal-form { display: flex; flex-direction: column; gap: 1rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem; }
.modal-actions .btn { padding: .65rem 1rem; font-size: .82rem; }

.confirm-box {
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.75rem 1.5rem;
}
.confirm-icon {
  width: 58px; height: 58px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin-bottom: 1rem;
  background: rgba(248, 113, 113, .12);
  border: 1.5px solid rgba(248, 113, 113, .5);
  color: var(--danger);
  box-shadow: 0 0 30px -8px rgba(248, 113, 113, .5);
  animation: confirmPulse 2s ease-in-out infinite;
}
.confirm-icon svg { width: 28px; height: 28px; }
@keyframes confirmPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.confirm-icon.is-info {
  background: rgba(59, 130, 246, .12);
  border-color: rgba(96, 165, 250, .5);
  color: var(--blue-bright);
  box-shadow: 0 0 30px -8px var(--blue-glow);
}
.confirm-title { font-family: 'Cinzel', serif; font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: .5rem; }
.confirm-message { color: var(--muted); font-size: .88rem; line-height: 1.55; margin-bottom: 1.5rem; }
.confirm-message strong { color: var(--text); font-weight: 600; }
.confirm-actions { display: flex; gap: .6rem; width: 100%; justify-content: center; }
.confirm-actions .btn { padding: .75rem 1.25rem; font-size: .85rem; flex: 1; justify-content: center; max-width: 160px; }
.confirm-actions #confirm-ok {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 22px -8px rgba(248, 113, 113, .6);
}
.confirm-actions #confirm-ok.is-safe {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 0 22px -8px var(--blue-glow);
}

.user-details-box {
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}
.user-details-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1rem;
}
.user-details-tabs {
  display: flex;
  gap: .35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
}
.user-details-tab {
  padding: .65rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition: all .15s;
}
.user-details-tab svg { width: 15px; height: 15px; }
.user-details-tab:hover { color: var(--text); }
.user-details-tab.active { color: var(--blue-bright); border-bottom-color: var(--blue-bright); }
.tab-count {
  background: rgba(59, 130, 246, .18);
  border: 1px solid rgba(96, 165, 250, .4);
  color: var(--blue-bright);
  padding: .1rem .45rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}
.user-details-tab.active .tab-count { background: rgba(59, 130, 246, .3); border-color: var(--blue-bright); }
.user-details-content { overflow-y: auto; flex: 1; min-height: 100px; padding-right: .25rem; }
.user-details-content::-webkit-scrollbar { width: 6px; }
.user-details-content::-webkit-scrollbar-thumb { background: rgba(96, 165, 250, .3); border-radius: 3px; }

.detail-list { display: flex; flex-direction: column; gap: .55rem; }
.detail-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem .9rem;
  background: rgba(0, 0, 0, .45);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  transition: border-color .15s, background .15s;
  animation: cardIn .25s ease;
}
.detail-item:hover { border-color: rgba(96, 165, 250, .4); background: rgba(59, 130, 246, .05); }
.detail-thumb {
  width: 48px; height: 48px;
  border-radius: 8px;
  background: repeating-conic-gradient(#050a14 0% 25%, #000 0% 50%) 50% / 8px 8px;
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
}
.detail-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.detail-thumb-icon {
  width: 48px; height: 48px;
  border-radius: 8px;
  background: rgba(59, 130, 246, .1);
  border: 1px solid rgba(96, 165, 250, .25);
  display: grid; place-items: center;
  color: var(--blue-bright);
  flex-shrink: 0;
}
.detail-thumb-icon svg { width: 22px; height: 22px; }

.detail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.detail-name { font-size: .85rem; font-weight: 600; color: var(--text); word-break: break-all; line-height: 1.3; }
.detail-meta {
  font-size: .7rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  line-height: 1.5;
}
.detail-meta span { display: inline-flex; align-items: center; gap: .25rem; }
.detail-meta svg { width: 11px; height: 11px; opacity: .7; flex-shrink: 0; }
.detail-meta a {
  color: var(--blue-bright);
  text-decoration: none;
  border-bottom: 1px dotted rgba(147, 197, 253, .5);
  word-break: break-all;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-meta a:hover { color: #fff; border-bottom-color: #fff; }

.detail-actions { display: flex; gap: .3rem; flex-shrink: 0; align-self: center; }
/* seções dentro de uma aba do modal de detalhes (ex: hospedados x baixados) */
.detail-section {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1.1rem 0 .6rem;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-section:first-child { margin-top: 0; }
.detail-thumb.detail-video { width: 140px; height: 79px; background: #000; }
.detail-thumb.detail-video video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.detail-actions .btn { padding: .4rem .55rem; font-size: .7rem; }

.detail-empty { text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: .85rem; font-style: italic; }
.detail-empty svg { width: 40px; height: 40px; opacity: .3; margin-bottom: .75rem; color: var(--blue-bright); }

/* ===== ÁUDIO ===== */
.audio-workspace { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.audio-workspace.hidden { display: none; }

.audio-file-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1.15rem;
  background: rgba(10, 14, 23, .85);
  border: 1px solid rgba(96, 165, 250, .35);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}
.audio-file-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(59, 130, 246, .18), rgba(29, 78, 216, .08));
  border: 1px solid rgba(96, 165, 250, .4);
  display: grid;
  place-items: center;
  color: var(--blue-bright);
  flex-shrink: 0;
}
.audio-file-icon svg { width: 20px; height: 20px; }
.audio-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.audio-file-name { font-size: .9rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-file-meta { font-size: .75rem; color: var(--muted); }
.audio-file-card .btn.danger { margin-left: 0; }

.audio-preview {
  background: rgba(10, 14, 23, .7);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 1rem;
  backdrop-filter: blur(8px);
}
.audio-preview-media video,
.audio-preview-media audio { width: 100%; display: block; border-radius: 10px; background: #000; }
.audio-preview-media.audio { padding: .5rem 0; }

.audio-actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: flex-end; }
.audio-actions .btn { padding: .7rem 1.1rem; font-size: .82rem; height: 40px; }
.audio-actions .btn svg { width: 15px; height: 15px; }

.audio-status {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1.25rem;
  background: rgba(59, 130, 246, .08);
  border: 1px solid rgba(96, 165, 250, .35);
  border-radius: 12px;
  color: var(--blue-bright);
  font-size: .88rem;
  animation: fadeIn .25s ease;
}
.audio-status.hidden { display: none; }
.audio-status-spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(96, 165, 250, .2);
  border-top-color: var(--blue-bright);
  border-right-color: var(--blue);
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
.audio-status-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.audio-status-sub { font-size: .72rem; color: var(--muted); opacity: .85; }
.audio-status-sub:empty { display: none; }

.audio-result {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(10, 14, 23, .85);
  border: 1px solid rgba(96, 165, 250, .45);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  animation: fadeIn .35s ease;
}
.audio-result.hidden { display: none; }

.audio-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.audio-result-title { display: flex; align-items: center; gap: .55rem; font-size: .95rem; font-weight: 600; color: var(--text); }
.audio-result-title svg { width: 17px; height: 17px; color: var(--blue-bright); }
.audio-result-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.audio-result-actions .btn { padding: .5rem .8rem; font-size: .75rem; }

.audio-transcription {
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: .85rem;
  line-height: 1.7;
  color: var(--text);
  background: rgba(0, 0, 0, .5);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.audio-result-media {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .35rem;
}
.audio-result-media video,
.audio-result-media audio { width: 100%; max-height: 340px; display: block; border-radius: 8px; }

.audio-result-meta { font-size: .78rem; color: var(--muted); line-height: 1.5; }

/* ====================================================
   CARD PANEL GENÉRICO
   ==================================================== */
.card-panel {
  background: rgba(10, 14, 23, .8);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

/* ====================================================
   TOTP GENERATOR
   ==================================================== */
.totp-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.totp-form { display: flex; flex-direction: column; gap: 1rem; }
.totp-paste-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.totp-paste-row input {
  flex: 1;
  background: rgba(0, 0, 0, .5);
  border: 1.5px solid rgba(59, 130, 246, .25);
  border-radius: 10px;
  padding: .7rem .85rem;
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: .82rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.totp-paste-row input:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
.totp-paste-row .btn.icon-btn { width: 40px; height: 40px; flex-shrink: 0; }

.totp-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}
.totp-actions {
  display: flex;
  gap: .75rem;
  margin-top: .5rem;
}
.totp-actions .btn { padding: .7rem 1.1rem; font-size: .82rem; }

.totp-result {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 260px;
}
.totp-result.visible { display: flex; }
.totp-code-display {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.totp-code {
  font-family: 'Courier New', monospace;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--blue-bright);
  text-shadow: 0 0 30px var(--blue-glow);
}
.totp-progress-ring {
  position: relative;
  width: 64px;
  height: 64px;
}
.totp-progress-ring svg {
  transform: rotate(-90deg);
  width: 64px;
  height: 64px;
}
.totp-ring-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.totp-ring-progress {
  fill: none;
  stroke: var(--blue);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke .3s;
}
.totp-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
}
.totp-meta { color: var(--muted); font-size: .8rem; text-align: center; line-height: 1.5; }
.totp-result-actions { display: flex; gap: .5rem; }
.totp-result-actions .btn { padding: .65rem 1rem; font-size: .8rem; }

/* ====================================================
   OTP — ABAS INTERNAS (TOTP | QR CODE)
   ==================================================== */
.otp-tabs, .hosp-tabs {
  display: flex;
  gap: .35rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}
.otp-tab, .hosp-tab {
  padding: .7rem 1.15rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  transition: all .15s;
}
.otp-tab svg, .hosp-tab svg { width: 16px; height: 16px; }
.otp-tab:hover, .hosp-tab:hover { color: var(--text); }
.otp-tab.active, .hosp-tab.active { color: var(--blue-bright); border-bottom-color: var(--blue-bright); }
.otp-panel, .hosp-panel { display: none; }
.otp-panel.active, .hosp-panel.active { display: block; animation: fadeIn .25s ease; }

/* ====================================================
   OTP SAVED LIST (compartilhado TOTP + QR)
   ==================================================== */
.otp-saved-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(10, 14, 23, .8);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}
.otp-saved-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.otp-saved-head h2 {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.otp-saved-head h2 svg {
  width: 20px;
  height: 20px;
  color: var(--blue-bright);
  flex-shrink: 0;
}
.otp-count {
  background: rgba(59, 130, 246, .18);
  border: 1px solid rgba(96, 165, 250, .4);
  color: var(--blue-bright);
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.otp-saved-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: .85rem;
}
.otp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: .85rem;
  font-style: italic;
}

.otp-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "info code"
    "actions code";
  gap: .35rem .85rem;
  padding: .85rem 1rem;
  background: rgba(0, 0, 0, .5);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  animation: cardIn .3s ease;
  align-items: center;
}
.otp-card:hover {
  border-color: rgba(96, 165, 250, .5);
  box-shadow: 0 0 30px -12px var(--blue-glow);
  transform: translateY(-1px);
}

.otp-card-info {
  grid-area: info;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 0;
}
.otp-card-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}
.otp-card-source {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: .15rem .45rem;
  border-radius: 6px;
  background: rgba(59, 130, 246, .18);
  border: 1px solid rgba(96, 165, 250, .4);
  color: var(--blue-bright);
  text-transform: uppercase;
  flex-shrink: 0;
}
.otp-card-source.is-qr {
  background: rgba(74, 222, 128, .14);
  border-color: rgba(74, 222, 128, .5);
  color: var(--success);
}
.otp-card-issuer {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.otp-card-label {
  font-size: .72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.otp-card-meta {
  font-size: .65rem;
  color: var(--muted);
  letter-spacing: .04em;
  opacity: .85;
}

.otp-card-code-wrap {
  grid-area: code;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.otp-card-code {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--blue-bright);
  text-shadow: 0 0 20px rgba(59, 130, 246, .4);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.otp-card-progress {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.otp-card-progress svg {
  width: 42px;
  height: 42px;
  transform: rotate(-90deg);
}
.otp-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 4;
}
.otp-ring-fg {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke .3s;
}
.otp-card-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.otp-card-actions {
  grid-area: actions;
  display: flex;
  gap: .35rem;
  align-items: center;
}
.otp-card-actions .btn.icon-btn { width: 28px; height: 28px; }
.otp-card-actions .btn.icon-btn svg { width: 13px; height: 13px; }
.otp-card-actions .btn.icon-btn:last-child { color: var(--danger); }
.otp-card-actions .btn.icon-btn:last-child:hover { background: rgba(248,113,113,.14); }

/* ====================================================
   QR CODE READER
   ==================================================== */
.qr-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.qr-scan-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.qr-reader {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-reader video { border-radius: 12px; max-width: 100%; display: block; }
.qr-controls {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.qr-controls .btn { padding: .65rem 1rem; font-size: .8rem; }
.qr-controls .btn svg { width: 15px; height: 15px; }
.qr-hint {
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}
.qr-result-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 300px;
}
.qr-result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  color: var(--muted);
  text-align: center;
  padding: 3rem 0;
  flex: 1;
}
.qr-result-empty svg { width: 48px; height: 48px; opacity: .5; }
.qr-result-empty.hidden { display: none; }
.qr-result-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.qr-result-content.hidden { display: none; }
.qr-code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.qr-totp-code {
  font-family: 'Courier New', monospace;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--blue-bright);
  text-shadow: 0 0 30px var(--blue-glow);
  font-variant-numeric: tabular-nums;
}
.qr-totp-countdown {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.qr-issuer {
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  word-break: break-word;
}
.qr-meta {
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
  line-height: 1.5;
}
.qr-actions {
  display: flex;
  gap: .6rem;
  justify-content: center;
  flex-wrap: wrap;
}
.qr-actions .btn { padding: .65rem 1rem; font-size: .8rem; }
.qr-actions .btn svg { width: 14px; height: 14px; }
.qr-raw {
  margin-top: .5rem;
  width: 100%;
}
.qr-raw.hidden { display: none; }
.qr-raw-label {
  font-size: .7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.qr-raw pre {
  background: #000;
  padding: .75rem;
  border-radius: 8px;
  font-size: .75rem;
  color: var(--muted);
  word-break: break-all;
  white-space: pre-wrap;
  margin-top: .35rem;
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--border-soft);
}
/* token cru lido de um QR que não é otpauth: salvar junto da entrada */
.qr-raw-actions {
  display: flex;
  gap: .5rem;
  margin-top: .6rem;
  flex-wrap: wrap;
}
.qr-raw-actions input {
  flex: 1 1 160px;
  min-width: 0;
  background: #000;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: .6rem .8rem;
  color: var(--text);
  font-size: .8rem;
  font-family: inherit;
}
.qr-raw-actions input:focus { outline: none; border-color: rgba(96, 165, 250, .55); }
.qr-raw-actions .btn { padding: .6rem .95rem; font-size: .78rem; }
.qr-raw-actions .btn svg { width: 14px; height: 14px; }

.qr-save-token-toggle { margin-top: .85rem; }

/* token guardado junto de uma entrada TOTP */
.otp-card-token.is-extra { margin-top: .4rem; }
.d-token {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  color: var(--blue-bright);
  word-break: break-all;
}

/* token guardado (TOTP ou QR cru): resumo de uma linha só, com reticências */
.otp-card-token {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  background: rgba(59, 130, 246, .07);
  border: 1px dashed rgba(96, 165, 250, .3);
  border-radius: 999px;
  padding: .3rem .7rem;
  max-width: 100%;
}

/* ====================================================
   JSON FORMATTER
   ==================================================== */
.json-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.json-input-panel,
.json-output-panel {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.json-toolbar {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}
.json-toolbar .btn { padding: .6rem 1rem; font-size: .8rem; }
.json-status {
  font-size: .78rem;
  margin-left: auto;
  font-weight: 600;
}
.json-status.ok { color: var(--success); }
.json-status.err { color: var(--danger); }
.json-textarea,
.json-output {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: .85rem;
  padding: 1rem;
  min-height: 350px;
  resize: vertical;
  outline: none;
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.json-textarea:focus {
  border-color: rgba(96, 165, 250, .6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.json-output {
  overflow: auto;
  white-space: pre;
  margin: 0;
  max-height: 550px;
  color: var(--blue-bright);
}
.json-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.json-output-actions { display: flex; gap: .5rem; }
.btn.tiny { padding: .3rem .65rem; font-size: .72rem; }

/* ====================================================
   BASE64 TO IMAGE
   ==================================================== */
.base64-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.base64-input-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.base64-textarea {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: .82rem;
  padding: 1rem;
  min-height: 280px;
  resize: vertical;
  outline: none;
  line-height: 1.5;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.base64-textarea:focus {
  border-color: rgba(96, 165, 250, .6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.base64-actions { display: flex; gap: .75rem; }
.base64-actions .btn { padding: .65rem 1rem; font-size: .8rem; }
.base64-info {
  font-size: .78rem;
  color: var(--success);
  min-height: 1.2em;
}
.base64-preview-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.base64-preview {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow: hidden;
}
.base64-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  color: var(--muted);
}
.base64-empty.hidden { display: none; }
.base64-empty svg { width: 48px; height: 48px; opacity: .5; }
#base64-img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 8px;
}
#base64-img.hidden { display: none; }
.base64-preview-actions { display: flex; gap: .75rem; }
.base64-preview-actions.hidden { display: none; }
.base64-preview-actions .btn { padding: .65rem 1rem; font-size: .8rem; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  background: var(--panel-2);
  color: var(--text);
  padding: .8rem 1.15rem;
  border-radius: 12px;
  font-size: .85rem;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,.8), 0 0 30px -10px var(--blue-glow);
  border: 1px solid rgba(96, 165, 250, .3);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  z-index: 5000;
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #0f1a2e; border-radius: 5px; border: 2px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #1a2a44; }

/* ===== RESPONSIVO ===== */
@media (max-width: 900px) {
  .totp-layout,
  .qr-layout,
  .json-layout,
  .base64-layout { grid-template-columns: 1fr; }
  .otp-saved-list { grid-template-columns: 1fr; }
}

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

@media (max-width: 720px) {
  .content { padding: 4rem 1rem 3rem; max-width: 100%; }
  .mobile-menu-btn { display: flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 250px;
    transform: translateX(-100%);
    border-right: 1px solid var(--border-soft);
    box-shadow: 20px 0 60px -20px rgba(0,0,0,.9);
  }
  body.sidebar-mobile-open .sidebar { transform: translateX(0); }
  body.sidebar-mobile-open .sidebar-overlay { display: block; }
  body.sidebar-collapsed .sidebar { width: 250px; }
  body.sidebar-collapsed .brand-text { opacity: 1; width: auto; }
  body.sidebar-collapsed .nav-item span { display: inline; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: .65rem .8rem; }
  body.sidebar-collapsed .sidebar-footer .stat-line { display: flex; }
  body.sidebar-collapsed .user-meta { display: flex; }
  body.sidebar-collapsed .user-info { flex-direction: row; gap: .5rem; }
  body.sidebar-collapsed .sidebar-head { flex-direction: row; gap: .5rem; padding-bottom: .85rem; }
  body.sidebar-collapsed .brand { justify-content: flex-start; }
  .sidebar-toggle { display: none; }
  .video-drop-actions { grid-template-columns: 1fr 1fr; }
  .vselect[data-select="platform"] { grid-column: 1 / -1; }
  .video-go { grid-column: 1 / -1; }
  .pdf-toolbar { position: relative; top: 0; }
  .screen-head h1 { font-size: 1.45rem; }
  .dropzone { padding: 2.25rem 1rem; }
  .dz-title { font-size: 1.1rem; }
  .results { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
  .glow { width: 500px; height: 500px; }
  .admin-grid { grid-template-columns: 1fr; }
  .video-result { flex-direction: column; }
  .video-result-media { max-width: 100%; }
  .admin-user-actions { flex-wrap: wrap; }
  .admin-user-actions .btn.danger { margin-left: 0; width: 100%; justify-content: center; }
  .user-details-box { max-height: 90vh; padding: 1.25rem; }
  .audio-actions { flex-direction: column; align-items: stretch; }
  .audio-actions .btn { justify-content: center; width: 100%; }
  .audio-model-select { max-width: 100%; width: 100%; }
  .audio-result-actions { width: 100%; }
  .audio-result-actions .btn { flex: 1; justify-content: center; }
  .totp-options { grid-template-columns: 1fr 1fr; }
  .totp-code { font-size: 2.2rem; }
  .qr-totp-code { font-size: 1.8rem; }
  .totp-code-display { gap: 1rem; }
  .otp-card { grid-template-columns: 1fr; grid-template-areas: "info" "code" "actions"; }
  .otp-card-code-wrap { justify-content: space-between; width: 100%; }
  .otp-card-actions { justify-content: flex-end; }
}

@media (max-width: 480px) {
  .totp-options { grid-template-columns: 1fr; }
  .totp-code { font-size: 1.8rem; }
  .qr-totp-code { font-size: 1.5rem; }
  .totp-code-display { flex-direction: column; }
  .qr-code-display { flex-direction: column; gap: .75rem; }
  .otp-card-code { font-size: 1.2rem; }
}

@media (hover: none) { .glow { display: none; } }