@import url("./base.css");

.history-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 26px auto 48px;
}

.history-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.history-heading h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    letter-spacing: -0.04em;
}

.history-panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.history-table-wrap {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.history-table th {
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.history-table td {
    font-size: 0.88rem;
}

.history-table tbody tr:last-child td {
    border-bottom: 0;
}

.history-table__price,
.history-table__date {
    white-space: nowrap;
}

.history-table__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.history-table__input {
    width: 100%;
    min-width: 150px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
}

.history-action {
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.history-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.history-action--danger {
    color: var(--danger);
}

.history-action--primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.history-action--primary:hover {
    background: var(--primary-strong);
    color: #fff;
}

.history-empty,
.history-error,
.history-status {
    padding: 18px;
    color: var(--text-muted);
    text-align: center;
}

.history-error,
.history-status--error {
    color: var(--danger);
}

.history-status--success {
    color: var(--primary);
}

.confirm-dialog {
    width: min(420px, calc(100% - 32px));
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-hover);
    color: var(--text);
}

.confirm-dialog::backdrop {
    background: rgba(8, 16, 18, 0.58);
    backdrop-filter: blur(3px);
}

.confirm-dialog__content {
    padding: 24px;
}

.confirm-dialog h2 {
    margin: 0;
    font-size: 1.08rem;
}

.confirm-dialog p {
    margin: 8px 0 22px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.history-form {
    display: grid;
    gap: 14px;
    margin: 20px 0;
}

.history-form__field {
    display: grid;
    gap: 7px;
}

.history-form__field span {
    color: var(--text-muted);
    font-size: 0.79rem;
    font-weight: 700;
}

.confirm-dialog__status {
    margin: -8px 0 18px;
    color: var(--danger);
    font-size: 0.8rem;
}

.confirm-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.confirm-dialog__actions .history-action--danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.confirm-dialog__actions .history-action--danger:hover {
    color: #fff;
}

@media (max-width: 680px) {
    .history-shell {
        width: min(100% - 28px, 1180px);
        margin-top: 18px;
    }

    .history-table th,
    .history-table td {
        padding: 12px;
    }

    .history-table__actions {
        flex-wrap: wrap;
        min-width: 150px;
    }
}
