/* OAT Client Styles */

/* Status badges */
.oat-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.oat-status-pending { background: #f0f0f1; color: #50575e; }
.oat-status-held { background: #fcf0e3; color: #996800; }
.oat-status-approved { background: #d7f0d7; color: #006505; }
.oat-status-denied { background: #f0d7d7; color: #8b0000; }
.oat-status-cancelled { background: #f0f0f1; color: #8b8d8f; }
.oat-status-auto_approved { background: #d7f0d7; color: #006505; }
.oat-status-auto_denied { background: #f0d7d7; color: #8b0000; }

/* Entry header */
.oat-entry-header {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 10px 20px;
    margin: 20px 0;
}

.oat-entry-header .form-table th {
    width: 150px;
    padding: 8px 10px 8px 0;
}

.oat-entry-header .form-table td {
    padding: 8px 10px;
}

/* Action cards */
.oat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 10px 0 20px;
}

.oat-action-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 15px;
    min-width: 320px;
    flex: 1;
    max-width: 500px;
}

.oat-action-card strong {
    display: block;
    margin-bottom: 8px;
}

.oat-action-card textarea {
    margin: 8px 0;
}

.oat-bbp-card {
    border-color: #2271b1;
    border-width: 2px;
}

.oat-bbp-card h3 {
    color: #2271b1;
    margin-top: 0;
}

/* Timeline */
.oat-timeline {
    border-left: 3px solid #ccd0d4;
    margin: 10px 0 20px 10px;
    padding-left: 20px;
}

.oat-timeline-event {
    position: relative;
    padding: 10px 15px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.oat-timeline-event::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 15px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccd0d4;
}

.oat-timeline-event.oat-tier-staff::before { background: #2271b1; }
.oat-timeline-event.oat-tier-coordinator::before { background: #996800; }
.oat-timeline-event.oat-tier-archivist::before { background: #006505; }

.oat-timeline-meta {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: #646970;
    flex-wrap: wrap;
}

.oat-timeline-action {
    font-weight: 600;
    color: #1d2327;
}

.oat-timeline-tier {
    font-style: italic;
    font-size: 11px;
}

.oat-timeline-note {
    margin-top: 8px;
    padding: 8px;
    background: #f6f7f7;
    border-radius: 3px;
    white-space: pre-wrap;
}

/* Rule picker */
.oat-rule-picker {
    position: relative;
}

#oat-selected-rules {
    margin-top: 8px;
}

.oat-rule-tag {
    display: inline-block;
    background: #e5f5fa;
    border: 1px solid #b4dce7;
    border-radius: 3px;
    padding: 3px 8px;
    margin: 2px;
    font-size: 12px;
}

.oat-rule-tag .oat-remove-rule {
    cursor: pointer;
    color: #8b0000;
    margin-left: 5px;
    font-weight: bold;
}
.oat-rule-tag.oat-rule-freetext {
    /* Same style as linked rules */
}

/* User picker (reassign/delegate) */
.oat-user-picker {
    margin: 6px 0;
}

.oat-user-picker .oat-user-search {
    width: 100%;
    box-sizing: border-box;
}

.oat-user-picked {
    display: block;
    margin-top: 6px;
}

.oat-user-tag {
    display: inline-block;
    background: #e5f5fa;
    border: 1px solid #b4dce7;
    border-radius: 3px;
    padding: 4px 10px;
    font-size: 13px;
}

.oat-remove-user {
    cursor: pointer;
    color: #8b0000;
    margin-left: 6px;
    font-weight: bold;
}

/* Timer extend */
.oat-timer-extend-fields {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 6px 0;
}

.oat-timer-extend-fields label {
    font-weight: 500;
}

.oat-timer-extend-fields .small-text {
    width: 60px;
}

.oat-action-card .large-text {
    width: 100%;
    box-sizing: border-box;
}

/* jQuery UI autocomplete styling within action cards */
.ui-autocomplete {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100100;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .oat-actions {
        flex-direction: column;
    }

    .oat-action-card {
        max-width: none;
    }
}
