:root {
    --history-surface: var(--theme-surface-strong);
    --history-border: var(--theme-border);
    --history-ink: var(--theme-text);
    --history-muted: var(--theme-text-muted);
    --history-accent: var(--theme-accent);
    --history-accent-soft: var(--theme-accent-soft);
    --history-tag-bg: var(--theme-bg);
    --history-tag-text: var(--theme-text);
}

.app-rejection-history-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.app-rejection-history-trigger.has-rejection-history {
    border-color: rgba(33, 87, 207, 0.28);
    background: #ffffff;
    color: var(--history-accent);
}

.app-rejection-history-trigger.is-tagged {
    border-color: rgba(33, 121, 109, 0.28);
    color: var(--history-tag-text);
}

.app-rejection-history-trigger-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: var(--history-accent-soft);
    color: var(--history-accent);
    font-size: var(--app-font-size-11);
    font-weight: var(--app-font-weight-extrabold);
    line-height: 1;
}

.app-rejection-history-trigger.is-tagged .app-rejection-history-trigger-count {
    background: var(--history-tag-bg);
    color: var(--history-tag-text);
}

.app-rejection-history-kicker {
    color: var(--history-accent);
    font-size: var(--app-font-size-12);
    font-weight: var(--app-font-weight-extrabold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.app-rejection-history-item {
    display: grid;
    gap: 0.6rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(21, 32, 51, 0.08);
    border-radius: var(--erp-control-radius);
    background: var(--history-surface);
}

.app-rejection-history-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.app-rejection-history-item-head strong {
    color: var(--history-ink);
    font-size: var(--app-font-size-15);
    font-weight: var(--app-font-weight-extrabold);
}

.app-rejection-history-item-reason {
    margin: 0;
    color: #243247;
    font-size: var(--app-font-size-15);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.app-rejection-history-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    color: var(--history-muted);
    font-size: var(--app-font-size-13);
}

.app-rejection-history-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--history-accent-soft);
    color: var(--history-accent);
    font-size: var(--app-font-size-12);
    font-weight: var(--app-font-weight-extrabold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-rejection-history-chip.is-tagged {
    background: var(--history-tag-bg);
    color: var(--history-tag-text);
}

.app-rejection-history-list {
    display: grid;
    gap: 0.8rem;
}

.app-rejection-history-empty {
    padding: 0.6rem 0;
    color: var(--history-muted);
    font-size: var(--app-font-size-15);
}

.app-rejection-history-modal .modal-content {
    border: 1px solid var(--history-border);
    border-radius: var(--erp-control-radius);
    box-shadow: none;
}

.app-rejection-history-modal-header {
    align-items: flex-start;
}

.app-rejection-history-modal-title {
    display: grid;
    gap: 0.25rem;
}

.app-rejection-history-modal .modal-body {
    display: grid;
    gap: 0.9rem;
    max-height: min(72vh, 720px);
    overflow-y: auto;
}

.app-rejection-history-modal .alert {
    margin: 0;
}

@media (max-width: 767.98px) {
    .app-rejection-history-item-head {
        flex-direction: column;
    }
}
