/*
 * MYINSURIA
 * MYI-023-009 — Import History Workspace V1
 * Phase D — History Workspace Human Orchestration V1
 */

.myi-history-orchestrator {
    margin: 24px 0;
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background:
        linear-gradient(
            145deg,
            rgba(15, 23, 42, 0.98),
            rgba(17, 24, 39, 0.96)
        );
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.18);
}

.myi-history-orchestrator *,
.myi-history-orchestrator *::before,
.myi-history-orchestrator *::after {
    box-sizing: border-box;
}

.myi-history-orchestrator__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.myi-history-orchestrator__title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.25;
}

.myi-history-orchestrator__subtitle {
    margin: 7px 0 0;
    color: #94a3b8;
    line-height: 1.5;
}

.myi-history-orchestrator__authority {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.10);
    color: #86efac;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.myi-history-orchestrator__filters {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(170px, 1fr)
        );
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.myi-history-filter {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.myi-history-filter label {
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 700;
}

.myi-history-filter input,
.myi-history-filter select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
}

.myi-history-orchestrator__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 18px;
}

.myi-history-button {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.88);
    color: #f8fafc;
    font-weight: 700;
    cursor: pointer;
}

.myi-history-button:hover {
    border-color: rgba(96, 165, 250, 0.65);
}

.myi-history-button--primary {
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(37, 99, 235, 0.82);
}

.myi-history-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.myi-history-orchestrator__status {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}

.myi-history-orchestrator__status[data-state="error"] {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.18);
    color: #fecaca;
}

.myi-history-orchestrator__status[data-state="empty"] {
    border-color: rgba(250, 204, 21, 0.28);
    color: #fde68a;
}

.myi-history-orchestrator__status[data-state="ready"] {
    border-color: rgba(34, 197, 94, 0.22);
}

.myi-history-orchestrator__table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.myi-history-orchestrator__table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    background: rgba(15, 23, 42, 0.64);
}

.myi-history-orchestrator__table th,
.myi-history-orchestrator__table td {
    padding: 12px 11px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    vertical-align: middle;
}

.myi-history-orchestrator__table th {
    color: #94a3b8;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.myi-history-orchestrator__table td {
    color: #e2e8f0;
    font-size: 0.87rem;
}

.myi-history-orchestrator__table tbody tr {
    transition:
        background 120ms ease,
        transform 120ms ease;
}

.myi-history-orchestrator__table tbody tr:hover {
    background: rgba(59, 130, 246, 0.07);
}

.myi-history-session-id {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;
    color: #93c5fd;
}

.myi-history-status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 0.74rem;
    white-space: nowrap;
}

.myi-history-orchestrator__pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.myi-history-orchestrator__pager-info {
    color: #94a3b8;
    font-size: 0.83rem;
}

.myi-history-orchestrator__pager-actions {
    display: flex;
    gap: 8px;
}

.myi-history-orchestrator__contract {
    margin-top: 16px;
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.55;
}

@media (max-width: 760px) {

    .myi-history-orchestrator {
        padding: 15px;
    }

    .myi-history-orchestrator__header {
        flex-direction: column;
    }

    .myi-history-orchestrator__authority {
        align-self: flex-start;
    }
}
