/* ============================================================
   ULTIMATE STORE — Design System "Console" v3 (dark premium)
   Deep-space + glow neon, display Space Grotesk,
   chips de código com cor semântica (Downloader = âmbar).
   ============================================================ */

:root {
    /* Paleta extraída da logo P2 PLAY: cyan -> azul -> azul profundo */
    --bg: #04080f;
    --bg-2: #071021;
    --card-solid: #0a1428;
    --card-grad: linear-gradient(180deg, #0d1830 0%, #091224 100%);
    --card-2: #101c38;
    --border: rgba(120, 170, 255, 0.1);
    --border-strong: rgba(120, 170, 255, 0.22);
    --text: #eef3fa;
    --muted: #8fa3bd;
    --accent: #008afe;
    --accent-2: #06e3f7;
    --accent-3: #0156fd;
    --gradient: linear-gradient(120deg, #06e3f7 0%, #008afe 52%, #0156fd 100%);
    --glow: 0 0 44px rgba(0, 138, 254, 0.25);
    --amber: #f5a623;
    --warning: #ffd166;
    --danger: #f0516e;
    --danger-dark: #c93a55;
    --success: #2ee6a8;
    --radius: 18px;
    --radius-sm: 11px;
    --shadow: 0 20px 55px rgba(1, 5, 12, 0.65);
    --shadow-sm: 0 6px 22px rgba(1, 5, 12, 0.5);
    --sidebar-w: 252px;
    --sidebar-w-collapsed: 72px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Code', Consolas, monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
}

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

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text);
}

::selection {
    background: rgba(0, 138, 254, 0.5);
    color: #fff;
}

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

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

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #232c44;
    border-radius: 999px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: #2f3a5a;
}

/* ---------- Botões ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--card-2);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.2s, border-color 0.2s, box-shadow 0.25s;
    white-space: nowrap;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

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

.btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 24px rgba(0, 138, 254, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 8px 34px rgba(6, 227, 247, 0.4);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.btn-primary:hover::after {
    left: 130%;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--accent-2);
    background: rgba(6, 227, 247, 0.07);
}

.btn-sm {
    padding: 7px 13px;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
}

.btn[disabled] {
    opacity: 0.35;
    pointer-events: none;
}

/* Botão de ícone (QR, copiar link) */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    flex: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.18s;
}

.icon-btn:hover {
    color: var(--accent-2);
    border-color: var(--accent-2);
    background: rgba(6, 227, 247, 0.08);
    transform: translateY(-2px);
}

.icon-btn svg {
    width: 17px;
    height: 17px;
}

/* ---------- Formulários ---------- */
.field {
    margin-bottom: 18px;
    text-align: left;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
}

.field .hint {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--muted);
}

.input,
.field input[type="text"],
.field input[type="password"],
.field input[type="url"],
.field input[type="number"],
.field input[type="datetime-local"],
.field input[type="file"],
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(6, 9, 16, 0.7);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: rgba(148, 163, 255, 0.35);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 138, 254, 0.18);
    background: rgba(6, 9, 16, 0.95);
    outline: none;
}

.field textarea {
    resize: vertical;
    min-height: 84px;
}

.field input[type="file"] {
    padding: 10px;
}

.field input[type="file"]::file-selector-button {
    background: var(--card-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: 8px;
    padding: 7px 12px;
    margin-right: 10px;
    font-family: var(--font);
    font-size: 0.82rem;
    cursor: pointer;
}

.field-error {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--danger);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

/* ---------- Alertas ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex: none;
    margin-top: 1px;
}

.alert-success {
    background: rgba(46, 230, 168, 0.09);
    border-color: rgba(46, 230, 168, 0.3);
    color: #8df5d2;
}

.alert-error {
    background: rgba(240, 81, 110, 0.09);
    border-color: rgba(240, 81, 110, 0.3);
    color: #ffb3c1;
}

.alert-info {
    background: rgba(0, 138, 254, 0.09);
    border-color: rgba(0, 138, 254, 0.3);
    color: #b8d9ff;
}

/* ---------- Toasts ---------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(370px, calc(100vw - 48px));
}

.toast {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 17px;
    background: rgba(24, 32, 54, 0.94);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent-2);
    border-radius: 13px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    font-size: 0.9rem;
    animation: toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-info    { border-left-color: var(--accent-2); }

.toast svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.toast.toast-success svg { color: var(--success); }
.toast.toast-error svg   { color: var(--danger); }
.toast.toast-info svg    { color: var(--accent-2); }

.toast.hide {
    animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(10px) scale(0.97); }
}

/* ---------- Modal ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(3, 5, 9, 0.78);
    backdrop-filter: blur(6px);
    padding: 20px;
    overflow-y: auto;
}

.modal.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-box {
    background: var(--card-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow), var(--glow);
    width: 100%;
    max-width: 580px;
    margin: 5vh auto;
    animation: modal-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

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

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 19px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-head h2 {
    font-size: 1.15rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 7px;
    border-radius: 9px;
    line-height: 0;
    transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 17px 24px;
    border-top: 1px solid var(--border);
}

/* ---------- Sidebar (admin) ---------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: rgba(10, 14, 24, 0.94);
    backdrop-filter: blur(14px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1500;
    transition: width 0.25s ease, transform 0.25s ease;
}

.sidebar .side-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 14px;
    border-bottom: 1px solid var(--border);
}

.sidebar .side-logo {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.sidebar .side-logo img {
    max-width: 140px;
    height: auto;
    filter: drop-shadow(0 0 14px rgba(0, 138, 254, 0.35));
}

.sidebar.collapsed .side-logo {
    display: none;
}

.side-toggle {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 9px;
    border-radius: 9px;
    line-height: 0;
    transition: color 0.2s, background 0.2s;
}

.side-toggle:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
}

.side-toggle svg {
    width: 20px;
    height: 20px;
}

.sidebar nav {
    overflow-y: auto;
    flex: 1;
    padding: 12px 10px;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav > ul > li {
    margin-bottom: 2px;
}

.sidebar nav a,
.sidebar .submenu-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.sidebar nav a:hover,
.sidebar .submenu-toggle:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.sidebar nav a.active {
    color: #fff;
    background: linear-gradient(120deg, rgba(0, 138, 254, 0.24), rgba(6, 227, 247, 0.12));
    box-shadow: inset 0 0 0 1px rgba(0, 138, 254, 0.35), 0 0 20px rgba(0, 138, 254, 0.15);
}

.sidebar nav svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.sidebar.collapsed {
    width: var(--sidebar-w-collapsed);
}

.sidebar.collapsed .menu-text,
.sidebar.collapsed .submenu {
    display: none;
}

.sidebar.collapsed nav a,
.sidebar.collapsed .submenu-toggle {
    justify-content: center;
    padding: 12px;
}

.submenu {
    display: none;
    list-style: none;
    margin: 4px 0 4px 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border-strong);
}

.submenu.show {
    display: block;
}

.submenu a {
    font-size: 0.84rem !important;
    padding: 9px 12px !important;
}

.side-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 9, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1400;
}

/* ---------- Layout admin ---------- */
.admin-main {
    margin-left: var(--sidebar-w);
    padding: 30px;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
    background:
        radial-gradient(800px 320px at 90% -5%, rgba(0, 138, 254, 0.08), transparent 60%),
        var(--bg);
}

.sidebar.collapsed ~ .admin-main {
    margin-left: var(--sidebar-w-collapsed);
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 26px;
}

.page-head h1 {
    font-size: 1.55rem;
    font-weight: 700;
}

.page-head .sub {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 4px;
}

.panel {
    background: var(--card-grad);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow-sm);
}

.panel-narrow {
    max-width: 580px;
}

/* ---------- Tabelas ---------- */
.table-wrap {
    overflow-x: auto;
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 680px;
}

.table th,
.table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table thead th {
    background: rgba(0, 138, 254, 0.09);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.table tbody tr {
    transition: background 0.15s;
}

.table tbody tr:hover {
    background: rgba(0, 138, 254, 0.05);
}

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

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

.table td .cell-main {
    color: var(--text);
}

.table .row-actions {
    display: flex;
    gap: 7px;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(10, 14, 24, 0.55);
    border: 1px solid var(--border-strong);
    color: var(--muted);
    backdrop-filter: blur(4px);
}

.badge-success { color: #8df5d2; border-color: rgba(46, 230, 168, 0.35); }
.badge-danger  { color: #ffb3c1; border-color: rgba(240, 81, 110, 0.35); }
.badge-accent  { color: #b8d9ff; border-color: rgba(0, 138, 254, 0.4); }
.badge-amber   { color: #ffd98a; border-color: rgba(245, 166, 35, 0.4); }

/* ---------- Paginação ---------- */
.table-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 0.85rem;
}

.results-info select {
    padding: 7px 10px;
    background: var(--card-solid);
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 35px;
    text-align: center;
    padding: 7px 11px;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--card-solid);
    transition: border-color 0.2s, color 0.2s;
}

.pagination a:hover {
    color: var(--text);
    border-color: var(--accent-2);
    text-decoration: none;
}

.pagination .active {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
    cursor: default;
    box-shadow: 0 3px 14px rgba(0, 138, 254, 0.35);
}

.pagination .disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ---------- Cards de apps (admin) ---------- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.app-card {
    background: var(--card-grad);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 17px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 11px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.25s;
}

.app-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.app-card .app-top {
    display: flex;
    gap: 13px;
    align-items: center;
}

.app-card img.app-img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--bg-2);
    border: 1px solid var(--border);
    flex: none;
}

.app-card h3 {
    font-size: 1rem;
    word-break: break-word;
}

.app-card .app-meta {
    font-size: 0.76rem;
    color: var(--muted);
    margin-top: 3px;
}

.app-card .app-desc {
    font-size: 0.85rem;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-card .app-kv {
    font-size: 0.79rem;
    color: var(--muted);
    word-break: break-all;
}

.app-card .app-kv strong {
    color: var(--text);
    font-weight: 600;
}

.app-card .app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ---------- Destaque + drag & drop (admin) ---------- */
.dnd-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    margin: -10px 0 18px;
}

.dnd-hint svg {
    width: 15px;
    height: 15px;
    opacity: 0.7;
}

.drag-handle {
    color: var(--muted);
    cursor: grab;
    padding: 4px 2px;
    line-height: 0;
    flex: none;
    touch-action: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle svg {
    width: 14px;
    height: 14px;
}

.app-card.dragging {
    opacity: 0.55;
    border-color: var(--accent);
    border-style: dashed;
    transform: scale(0.98);
}

.star-btn {
    margin-left: auto;
    flex: none;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 7px;
    border-radius: 9px;
    line-height: 0;
    transition: color 0.2s, background 0.2s, transform 0.15s;
}

.star-btn:hover {
    color: var(--warning);
    background: rgba(255, 209, 102, 0.08);
    transform: scale(1.12);
}

.star-btn.on {
    color: var(--warning);
    filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.45));
}

.star-btn svg {
    width: 19px;
    height: 19px;
}

.star-btn[disabled] {
    opacity: 0.5;
    pointer-events: none;
}

.app-card.is-featured {
    border-color: rgba(255, 209, 102, 0.4);
    box-shadow: var(--shadow-sm), 0 0 22px rgba(255, 209, 102, 0.08);
}

/* Checkbox de destaque no modal */
.check-featured {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    background: rgba(6, 9, 16, 0.55);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.check-featured:hover {
    border-color: rgba(255, 209, 102, 0.45);
}

.check-featured input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-featured .check-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    color: var(--muted);
    transition: all 0.2s;
}

.check-featured .check-star svg {
    width: 17px;
    height: 17px;
}

.check-featured input:checked ~ .check-star {
    background: rgba(255, 209, 102, 0.14);
    border-color: var(--warning);
    color: var(--warning);
    box-shadow: 0 0 14px rgba(255, 209, 102, 0.25);
}

.check-featured input:checked ~ .check-star svg {
    fill: currentColor;
}

.check-featured strong {
    display: block;
    font-size: 0.9rem;
}

.check-featured small {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    margin-top: 2px;
}

.check-featured input:focus-visible ~ .check-star {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

/* ---------- Stats (dashboard) ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

.stat-card {
    position: relative;
    background: var(--card-grad);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
    opacity: 0.7;
}

.stat-card .stat-label {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-top: 7px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.chart-row {
    display: grid;
    grid-template-columns: minmax(90px, 170px) 1fr auto;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.chart-row .chart-name {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.chart-row .chart-track {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
}

.chart-row .chart-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 999px;
    min-width: 3px;
    box-shadow: 0 0 12px rgba(6, 227, 247, 0.5);
    transition: width 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.chart-row .chart-val {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
}

/* ============================================================
   LOJA PÚBLICA
   ============================================================ */

.store-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
        radial-gradient(1000px 500px at 85% -10%, rgba(0, 138, 254, 0.18), transparent 60%),
        radial-gradient(800px 450px at -5% 5%, rgba(6, 227, 247, 0.11), transparent 55%),
        radial-gradient(600px 600px at 50% 110%, rgba(0, 138, 254, 0.08), transparent 60%),
        var(--bg);
}

.store-body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 255, 0.03) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
    z-index: 0;
}

.store-body > * {
    position: relative;
    z-index: 1;
}

/* Header de vidro */
.store-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(6, 9, 16, 0.72);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}

.store-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 13px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.store-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.store-brand img {
    height: 46px;
    width: auto;
    filter: drop-shadow(0 0 14px rgba(0, 138, 254, 0.4));
}

.store-search {
    flex: 1;
    min-width: 210px;
    max-width: 460px;
    margin-left: auto;
    position: relative;
}

.store-search svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
}

.store-search input {
    width: 100%;
    padding: 11px 16px 11px 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.store-search input::placeholder {
    color: var(--muted);
}

.store-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 138, 254, 0.16), 0 0 24px rgba(0, 138, 254, 0.15);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

/* Hero */
.store-hero {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px 22px 14px;
    text-align: center;
}

.hero-orb {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    height: 320px;
    background: radial-gradient(ellipse at center, rgba(0, 138, 254, 0.22), transparent 65%);
    filter: blur(30px);
    pointer-events: none;
}

.store-hero .hero-kicker {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 17px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(0, 138, 254, 0.09);
    color: #b9c0d8;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.store-hero .hero-kicker .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse-dot 2.2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.store-hero h2 {
    position: relative;
    font-size: clamp(2.1rem, 5.5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
}

.store-hero h2 .grad {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.store-hero .hero-sub {
    position: relative;
    color: var(--muted);
    margin: 16px auto 0;
    max-width: 560px;
    font-size: 1rem;
}

.hero-stats {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 34px;
    flex-wrap: wrap;
}

.hero-stats .hstat b {
    display: block;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stats .hstat span {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.hero-stats .hstat-div {
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, transparent, var(--border-strong), transparent);
}

/* Grid de apps */
.store-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 22px 50px;
}

.store-count {
    color: var(--muted);
    font-size: 0.84rem;
    margin-bottom: 18px;
    letter-spacing: 0.02em;
}

.store-section + .store-section {
    margin-top: 44px;
}

.store-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.store-section-head .section-bar {
    display: inline-block;
    width: 4px;
    height: 24px;
    border-radius: 999px;
    background: var(--gradient);
    box-shadow: 0 0 14px rgba(0, 138, 254, 0.5);
}

.store-section-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.25rem;
    font-weight: 700;
}

.store-section-head h2 svg {
    width: 20px;
    height: 20px;
    color: var(--warning);
    filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.5));
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Destaques: cards maiores */
.store-grid-featured {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

.app-tile {
    background: var(--card-grad);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.3s;
    animation: tile-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}

.app-tile:nth-child(1) { animation-delay: 0.03s; }
.app-tile:nth-child(2) { animation-delay: 0.06s; }
.app-tile:nth-child(3) { animation-delay: 0.09s; }
.app-tile:nth-child(4) { animation-delay: 0.12s; }
.app-tile:nth-child(5) { animation-delay: 0.15s; }
.app-tile:nth-child(6) { animation-delay: 0.18s; }
.app-tile:nth-child(n+7) { animation-delay: 0.21s; }

@keyframes tile-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

.app-tile:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 138, 254, 0.45);
    box-shadow: var(--shadow), 0 0 50px rgba(0, 138, 254, 0.15);
}

/* Card em destaque: anel de gradiente + badge estrela */
.app-tile.is-featured {
    border: 1px solid transparent;
    background:
        linear-gradient(#0d1830, #091224) padding-box,
        var(--gradient) border-box;
    box-shadow: var(--shadow-sm), 0 0 34px rgba(0, 138, 254, 0.2);
}

.app-tile.is-featured:hover {
    border-color: transparent;
    box-shadow: var(--shadow), 0 0 55px rgba(6, 227, 247, 0.28);
}

.app-tile .tile-star {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(6, 9, 16, 0.75);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 209, 102, 0.45);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--warning);
}

.app-tile .tile-star svg {
    width: 12px;
    height: 12px;
}

/* Imagem estilo pôster com título sobreposto */
.app-tile .tile-img {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-2);
    overflow: hidden;
}

.app-tile .tile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.app-tile:hover .tile-img img {
    transform: scale(1.06);
}

/* Scrim: integra a imagem ao card e garante leitura do título */
.app-tile .tile-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(9, 12, 21, 0.94) 0%, rgba(9, 12, 21, 0.45) 38%, transparent 65%),
        linear-gradient(to bottom, rgba(9, 12, 21, 0.25), transparent 30%);
    pointer-events: none;
}

.app-tile .tile-version {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: rgba(6, 9, 16, 0.72);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(6, 227, 247, 0.4);
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent-2);
}

.app-tile .tile-title {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 13px;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.app-tile .tile-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.app-tile .tile-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.app-tile .tile-body {
    padding: 17px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    flex: 1;
}

.app-tile .tile-desc {
    color: var(--muted);
    font-size: 0.86rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

/* Chips de código — clique copia */
.chip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.chip-grid .chip:only-child {
    grid-column: 1 / -1;
}

.chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 10px 13px;
    background: rgba(6, 9, 16, 0.55);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    color: var(--text);
    position: relative;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.chip:hover {
    border-color: var(--chip-accent, var(--accent-2));
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 18px color-mix(in srgb, var(--chip-accent, var(--accent-2)) 18%, transparent);
}

.chip .chip-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip .chip-label svg {
    width: 13px;
    height: 13px;
    color: var(--chip-accent, var(--accent-2));
}

.chip .chip-value {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    color: var(--chip-accent, var(--text));
}

.chip .copy-ic {
    position: absolute;
    top: 10px;
    right: 11px;
    width: 14px;
    height: 14px;
    color: var(--muted);
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.chip:hover .copy-ic {
    opacity: 1;
    color: var(--chip-accent, var(--accent-2));
}

.chip-downloader { --chip-accent: var(--amber); }
.chip-ntdown     { --chip-accent: var(--accent-2); }

.tile-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.tile-actions .btn-primary {
    flex: 1;
}

.qr-pop {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    padding: 16px;
    background: rgba(6, 9, 16, 0.55);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    animation: tile-in 0.3s ease;
}

.qr-pop.open {
    display: flex;
}

.qr-pop .qr-box {
    background: #fff;
    padding: 11px;
    border-radius: 12px;
    line-height: 0;
    box-shadow: 0 0 30px rgba(6, 227, 247, 0.2);
}

.qr-pop .qr-box img,
.qr-pop .qr-box canvas {
    display: block;
}

.qr-pop p {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

.store-empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--muted);
}

.store-empty svg {
    width: 46px;
    height: 46px;
    margin-bottom: 14px;
    opacity: 0.45;
}

/* Seção Como instalar */
.howto {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 22px 66px;
}

.section-head {
    text-align: center;
    margin-bottom: 32px;
}

.section-head .section-bar {
    display: inline-block;
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: var(--gradient);
    margin-bottom: 16px;
    box-shadow: 0 0 16px rgba(0, 138, 254, 0.5);
}

.section-head h2 {
    font-size: clamp(1.35rem, 2.8vw, 1.75rem);
}

.howto .howto-sub {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

.howto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.howto-step {
    position: relative;
    background: var(--card-grad);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.howto-step:hover {
    border-color: rgba(0, 138, 254, 0.4);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.howto-step .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--gradient);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(0, 138, 254, 0.35);
}

.howto-step h3 {
    font-size: 0.98rem;
    margin-bottom: 7px;
}

.howto-step p {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Rodapé loja */
.store-footer {
    border-top: 1px solid var(--border);
    background: rgba(10, 14, 24, 0.75);
    padding: 30px 22px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.store-footer .footer-logo {
    height: 44px;
    width: auto;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 12px rgba(0, 138, 254, 0.3));
}

.store-footer a {
    color: var(--accent-2);
    font-weight: 600;
}

/* ---------- Login ---------- */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(900px 450px at 80% -10%, rgba(0, 138, 254, 0.22), transparent 60%),
        radial-gradient(700px 400px at 5% 100%, rgba(6, 227, 247, 0.13), transparent 55%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 390px;
    background: var(--card-grad);
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    box-shadow: var(--shadow), var(--glow);
    padding: 36px 30px;
    animation: tile-in 0.45s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.login-card .login-logo {
    display: block;
    margin: 0 auto 22px;
    max-width: 220px;
    filter: drop-shadow(0 0 20px rgba(0, 138, 254, 0.45));
}

.login-card h1 {
    font-size: 1.35rem;
    text-align: center;
    margin-bottom: 5px;
}

.login-card .login-sub {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

/* ---------- Páginas de status ---------- */
.status-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    background:
        radial-gradient(800px 400px at 50% -10%, rgba(0, 138, 254, 0.15), transparent 60%),
        var(--bg);
}

.status-card {
    max-width: 430px;
    width: 100%;
    background: var(--card-grad);
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    padding: 40px 30px;
    box-shadow: var(--shadow);
    animation: tile-in 0.4s ease;
}

.status-card .status-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 138, 254, 0.12);
    border: 1px solid rgba(0, 138, 254, 0.3);
    color: var(--accent);
    box-shadow: 0 0 30px rgba(0, 138, 254, 0.2);
}

.status-card .status-icon svg {
    width: 27px;
    height: 27px;
}

.status-card h1 {
    font-size: 1.4rem;
    margin-bottom: 9px;
}

.status-card p {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 22px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-w) !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar.mobile-open .side-logo,
    .sidebar.mobile-open .menu-text {
        display: block;
    }

    .side-overlay.show {
        display: block;
    }

    .admin-main,
    .sidebar.collapsed ~ .admin-main {
        margin-left: 0;
        padding: 18px;
    }

    .mobile-topbar {
        display: flex !important;
    }
}

.mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.mobile-topbar .side-toggle {
    border: 1px solid var(--border-strong);
}

.mobile-topbar .topbar-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.02rem;
}

@media (max-width: 560px) {
    .store-header-inner {
        gap: 10px;
    }

    .store-search {
        min-width: 100%;
        order: 3;
    }

    .store-hero {
        padding-top: 44px;
    }

    .hero-stats {
        gap: 18px;
    }

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

    .tile-actions {
        flex-wrap: wrap;
    }

    .modal-foot {
        flex-direction: column-reverse;
    }

    .modal-foot .btn {
        width: 100%;
    }

    .chart-row {
        grid-template-columns: minmax(70px, 105px) 1fr auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
}
