/* =============================================
   Workflow Engine Styles
   ============================================= */

/* =============================================
   1. Status Progress Bar (DetailView)
   ============================================= */

.workflow-bar {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    /* margin: 0 8px 12px 8px; */
    background: var(--dx-component-color-bg, #fff);
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); */
    overflow-x: auto;
    white-space: nowrap;
}

.workflow-states {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
}

.workflow-state {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #999;
    background: transparent;
    transition: all 0.3s ease;
    cursor: default;
}

.workflow-state-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.workflow-state.completed .workflow-state-dot {
    background: #4CAF50;
    border-color: #4CAF50;
}

.workflow-state.active {
    color: var(--dx-color-text, #333);
    font-weight: 600;
}

.workflow-state.active .workflow-state-dot {
    width: 14px;
    height: 14px;
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.workflow-state.future {
    color: #bbb;
}

.workflow-state-connector {
    width: 30px;
    height: 2px;
    background: #e0e0e0;
    flex-shrink: 0;
}

.workflow-state.completed + .workflow-state-connector,
.workflow-state-connector.completed {
    background: #4CAF50;
}

/* =============================================
   2. Transition Buttons (Toolbar)
   ============================================= */

.workflow-transition-btn {
    margin-left: 4px;
}

.workflow-transition-btn .dx-button-content {
    padding: 4px 12px;
}

.workflow-transition-separator {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 8px;
    display: inline-block;
    vertical-align: middle;
}

/* =============================================
   3. Comment Dialog
   ============================================= */

.workflow-comment-dialog {
    padding: 16px;
}

.workflow-comment-dialog .workflow-comment-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dx-color-text, #333);
}

.workflow-comment-dialog .workflow-transition-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 13px;
}

.workflow-comment-dialog .workflow-transition-arrow {
    color: #999;
}

/* =============================================
   4. Row Highlighting (ListView)
   ============================================= */

.workflow-needs-action {
    background-color: #FFF8E1 !important;
}

.workflow-needs-action:hover {
    background-color: #FFF3C4 !important;
}

.workflow-needs-action td {
    border-bottom-color: #FFE082 !important;
}

/* Status badge in grid cells */
.workflow-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

/* =============================================
   5. Notification Bell
   ============================================= */

#notification-bell {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 8px 12px;
    float: right;
    margin-top: 10px;
    transition: opacity 0.2s;
}

#notification-bell:hover {
    opacity: 0.8;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #F44336;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Notification panel */
.workflow-notification-panel {
    max-height: 400px;
    overflow-y: auto;
}

.workflow-notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.workflow-notification-item:hover {
    background: #f8f8f8;
}

.workflow-notification-item.unread {
    background: #E3F2FD;
}

.workflow-notification-item.unread:hover {
    background: #BBDEFB;
}

.workflow-notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FF9800;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.workflow-notification-content {
    flex: 1;
    min-width: 0;
}

.workflow-notification-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--dx-color-text, #333);
    margin-bottom: 2px;
}

.workflow-notification-message {
    font-size: 12px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workflow-notification-time {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

.workflow-notification-empty {
    padding: 30px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* =============================================
   6. Menu Badge Counts
   ============================================= */

.menu-badge {
    display: inline-block;
    background: #FF9800;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    margin-left: 6px;
    min-width: 16px;
    text-align: center;
    line-height: 16px;
}

/* =============================================
   7. History Tab (DetailView)
   ============================================= */

.workflow-history-container {
    padding: 8px;
    height: 100%;
}

.workflow-history-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.workflow-history-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2196F3;
    margin-top: 4px;
    flex-shrink: 0;
}

.workflow-history-dot.auto {
    background: #9E9E9E;
}

.workflow-history-details {
    flex: 1;
}

.workflow-history-transition {
    font-size: 13px;
    font-weight: 500;
}

.workflow-history-meta {
    font-size: 12px;
    color: #777;
    margin-top: 2px;
}

.workflow-history-comment {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
    padding: 4px 8px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #ddd;
}

/* =============================================
   8. Context Menu Workflow Items
   ============================================= */

.dx-context-menu .workflow-menu-item {
    font-weight: 500;
}

.dx-context-menu .workflow-menu-arrow {
    color: #4CAF50;
    margin-right: 4px;
}
