:root {
    --bg-primary: #07090b;
    --bg-surface: #0c1015;
    --bg-card: #121820;
    --border-color: #1c2633;
    --border-glow: rgba(60, 208, 112, 0.25);
    --green-primary: #3cd070;
    --green-light: #5be28d;
    --green-dark: #15803d;
    --accent-orange: #ff9f43;
    --text-main: #f4f7f5;
    --text-muted: #85958c;
    --font-sans: 'Space Grotesk', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 32px;
    background: rgba(12, 16, 21, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
}

.brand-img-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
    background: #ffffff;
    padding: 2px;
    box-shadow: 0 0 20px rgba(60, 208, 112, 0.4);
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.badge-network {
    background: rgba(60, 208, 112, 0.12);
    color: var(--green-light);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(60, 208, 112, 0.35);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--green-primary);
}

/* Header Right - Wallet Bar */
.header-right {
    display: flex;
    align-items: center;
}

.dual-addresses {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.addr-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 8px;
}

.addr-chip.public {
    background: rgba(255, 255, 255, 0.05);
}

.addr-chip.private {
    background: rgba(60, 208, 112, 0.12);
    border: 1px solid rgba(60, 208, 112, 0.35);
}

.addr-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
}

.addr-label.zk {
    color: var(--green-light);
}

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

.btn-icon:hover {
    opacity: 1;
}

/* Main Container */
.app-main {
    max-width: 1040px;
    margin: 40px auto;
    padding: 0 24px;
    width: 100%;
    flex: 1;
}

/* Balances Grid */
.balances-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.balance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}

.balance-card.private-card {
    border-color: rgba(60, 208, 112, 0.45);
    background: linear-gradient(180deg, rgba(60, 208, 112, 0.05), var(--bg-card));
    box-shadow: 0 0 30px rgba(60, 208, 112, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chain-badge, .zk-badge, .badge-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.chain-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.zk-badge {
    background: rgba(60, 208, 112, 0.15);
    color: var(--green-light);
}

.badge-status {
    background: rgba(60, 208, 112, 0.15);
    color: var(--green-primary);
}

.balance-amount {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-main);
    margin-bottom: 8px;
}

.balance-amount .unit {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-left: 6px;
}

.balance-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pool-stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 1rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: block;
}

.code-link {
    color: var(--green-primary);
    text-decoration: none;
    font-family: var(--font-mono);
}

/* Action Box */
.action-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.tabs-header {
    display: flex;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 18px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

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

.tab-btn.active {
    color: var(--green-primary);
    border-bottom-color: var(--green-primary);
    background: rgba(60, 208, 112, 0.04);
}

.tab-content {
    display: none;
    padding: 32px;
}

.tab-content.active {
    display: block;
}

.tab-intro {
    margin-bottom: 24px;
}

.tab-intro h3 {
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.tab-intro p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.input-with-button {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-button input, input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: var(--font-mono);
    outline: none;
    transition: border-color 0.2s;
}

.input-with-button input:focus, input[type="text"]:focus {
    border-color: var(--green-primary);
}

.input-unit {
    position: absolute;
    right: 18px;
    color: var(--green-primary);
    font-weight: 700;
    font-family: var(--font-mono);
}

.quick-amounts {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.quick-amounts button {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.quick-amounts button:hover {
    color: var(--green-primary);
    border-color: var(--green-primary);
}

.info-alert {
    display: flex;
    gap: 14px;
    background: rgba(60, 208, 112, 0.06);
    border: 1px solid rgba(60, 208, 112, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.alert-text {
    font-size: 0.85rem;
    color: #c0cfc5;
    line-height: 1.5;
}

.alert-text code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    color: var(--green-light);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #c0cfc5;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-primary), var(--green-light));
    color: #07090b;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(60, 208, 112, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(60, 208, 112, 0.45);
}

.btn-action {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--green-primary), var(--green-light));
    color: #07090b;
    font-size: 1.05rem;
    font-weight: 700;
    justify-content: center;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(60, 208, 112, 0.3);
}

.btn-action:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(60, 208, 112, 0.45);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: #fff;
}

/* Notes Table */
.notes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.notes-table th {
    text-align: left;
    padding: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.notes-table td {
    padding: 14px 12px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge.unspent {
    background: rgba(60, 208, 112, 0.15);
    color: var(--green-light);
}

.status-badge.spent {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 550px;
    padding: 28px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.key-field {
    margin-bottom: 16px;
}

.key-field label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.code-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    word-break: break-all;
}

.code-box.blurred {
    filter: blur(4px);
    cursor: pointer;
    user-select: none;
}

.modal-tip {
    font-size: 0.8rem;
    color: var(--accent-orange);
    margin-top: 16px;
}

/* Notification Bar */
.notification-bar {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
}

.notification-bar.success {
    background: rgba(60, 208, 112, 0.15);
    border: 1px solid var(--green-primary);
    color: var(--green-light);
}

.notification-bar.error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

.notification-bar.info {
    background: rgba(60, 208, 112, 0.1);
    border: 1px solid var(--green-primary);
    color: var(--green-light);
}

@media (max-width: 768px) {
    .balances-grid {
        grid-template-columns: 1fr;
    }
    .header-left {
        gap: 16px;
    }
    .nav-links {
        display: none;
    }
}
