/* Economy / Ledger shared styles */

.ledger-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    color: #e5e5e5;
    background: #000;
}

.ledger-container h1,
.transactions-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.ledger-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.metric-card {
    border: 1px solid #333;
    padding: 20px;
    text-align: center;
    background: #000;
    color: #e5e5e5;
}

.metric-label {
    display: block;
    font-size: 0.9em;
    color: #c0c0c0;
    margin-bottom: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.metric-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.transactions-section {
    margin-top: 40px;
}

.transactions-log {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.transaction-entry {
    display: grid;
    grid-template-columns: 1fr 160px 120px;
    gap: 20px;
    padding: 12px 15px;
    border: 1px solid #333;
    background: #000;
    align-items: center;
    color: #e5e5e5;
}

.tx-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tx-reason {
    font-weight: bold;
    color: #e5e5e5;
}

.tx-time {
    font-size: 0.85em;
    color: #c0c0c0;
}

.tx-details {
    text-align: center;
}

.tx-user {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: #c0c0c0;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.tx-user-icon {
    stroke: currentColor;
}

.tx-amount {
    text-align: right;
}

.tx-value {
    font-weight: bold;
    font-size: 1.1em;
    font-family: 'Courier New', monospace;
}

.tx-value.positive {
    color: #4caf50;
}

.tx-value.negative {
    color: #ff5252;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #c0c0c0;
}

@media (max-width: 768px) {
    .transaction-entry {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tx-amount {
        text-align: left;
    }

    .metric-card {
        padding: 15px;
    }

    .metric-value {
        font-size: 1.5em;
    }
}


/* ========================================
   MEMETIC ECONOMY - Dashboard & Profiles
   Brand: antique white bg, warm tones, royal-blue accent, gold stars (#d4a017)
   ======================================== */

.economy-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #faebd7;
    min-height: 100vh;
}

.economy-title {
    font-size: 2em;
    color: #333;
    margin: 0 0 20px;
    font-weight: bold;
}

.econ-scope-key {
    font-size: 14px;
    color: #777;
    margin-left: 8px;
}

/* Stats Grid */
.economy-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.econ-stat {
    background: #fff;
    border: 1px solid #d4c4a8;
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
}

.econ-stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    font-family: 'Courier New', monospace;
}

.econ-stat-label {
    display: block;
    font-size: 11px;
    color: #777;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sections */
.econ-section {
    margin-bottom: 28px;
}

.econ-section-title {
    font-size: 1.1em;
    color: #444;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #d4c4a8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.econ-see-all {
    font-size: 12px;
    color: var(--royal-blue);
    text-decoration: none;
}

.econ-see-all:hover {
    text-decoration: underline;
}

.econ-empty {
    color: #888;
    font-style: italic;
    font-size: 13px;
}

.econ-offline {
    background: #f5e6d3;
    border: 1px solid #d4c4a8;
    border-radius: 8px;
    padding: 20px;
    color: #777;
    text-align: center;
    margin-bottom: 24px;
}

/* Navigation */
.econ-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.econ-nav-link {
    color: #777;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
}

.econ-nav-link:hover,
.econ-nav-link.active {
    color: var(--royal-blue);
    background: #f0e8f5;
}

/* Event Types */
.econ-event-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.econ-event-type {
    background: #fff;
    border: 1px solid #d4c4a8;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
}

.event-type-name {
    color: #666;
    margin-right: 8px;
}

.event-type-count {
    color: var(--royal-blue);
    font-weight: 600;
}

/* Leaderboard */
.econ-leaderboard {
    border: 1px solid #d4c4a8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.lb-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #ebe0d0;
    gap: 12px;
}

.lb-row:last-child {
    border-bottom: none;
}

.lb-top {
    background: #f5f0ea;
}

.lb-rank {
    font-weight: 700;
    color: var(--royal-blue);
    min-width: 36px;
    font-size: 14px;
}

.lb-agent {
    flex: 1;
    font-size: 13px;
    color: #333;
}

.lb-balance {
    color: #d4a017;
    font-weight: 600;
    font-size: 14px;
}

.lb-lifetime {
    color: #999;
    font-size: 11px;
}

.lb-percentile {
    color: #888;
    font-size: 11px;
    min-width: 60px;
    text-align: right;
}

.persona-link {
    color: var(--royal-blue);
    text-decoration: none;
}

.persona-link:hover {
    text-decoration: underline;
}

.agent-id {
    color: #666;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

/* Narrative Cards */
.econ-narratives {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.narrative-card {
    background: #fff;
    border: 1px solid #d4c4a8;
    border-radius: 8px;
    padding: 14px;
    text-decoration: none;
    transition: border-color 0.2s;
    display: block;
}

.narrative-card:hover {
    border-color: var(--royal-blue);
}

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

.narrative-label {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.narrative-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.narrative-active {
    color: #2e7d32;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.narrative-dormant {
    color: #e65100;
    background: #fff3e0;
    border: 1px solid #ffe0b2;
}

.narrative-dead {
    color: #888;
    background: #f5f0ea;
    border: 1px solid #d4c4a8;
}

.narrative-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #777;
}

.narrative-mutations {
    color: var(--royal-blue);
}

.narrative-detail-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #666;
}

.narrative-meta {
    font-size: 13px;
    color: #777;
    margin-bottom: 20px;
}

.narrative-meta a {
    color: var(--royal-blue);
}

/* Narrative Thread */
.narrative-thread {
    border-left: 2px solid #d4c4a8;
    padding-left: 16px;
}

.narrative-link {
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #d4c4a8;
}

.narrative-relation-origin {
    border-left: 3px solid #4caf50;
}

.narrative-relation-extend {
    border-left: 3px solid var(--accent-reply);
}

.narrative-relation-mutate {
    border-left: 3px solid var(--royal-blue);
}

.narrative-relation-attack {
    border-left: 3px solid #c62828;
}

.link-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 4px;
}

.link-relation {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 3px;
    background: #f5e6d3;
    color: #666;
}

.link-agent a {
    color: var(--royal-blue);
    text-decoration: none;
    font-size: 13px;
}

.link-cluster {
    color: #888;
    font-size: 11px;
}

.link-meta {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: #888;
}

/* Agent Profile */
.agent-header {
    margin-bottom: 16px;
}

.agent-type-label {
    color: #777;
    font-size: 13px;
}

.agent-rank-display {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: #f5e6d3;
    border: 1px solid #d4c4a8;
    border-radius: 8px;
}

.agent-global-rank {
    font-size: 18px;
    font-weight: 700;
    color: var(--royal-blue);
}

.agent-balance {
    font-size: 18px;
    font-weight: 600;
    color: #d4a017;
}

.agent-lifetime {
    color: #888;
    font-size: 13px;
}

.agent-percentile {
    color: #777;
    font-size: 13px;
}

/* Balance Grid */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.balance-card {
    background: #fff;
    border: 1px solid #d4c4a8;
    border-radius: 6px;
    padding: 12px;
}

.balance-scope {
    display: block;
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.balance-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #d4a017;
}

.balance-lifetime {
    font-size: 11px;
    color: #888;
    margin-right: 8px;
}

.balance-percentile {
    font-size: 11px;
    color: #777;
}

/* Goals */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.goal-card {
    background: #fff;
    border: 1px solid #d4c4a8;
    border-radius: 8px;
    padding: 14px;
}

.goal-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.goal-type {
    font-size: 11px;
    color: var(--royal-blue);
    background: #f0e8f5;
    padding: 2px 6px;
    border-radius: 3px;
}

.goal-horizon {
    font-size: 11px;
    color: #777;
}

.goal-priority {
    font-size: 11px;
    color: #d4a017;
    margin-left: auto;
}

.goal-text {
    font-size: 13px;
    color: #444;
    margin-bottom: 8px;
}

.goal-progress-bar {
    height: 4px;
    background: #e0d4c0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.goal-progress-fill {
    height: 100%;
    background: var(--royal-blue);
    border-radius: 2px;
    transition: width 0.3s;
}

.goal-progress-text {
    font-size: 11px;
    color: #888;
}

/* Budget */
.budget-display {
    display: flex;
    gap: 20px;
}

.budget-item {
    background: #fff;
    border: 1px solid #d4c4a8;
    border-radius: 6px;
    padding: 12px 16px;
}

.budget-label {
    display: block;
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.budget-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Neighbors */
.neighbors-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.neighbor-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ebe0d0;
    border-radius: 6px;
    font-size: 12px;
}

.neighbor-agent {
    color: var(--royal-blue);
    text-decoration: none;
    min-width: 120px;
}

.neighbor-interactions {
    color: #666;
}

.neighbor-affinity {
    color: #777;
}

.affinity-ally {
    color: #2e7d32;
}

.affinity-rival {
    color: #c62828;
}

.neighbor-reciprocity {
    color: #888;
}

.neighbor-narratives {
    color: var(--royal-blue);
    font-size: 11px;
}

/* Events */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f5f0ea;
    border-radius: 4px;
    font-size: 12px;
}

.event-type {
    color: #666;
    min-width: 150px;
}

.event-amount {
    color: #d4a017;
    font-weight: 600;
    min-width: 60px;
}

.event-scope {
    color: #888;
    flex: 1;
}

.event-time {
    color: #999;
    font-size: 11px;
}

/* Economy Responsive */
@media (max-width: 600px) {
    .economy-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .balance-grid {
        grid-template-columns: 1fr;
    }

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

    .lb-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .lb-lifetime,
    .lb-percentile {
        display: none;
    }

    .neighbor-row {
        flex-wrap: wrap;
    }

    .event-row {
        flex-wrap: wrap;
    }
}
