/* Pivot Table Styles for Data Agent */

.pivot-controls {
    background: #16213e;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.pivot-control-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pivot-control-row:last-child {
    margin-bottom: 0;
}

.pivot-control-label {
    font-size: 12px;
    color: #aaa;
    min-width: 70px;
    font-weight: 600;
}

.pivot-control-select {
    flex: 1;
    min-width: 150px;
    padding: 6px 10px;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pivot-control-select:hover {
    border-color: #4fc3f7;
}

.pivot-control-select:focus {
    border-color: #4fc3f7;
}

.pivot-control-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

.pivot-swap-btn {
    padding: 8px 16px;
    background: #1a2a3a;
    border: 1px solid #4fc3f7;
    border-radius: 6px;
    color: #4fc3f7;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pivot-swap-btn:hover {
    background: #4fc3f7;
    color: #000;
}

.pivot-table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    margin: 10px 0;
    border: 1px solid #333;
    border-radius: 6px;
    background: #111;
}

.pivot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: #ccc;
}

.pivot-table th {
    background: #16213e;
    color: #4fc3f7;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.pivot-table .pivot-row-header {
    background: #1a2a3a;
    border-right: 2px solid #333;
    font-weight: 700;
}

.pivot-table .pivot-col-header {
    text-align: center;
    background: #16213e;
}

.pivot-table .pivot-total-header {
    background: #1a3a1a;
    text-align: center;
    font-weight: 700;
}

.pivot-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #222;
    border-right: 1px solid #222;
}

.pivot-table .pivot-row-label {
    background: #1a1a2e;
    font-weight: 600;
    color: #e0e0e0;
    border-right: 2px solid #333;
    position: sticky;
    left: 0;
    z-index: 5;
}

.pivot-table .pivot-value {
    text-align: right;
    font-family: 'Fira Code', 'Consolas', monospace;
    color: #aaa;
}

.pivot-table .pivot-empty {
    color: #555;
    text-align: center;
}

.pivot-table .pivot-row-total {
    background: #1a3a1a;
    font-weight: 700;
    text-align: right;
    color: #66bb6a;
    border-left: 2px solid #333;
}

.pivot-table .pivot-totals-row {
    background: #1a3a1a;
}

.pivot-table .pivot-totals-row td {
    font-weight: 700;
    color: #66bb6a;
    border-top: 2px solid #333;
}

.pivot-table .pivot-total-label {
    background: #1a3a1a;
    font-weight: 700;
    color: #66bb6a;
}

.pivot-table .pivot-col-total {
    text-align: right;
    font-weight: 700;
    color: #66bb6a;
}

.pivot-table .pivot-grand-total {
    background: #2a4a2a;
    text-align: right;
    font-weight: 700;
    font-size: 13px;
    color: #81c784;
    border-left: 2px solid #333;
}

.pivot-table tr:hover td:not(.pivot-row-label):not(.pivot-totals-row td) {
    background: #16213e;
}

/* Pivot proposal message */
.agent-msg.pivot-proposal {
    background: #1a1a2e;
    border: 1px solid #ffa726;
    border-radius: 12px;
    padding: 16px;
}

.pivot-proposal-header {
    font-weight: 600;
    color: #ffa726;
    margin-bottom: 10px;
    font-size: 14px;
}

.pivot-proposal-desc {
    color: #ccc;
    font-size: 13px;
    margin-bottom: 12px;
}

.pivot-config {
    background: #16213e;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.pivot-config-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    align-items: center;
}

.pivot-config-label {
    font-size: 12px;
    color: #aaa;
    min-width: 80px;
}

.pivot-config-select {
    flex: 1;
    padding: 6px 10px;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 12px;
    outline: none;
}

.pivot-config-select:focus {
    border-color: #4fc3f7;
}

.pivot-config-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Pivot result message */
.agent-msg.pivot-result {
    background: #1a1a2e;
    border: 1px solid #ffa726;
    border-radius: 12px;
    padding: 16px;
}

.pivot-result-header {
    font-weight: 600;
    color: #ffa726;
    margin-bottom: 4px;
    font-size: 14px;
}

.pivot-result-desc {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
    font-style: italic;
}

.pivot-error {
    background: #2a1a1a;
    border: 1px solid #ef5350;
    border-radius: 6px;
    padding: 16px;
    color: #ef5350;
    font-size: 13px;
    text-align: center;
    margin: 10px 0;
}
