/* ============================================================
   EHRPlus Analysis History Widget Styles
   ============================================================ */

/* History icon (clock) next to the service name */
.ehrplus-history-icon {
    display: inline-block;
    cursor: pointer;
    margin-left: 4px;
    color: #6c757d;
    font-size: 0.85em;
    vertical-align: middle;
    transition: color 0.15s ease;
}

.ehrplus-history-icon:hover {
    color: #0d6efd;
}

/* Dropdown container */
.ehrplus-history-dropdown {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 340px;
    max-width: 440px;
    max-height: 360px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
}

/* Loading spinner */
.ehrplus-history-loading {
    padding: 16px;
    text-align: center;
    color: #6c757d;
}

/* Error message */
.ehrplus-history-error {
    padding: 16px;
    text-align: center;
    color: #dc3545;
}

/* Empty state */
.ehrplus-history-empty {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Widget container (returned by Odoo) */
.ehrplus-history-widget {
    padding: 0;
}

/* Title bar */
.ehrplus-history-title {
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
    color: #212529;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table */
.ehrplus-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ehrplus-history-table thead th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 6px 10px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ehrplus-history-table tbody td {
    padding: 5px 10px;
    border-bottom: 1px solid #f0f0f0;
    color: #212529;
}

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

.ehrplus-history-table tbody tr:hover {
    background: #f8f9fa;
}

/* High / Low result rows */
.ehrplus-hist-high td {
    color: #dc3545;
    font-weight: 600;
}

.ehrplus-hist-low td {
    color: #0d6efd;
    font-weight: 600;
}

/* Relative date column ("3d ago") */
.ehrplus-hist-relative {
    color: #6c757d !important;
    font-size: 11px;
    font-weight: 400 !important;
    white-space: nowrap;
}
