/* ==========================================================================
   Ecosystem Shared Components
   Canonical component styles shared across all apps.
   Load order: ecosystem-nav.css → ecosystem-themes.css → THIS → app.css
   ========================================================================== */

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
    font-family: inherit;
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

.btn-primary {
    background: var(--brand-primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--brand-dark);
    color: var(--text-inverse);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger);
    filter: brightness(0.85);
    color: white;
}

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.badge-success {
    background: var(--success-light, rgba(16, 185, 129, 0.1));
    color: var(--brand-primary);
}

.badge-warning {
    background: var(--warning-light, rgba(245, 158, 11, 0.1));
    color: var(--warning);
}

.badge-info {
    background: var(--info-light, rgba(59, 130, 246, 0.1));
    color: var(--info);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
    position: relative;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(0,255,136,0.25); }
.alert-error   { background: var(--danger-light);  color: var(--danger);  border: 1px solid rgba(255,0,102,0.25); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(255,102,0,0.25); }
.alert-info    { background: var(--info-light);    color: var(--info);    border: 1px solid rgba(0,204,255,0.25); }

.alert-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.6;
    color: inherit;
}
.alert-dismiss:hover { opacity: 1; }

/* ── Section Headers ──────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.section-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ── Filter Bar ───────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Data View Controls ──────────────────────────────────────── */
.data-view-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 12px;
}

.hub-filter-view-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* ── Data Table ───────────────────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

/* ── Empty States ─────────────────────────────────────────────── */
.empty-state {
    padding: 3rem;
    text-align: center;
}

.empty-state.empty-state-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.empty-icon {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ── Back Link ────────────────────────────────────────────────── */
.page-header-back {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--brand-primary);
}

/* ── Text Utilities ───────────────────────────────────────────── */
.text-muted {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ── Action Buttons Row ───────────────────────────────────────── */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ── User Display Components ──────────────────────────────────── */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
}

.user-email {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.user-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.user-display .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

/* ── Permission Tags ──────────────────────────────────────────── */
.permission-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.perm-tag {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.perm-wallets {
    background: var(--brand-light);
    color: var(--brand-primary);
}

.perm-daos {
    background: var(--info-light);
    color: var(--info);
}

.perm-settings {
    background: var(--warning-light);
    color: var(--warning);
}

/* ── Ecosystem Pagination & Labels ────────────────────────────── */
.eco-total-label {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.eco-per-page {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.eco-per-page select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.eco-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.eco-pagination:empty { display: none; }

.eco-pagination button {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    min-width: 28px;
}

.eco-pagination button:hover:not(:disabled) { border-color: var(--brand-primary); color: var(--text-primary); }
.eco-pagination button.active { background: var(--brand-light); border-color: var(--brand-primary); color: var(--brand-primary); font-weight: 600; }
.eco-pagination button:disabled { opacity: 0.3; cursor: default; }

.eco-pagination .pagination-ellipsis {
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: default;
    user-select: none;
}

.eco-per-page ~ .collapsible-chevron {
    margin-left: 0.5rem;
}

[data-paginated] .hidden { display: none; }

/* ── Group Badges (Filter Bar) ───────────────────────────────── */
.tracker-group-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    flex: 1;
    min-width: 0;
}

.tracker-group-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
    background: none;
    font-family: inherit;
    line-height: 1.4;
}

.tracker-group-badge:hover {
    opacity: 0.85;
}

.tracker-group-badge.active {
    border-color: currentColor;
    box-shadow: 0 0 0 2px currentColor;
}

.tracker-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tracker-group-count {
    font-size: 0.6875rem;
    font-weight: 400;
    opacity: 0.7;
    margin-left: 0.125rem;
}

.tracker-groups-manage {
    flex-shrink: 0;
}

/* ── Group Color Picker ──────────────────────────────────────── */
.group-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.375rem;
}

.group-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    padding: 0;
    background: none;
    font-size: 0;
}

.group-color-swatch:hover {
    transform: scale(1.15);
}

.group-color-swatch.selected {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px currentColor;
}

.group-color-picker-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.group-custom-color {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.group-custom-color-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.group-color-input {
    width: 32px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: none;
    cursor: pointer;
    padding: 1px;
}

.group-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.group-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.group-color-input::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

/* ── Manage Groups Modal ─────────────────────────────────────── */
.manage-group-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.manage-group-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.manage-group-row .tracker-group-dot {
    width: 10px;
    height: 10px;
}

.manage-group-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manage-group-wallet-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.manage-group-actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.manage-group-edit-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.manage-group-edit-form input {
    flex: 1;
    padding: 0.375rem 0.625rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

.manage-group-edit-form input:focus {
    border-color: var(--brand-primary);
}

/* ── Edit Group Checkboxes (Wallet Edit Modal) ───────────────── */
.edit-group-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.375rem;
}

.edit-group-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.edit-group-item:hover {
    background: var(--bg-hover);
}

.edit-group-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.edit-group-item-label {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ── Create Group Form (Manage Modal) ────────────────────────── */
.manage-create-form {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.manage-create-form .we-field {
    margin-bottom: 0;
}

.manage-create-top {
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
}

.manage-create-name {
    flex: 1;
    min-width: 0;
}

/* ── Site Footer ─────────────────────────────────────────────── */
.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    margin-top: auto;
    font-size: 0.8rem;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.footer-card {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: fit-content;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius, 12px);
    padding: 12px 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.footer-copy {
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 0.8rem;
    line-height: 1;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--brand-primary);
}

.footer-legal {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
}

.footer-legal span {
    color: var(--text-muted);
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: var(--brand-primary);
}

.footer-disclaimer {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.6;
    text-align: center;
    max-width: 1024px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius, 12px);
    padding: 12px 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 640px) {
    .footer-card {
        max-width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-disclaimer {
        max-width: 100%;
    }
}

/* ==========================================================================
   Wallet Detail View Components (promoted from vault.css)
   Used by: Vault wallet-view, Scanner inline detail, Council DAO view
   ========================================================================== */

/* ── Price Change Indicators ─────────────────────────────────── */
.wv-price-change {
    font-family: monospace;
    font-size: 0.8125rem;
}

.wv-price-change.positive {
    color: var(--success);
}

.wv-price-change.negative {
    color: var(--danger);
}

.wv-price-change.neutral {
    color: var(--text-muted);
}

/* ── Locked Badge ────────────────────────────────────────────── */
.wv-locked-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: var(--warning-light);
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── DexScreener Link ────────────────────────────────────────── */
.wv-dex-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--brand-primary);
    text-decoration: none;
}

.wv-dex-link:hover {
    opacity: 0.8;
}

/* ── Unpriced Tokens Sub-Card ────────────────────────────────── */
.wv-unpriced-card {
    margin: 0.75rem 0 0.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.wv-unpriced-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    user-select: none;
}

.wv-unpriced-header .eco-total-label {
    font-weight: 400;
}

.wv-unpriced-header .collapsible-chevron {
    margin-left: auto;
}

.wv-unpriced-card > .collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.wv-unpriced-card > .expanded {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.wv-unpriced-card .data-table th {
    font-size: 0.75rem;
}

.wv-unpriced-card .data-table td {
    font-size: 0.8125rem;
}

/* ==========================================================================
   NFT Collectibles Grid (promoted from vault.css)
   ========================================================================== */

.nft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
}

.nft-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
}

.nft-card:hover {
    border-color: var(--brand-light);
    transform: translateY(-1px);
}

.nft-card-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.nft-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nft-card-image.nft-no-image {
    background: var(--bg-secondary);
}

.nft-card-info {
    padding: 0.5rem 0.625rem;
}

.nft-card-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nft-card-symbol {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.nft-card-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
}

@media (max-width: 480px) {
    .nft-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.5rem;
        padding: 0.75rem;
    }
}

/* ==========================================================================
   Modal (eco-modal) — Native <dialog> based
   ========================================================================== */

.eco-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    background: var(--bg-card, #1e2533);
    color: var(--text-primary, #e4e6eb);
    border: 1px solid var(--border, #2d3748);
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: calc(100vw - 2rem);
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Medium screens (tablets, small desktops) */
@media (min-width: 768px) {
    .eco-modal {
        max-width: 560px;
    }
}

/* Large screens (desktops) */
@media (min-width: 1200px) {
    .eco-modal {
        max-width: 640px;
    }
}

/* Small screens (phones) */
@media (max-width: 480px) {
    .eco-modal {
        max-width: none;
        width: calc(100vw - 1.5rem);
        border-radius: 10px;
    }
}

.eco-modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.eco-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.75rem;
    gap: 0.75rem;
}

.eco-modal-title {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.eco-modal-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted, #8a8d91);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.eco-modal-close:hover {
    color: var(--text-primary, #e4e6eb);
    background: var(--bg-hover, rgba(255,255,255,0.05));
}

/* Tab chooser */
.eco-modal-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--border, #2d3748);
    margin: 0 1rem;
}

.eco-modal-tab {
    background: none;
    border: none;
    color: var(--text-muted, #8a8d91);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.625rem 0.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    text-align: center;
}

.eco-modal-tab:hover {
    color: var(--text-secondary, #b0b3b8);
}

.eco-modal-tab.active {
    color: var(--brand-primary, #f59e0b);
    border-bottom-color: var(--brand-primary, #f59e0b);
}

/* Panels */
.eco-modal-panel {
    display: none;
    padding: 1rem;
}

.eco-modal-panel.active {
    display: block;
}

/* NFT image panel */
.eco-modal-nft-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #1a1f2e);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    max-height: min(560px, calc(100vh - 12rem));
    margin: 0 auto;
}

.eco-modal-nft-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.eco-modal-nft-image.nft-no-image {
    min-height: 200px;
}

/* NFT details panel */
.eco-modal-detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border, #2d3748);
}

.eco-modal-detail-row:last-child {
    border-bottom: none;
}

.eco-modal-detail-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #8a8d91);
}

.eco-modal-detail-value {
    font-size: 0.8125rem;
    color: var(--text-primary, #e4e6eb);
    word-break: break-word;
}

.eco-modal-detail-value .mono {
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
    font-size: 0.75rem;
}

/* NFT traits grid */
.eco-modal-traits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.eco-modal-trait {
    background: var(--bg-secondary, #1a1f2e);
    border: 1px solid var(--border, #2d3748);
    border-radius: 6px;
    padding: 0.375rem 0.5rem;
    text-align: center;
}

.eco-modal-trait-type {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-primary, #f59e0b);
    margin-bottom: 0.125rem;
}

.eco-modal-trait-value {
    font-size: 0.75rem;
    color: var(--text-primary, #e4e6eb);
}

/* Creator rows */
.eco-modal-creator {
    font-size: 0.8125rem;
    padding: 0.125rem 0;
}

/* Loading spinner */
.eco-modal-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border, #2d3748);
    border-top-color: var(--brand-primary, #f59e0b);
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    animation: eco-spin 0.6s linear infinite;
}

@keyframes eco-spin {
    to { transform: rotate(360deg); }
}

.eco-modal-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    flex-wrap: wrap;
}

.eco-modal-actions a,
.eco-modal-actions button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    border: 1px solid var(--border, #2d3748);
    background: var(--bg-tertiary, #232b3b);
    color: var(--text-secondary, #b0b3b8);
    cursor: pointer;
}

.eco-modal-actions a:hover,
.eco-modal-actions button:hover {
    background: var(--bg-hover, rgba(255,255,255,0.05));
    border-color: var(--brand-light, #fbbf24);
    color: var(--text-primary, #e4e6eb);
}

/* ==========================================================================
   Proposal State Badges (promoted from vault.css / council.css)
   ========================================================================== */

.proposal-state-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.state-0 { background: var(--bg-tertiary); color: var(--text-muted); }           /* Draft */
.state-1 { background: var(--warning-light); color: var(--warning); }              /* SigningOff */
.state-2 { background: var(--info-light); color: var(--info); }              /* Voting */
.state-3 { background: var(--success-light); color: var(--success); }               /* Succeeded */
.state-4 { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }              /* Executing */
.state-5 { background: var(--success-light); color: var(--success); opacity: 0.7; }  /* Completed */
.state-6 { background: rgba(107, 114, 128, 0.1); color: #6b7280; }             /* Cancelled */
.state-7 { background: var(--danger-light); color: var(--danger); }               /* Defeated */
.state-8 { background: var(--warning-light); color: var(--warning); }              /* ExecWithErrors */
.state-9 { background: var(--danger-light); color: var(--danger); opacity: 0.8; }  /* Vetoed */

/* ==========================================================================
   Executable Proposal & Transaction Tracking (promoted from vault.css / council.css)
   ========================================================================== */

/* Proposal rows */
.exec-proposal-group {
    border-bottom: 1px solid var(--border);
}

.exec-proposal-group:last-child {
    border-bottom: none;
}

.exec-proposal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.exec-proposal-header:hover {
    background: var(--bg-tertiary);
}

.exec-proposal-header.expanded {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.exec-proposal-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.exec-tx-header {
    display: flex;
    align-items: center;
    padding: 0.375rem 1rem;
    border-bottom: 1px solid var(--border);
}

.exec-proposal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.15s, color 0.15s;
}

.exec-proposal-link:hover {
    opacity: 1;
    color: var(--brand-primary);
}

/* Proposal body — hidden by default, toggled by JS */
.exec-proposal-body {
    display: none;
}

.exec-proposal-body.exec-proposal-open {
    display: block;
}

/* Chevron rotation when proposal is expanded */
.exec-proposal-header.expanded .collapsible-chevron {
    transform: rotate(180deg);
}

.exec-tx-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
}

.exec-tx-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--border);
    border-radius: 0 6px 6px 0;
    background: var(--bg-secondary);
}

.exec-tx-item.tx-executed {
    border-left-color: var(--success);
}

.exec-tx-item.tx-pending {
    border-left-color: #a78bfa;
}

.exec-tx-status {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.exec-tx-details {
    flex: 1;
    min-width: 0;
}

.exec-tx-program {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.exec-tx-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.exec-tx-wallet-match {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-top: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--warning-light);
    border: 1px solid var(--warning-light);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--warning);
}

@media (max-width: 768px) {
    .exec-proposal-header {
        flex-wrap: wrap;
        gap: 0.375rem;
    }

    .exec-proposal-title {
        flex-basis: 100%;
    }

    .exec-tx-item {
        padding: 0.375rem 0.5rem;
    }

    .exec-tx-list {
        padding: 0.5rem 0.625rem;
    }
}

/* ==========================================================================
   Deposit Table & Badges (shared by Council deposits.php + Vault wallet-view.php)
   ========================================================================== */

.deposit-table {
    font-size: 0.875rem;
}

.deposit-table .sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.deposit-table .sortable-th:hover {
    color: var(--brand-primary);
}

.deposit-table .sort-indicator {
    font-size: 0.6875rem;
    opacity: 0.7;
}

.deposit-counter {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.deposit-amount {
    text-align: right;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.deposit-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.deposit-remaining {
    text-align: right;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #a78bfa;
    white-space: nowrap;
}

/* ── Deposit Kind Badges ──────────────────────────────────── */
.deposit-kind-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.deposit-kind-badge.kind-none     { background: rgba(107, 112, 128, 0.15); color: #9ca3af; }
.deposit-kind-badge.kind-daily    { background: rgba(34, 211, 238, 0.15);  color: #22d3ee; }
.deposit-kind-badge.kind-monthly  { background: rgba(96, 165, 250, 0.15);  color: #60a5fa; }
.deposit-kind-badge.kind-cliff    { background: rgba(59, 130, 246, 0.15);  color: #60a5fa; }
.deposit-kind-badge.kind-constant { background: rgba(245, 158, 11, 0.15);  color: #fbbf24; }

/* ── Deposit Status Badges ────────────────────────────────── */
.deposit-status-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.deposit-status-badge.status-locked   { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.deposit-status-badge.status-unlocked { background: rgba(34, 197, 94, 0.15);  color: #22c55e; }

/* ── Deposit Filter Bar (Council deposits page) ───────────── */
.deposit-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
    line-height: 1.4;
}

.deposit-filter-badge:hover { opacity: 0.85; }

.deposit-filter-badge.active {
    border-color: currentColor;
    box-shadow: 0 0 0 1px currentColor;
}

.deposit-filter-badge .deposit-filter-count {
    font-size: 0.6875rem;
    font-weight: 400;
    opacity: 0.7;
}

.deposit-filter-badge.status-locked-bg   { background: rgba(139, 92, 246, 0.1); color: #a78bfa; }
.deposit-filter-badge.status-unlocked-bg { background: rgba(34, 197, 94, 0.1);  color: #22c55e; }
.deposit-filter-badge.kind-none-bg       { background: rgba(107, 112, 128, 0.1); color: #9ca3af; }
.deposit-filter-badge.kind-daily-bg      { background: rgba(34, 211, 238, 0.1);  color: #22d3ee; }
.deposit-filter-badge.kind-monthly-bg    { background: rgba(96, 165, 250, 0.1);  color: #60a5fa; }
.deposit-filter-badge.kind-cliff-bg      { background: rgba(59, 130, 246, 0.1);  color: #60a5fa; }
.deposit-filter-badge.kind-constant-bg   { background: rgba(245, 158, 11, 0.1);  color: #fbbf24; }

.deposit-filter-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
    align-self: center;
}

.deposit-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.deposit-results-count {
    font-weight: 500;
}

@media (max-width: 480px) {
    .deposit-table th:nth-child(6),
    .deposit-table td:nth-child(6),
    .deposit-table th:nth-child(7),
    .deposit-table td:nth-child(7) {
        display: none;
    }
}
