:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(51, 65, 85, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #6366f1;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #334155;
    --secondary-hover: #475569;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace !important;
}

.app-wrapper {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-info { border-left: 4px solid var(--primary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   AUTH CONTAINER (ONBOARDING / UNLOCK)
   ========================================================================== */
.auth-container {
    width: 100%;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}

.brand-header {
    text-align: center;
    margin-bottom: 2rem;
}
.brand-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}
.brand-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}
.brand-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.auth-view {
    display: none;
}
.auth-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.security-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 0.85rem;
    color: #fbbf24;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.mnemonic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 1.5rem;
}
.mnemonic-word {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.word-num {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 600;
}
.word-text {
    font-weight: 600;
    color: #cbd5e1;
}

.unlock-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.user-avatar {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.unlock-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}
.unlock-footer {
    text-align: center;
    margin-top: 1.5rem;
}

/* ==========================================================================
   MAIN APP INTERFACE
   ========================================================================== */
.main-app-container {
    width: 100%;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.25rem;
}
.header-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Tabs Navigation */
.app-tabs-nav {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px;
    margin-bottom: 1.5rem;
    gap: 4px;
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}
.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* Tab Panes */
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CARDS & COMPONENTS
   ========================================================================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.25rem;
}

.hero-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-glow);
    margin-bottom: 1.25rem;
}
.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hero-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.balance-display {
    margin: 0.75rem 0 1.25rem;
}
.balance-number {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-main);
}
.balance-currency {
    font-size: 1.2rem;
    font-weight: 600;
    color: #818cf8;
    margin-left: 6px;
}
.hero-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.75rem;
}

/* Card Address */
.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.card-title-row h2, .card-title-row h3 {
    font-size: 1rem;
    font-weight: 600;
}
.address-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-sm);
    word-break: break-all;
}
.address-code {
    font-size: 0.85rem;
    color: #38bdf8;
}

/* Network Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 0.75rem;
}
.stat-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: var(--radius-sm);
}
.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.stat-val {
    font-size: 0.82rem;
    color: var(--text-main);
    word-break: break-all;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

input, textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}
.input-suffix {
    position: absolute;
    right: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
}

.input-copy-group, .input-with-button {
    display: flex;
    gap: 8px;
}
.input-copy-group input, .input-with-button input {
    flex: 1;
}

.fee-info-box {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.input-feedback {
    display: block;
    font-size: 0.78rem;
    margin-top: 4px;
}
.input-feedback.success { color: var(--success); }
.input-feedback.error { color: var(--danger); }

/* QR Code Section */
.qr-wrapper {
    background: white;
    padding: 16px;
    border-radius: var(--radius-md);
    display: inline-block;
    margin: 1rem auto;
}
#qr-canvas {
    display: block;
    width: 180px;
    height: 180px;
}

/* Transaction History List */
.tx-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tx-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}
.tx-item:hover {
    background: rgba(30, 41, 59, 0.8);
}
.tx-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tx-badge {
    font-size: 1.2rem;
}
.tx-title {
    font-weight: 600;
    font-size: 0.9rem;
}
.tx-sub {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 2px;
}
.tx-right {
    text-align: right;
}
.tx-amount {
    font-weight: 700;
    font-size: 0.95rem;
}
.tx-amount.tx-in { color: var(--success); }
.tx-amount.tx-out { color: var(--danger); }
.tx-block {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.loading-state, .empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Settings */
.settings-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}
.text-sm { font-size: 0.8rem; }

/* Buttons */
.btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-lg {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-link {
    background: transparent;
    border: none;
    color: #818cf8;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.btn-link:hover { text-decoration: underline; }

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.btn-icon:hover { opacity: 1; }

.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.modal-card {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dim);
    cursor: pointer;
}
.btn-close:hover { color: var(--text-main); }

.review-details {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin: 1rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.review-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}
.review-label { color: var(--text-muted); }
.review-val { font-weight: 600; word-break: break-all; }
.highlight-amount {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    font-size: 1rem;
    color: #818cf8;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==========================================================================
   EXPLORADOR DE BLOCOS & TELEMETRIA STYLES
   ========================================================================== */
.explorer-search-card {
    padding: 16px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
}
.search-bar-row {
    display: flex;
    gap: 10px;
}
.search-bar-row input {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 0.95rem;
}
.search-bar-row input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.stats-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 1rem;
}
.stat-box {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    backdrop-filter: blur(8px);
}
.stat-box-title {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-box-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e0e7ff;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}
.explorer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}
.explorer-table th {
    background: rgba(15, 23, 42, 0.8);
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}
.explorer-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}
.explorer-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.modal-lg {
    max-width: 650px !important;
}
.max-h-60 { max-height: 240px; }
.overflow-y-auto { overflow-y: auto; }
.text-center { text-align: center; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
