/* Experiment 10 - 3PL Volume (server-rendered, no JS) */

.tpv-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

.tpv-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.tpv-title {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tpv-logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #3b82f6, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tpv-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tpv-actions {
    display: flex;
    gap: 0.5rem;
}

.tpv-btn {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #3b82f6, #f97316);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.tpv-btn:hover {
    filter: brightness(1.1);
}

.tpv-btn-ghost {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.tpv-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.tpv-card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.tpv-card h3 {
    margin: 1rem 0 0.5rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.tpv-card h2 + h2,
.tpv-card table + h2,
.tpv-card p + h2 {
    margin-top: 1.5rem;
}

.tpv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 960px) {
    .tpv-grid {
        grid-template-columns: 1fr;
    }
}

.tpv-statbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.5rem;
    margin-bottom: 1.25rem;
}

.tpv-stat {
    display: flex;
    flex-direction: column;
}

.tpv-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.tpv-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tpv-pos {
    color: var(--accent-green);
}

.tpv-neg {
    color: #f87171;
}

.tpv-small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.tpv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

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

.tpv-table td {
    padding: 0.45rem 0.75rem 0.45rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

.tpv-scroll {
    overflow-x: auto;
}

.tpv-history {
    min-width: 1150px;
    white-space: nowrap;
}

.tpv-alloc-grid {
    min-width: 1150px;
}

.tpv-alloc-grid td {
    border-bottom: none;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.tpv-alloc-grid tr.tpv-carrier-first td {
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
}

.tpv-alloc-grid td input {
    width: 6.5rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
}

.tpv-alloc-grid td input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}

.tpv-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.75rem 0 0;
}

.tpv-error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    font-size: 0.92rem;
}

.tpv-rules {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

.tpv-rules li {
    margin-bottom: 0.5rem;
}

.tpv-field {
    margin-bottom: 1rem;
    max-width: 480px;
}

.tpv-field label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tpv-field input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

.tpv-field input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}

.tpv-field-inline {
    max-width: 200px;
    margin-bottom: 0;
}

.tpv-decision {
    border-color: rgba(59, 130, 246, 0.4);
}

.tpv-start {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tpv-final-score {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 1rem;
}

.tpv-ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tpv-ranking-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

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

.tpv-ranking-first .tpv-ranking-name,
.tpv-ranking-first .tpv-ranking-score {
    color: var(--accent-green);
}

.tpv-ranking-pos {
    width: 2rem;
    font-weight: 700;
    color: var(--text-muted);
}

.tpv-ranking-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 600;
}

.tpv-ranking-score {
    font-weight: 700;
    color: var(--accent-green);
}

.tpv-empty {
    color: var(--text-muted);
}

/* --- message feed (email / internal) --- */

.tpv-feed {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 30rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.tpv-msg {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    background: var(--bg-secondary);
}

.tpv-msg-email {
    border-left: 3px solid #3b82f6;
}

.tpv-msg-internal {
    border-left: 3px solid #f97316;
}

.tpv-msg-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tpv-msg-sender {
    font-weight: 700;
    color: var(--text-primary);
}

.tpv-msg-channel {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
}

.tpv-msg-subject {
    font-weight: 600;
    color: var(--text-secondary);
}

.tpv-msg-body {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

/* --- offers and badges --- */

.tpv-offer {
    border: 1px dashed rgba(59, 130, 246, 0.6);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.tpv-offer p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tpv-badge {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    white-space: nowrap;
}

.tpv-badge-contract {
    border-color: rgba(59, 130, 246, 0.6);
    color: #93c5fd;
    text-transform: none;
    letter-spacing: 0;
}
