:root {
    --bg-color: #050a0f;
    --text-color: #ffffff;
    --hint-color: #9ab4c2;
    --card-bg: rgba(10, 18, 25, 0.6);
    --card-border: rgba(85, 136, 163, 0.3);
    --input-bg: rgba(5, 10, 15, 0.7);
    --accent: #5588a3;
    --accent-text: #ffffff;
    --danger: #ff453a;
    
    --tg-theme-bg-color: #050a0f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    -webkit-font-smoothing: antialiased;
    padding: 24px;
    height: 100vh;
    overflow-x: hidden;
}

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('bg_premium.png') no-repeat center center;
    background-size: cover;
    z-index: -1;
    filter: brightness(0.6) blur(2px);
}

.app-container {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    transition: max-width 0.3s ease;
}

body:has(#admin-panel-screen.active) .app-container {
    max-width: 800px;
}

/* Screens Toggle logic */
.screen {
    display: none;
    flex-direction: column;
    gap: 40px;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Header UI - Apple/Tesla esque minimal */
.header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.hero-image-container {
    width: 100%;
    /* Huge scaling out of bounds */
    max-width: 600px;
    height: auto;
    margin-top: 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(1.8); /* Doubling size making it pop outside borders! */
    filter: drop-shadow(0 25px 40px rgba(85, 136, 163, 0.6));
}

.hero-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.logo-wrapper {
    width: 68px;
    height: 68px;
    background: rgba(11, 232, 249, 0.05);
    border: 1px solid rgba(11, 232, 249, 0.2);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    margin-bottom: 12px;
    box-shadow: inset 0 0 20px rgba(11, 232, 249, 0.1);
}

.title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-shadow: 0 0 20px rgba(11, 232, 249, 0.3);
}

.subtitle {
    font-size: 15px;
    color: var(--hint-color);
    max-width: 90%;
    font-weight: 400;
}

.dash-subtitle {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 12px;
    color: #fff;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.unlink-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--hint-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.unlink-btn:hover {
    color: var(--danger);
    border-color: rgba(255, 69, 58, 0.3);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.info-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 16px;
    font-size: 14px;
    color: var(--hint-color);
    text-align: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Input Minimalista */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-left: 4px;
}

.input-wrapper {
    position: relative;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    background: rgba(8, 15, 22, 0.9);
    box-shadow: 0 0 15px rgba(85, 136, 163, 0.2);
}

input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 20px;
    font-size: 17px;
    font-weight: 500;
    outline: none;
    border-radius: 20px;
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(5, 10, 15, 0.9) inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
    transition: background-color 5000s ease-in-out 0s;
    border-radius: 20px;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
}

.error-msg {
    color: var(--danger);
    font-size: 13px;
    margin-left: 4px;
    font-weight: 500;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-msg.visible {
    display: block;
    opacity: 1;
}

/* DASHBOARD STYLES */
.dash-header {
    margin-top: 5px;
    gap: 4px;
}

.hero-image-container.mini {
    max-width: 280px;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 5px;
    filter: drop-shadow(0 15px 30px rgba(85, 136, 163, 0.5));
}

.dashboard-content {
    gap: 20px;
}

.dash-copy-block {
    width: 100%;
    margin-top: 5px;
    background: rgba(85, 136, 163, 0.1);
    border: 1px solid rgba(85, 136, 163, 0.25);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: monospace;
    transition: background 0.2s;
    backdrop-filter: blur(10px);
}

.dash-copy-block:active {
    background: rgba(85, 136, 163, 0.4);
}

.dash-wallet-hash {
    font-size: 16px;
    color: var(--text-color);
    letter-spacing: 0.05em;
}

.copy-icon {
    font-size: 18px;
    color: var(--accent);
}

.balances-container {
    display: flex;
    gap: 12px;
}

.balance-card {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.balance-card.usdt { border-color: rgba(48, 209, 88, 0.4); }

.balance-label {
    font-size: 16px;
    text-transform: uppercase;
    color: var(--hint-color);
    letter-spacing: 0.05em;
    font-weight: 700;
}

.balance-val {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.qr-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#qrcode-box {
    background: #ffffff;
    padding: 12px;
    border-radius: 16px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

#qrcode-box img {
    margin: 0 auto;
    display: block;
}

.history-container {
    margin-top: 10px;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 4px;
}

#tx-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tx-loading {
    text-align: center;
    color: var(--hint-color);
    font-size: 13px;
    padding: 20px;
    font-style: italic;
}

.tx-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease;
}

.tx-card:active {
    transform: scale(0.98);
}

.tx-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tx-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
}

.tx-icon.in {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
}

.tx-icon.out {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
}

.tx-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tx-hash {
    font-size: 13px;
    color: #ffffff;
    font-family: monospace;
}

.tx-date {
    font-size: 11px;
    color: var(--hint-color);
}

.tx-value {
    font-size: 15px;
    font-weight: 700;
    font-family: monospace;
}

.tx-value.in { color: #30d158; }
.tx-value.out { color: #ff453a; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Admin Cards Grid & Premium Layout */
body:has(#admin-panel-screen.active) {
    padding: 0;
}
body:has(#admin-panel-screen.active) .app-container {
    max-width: 100%;
    height: 100vh;
    display: flex;
}

.admin-layout {
    flex-direction: row !important;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
}

.admin-sidebar {
    width: 260px;
    background: rgba(8, 15, 22, 0.95);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    padding: 24px;
    backdrop-filter: blur(20px);
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}
.sidebar-header .mini-logo {
    width: 40px;
    height: 40px;
    font-size: 20px;
    margin-bottom: 0;
    border-radius: 12px;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--hint-color);
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.nav-item.active {
    background: rgba(85, 136, 163, 0.15);
    color: var(--accent);
    border: 1px solid rgba(85, 136, 163, 0.3);
}
.nav-item.logout-btn {
    color: var(--danger);
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}
.nav-item.logout-btn:hover {
    background: rgba(255, 69, 58, 0.1);
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.admin-topbar {
    padding: 30px 40px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-primary:hover {
    filter: brightness(1.2);
    box-shadow: 0 4px 15px rgba(85, 136, 163, 0.4);
}
.admin-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
}

.admin-quick-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 30px;
}
.action-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
    flex: 1;
    justify-content: center;
}
.action-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}

.admin-cards-container { padding: 0; }
.admin-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 20px; 
    margin-top: 10px; 
    width: 100%; 
    padding-bottom: 40px; 
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column !important;
    }
    .admin-sidebar {
        width: 100%;
        height: auto;
        padding: 15px 20px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .sidebar-header { margin-bottom: 0; }
    .sidebar-nav { display: none; }
    .sidebar-footer { display: block; }
    
    .admin-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
    }
    .admin-content-scroll {
        padding: 20px;
    }
    .admin-quick-actions {
        flex-wrap: wrap;
    }
    .action-btn { min-width: 100%; }
}

.admin-card { background: rgba(10, 18, 25, 0.8); border: 1px solid rgba(85, 136, 163, 0.4); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; backdrop-filter: blur(16px); }
.admin-card-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 8px; }
.admin-card-name { font-size: 16px; font-weight: 600; color: #fff; }
.admin-card-id { font-size: 12px; color: var(--hint-color); }
.admin-card-body { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.admin-card-address { flex: 1; font-family: monospace; font-size: 12px; color: var(--accent); background: rgba(85, 136, 163, 0.1); padding: 6px 12px; border-radius: 8px; word-break: break-all; }
.admin-card-qr-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; font-size: 16px; cursor: pointer; color: #fff; padding: 6px 10px; transition: 0.2s; display:flex; align-items:center; }
.admin-card-qr-btn:hover { background: rgba(255,255,255,0.2); }
.admin-card-notes { font-size: 13px; color: #ccc; background: rgba(0,0,0,0.3); padding: 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: flex-start; border: 1px dashed rgba(255,255,255,0.1); }
.admin-card-notes p { margin: 0; flex: 1; word-wrap: break-word; white-space: pre-wrap; font-style: italic; }
.admin-note-edit-btn { background: none; border: none; color: var(--accent); font-size: 15px; cursor: pointer; padding: 2px 6px; margin-left: 8px; }
.admin-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }

/* Modals */
.modal-overlay { position: fixed; top:0; left:0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); z-index: 999; display: none; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease; }
.modal-overlay.open { display: flex; opacity: 1; }
.modal-content { background: var(--bg-color); border: 1px solid var(--card-border); padding: 24px; border-radius: 20px; width: 90%; max-width: 400px; display: flex; flex-direction: column; }
#note-textarea { width: 100%; height: 120px; background: rgba(8,15,22,0.9); border: 1px solid var(--card-border); border-radius: 12px; color: #fff; padding: 12px; font-size: 14px; resize: none; margin-bottom: 20px; outline: none; }
#note-textarea:focus { border-color: var(--accent); box-shadow: 0 0 10px rgba(85,136,163,0.2); }
.modal-actions { display: flex; gap: 10px; }
.modal-btn { flex: 1; padding: 12px; border-radius: 10px; border: none; cursor: pointer; font-weight: 600; font-size: 14px; transition: 0.2s; }
.modal-btn.cancel { background: #1e1e1e; color: #fff; border: 1px solid #444; }
.modal-btn.save { background: var(--accent); color: #fff; }
.modal-btn:hover { filter: brightness(1.2); }
.admin-btn { background: #1e1e1e; color: #5bb35b; border: 1px solid #5bb35b; border-radius: 8px; padding: 14px; width: 100%; font-weight: 600; cursor: pointer; margin-top: 20px; transition: 0.3s; }
.admin-btn:hover { background: #5bb35b; color: #000; }
.admin-btn-logout { background: transparent; color: #c34444; border: 1px solid rgba(195, 68, 68, 0.4); padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; margin-top: 10px; font-weight: 600; transition: 0.3s; }
.admin-btn-logout:hover { background: rgba(195, 68, 68, 0.2); }
.admin-del-btn { background: #ff4a4a; color: #fff; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-weight: bold; }
#admin-login-screen .header { margin-top: 40px; }
#admin-login-screen .hero-image-container {
    transform: scale(1);
    max-width: 900px;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Toast */
.admin-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 255, 163, 0.15);
    border: 1px solid rgba(0, 255, 163, 0.4);
    color: #00ffa3;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 9999;
    backdrop-filter: blur(10px);
}
.admin-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ================================= */
/*       NEOBANK UI OVERHAUL         */
/* ================================= */
.neo-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 15px 25px 0 25px;
}
.user-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar-circle {
    width: 45px;
    height: 45px;
    background: #1e1e1e;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-light);
    border: 1px solid rgba(255,255,255,0.05);
}
.greeting-text {
    display: flex;
    flex-direction: column;
}
.greeting-text span {
    font-size: 13px;
    color: var(--hint-color);
}
.greeting-text strong {
    font-size: 16px;
    color: var(--text-color);
}
.neo-logo img {
    height: 40px;
    border-radius: 50%;
}

.neo-content {
    display: flex;
    flex-direction: column;
    padding-bottom: 120px; /* Space for dock */
}

/* External Balance Header */
.external-balance.inline-balance {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 15px 25px 0 25px;
}
.inline-balance .balance-label {
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    font-weight: 500;
}
.inline-balance .balance-currency {
    color: var(--accent-color);
    font-size: 18px;
    font-weight: 600;
}
.inline-balance .balance-val {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* Bank Bank Card Container */
.neo-bank-card-container {
    margin: 15px 0 25px 0; 
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Wrapper premium com respiro */
.physical-card-wrapper {
    position: relative;
    width: 92%; /* Breathing room so it doesn't collide grossly with phone edges */
    max-width: 400px; /* Golden proportion max size */
    display: block;
    margin: 0 auto;
    perspective: 1000px;
}

.physical-card-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 24px; /* Extremo cuidado NeoBank de cartao Apple */
    box-shadow: 0 25px 45px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.06); /* Borda metalizada super fina e glow de profundidade */
    transform-style: preserve-3d;
}

/* Wallet Top (Inside Card) */
.card-wallet-top {
    position: absolute;
    top: 14%; 
    left: 10%;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 12px;
    color: rgba(180, 180, 180, 0.85); /* Metallic grey to blend */
    font-weight: 500;
}
.card-wallet-top .copy-icon-neo {
    cursor: pointer;
    background: transparent;
    border: 1px solid rgba(180, 180, 180, 0.3);
    color: rgba(180, 180, 180, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    transition: all 0.2s;
}
.card-wallet-top .copy-icon-neo:active {
    background: rgba(180, 180, 180, 0.2);
}
/* Clear existing tag unused parts if any */
.neo-history .tx-card:first-child {
    border-top-left-radius: 16px; border-top-right-radius: 16px;
}
.neo-history .tx-card:last-child {
    border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; border-bottom: none;
}

/* MacBook Inspired Floating Dock */
.dock-container {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 400px;
    background: rgba(20, 20, 20, 0.65);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    padding: 10px 5px;
    z-index: 1000;
}
.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex: 1;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dock-item:active {
    transform: scale(0.9);
}
.dock-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(145deg, #2a2a2a, #1f1f1f);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    transition: background 0.3s;
}
.dock-icon.enhanced-icon span {
    font-size: 26px !important;
}
.dock-icon.active-glow {
    background: linear-gradient(145deg, rgba(0, 255, 163, 0.2), #101010);
    color: var(--accent-light);
    border: 1px solid rgba(0, 255, 163, 0.5);
    box-shadow: 0 0 18px rgba(0,255,163,0.3);
}
.dock-item span {
    font-size: 11px;
    font-weight: 600;
    color: #ccc;
    margin-top: 5px;
}
