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

:root {
    --bg:           #0a0a0a;
    --surface:      #141414;
    --surface2:     #1a1a1a;
    --border:       #2a2a2a;
    --text:         #e0e0e0;
    --muted:        #888;
    --accent:       #c8a86b;
    --danger:       #e05555;
    --success:      #55c87a;
    --sidebar-w:    220px;
    --topbar-h:     56px;
    --bottom-nav-h: 62px;
}

body { background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; min-height: 100vh; }

/* ── Landing ─────────────────────────────────────────────────────────────── */
.landing-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.landing-card { text-align: center; max-width: 400px; width: 100%; }
.landing-title { font-size: 2rem; color: var(--accent); margin-bottom: .5rem; }
.landing-subtitle { color: var(--muted); margin-bottom: 2rem; }
.landing-actions { display: flex; flex-direction: column; gap: 1rem; }

/* ── Botões ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .65rem 1.25rem; border-radius: 6px; font-size: .9rem; text-decoration: none; cursor: pointer; border: none; transition: opacity .15s, transform .1s; font-weight: 500; }
.btn:hover  { opacity: .85; }
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--accent); color: #000; font-weight: 700; }
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }

/* ── Auth ────────────────────────────────────────────────────────────────── */
.auth-container, .token-display-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.auth-card, .token-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 2rem; max-width: 480px; width: 100%; }
.auth-card h1, .token-card h1 { margin-bottom: 1rem; }
.field { margin-bottom: 1.25rem; }
.field label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .9rem; }
.field input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .65rem .9rem; color: var(--text); font-size: 1rem; transition: border-color .15s; }
.field input:focus { outline: none; border-color: var(--accent); }
.warning { background: #3a2a00; border: 1px solid #6a4a00; border-radius: 6px; padding: .75rem; margin-bottom: 1.25rem; color: #ffc; }
.token-box { display: flex; align-items: center; gap: .5rem; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .75rem; margin: 1rem 0; }
.token-box code { flex: 1; word-break: break-all; font-family: monospace; font-size: .9rem; }
.btn-copy { background: var(--border); border: none; color: var(--text); padding: .4rem .8rem; border-radius: 4px; cursor: pointer; font-size: .85rem; transition: background .15s; }
.btn-copy:hover { background: #3a3a3a; }
.back-link { display: inline-block; margin-top: 1rem; color: var(--muted); font-size: .9rem; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════════════════
   APP DO USUÁRIO — layout com bottom nav estilo Instagram
   ══════════════════════════════════════════════════════════════════════════ */

/* Body quando usa user_base */
body.user-app { padding-bottom: var(--bottom-nav-h, 62px); }

/* Topbar */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    height: 52px;
    background: rgba(10,10,10,.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.app-brand { font-weight: 700; font-size: 1.1rem; color: var(--accent); letter-spacing: .02em; }
.app-topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar-expiry { font-size: .78rem; color: var(--muted); }

/* Main scroll area */
.app-content { min-height: calc(100vh - 52px - var(--bottom-nav-h, 62px)); }

/* Bottom nav */
.app-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h, 62px);
    background: rgba(14,14,14,.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    /* safe area para notch/home bar no iPhone */
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    text-decoration: none;
    font-size: .68rem;
    transition: color .15s;
    padding-top: 6px;
}
.nav-tab svg { width: 22px; height: 22px; transition: transform .15s; }
.nav-tab:hover { color: var(--text); }
.nav-tab:hover svg { transform: scale(1.1); }
.nav-tab.active { color: var(--accent); }
.nav-tab.active svg { stroke: var(--accent); }

/* Badge de não lidos no ícone de Novidades */
.nav-tab-wrap {
    position: relative;
    display: inline-flex;   /* abraça só o SVG, não a largura total do tab */
    align-items: center;
    justify-content: center;
}
.nav-unread {
    display: none;
    position: absolute;
    top: -5px;
    right: -9px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: #e03;       /* vermelho — contraste alto sobre fundo escuro */
    color: #fff;
    font-size: .58rem;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    pointer-events: none;
    z-index: 1;
}
.nav-unread.visible { display: block; }

/* Media grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    padding: 1.25rem;
}
.media-item { border-radius: 8px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); transition: border-color .2s; }
.media-item:hover { border-color: #444; }
.media-viewer { position: relative; user-select: none; }
.media-viewer img   { width: 100%; display: block; pointer-events: none; }
.media-viewer video { width: 100%; display: block; position: relative; z-index: 1; }
.media-title { padding: .6rem .85rem; font-size: .82rem; color: var(--muted); }

/* Watermark */
.media-viewer::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--wm-tile, none);
    background-repeat: repeat;
    background-size: 600px 600px;
    pointer-events: none;
    z-index: 3;
}

/* Botão fullscreen do vídeo */
.video-fs-btn {
    position: absolute;
    bottom: 52px; /* acima dos controles nativos do vídeo */
    right: 8px;
    z-index: 4;
    background: rgba(0,0,0,.55);
    border: none;
    border-radius: 6px;
    color: #fff;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
    backdrop-filter: blur(4px);
}
.video-fs-btn:hover { background: rgba(0,0,0,.8); }

/* Fullscreen: vídeo ocupa tudo, watermark persiste */
.media-viewer:-webkit-full-screen { width: 100vw; height: 100vh; background: #000; }
.media-viewer:fullscreen          { width: 100vw; height: 100vh; background: #000; }
.media-viewer:-webkit-full-screen video { width: 100%; height: 100%; object-fit: contain; }
.media-viewer:fullscreen          video { width: 100%; height: 100%; object-fit: contain; }
.media-viewer:-webkit-full-screen::after { z-index: 2147483647; }
.media-viewer:fullscreen::after          { z-index: 2147483647; }

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 1rem;
    color: var(--muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: .5; }

/* ── Feed de novidades ───────────────────────────────────────────────────── */
.feed-container { max-width: 640px; margin: 0 auto; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.feed-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color .2s;
}
.feed-card:hover { border-color: #3a3a3a; }
.feed-card--pinned { border-color: rgba(200,168,107,.35); background: rgba(200,168,107,.04); }
.feed-pin-badge { font-size: .75rem; color: var(--accent); margin-bottom: .6rem; }
.feed-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }
.feed-card-title { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.feed-card-time { font-size: .75rem; color: var(--muted); flex-shrink: 0; margin-top: .15rem; }
.feed-card-body { font-size: .9rem; color: var(--muted); line-height: 1.65; }

/* ── Perfil ──────────────────────────────────────────────────────────────── */
.profile-container { max-width: 480px; margin: 0 auto; padding: 2rem 1.25rem; display: flex; flex-direction: column; gap: 1.5rem; }
.profile-avatar { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.profile-avatar-circle {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(200,168,107,.3), rgba(200,168,107,.05));
    border: 2px solid rgba(200,168,107,.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--accent);
}
.profile-name { font-size: 1.2rem; font-weight: 600; }
.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-label { font-size: .85rem; color: var(--muted); }
.profile-value { font-size: .9rem; }
.profile-section { display: flex; flex-direction: column; gap: .6rem; }
.profile-section-title { font-weight: 600; font-size: .9rem; }
.profile-section-desc  { font-size: .82rem; color: var(--muted); }
.token-display-box {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .85rem 1rem;
}
.token-display-box code {
    flex: 1;
    word-break: break-all;
    font-family: monospace;
    font-size: .82rem;
    color: var(--accent);
    line-height: 1.5;
}
.btn-copy-token {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: .3rem;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color .15s;
}
.btn-copy-token:hover { color: var(--text); }
.profile-token-warn { font-size: .78rem; color: var(--muted); }

/* ── Admin announcements form ────────────────────────────────────────────── */
.ann-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: .5rem;
}
.ann-form-card textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .65rem .9rem;
    color: var(--text);
    font-size: .9rem;
    resize: vertical;
    font-family: inherit;
    transition: border-color .15s;
}
.ann-form-card textarea:focus { outline: none; border-color: var(--accent); }
.ann-input { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .5rem .75rem; color: var(--text); font-size: .9rem; transition: border-color .15s; }
.ann-input:focus { outline: none; border-color: var(--accent); }
.field-label { font-size: .78rem; color: var(--muted); display: block; margin-bottom: .3rem; }

/* ── Plan selection ──────────────────────────────────────────────────────── */
.plan-options { display: flex; flex-direction: column; gap: .5rem; }
.plan-option { display: block; cursor: pointer; }
.plan-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.plan-option-box { display: flex; flex-direction: column; gap: .15rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 8px; transition: border-color .15s, background .15s; }
.plan-option input:checked + .plan-option-box { border-color: var(--accent); background: rgba(200,168,107,.07); }
.plan-option-box strong { color: var(--text); font-size: .95rem; }
.plan-option-box .plan-price { color: var(--accent); font-size: 1.1rem; font-weight: 600; }
.plan-option-box small { color: var(--muted); font-size: .78rem; }

/* ── Carousel ────────────────────────────────────────────────────────────── */
.media-carousel { position: relative; }
.carousel-wrap  { position: relative; overflow: hidden; border-radius: 10px; }
.carousel-track { display: flex; transition: transform .35s ease; will-change: transform; }
.carousel-slide { flex: 0 0 100%; min-width: 0; }
.carousel-slide .media-viewer { border-radius: 0; }
.carousel-btn   { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.55); border: none; color: #fff; font-size: 1.6rem; line-height: 1; padding: .3rem .6rem; border-radius: 4px; cursor: pointer; z-index: 5; transition: background .15s; }
.carousel-btn:hover { background: rgba(0,0,0,.8); }
.carousel-prev  { left: .4rem; }
.carousel-next  { right: .4rem; }
.carousel-dots  { position: absolute; bottom: .5rem; left: 50%; transform: translateX(-50%); display: flex; gap: .35rem; z-index: 5; }
.carousel-dot   { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.4); transition: background .2s; }
.carousel-dot.active { background: #fff; }

/* Legacy compat — keep old content-header in case used elsewhere */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .85rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(10,10,10,.92);
    backdrop-filter: blur(8px);
    z-index: 10;
    gap: 1rem;
}
.content-header nav { display: flex; gap: .25rem; }
.content-header nav a { color: var(--muted); text-decoration: none; padding: .45rem .9rem; border-radius: 6px; font-size: .9rem; transition: color .15s, background .15s; }
.content-header nav a:hover  { color: var(--text); background: var(--surface); }
.content-header nav a.active { color: var(--accent); background: var(--surface); }
.header-info { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.expiry { font-size: .82rem; color: var(--muted); }

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    padding: 1.5rem;
}
.media-item { border-radius: 8px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); transition: border-color .2s; }
.media-item:hover { border-color: #444; }
.media-viewer { position: relative; user-select: none; }
.media-viewer img   { width: 100%; display: block; pointer-events: none; }
.media-viewer video { width: 100%; display: block; position: relative; z-index: 1; }
.media-title { padding: .6rem .85rem; font-size: .82rem; color: var(--muted); }

/* Watermark */
.media-viewer::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--wm-tile, none);
    background-repeat: repeat;
    background-size: 600px 600px;
    pointer-events: none;
    z-index: 3;
}

/* empty state */
.empty { color: var(--muted); text-align: center; padding: 4rem 1rem; grid-column: 1/-1; }

/* cursor zoom nas fotos — aplicado via JS no .media-photo */

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,.95);
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    animation: lb-in .18s ease;
}
#lightbox.open { display: flex; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

#lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    max-width: calc(100vw - 120px);
    max-height: 100vh;
}

#lightbox-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(100vh - 80px);
    user-select: none;
}

#lightbox-img {
    width: min(90vw, 1200px);
    height: min(82vh, 900px);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
    transition: opacity .2s;
}

/* watermark sobreposta no lightbox */
#lightbox-wm {
    position: absolute;
    inset: 0;
    background-repeat: repeat;
    background-size: 600px 600px;
    pointer-events: none;
    user-select: none;
    border-radius: 4px;
}

#lightbox-caption {
    color: var(--muted);
    font-size: .85rem;
    text-align: center;
    max-width: 480px;
}

/* botões de navegação e fechar */
#lightbox-close,
#lightbox-prev,
#lightbox-next {
    background: rgba(255,255,255,.08);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}
#lightbox-close:hover,
#lightbox-prev:hover,
#lightbox-next:hover { background: rgba(255,255,255,.18); }

#lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    border-radius: 50%;
}

@media (max-width: 560px) {
    #lightbox-inner { max-width: 100vw; }
    #lightbox-prev, #lightbox-next { width: 36px; height: 36px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   ADMIN — layout base
   ══════════════════════════════════════════════════════════════════════════ */

/* Topbar mobile */
.admin-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 200;
}
.admin-topbar-title { font-weight: 600; color: var(--accent); flex: 1; }
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s, opacity .25s; }

/* Overlay mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 150;
}
.sidebar-overlay.open { display: block; }

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

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-sidebar-brand { color: var(--accent); font-weight: 700; font-size: 1.1rem; padding: 0 .5rem .5rem; border-bottom: 1px solid var(--border); }
.admin-sidebar nav { display: flex; flex-direction: column; gap: .25rem; }
.admin-sidebar nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: .88rem;
    padding: .55rem .75rem;
    border-radius: 6px;
    transition: color .15s, background .15s;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.admin-sidebar nav a:hover  { color: var(--text); background: var(--surface2); }
.admin-sidebar nav a.active { color: var(--accent); background: rgba(200,168,107,.1); }
.admin-sidebar nav a .nav-icon { font-size: 1rem; width: 18px; text-align: center; }
.admin-sidebar-footer { margin-top: auto; }

/* Main content */
.admin-main { flex: 1; padding: 2rem; min-width: 0; }
.admin-page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.admin-page-header h1 { font-size: 1.4rem; }
.admin-page-header .page-meta { font-size: .8rem; color: var(--muted); }

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.1rem 1rem;
    text-align: center;
    transition: border-color .2s;
}
.stat-card:hover { border-color: #3a3a3a; }
.stat-card--alert { border-color: var(--danger); }
.stat-value { display: block; font-size: 1.9rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label { display: block; font-size: .75rem; color: var(--muted); margin-top: .4rem; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
.log-table, .users-table, .media-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.log-table th, .log-table td,
.users-table th, .users-table td,
.media-table th, .media-table td {
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}
.log-table tr:last-child td,
.users-table tr:last-child td,
.media-table tr:last-child td { border-bottom: none; }
.log-table th, .users-table th, .media-table th { color: var(--muted); font-weight: 500; background: var(--surface2); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.log-table tbody tr:hover, .users-table tbody tr:hover { background: rgba(255,255,255,.02); }

/* row colors */
.row-error { color: var(--danger); }
.row-5xx { background: rgba(224,85,85,.08); }
.row-4xx { background: rgba(224,150,85,.06); }
.row-3xx { background: rgba(85,150,224,.06); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.badge-low      { background: #1a3a1a; color: var(--success); }
.badge-medium   { background: #3a3a1a; color: #ffd; }
.badge-high     { background: #3a1a1a; color: #fcc; }
.badge-critical { background: var(--danger); color: #fff; }
.badge-active   { background: #1a3a1a; color: var(--success); }
.badge-pending  { background: #3a3a1a; color: #ffd; }
.badge-expired  { background: #2a2a2a; color: var(--muted); }
.badge-banned   { background: var(--danger); color: #fff; }

/* Status code badges */
.badge-status { display: inline-block; padding: .15rem .45rem; border-radius: 4px; font-size: .8rem; font-weight: 700; font-family: monospace; }
.badge-status-2xx { background: #1a3a1a; color: var(--success); }
.badge-status-3xx { background: #102030; color: #7ae; }
.badge-status-4xx { background: #3a2010; color: #fca; }
.badge-status-5xx { background: #3a1010; color: #f88; }

/* HTTP method badges */
.badge-method { display: inline-block; padding: .15rem .4rem; border-radius: 3px; font-size: .75rem; font-weight: 700; font-family: monospace; }
.badge-method-get    { background: #102a10; color: #6c6; }
.badge-method-post   { background: #102030; color: #6af; }
.badge-method-put    { background: #2a2510; color: #ec9; }
.badge-method-patch  { background: #1a2010; color: #9c9; }
.badge-method-delete { background: #2a1010; color: #f77; }

/* ── Filters ─────────────────────────────────────────────────────────────── */
.log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .85rem 1rem;
}
.log-filters input,
.log-filters select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .4rem .7rem;
    color: var(--text);
    font-size: .85rem;
    transition: border-color .15s;
}
.log-filters input:focus,
.log-filters select:focus { outline: none; border-color: var(--accent); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: .4rem; margin-top: 1.25rem; flex-wrap: wrap; align-items: center; }
.page-btn {
    padding: .4rem .75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: .85rem;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}
.page-btn:hover  { border-color: var(--accent); color: var(--accent); }
.page-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(200,168,107,.1); font-weight: 600; }
.page-info { color: var(--muted); font-size: .85rem; margin-left: .5rem; }

/* ── Users table extras ──────────────────────────────────────────────────── */
.users-table .col-token { max-width: 140px; overflow: hidden; text-overflow: ellipsis; font-family: monospace; font-size: .8rem; color: var(--muted); }
.users-search { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; align-items: center; }
.users-search input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .5rem .85rem;
    color: var(--text);
    font-size: .88rem;
    flex: 1;
    min-width: 180px;
    transition: border-color .15s;
}
.users-search input:focus { outline: none; border-color: var(--accent); }
.banned-label { color: var(--danger); font-size: .8rem; }

/* ── Upload / Media ──────────────────────────────────────────────────────── */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 2.5rem 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    color: var(--muted);
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--accent); background: rgba(200,168,107,.04); color: var(--text); }
.upload-area .link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.upload-progress-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 1rem; overflow: hidden; }
.upload-progress-fill { height: 100%; background: var(--accent); width: 0; transition: width .3s; border-radius: 2px; }
.thumb-preview { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.media-table .col-title input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text);
    font-size: .85rem;
    padding: .25rem .4rem;
    width: 100%;
    min-width: 120px;
    transition: border-color .15s, background .15s;
}
.media-table .col-title input:hover { border-color: var(--border); background: var(--bg); }
.media-table .col-title input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
.toggle-visible { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.path-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monospace { font-family: monospace; }

/* ── Misc admin ──────────────────────────────────────────────────────────── */
.admin-login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.admin-login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 2rem; width: 320px; }
.btn-logout { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: .45rem .9rem; border-radius: 6px; cursor: pointer; font-size: .82rem; transition: color .15s, border-color .15s; }
.btn-logout:hover { color: var(--danger); border-color: var(--danger); }
.section-title { font-size: 1rem; font-weight: 600; color: var(--muted); margin: 2rem 0 .85rem; text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; }
.recent-logs, .security-alerts { margin-top: 2rem; }
.recent-logs h2, .security-alerts h2 { font-size: 1rem; margin-bottom: .85rem; color: var(--muted); }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVO
   ══════════════════════════════════════════════════════════════════════════ */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
    /* sidebar vira drawer */
    .admin-topbar { display: flex; }
    .sidebar-overlay { display: none; }

    .admin-layout { display: block; padding-top: var(--topbar-h); }

    .admin-sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        z-index: 180;
        transform: translateX(-100%);
        transition: transform .25s ease;
        width: 240px;
        padding-top: calc(var(--topbar-h) + 1rem);
    }
    .admin-sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }

    .admin-main { padding: 1.25rem 1rem; }

    .stats-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

    /* hide less important table cols */
    .log-table .col-hide-tablet,
    .users-table .col-hide-tablet,
    .media-table .col-hide-tablet { display: none; }
}

/* Mobile (≤ 560px) */
@media (max-width: 560px) {
    .admin-main { padding: 1rem .75rem; }

    .log-table .col-hide-mobile,
    .users-table .col-hide-mobile,
    .media-table .col-hide-mobile { display: none; }

    .log-filters { padding: .65rem .75rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 1.5rem; }

    /* content area (legacy) */
    .content-header { padding: .65rem 1rem; flex-wrap: wrap; gap: .5rem; }
    .expiry { display: none; }

    /* pagination */
    .pagination { gap: .25rem; }
    .page-btn { padding: .35rem .6rem; font-size: .8rem; }

    /* auth */
    .auth-card, .token-card { padding: 1.5rem 1.25rem; }

    /* user app */
    .media-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; padding: .5rem; }
    .media-title { font-size: .75rem; padding: .4rem .6rem; }
    .feed-container { padding: .85rem .75rem; }
    .feed-card { padding: 1rem; }
    .profile-container { padding: 1.25rem .85rem; }
    .app-topbar { padding: 0 1rem; }
}

/* Large screens */
@media (min-width: 1280px) {
    :root { --sidebar-w: 240px; }
    /* user app: no bottom nav needed, show it side by side */
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
    .feed-container { max-width: 720px; }
}

/* Very wide: bottom nav becomes a left rail */
@media (min-width: 900px) {
    body.user-app { padding-bottom: 0; padding-left: 72px; }
    .app-bottom-nav {
        flex-direction: column;
        width: 72px;
        height: 100vh;
        top: 0; left: 0; bottom: auto; right: auto;
        border-top: none;
        border-right: 1px solid var(--border);
        padding-bottom: 0;
        padding-top: 52px;
    }
    .app-topbar { left: 72px; }
    .nav-tab { padding: 1rem 0; font-size: 0; gap: 0; }
    .nav-tab svg { width: 24px; height: 24px; }
    .app-content { min-height: 100vh; }
}
