:root {
    --bg: #090305;
    --bg-soft: #110609;
    --panel: #100407;
    --panel-2: #18080c;
    --card: #16090d;
    --card-2: #1d0b10;
    --text: #f6e9ec;
    --muted: #b899a1;
    --line: #3a1720;
    --line-soft: #2a1016;
    --accent: #8f1028;
    --accent-strong: #bd1738;
    --accent-bright: #e12a4d;
    --success: #24976a;
    --danger: #c92542;
    --warning: #b97625;
    --shadow: 0 24px 70px rgba(0,0,0,.38);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 82% 5%, rgba(143,16,40,.14), transparent 26%),
        linear-gradient(145deg, #090305 0%, #0d0407 45%, #070203 100%);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
code { color: #f0a2b1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }

.shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 278px;
    min-width: 278px;
    background:
        linear-gradient(180deg, rgba(143,16,40,.12), transparent 24%),
        var(--panel);
    border-right: 1px solid var(--line-soft);
    padding: 26px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 50;
}
.brand { display:flex; align-items:center; gap:13px; padding: 2px 6px 24px; }
.brand-mark, .login-mark {
    width: 48px; height: 48px; border-radius: 15px; display:grid; place-items:center;
    background: linear-gradient(135deg, #6f0b1d, #ca1b3f);
    border: 1px solid rgba(255,110,137,.2);
    box-shadow: 0 12px 34px rgba(143,16,40,.28);
    font-weight: 900; color: #fff;
}
.brand-title { font-size: 18px; font-weight: 900; letter-spacing: -.02em; }
.brand-subtitle { color: var(--muted); font-size: 12px; margin-top: 3px; }

.user-card {
    display:flex; align-items:center; gap:11px;
    padding: 12px; margin-bottom: 20px;
    background: #17090d; border: 1px solid var(--line-soft); border-radius: 16px;
}
.user-avatar {
    width: 38px; height: 38px; border-radius: 12px; display:grid; place-items:center;
    background:#2a0e16; border:1px solid #4a1725; color:#ff8097; font-weight:900;
}
.user-card strong { display:block; font-size:13px; }
.user-card small { display:block; color:var(--muted); font-size:11px; margin-top:2px; }

.nav { display:grid; gap:7px; }
.nav a {
    display:flex; align-items:center; gap:11px;
    color:#d8bdc3; padding:12px 13px; border-radius:13px; font-weight:750; font-size:14px;
    transition:.18s ease; border:1px solid transparent;
}
.nav a span { width:20px; text-align:center; color:#c73a56; }
.nav a:hover, .nav a.active {
    color:#fff; background:#220b12; border-color:#421522; transform:translateX(2px);
}
.nav a.active { box-shadow: inset 3px 0 0 var(--accent-bright); }
.sidebar-footer {
    margin-top:auto; color:#826a70; font-size:11px; padding:14px 8px 4px;
}
.status-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:#2da879; margin-right:6px; box-shadow:0 0 0 4px rgba(45,168,121,.08); }

.content { flex:1; min-width:0; padding:34px; max-width:1480px; }
.mobile-topbar { display:none; }
.topbar { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:24px; }
h1 { margin:3px 0 0; font-size:34px; line-height:1.08; letter-spacing:-.035em; }
h2 { margin:2px 0 0; font-size:20px; letter-spacing:-.02em; }
.page-subtitle { margin:9px 0 0; color:var(--muted); font-size:14px; }
.eyebrow { color:#d94a65; font-weight:900; font-size:10px; letter-spacing:.16em; }
.role-chip, .count-chip, .test-chip {
    display:inline-flex; align-items:center; min-height:34px; padding:8px 12px; border-radius:999px;
    background:#1e0b10; border:1px solid #481622; color:#f29aaa; font-size:12px; font-weight:850;
}

.card, .stat-card {
    background: linear-gradient(180deg, rgba(255,255,255,.012), transparent), var(--card);
    border:1px solid var(--line);
    border-radius:22px;
    box-shadow:var(--shadow);
}
.card { padding:23px; margin-bottom:22px; }
.card.narrow { max-width:610px; }
.section-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:19px; }
.section-heading h2 { margin-top:4px; }

.grid { display:grid; gap:20px; }
.grid.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.grid.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.stats-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:22px; }
.stat-card { padding:20px; min-height:142px; display:flex; flex-direction:column; justify-content:center; }
.stat-card span { color:#c9aab1; font-size:12px; font-weight:750; }
.stat-card strong { display:block; font-size:31px; line-height:1; margin:12px 0 10px; letter-spacing:-.04em; }
.stat-card small { color:#896d74; font-size:11px; }
.accent-card { background:linear-gradient(145deg,#2a0a13,#17070b); border-color:#5a1928; }

label { display:block; margin:0 0 8px; color:#d7bdc3; font-size:12px; font-weight:800; }
input[type="text"], input[type="password"], input[type="url"], input[type="date"],
input[type="number"], input[type="file"], select {
    width:100%; min-height:46px; border:1px solid #431723; border-radius:13px; padding:11px 13px;
    background:#0f0508; color:var(--text); outline:none; margin-bottom:15px;
}
input::placeholder { color:#705860; }
input:focus, select:focus { border-color:#9e2039; box-shadow:0 0 0 4px rgba(158,32,57,.12); }
input[type="file"] { padding:9px; }
select option { background:#120609; color:var(--text); }
.field-help { display:block; color:#80666d; font-size:10px; margin:-9px 0 13px; }

button, .secondary, .small, .api-link {
    display:inline-flex; align-items:center; justify-content:center; gap:8px;
    border:1px solid #c62545; border-radius:13px; padding:11px 15px;
    font:inherit; font-weight:850; cursor:pointer; color:#fff;
    background:linear-gradient(135deg,#8d1028,#c51d3e); transition:.18s ease;
}
button:hover, .secondary:hover, .small:hover, .api-link:hover { filter:brightness(1.1); transform:translateY(-1px); }
.secondary { background:#211016; border-color:#4c2630; color:#e7cfd5; }
.danger { background:#6f0b1d; border-color:#9f1730; color:#ffd9df; }
.small { padding:7px 10px; border-radius:10px; font-size:11px; }
.wide { width:100%; }
.actions { display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin-top:4px; }
.checkline { display:inline-flex; align-items:center; gap:9px; margin:2px 0 16px; color:#b8979f; }
.checkline input { accent-color:#b81938; }

.alert { padding:13px 15px; border-radius:13px; margin:0 0 18px; font-weight:750; border:1px solid; font-size:13px; }
.alert.success { color:#9ee6ca; background:#0a2119; border-color:#174c39; }
.alert.error { color:#ffadb9; background:#2a0b12; border-color:#6d1d2d; }
.alert.info { color:#e7b2bc; background:#211016; border-color:#4d1d29; }

.table-wrap { overflow-x:auto; border:1px solid #32121a; border-radius:16px; background:#0f0508; }
table { width:100%; border-collapse:collapse; min-width:920px; }
th, td { padding:13px 14px; text-align:left; border-bottom:1px solid #281017; vertical-align:middle; font-size:12px; }
th { color:#9f7d85; font-size:10px; text-transform:uppercase; letter-spacing:.09em; background:#13070a; }
tr:last-child td { border-bottom:0; }
tbody tr:hover { background:#16080c; }
.right { text-align:right; }
.action-buttons { display:flex; justify-content:flex-end; align-items:center; gap:6px; flex-wrap:wrap; }
.action-buttons form { display:inline; margin:0; }

.pill { display:inline-flex; border-radius:999px; padding:5px 8px; font-size:10px; font-weight:850; border:1px solid; white-space:nowrap; }
.pill.on { color:#8be0c1; background:#092017; border-color:#18503a; }
.pill.off { color:#ff9aad; background:#290a11; border-color:#692033; }
.mini-tag { display:inline-flex; margin-left:7px; padding:3px 6px; border-radius:7px; font-size:8px; letter-spacing:.08em; background:#39101a; color:#ff7f98; border:1px solid #5d1b2a; vertical-align:middle; }
.empty { color:#8f7279; padding:24px; text-align:center; border:1px dashed #3a1720; border-radius:14px; background:#100609; }

.preview-box { height:210px; border-radius:16px; border:1px solid #3c1620; background:#0c0305; display:grid; place-items:center; overflow:hidden; margin-bottom:10px; }
.preview-box img { max-width:100%; max-height:100%; display:block; }
.background-preview img { width:100%; height:100%; object-fit:cover; }
.small-empty { margin-bottom:10px; }

.quick-test-card { position:relative; overflow:hidden; background:linear-gradient(145deg,#210b12,#120609); }
.quick-test-card::after {
    content:""; position:absolute; width:180px; height:180px; border-radius:50%; right:-70px; top:-75px;
    background:radial-gradient(circle,rgba(195,25,58,.18),transparent 68%); pointer-events:none;
}
.quick-test-card p { color:#a98a92; line-height:1.6; font-size:13px; }
.quick-test-card hr { border:0; border-top:1px solid #37131c; margin:20px 0; }

.credential-card { border-color:#6c2030; background:linear-gradient(145deg,#270c15,#14070a); }
.credential-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.credential-grid > div { padding:14px; border-radius:13px; background:#110609; border:1px solid #32121b; }
.credential-grid span { display:block; color:#92747c; font-size:10px; text-transform:uppercase; letter-spacing:.08em; margin-bottom:5px; }
.credential-grid b { color:#f5dce1; font-size:13px; word-break:break-word; }

.quick-links { display:grid; gap:10px; }
.quick-link { display:flex; align-items:center; gap:12px; padding:13px; background:#100609; border:1px solid #2d1118; border-radius:14px; transition:.18s ease; }
.quick-link:hover { background:#1b0910; border-color:#511827; transform:translateX(3px); }
.quick-icon { width:38px; height:38px; border-radius:11px; display:grid; place-items:center; background:#2b0d15; color:#f15b76; font-weight:900; }
.quick-link strong { display:block; font-size:13px; }
.quick-link small { display:block; margin-top:3px; color:#826970; font-size:10px; }
.info-stack { display:grid; gap:11px; }
.info-stack > div { display:flex; gap:11px; align-items:flex-start; padding:12px; background:#100609; border-radius:13px; border:1px solid #2a1017; }
.info-stack b { color:#ed526e; }
.info-stack span { color:#aa8991; font-size:12px; line-height:1.55; }

.login-page {
    min-height:100vh; display:grid; place-items:center; padding:24px; overflow:hidden; position:relative;
    background:
        linear-gradient(rgba(7,2,3,.78),rgba(7,2,3,.9)),
        var(--login-bg-image, none),
        radial-gradient(circle at 20% 10%,#3b0a14,transparent 34%),
        linear-gradient(145deg,#080204,#120509);
    background-size:cover; background-position:center;
}
.login-glow { position:absolute; border-radius:50%; filter:blur(8px); opacity:.28; pointer-events:none; }
.login-glow-one { width:330px; height:330px; background:#771028; left:-120px; top:-90px; }
.login-glow-two { width:420px; height:420px; background:#3c0712; right:-150px; bottom:-170px; }
.login-card {
    width:min(450px,100%); position:relative; z-index:2;
    background:linear-gradient(180deg,rgba(34,10,17,.96),rgba(15,5,8,.98));
    border:1px solid #4a1724; border-radius:26px; padding:30px; box-shadow:0 35px 100px rgba(0,0,0,.55);
}
.login-brand { display:flex; align-items:center; gap:14px; }
.login-brand span { color:#bc8d98; text-transform:uppercase; letter-spacing:.12em; font-size:9px; font-weight:900; }
.login-brand h1 { font-size:25px; margin:2px 0 0; }
.login-logo { width:58px; height:58px; border-radius:16px; background:#0d0305; border:1px solid #4b1724; display:grid; place-items:center; overflow:hidden; }
.login-logo img { width:100%; height:100%; object-fit:contain; }
.login-intro { color:#9f7d85; font-size:12px; line-height:1.6; margin:20px 0; }
.login-card label { margin-top:4px; }
.login-security { text-align:center; color:#654f55; font-size:9px; margin-top:16px; text-transform:uppercase; letter-spacing:.08em; }

.sidebar-overlay { display:none; }

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .credential-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
    .sidebar { position:fixed; left:-290px; transition:.22s ease; }
    .sidebar.open { left:0; }
    .sidebar-overlay { position:fixed; inset:0; background:rgba(0,0,0,.62); z-index:40; }
    .sidebar-overlay.show { display:block; }
    .content { padding:20px; width:100%; }
    .mobile-topbar {
        display:flex; align-items:center; gap:12px; margin-bottom:22px; padding-bottom:14px; border-bottom:1px solid #281017;
    }
    .menu-button { width:40px; height:40px; padding:0; border-radius:11px; }
    .grid.two, .grid.three { grid-template-columns:1fr; }
}
@media (max-width: 620px) {
    .content { padding:15px; }
    .topbar { display:block; }
    .topbar > .role-chip, .topbar > .count-chip { margin-top:13px; }
    h1 { font-size:28px; }
    .stats-grid, .credential-grid { grid-template-columns:1fr; }
    .card { padding:17px; border-radius:18px; }
    .action-buttons { justify-content:flex-start; }
    .login-card { padding:24px 19px; border-radius:22px; }
}

/* Dashboard melhorado */
.dashboard-hero {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    padding:26px;
    background:
        radial-gradient(circle at top right, rgba(225,42,77,.16), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,.02), transparent),
        #14070a;
}
.hero-badges { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.dashboard-blocks { margin-bottom: 22px; }
.dashboard-panel { padding:24px; }

.kpi-grid {
    display:grid;
    grid-template-columns:repeat(3, minmax(0,1fr));
    gap:16px;
    margin-bottom:22px;
}
.kpi-card {
    position:relative;
    overflow:hidden;
    padding:22px;
    border-radius:22px;
    border:1px solid #3c1620;
    background:
        linear-gradient(180deg, rgba(255,255,255,.015), transparent),
        #13070a;
    box-shadow: var(--shadow);
}
.kpi-card::after {
    content:"";
    position:absolute;
    right:-32px;
    top:-34px;
    width:120px;
    height:120px;
    border-radius:50%;
    background:radial-gradient(circle, rgba(225,42,77,.12), transparent 68%);
    pointer-events:none;
}
.kpi-primary {
    background: linear-gradient(135deg, rgba(143,16,40,.45), rgba(21,7,10,1));
    border-color:#692131;
}
.kpi-label {
    display:block;
    font-size:12px;
    color:#cdaeb6;
    font-weight:800;
    letter-spacing:.02em;
}
.kpi-card strong {
    display:block;
    margin:12px 0 8px;
    font-size:34px;
    line-height:1;
    letter-spacing:-.04em;
}
.kpi-card small { color:#8f737a; font-size:11px; }

.health-grid { display:grid; gap:14px; margin-bottom:18px; }
.health-item {
    padding:14px;
    border:1px solid #33131b;
    background:#100609;
    border-radius:16px;
}
.health-top { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px; }
.health-top span { color:#d5bcc2; font-size:12px; font-weight:700; }
.health-top b { color:#ffd2da; font-size:13px; }
.progress-track { height:10px; border-radius:999px; background:#240d13; overflow:hidden; }
.progress-fill {
    height:100%;
    border-radius:999px;
    background:linear-gradient(90deg, #8f1028, #e12a4d);
}
.summary-mini-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.summary-box {
    padding:16px;
    border-radius:16px;
    background:#100609;
    border:1px solid #2f1219;
}
.summary-box span { display:block; color:#b9969f; font-size:11px; margin-bottom:8px; font-weight:700; }
.summary-box b { display:block; font-size:24px; margin-bottom:6px; }
.summary-box small { color:#7f676f; font-size:11px; line-height:1.5; }

.action-card-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.action-card {
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:16px;
    border-radius:18px;
    border:1px solid #36141d;
    background:linear-gradient(180deg, rgba(255,255,255,.015), transparent), #100609;
    transition:.18s ease;
}
.action-card:hover {
    transform:translateY(-2px);
    border-color:#692131;
    background:#16080c;
}
.action-icon {
    width:42px;
    height:42px;
    flex:0 0 42px;
    display:grid;
    place-items:center;
    border-radius:13px;
    background:#2b0d15;
    border:1px solid #4b1824;
    font-size:18px;
}
.action-card strong { display:block; font-size:14px; margin-bottom:5px; }
.action-card small { display:block; color:#8b7279; line-height:1.5; font-size:11px; }

.compact-table table { min-width: 100%; }
.table-subinfo { color:#857076; font-size:11px; margin-top:4px; }

/* Ajustes visuais gerais */
.content {
    background: linear-gradient(180deg, rgba(255,255,255,.01), rgba(255,255,255,0));
}
.card, .stat-card, .kpi-card {
    backdrop-filter: blur(2px);
}
.quick-link strong, .action-card strong { color:#f5e6ea; }

@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns:repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
    .dashboard-hero { display:block; }
    .hero-badges { justify-content:flex-start; margin-top:14px; }
    .action-card-grid, .summary-mini-grid { grid-template-columns:1fr; }
}

@media (max-width: 620px) {
    .kpi-grid { grid-template-columns:1fr; }
    .dashboard-hero, .dashboard-panel { padding:18px; }
}

/* Correções fortes de tema escuro/vermelho */
html, body {
    background: #070203 !important;
}
body {
    background:
        radial-gradient(circle at 12% 0%, rgba(120, 10, 28, .28), transparent 22%),
        radial-gradient(circle at 100% 8%, rgba(176, 18, 46, .16), transparent 20%),
        linear-gradient(145deg, #070203 0%, #0b0305 48%, #050102 100%) !important;
    color: var(--text);
}
.shell { background: transparent; }
.content {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(255,255,255,.01), rgba(255,255,255,0)),
        transparent;
}
.sidebar {
    background:
        linear-gradient(180deg, rgba(143,16,40,.18), transparent 24%),
        #0e0407;
}
.card, .stat-card, .kpi-card, .dashboard-hero, .dashboard-panel, .entity-card, .summary-box, .health-item, .action-card {
    background-color: #120609;
}
.quick-test-card { background: linear-gradient(145deg,#1a080d,#100406); }
.table-wrap, .credential-grid > div, .summary-box, .health-item, .entity-meta-grid > div { background-color:#0d0406; }

/* Listagem em cards */
.compact-kpi-grid { margin-bottom: 22px; }
.entity-grid {
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:16px;
}
.entity-card {
    border:1px solid #3c1620;
    border-radius:22px;
    padding:18px;
    box-shadow: var(--shadow);
    background:
        linear-gradient(180deg, rgba(255,255,255,.015), transparent),
        #120609;
}
.entity-card-top {
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start;
    margin-bottom:14px;
}
.entity-label {
    display:block;
    color:#d0526b;
    font-size:10px;
    font-weight:900;
    letter-spacing:.12em;
    text-transform:uppercase;
    margin-bottom:7px;
}
.entity-card h3 {
    margin:0;
    font-size:20px;
    line-height:1.15;
    letter-spacing:-.02em;
}
.entity-meta-grid {
    display:grid;
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:10px;
    margin-bottom:16px;
}
.entity-meta-grid > div {
    border:1px solid #2f1218;
    border-radius:14px;
    padding:12px;
}
.entity-meta-grid span {
    display:block;
    color:#997c84;
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.08em;
    margin-bottom:5px;
}
.entity-meta-grid b {
    color:#f5e8eb;
    font-size:12px;
    line-height:1.45;
    word-break: break-word;
}
.entity-actions {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    align-items:center;
}
.inline-block-form { display:inline; margin:0; }
.full-width-form { display:block; }
.full-width-card {
    width:100%;
    text-align:left;
    background:linear-gradient(180deg, rgba(255,255,255,.015), transparent), #100609;
}
.action-card-button {
    border:1px solid #36141d;
    border-radius:18px;
    cursor:pointer;
}
.single-action-grid { grid-template-columns:1fr; }

@media (max-width: 1200px) {
    .entity-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .entity-grid, .entity-meta-grid { grid-template-columns:1fr; }
}

/* Gatilhos rápidos dentro dos cards */
.quick-menu {
    position: relative;
}
.quick-menu > summary {
    list-style: none;
}
.quick-menu > summary::-webkit-details-marker { display:none; }
.quick-summary {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    background:#211016;
    border:1px solid #4c2630;
    color:#f0d8de;
    user-select:none;
}
.quick-menu[open] .quick-summary {
    border-color:#7a2335;
    background:#2b0d15;
    color:#fff;
}
.quick-menu-panel {
    position:absolute;
    left:0;
    bottom:calc(100% + 10px);
    z-index:120;
    width:260px;
    padding:14px;
    border:1px solid #5b1b2a;
    border-radius:16px;
    background:#100508 !important;
    box-shadow:0 22px 70px rgba(0,0,0,.6);
}
.quick-menu-panel strong {
    display:block;
    font-size:12px;
    color:#f4dfe4;
    margin-bottom:10px;
}
.quick-option-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
}
.quick-option-grid form,
.quick-manual-form { margin:0; }
.quick-option {
    width:100%;
    min-height:36px;
    padding:8px 10px;
    border-radius:10px;
    border:1px solid #4c1724;
    background:#250b12;
    color:#f7e8ec;
    font-size:11px;
    font-weight:800;
    cursor:pointer;
}
.quick-option:hover {
    background:#35101a;
    border-color:#8f2940;
}
.quick-manual-form {
    display:grid;
    grid-template-columns:1fr auto;
    gap:8px;
    margin-top:10px;
}
.quick-manual-form input[type="number"] {
    min-height:36px;
    margin:0;
    padding:8px 10px;
}

@media (max-width: 700px) {
    .quick-menu-panel {
        position:fixed;
        left:14px;
        right:14px;
        bottom:18px;
        width:auto;
        z-index:300;
    }
}
.quick-transfer-form { display:grid; gap:9px; }
.quick-transfer-form select { margin:0; min-height:40px; }

/* Ajustes finais: logos separadas, menu com rolagem própria e Downloader */
html { color-scheme: dark; }
.sidebar {
    overflow: hidden;
}
.nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #681d2d #100609;
}
.nav::-webkit-scrollbar { width: 7px; }
.nav::-webkit-scrollbar-track { background: #100609; border-radius: 999px; }
.nav::-webkit-scrollbar-thumb { background: #681d2d; border-radius: 999px; }
.nav::-webkit-scrollbar-thumb:hover { background: #9d2740; }
.sidebar-footer { flex: 0 0 auto; margin-top: 12px; }

.brand-mark-image { overflow: hidden; padding: 4px; background:#0c0305; }
.brand-mark-image img { width:100%; height:100%; object-fit:contain; display:block; border-radius:10px; }

textarea {
    width: 100%;
    border: 1px solid #431723;
    border-radius: 13px;
    padding: 11px 13px;
    background: #0f0508;
    color: var(--text);
    outline: none;
    margin-bottom: 15px;
    resize: vertical;
    font: inherit;
}
textarea:focus { border-color:#9e2039; box-shadow:0 0 0 4px rgba(158,32,57,.12); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f6e9ec;
    -webkit-box-shadow: 0 0 0 1000px #0f0508 inset;
    transition: background-color 9999s ease-out;
}

.branding-card-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:18px;
}
.branding-card { margin-bottom:0; }
.branding-help { color:#9e8189; font-size:12px; line-height:1.55; margin:-5px 0 15px; }
.save-bar-card {
    margin-top:18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}
.save-bar-card strong { display:block; }
.save-bar-card small { display:block; color:#8f747b; margin-top:4px; }
.account-card { background:linear-gradient(180deg,rgba(255,255,255,.015),transparent),#120609; }

.copy-source {
    position: fixed !important;
    left: -10000px !important;
    top: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.downloader-admin-grid { align-items:start; margin-bottom:22px; }
.download-checks { display:flex; flex-direction:column; justify-content:center; padding-top:8px; }
.orientation-preview {
    white-space: normal;
    padding:14px;
    margin-top:14px;
    border:1px solid #37131c;
    background:#0d0406;
    border-radius:14px;
    color:#c5a8b0;
    line-height:1.55;
    font-size:12px;
}
.download-search-form { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.download-search-form input { margin:0; min-width:240px; min-height:38px; }
.download-card-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
}
.download-app-card {
    position:relative;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    min-height:420px;
    padding:20px;
    border-radius:22px;
    border:1px solid #3a1720;
    background:linear-gradient(180deg,rgba(255,255,255,.014),transparent),#120609;
    box-shadow:var(--shadow);
}
.download-app-card.featured { border-color:#722239; box-shadow:0 22px 60px rgba(0,0,0,.36), inset 0 1px 0 rgba(225,42,77,.08); }
.download-app-card::after {
    content:"";
    position:absolute;
    right:-60px;
    top:-65px;
    width:150px;
    height:150px;
    border-radius:50%;
    background:radial-gradient(circle,rgba(225,42,77,.14),transparent 70%);
    pointer-events:none;
}
.download-card-head { display:flex; gap:12px; align-items:flex-start; position:relative; z-index:1; }
.download-app-icon {
    width:52px;
    height:52px;
    flex:0 0 52px;
    border-radius:16px;
    display:grid;
    place-items:center;
    overflow:hidden;
    background:#280c14;
    border:1px solid #4b1724;
    color:#ff7991;
    font-size:22px;
    font-weight:900;
}
.download-app-icon img { width:100%; height:100%; object-fit:cover; }
.download-head-text { flex:1; min-width:0; }
.download-head-text h3 { margin:0; font-size:18px; letter-spacing:-.02em; }
.download-head-text small { color:#8f737a; display:block; margin-top:4px; }
.download-description { color:#a98a92; line-height:1.55; font-size:12px; margin:16px 0 0; position:relative; z-index:1; }
.download-info-stack { display:grid; gap:10px; margin:16px 0; position:relative; z-index:1; }
.download-info-box {
    padding:13px;
    border-radius:14px;
    border:1px solid #32121b;
    background:#0d0406;
}
.download-info-box span { display:block; color:#90737b; text-transform:uppercase; letter-spacing:.08em; font-size:9px; margin-bottom:6px; }
.download-info-box b, .download-info-box a { display:block; color:#f4dfe4; font-size:13px; line-height:1.45; word-break:break-word; }
.download-info-box.code-box { border-color:#4e1a27; }
.download-info-box.code-box b { color:#ff879d; font-size:17px; letter-spacing:.05em; }
.download-info-box.ntdown-box { border-color:#58411a; }
.download-info-box.ntdown-box b { color:#f1ca71; font-size:16px; }
.download-info-box.link-box { border-color:#24384b; }
.download-info-box.link-box a { color:#8ecbf7; }
.download-changelog { padding:12px 13px; border-radius:14px; background:#0d0406; border:1px solid #2f1218; margin-bottom:15px; position:relative; z-index:1; }
.download-changelog span { color:#d0526b; font-size:9px; font-weight:900; letter-spacing:.1em; text-transform:uppercase; }
.download-changelog p { color:#a98a92; margin:7px 0 0; font-size:11px; line-height:1.5; }
.download-actions { margin-top:auto; position:relative; z-index:1; }

@media (max-width: 1200px) {
    .download-card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
    .branding-card-grid { grid-template-columns:1fr; }
}
@media (max-width: 700px) {
    .download-card-grid { grid-template-columns:1fr; }
    .download-search-form { width:100%; }
    .download-search-form input { min-width:0; flex:1; }
    .save-bar-card { align-items:stretch; flex-direction:column; }
}
input[type="file"]::file-selector-button {
    border:1px solid #4c1a26;
    background:#251017;
    color:#f6e9ec;
    border-radius:10px;
    padding:8px 11px;
    margin-right:10px;
    cursor:pointer;
}
input[type="file"]::file-selector-button:hover { background:#35111c; }

/* Navegação lateral: rolagem própria sem alterar o tamanho dos cards */
.sidebar {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}
.sidebar > .brand,
.sidebar > .user-card,
.sidebar > .sidebar-footer {
    flex: 0 0 auto;
}
.sidebar > .nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    touch-action: pan-y;
}

@media (max-width: 900px) {
    .sidebar {
        top: 0;
        bottom: 0;
        height: 100dvh;
        max-height: 100dvh;
    }
    .sidebar > .nav {
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}
