:root {
    --ad-bg: #0b0d12;
    --ad-panel: #12151d;
    --ad-card: rgba(255,255,255,0.045);
    --ad-line: rgba(255,255,255,0.09);
    --ad-accent: #00e0a1;
    --ad-accent-2: #16d1ff;
    --ad-ink: #eef0f4;
    --ad-muted: #8a909e;
    --ad-danger: #ff5d6c;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--ad-bg);
    color: var(--ad-ink);
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: var(--ad-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Fundo decorativo */
.ad-bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
}
.ad-glow { position: fixed; z-index: 0; border-radius: 50%; filter: blur(120px); opacity: .35; pointer-events: none; }
.ad-glow-1 { width: 520px; height: 520px; background: #00e0a1; top: -180px; right: -120px; }
.ad-glow-2 { width: 460px; height: 460px; background: #16d1ff; bottom: -220px; left: -140px; opacity: .22; }

/* ===== LOGIN ===== */
.ad-login { position: relative; z-index: 2; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ad-login-card {
    width: 100%; max-width: 420px; padding: 40px 34px;
    background: rgba(18,21,29,.72); backdrop-filter: blur(22px);
    border: 1px solid var(--ad-line); border-radius: 26px;
    box-shadow: 0 30px 80px rgba(0,0,0,.55);
    animation: adUp .6s cubic-bezier(.22,1,.36,1) both;
}
@keyframes adUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.ad-login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.ad-login-brand h1 { font-size: 20px; margin: 0; letter-spacing: -.02em; }
.ad-login-brand span { color: var(--ad-muted); font-size: 13px; }
.ad-logo-mark {
    width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--ad-accent), var(--ad-accent-2));
    color: #04160f; font-size: 26px;
    box-shadow: 0 10px 28px rgba(0,224,161,.35);
}
.ad-logo-mark.sm { width: 38px; height: 38px; border-radius: 12px; font-size: 20px; }

.ad-form { display: flex; flex-direction: column; gap: 14px; }
.ad-input {
    position: relative; display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.04); border: 1.5px solid var(--ad-line);
    border-radius: 14px; padding: 0 14px; transition: border-color .2s ease, background .2s ease;
}
.ad-input:focus-within { border-color: var(--ad-accent); background: rgba(0,224,161,.06); }
.ad-input > i { color: var(--ad-muted); font-size: 18px; }
.ad-input input { flex: 1; border: none; background: transparent; outline: none; color: var(--ad-ink); font-family: inherit; font-size: 15px; padding: 14px 0; }
.ad-eye { background: none; border: none; color: var(--ad-muted); cursor: pointer; padding: 4px; font-size: 18px; }
.ad-login-err { color: var(--ad-danger); font-size: 13px; min-height: 4px; }
.ad-login-err.show { padding: 2px 0; }
.ad-login-foot { text-align: center; color: var(--ad-muted); font-size: 12px; margin: 22px 0 0; display: flex; gap: 6px; justify-content: center; align-items: center; }

/* Botões */
.ad-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    background: linear-gradient(135deg, var(--ad-accent), #04c98d);
    color: #04160f; font-weight: 700; font-family: inherit; font-size: 15px;
    border: none; border-radius: 14px; padding: 14px 22px; cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
    box-shadow: 0 10px 26px rgba(0,224,161,.28);
}
.ad-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.ad-btn:active { transform: translateY(0); }
.ad-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.ad-btn-block { width: 100%; padding: 15px; }
.ad-btn-ghost { background: transparent; color: var(--ad-ink); border: 1.5px solid var(--ad-line); box-shadow: none; }
.ad-btn-ghost:hover { border-color: var(--ad-accent); color: var(--ad-accent); }

/* ===== SHELL ===== */
.ad-shell { position: relative; z-index: 2; display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.ad-sidebar {
    background: rgba(15,18,25,.7); backdrop-filter: blur(16px);
    border-right: 1px solid var(--ad-line);
    padding: 26px 18px; display: flex; flex-direction: column; gap: 26px;
    position: sticky; top: 0; height: 100vh;
}
.ad-side-brand { display: flex; align-items: center; gap: 11px; font-size: 16px; letter-spacing: -.02em; padding: 0 6px; }
.ad-nav { display: flex; flex-direction: column; gap: 6px; }
.ad-nav-item {
    display: flex; align-items: center; gap: 12px; width: 100%;
    background: transparent; border: none; color: var(--ad-muted);
    font-family: inherit; font-size: 14.5px; font-weight: 600; text-align: left;
    padding: 12px 14px; border-radius: 12px; cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.ad-nav-item i { font-size: 19px; }
.ad-nav-item:hover { color: var(--ad-ink); background: rgba(255,255,255,.04); }
.ad-nav-item.is-active { color: #04160f; background: linear-gradient(135deg, var(--ad-accent), #04c98d); box-shadow: 0 8px 22px rgba(0,224,161,.25); }
.ad-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.ad-side-link {
    display: flex; align-items: center; gap: 10px; color: var(--ad-muted);
    background: none; border: none; font-family: inherit; font-size: 13.5px; font-weight: 600;
    padding: 10px 14px; border-radius: 10px; cursor: pointer; text-align: left;
}
.ad-side-link:hover { color: var(--ad-ink); background: rgba(255,255,255,.04); text-decoration: none; }
.ad-logout:hover { color: var(--ad-danger); }

.ad-main { padding: 28px 34px 60px; min-width: 0; }
.ad-card { overflow: hidden; }
.ad-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.ad-topbar h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.ad-topbar p { margin: 4px 0 0; color: var(--ad-muted); font-size: 14px; }
.ad-user-chip { display: flex; align-items: center; gap: 8px; background: var(--ad-card); border: 1px solid var(--ad-line); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; }
.ad-user-chip i { color: var(--ad-accent); font-size: 20px; }

/* Sections */
.ad-section { display: none; animation: adFade .4s ease both; }
.ad-section.is-active { display: block; }
@keyframes adFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Stats */
.ad-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 22px; }
.ad-stat { display: flex; align-items: center; gap: 16px; background: var(--ad-card); border: 1px solid var(--ad-line); border-radius: 20px; padding: 22px; backdrop-filter: blur(10px); transition: transform .2s ease, border-color .2s ease; }
.ad-stat:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.18); }
.ad-stat-icon { width: 54px; height: 54px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.ad-stat-icon.green { background: rgba(0,224,161,.14); color: var(--ad-accent); }
.ad-stat-icon.blue { background: rgba(22,209,255,.14); color: var(--ad-accent-2); }
.ad-stat-icon.purple { background: rgba(167,139,250,.16); color: #a78bfa; }
.ad-stat-icon.amber { background: rgba(245,169,0,.16); color: #f5a900; }
.ad-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.ad-head-actions { display: flex; gap: 10px; }
.ad-btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 11px; }
.ad-btn-danger { background: rgba(255,93,108,.14); color: var(--ad-danger); border: 1.5px solid rgba(255,93,108,.35); box-shadow: none; }
.ad-btn-danger:hover { background: var(--ad-danger); color: #fff; }
.ad-badge-yes { background: rgba(0,224,161,.16); color: var(--ad-accent); }
.ad-badge-no { background: rgba(255,255,255,.07); color: var(--ad-muted); }
.ad-badge-done { background: rgba(0,224,161,.16); color: var(--ad-accent); }
.ad-badge-pending { background: rgba(245,169,0,.16); color: #f5a900; }
.ad-badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.ad-mono { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--ad-muted); }
.ad-stat-label { display: block; color: var(--ad-muted); font-size: 13px; margin-bottom: 3px; }
.ad-stat-value { font-size: 26px; font-family: 'JetBrains Mono', monospace; font-weight: 700; letter-spacing: -.02em; }

/* Cards */
.ad-card { background: var(--ad-card); border: 1px solid var(--ad-line); border-radius: 20px; padding: 24px; backdrop-filter: blur(10px); margin-bottom: 20px; }
.ad-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ad-card-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 9px; }
.ad-card-head h3 i { color: var(--ad-accent); font-size: 20px; }
.ad-hint { color: var(--ad-muted); font-size: 13px; margin: 0 0 16px; line-height: 1.5; }
.ad-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Fields */
.ad-label { display: block; font-size: 13px; color: var(--ad-muted); font-weight: 600; margin: 4px 0 -4px; }
.ad-field {
    width: 100%; background: rgba(255,255,255,.04); border: 1.5px solid var(--ad-line);
    border-radius: 12px; padding: 13px 15px; color: var(--ad-ink);
    font-family: inherit; font-size: 15px; outline: none; transition: border-color .2s ease, background .2s ease;
}
.ad-field:focus { border-color: var(--ad-accent); background: rgba(0,224,161,.05); }
select.ad-field { appearance: none; cursor: pointer; }
.ad-form-actions { display: flex; gap: 12px; align-items: flex-end; grid-column: 1 / -1; }

/* QR preview */
.ad-qr-preview { display: flex; flex-direction: column; }
.ad-qr-holder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 220px; }
.ad-qr-holder canvas { border-radius: 14px; background: #fff; padding: 10px; display: none; }

/* Table */
.ad-table-wrap { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ad-table th { text-align: left; color: var(--ad-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--ad-line); }
.ad-table td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,.05); }
.ad-table tbody tr { transition: background .15s ease; }
.ad-table tbody tr:hover { background: rgba(255,255,255,.03); }
.ad-table .val { font-family: 'JetBrains Mono', monospace; color: var(--ad-accent); font-weight: 700; }
.ad-tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--ad-muted); }
.ad-tag.pix { background: rgba(0,224,161,.14); color: var(--ad-accent); }
.ad-empty { text-align: center; color: var(--ad-muted); padding: 30px; font-size: 14px; }

/* Users */
.ad-user-list { display: flex; flex-direction: column; gap: 10px; }
.ad-user-row { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.03); border: 1px solid var(--ad-line); border-radius: 12px; padding: 12px 16px; }
.ad-user-row .u-name { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.ad-user-row .u-name i { color: var(--ad-accent); font-size: 20px; }
.ad-user-role { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(22,209,255,.14); color: var(--ad-accent-2); margin-left: 8px; }
.ad-user-role.admin { background: rgba(0,224,161,.14); color: var(--ad-accent); }
.ad-del { background: none; border: none; color: var(--ad-muted); cursor: pointer; font-size: 20px; padding: 4px; border-radius: 8px; transition: color .2s, background .2s; }
.ad-del:hover { color: var(--ad-danger); background: rgba(255,93,108,.1); }

/* Toast */
.ad-toast {
    position: fixed; bottom: 26px; right: 26px; z-index: 100;
    background: #161a22; border: 1px solid var(--ad-line); border-left: 4px solid var(--ad-accent);
    color: var(--ad-ink); padding: 15px 20px; border-radius: 14px; font-size: 14px; font-weight: 500;
    box-shadow: 0 20px 50px rgba(0,0,0,.5); transform: translateX(140%); transition: transform .35s cubic-bezier(.22,1,.36,1);
    max-width: 340px;
}
.ad-toast.show { transform: translateX(0); }
.ad-toast.err { border-left-color: var(--ad-danger); }

@media (max-width: 860px) {
    .ad-shell { grid-template-columns: 1fr; }
    .ad-sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .ad-nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
    .ad-side-foot { flex-direction: row; margin: 0; }
    .ad-stats { grid-template-columns: 1fr; }
    .ad-grid-2 { grid-template-columns: 1fr; }
    .ad-main { padding: 20px; }
}

/* Badges extras */
.ad-badge-method { background: rgba(22,209,255,.14); color: var(--ad-accent-2); }
.ad-badge-copied { background: rgba(0,224,161,.16); color: var(--ad-accent); }

/* Correção de overflow dos cartões de estatística */
.ad-stat > div { min-width: 0; }
.ad-stat > div:last-child { flex: 1; }
.ad-stat-value { white-space: nowrap; display: block; }

/* Cartões de doação (responsivo, sem rolagem horizontal) */
.ad-don-list { display: flex; flex-direction: column; gap: 12px; }
.ad-don-card { border: 1px solid var(--ad-line); border-radius: 16px; padding: 16px 18px; background: rgba(255,255,255,.015); }
.ad-don-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.ad-don-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ad-don-name { font-weight: 700; font-size: 15px; word-break: break-word; }
.ad-don-cand { color: var(--ad-muted); font-size: 13px; display: flex; align-items: center; gap: 5px; }
.ad-don-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.ad-don-val { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--ad-accent); font-size: 17px; white-space: nowrap; }
.ad-don-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ad-don-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 20px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.ad-don-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-don-cell span { color: var(--ad-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.ad-don-cell b { font-size: 13.5px; font-weight: 600; word-break: break-word; overflow-wrap: anywhere; }

/* Cartão de cliques clicável */
.ad-stat-clickable { cursor: pointer; }
.ad-stat-clickable:hover { border-color: rgba(245,169,0,.5); }
.ad-stat-go { margin-left: auto; color: var(--ad-muted); font-size: 18px; flex-shrink: 0; }

/* Modal */
.ad-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ad-modal-backdrop { position: absolute; inset: 0; background: rgba(3,8,14,.72); backdrop-filter: blur(6px); }
.ad-modal-card { position: relative; z-index: 1; width: 100%; max-width: 820px; max-height: 82vh; overflow: auto; background: var(--ad-card); border: 1px solid var(--ad-line); border-radius: 20px; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.ad-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ad-modal-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.ad-modal-x { background: rgba(255,255,255,.06); border: 1px solid var(--ad-line); color: var(--ad-muted); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease; }
.ad-modal-x:hover { background: rgba(255,255,255,.12); color: #fff; }


/* Rodapé do card de doação (comprovante) */
.ad-don-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.06); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ad-don-nocomp { color: var(--ad-muted); font-size: 12.5px; display: flex; align-items: center; gap: 5px; }

