/* Three-panel layout */
.dashboard-container {
    display: flex;
    height: calc(100vh - 64px);
    overflow: hidden;
}

.left-panel {
    width: 350px;
    min-width: 300px;
    max-width: 400px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.form-panel {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.form-panel .input-field {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-panel textarea.materialize-textarea {
    min-height: 4rem;
    max-height: 6rem;
}

.history-panel {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.history-header {
    padding: 0.5rem 1rem;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #757575;
    position: sticky;
    top: 0;
    z-index: 1;
}

.history-panel .collection {
    margin: 0;
    border: none;
}

.history-panel .collection-item {
    cursor: pointer;
    padding-right: 3rem;
    position: relative;
}

.history-panel .collection-item:hover {
    background: #e3f2fd;
}

.history-panel .collection-item.active {
    background-color: #e3f2fd !important;
    color: #333 !important;
}

.history-panel .delete-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.right-panel {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Results table */
.results-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.results-table {
    font-size: 0.85rem;
}

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

.results-table th:hover {
    background: #f5f5f5;
}

.results-table th .sort-icon {
    font-size: 1rem;
    vertical-align: middle;
}

.results-table td {
    white-space: nowrap;
}

.copy-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.copy-bar .filter-input {
    margin: 0 0 0 auto;
    padding: 0.25rem 0.5rem;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 220px;
    height: auto;
    box-sizing: border-box;
}

.history-filter {
    padding: 0.5rem 1rem;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.history-filter input {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    font-size: 0.85rem;
    height: auto;
    box-sizing: border-box;
    margin: 0;
}

/* Sparkline cells */
.sparkline-cell {
    min-width: 80px;
}

/* Research button loading state — driven by [disabled] via hx-disabled-elt */
.form-panel form button .btn-label-loading {
    display: none;
}
.form-panel form button[disabled] .btn-label-default {
    display: none;
}
.form-panel form button[disabled] .btn-label-loading {
    display: inline;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9e9e9e;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}
