/* ========================================
   ItiContacts Module - Alert Messages
   ======================================== */

/* Base alert */
.iti .alert {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: start;
}

.iti .alert-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.iti .alert-content {
    flex: 1;
}

.iti .alert-title {
    font-weight: bold;
    font-size: 16px;
    display: block;
}

.iti .alert-title:not(:last-child) {
    margin-bottom: 8px;
}

.iti .alert-message {
    margin: 8px 0;
}

.iti .alert ul {
    margin: 10px 0 10px 20px;
    padding: 0;
}

.iti .alert li {
    margin: 5px 0;
}

.iti .alert-actions {
    margin-top: 12px;
}

/* Info - Blue */
.iti .alert-info {
    background-color: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.iti .alert-info .iti .alert-title {
    color: #0c5460;
}

/* Warning - Yellow/Orange */
.iti .alert-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.iti .alert-warning .iti .alert-title {
    color: #856404;
}

/* Error - Red */
.iti .alert-error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.iti .alert-error .iti .alert-title {
    color: #721c24;
}

/* Success - Green */
.iti .alert-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.iti .alert-success .iti .alert-title {
    color: #155724;
}

/* ========================================
   Widget States - Simple One Line Design
   ======================================== */

.iti .widget-state {
    background: #3b82f6;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    color: white;
}

.iti .widget-state::before {
    display: none;
}

.iti .widget-state-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: white;
}

.iti .widget-state-content {
    flex: 1;
    min-width: 0;
}

.iti .widget-state-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.3;
}

.iti .widget-state-decoration {
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    color: white;
}

/* Info State */
.iti .widget-state-info {
    background: #3b82f6;
}

/* Success State */
.iti .widget-state-success {
    background: #10b981;
}

/* ========================================
   Widget Actions - Simple One Line Design
   ======================================== */

.iti .widget-action {
    background: #f59e0b;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0;
    border: none;
    position: relative;
    overflow: hidden;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.iti .widget-action::before {
    display: none;
}

.iti .widget-action-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.iti .widget-action-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.iti .widget-action-content {
    flex: 1;
    min-width: 0;
}

.iti .widget-action-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.3;
}

.iti .widget-action-count {
    display: none;
}

.iti .widget-action-badge {
    flex-shrink: 0;
}

.iti .widget-action-body {
    display: none;
}

.iti .widget-action-description {
    display: none;
}

.iti .widget-action-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Badge Styles */
.iti .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    min-width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.iti .badge-warning {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Button Styles */
.iti .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.iti .btn-primary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.iti .btn-primary:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    text-decoration: none;
    border-color: rgba(255, 255, 255, 0.5);
}

.iti .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .iti .widget-state {
        padding: 12px 16px;
        gap: 10px;
    }

    .iti .widget-state-icon {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }

    .iti .widget-state-title {
        font-size: 14px;
    }

    .iti .widget-state-decoration {
        font-size: 16px;
    }

    .iti .widget-action {
        padding: 12px 16px;
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
    }

    .iti .widget-action-header {
        gap: 10px;
    }

    .iti .widget-action-icon {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }

    .iti .widget-action-title {
        font-size: 14px;
    }

    .iti .widget-action-actions {
        justify-content: center;
        margin-top: 8px;
    }

    .iti .btn {
        flex: 1;
        justify-content: center;
    }

    .iti .badge {
        min-width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* ========================================
   Widget Change Management - Modern Design
   ======================================== */

.iti .widget-change-management {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 12px;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    overflow: hidden;
    position: relative;
    color: white;
}

.iti .widget-change-management::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    pointer-events: none;
}

.iti .widget-change-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 14px 20px;
    position: relative;
    z-index: 1;
}

.iti .widget-change-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.iti .widget-change-icon i {
    color: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.iti .widget-change-title {
    flex: 1;
    min-width: 0;
}

.iti .widget-change-title h4 {
    margin: 0 0 3px 0;
    font-size: 17px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    line-height: 1.3;
}

.iti .widget-change-title p {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.iti .widget-change-message {
    padding: 0 20px 16px 20px;
    position: relative;
    z-index: 1;
}

.iti .widget-change-message p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
}

.iti .widget-change-message a {
    color: white;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.5);
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.iti .widget-change-message a:hover {
    text-decoration-color: white;
}

.iti .widget-change-message p i {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    margin-right: 6px;
    vertical-align: middle;
}

.iti .widget-change-progress {
    padding: 0 20px 20px 20px;
    position: relative;
    z-index: 1;
}

.iti .widget-change-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.iti .widget-change-progress-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
}

.iti .widget-change-progress-label i {
    font-size: 14px;
    opacity: 0.8;
}

.iti .widget-change-progress-percentage {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    font-variant-numeric: tabular-nums;
}

.iti .widget-change-progress-bar {
    width: 100%;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
}

.iti .widget-change-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.iti .widget-change-progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer-progress 2.5s infinite;
}

@keyframes shimmer-progress {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.iti .widget-change-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.iti .widget-change-progress-steps i {
    color: #86efac;
    font-size: 14px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.iti .widget-change-steps-completed {
    font-size: 16px;
    font-weight: 700;
    color: white;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.iti .widget-change-steps-separator {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.iti .widget-change-steps-total {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-variant-numeric: tabular-nums;
}

.iti .widget-change-steps-label {
    margin-left: 3px;
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
    .iti .widget-change-management {
        border-radius: 12px;
    }

    .iti .widget-change-header {
        padding: 18px 18px 12px 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .iti .widget-change-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .iti .widget-change-title h4 {
        font-size: 16px;
    }

    .iti .widget-change-title p {
        font-size: 11px;
    }

    .iti .widget-change-message {
        padding: 0 18px 14px 18px;
    }

    .iti .widget-change-message p {
        font-size: 12px;
    }

    .iti .widget-change-progress {
        padding: 0 18px 18px 18px;
    }

    .iti .widget-change-progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .iti .widget-change-progress-percentage {
        font-size: 18px;
    }

    .iti .widget-change-progress-bar {
        height: 20px;
    }

    .iti .widget-change-progress-steps {
        font-size: 11px;
        flex-wrap: wrap;
    }
}

/* ========================================
   Modern Widget Actions (Vibrant Flat Grid)
   ======================================== */

.iti .widget-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.iti .widget-action {
    background: #64748b;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 0;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.iti .widget-action-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0; /* Allow title to shrink if needed */
}

.iti .widget-action-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.iti .widget-action-title {
    font-weight: 600;
    color: white;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
}

.iti .widget-action-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: 8px;
}

.iti .btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Specific styles for dual counters */
.iti .widget-dual-badge {
    display: flex;
    gap: 12px;
    align-items: center;
}

.iti .widget-badge-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.iti .widget-badge-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.iti .widget-badge-value {
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    min-width: 24px;
    text-align: center;
    background: white;
    color: #475569;
}

.iti .badge-orange {
    background: white;
    color: #c2410c;
}

/* Grouped items styles - Vibrant Flat */
.iti .widget-action-grouped {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.iti .widget-action-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    padding-bottom: 12px;
}

.iti .widget-action-group-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.iti .widget-action-group-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
}

.iti .widget-action-group-item:last-child {
    border-bottom: none;
}

.iti .widget-action-group-label {
    font-size: 13px;
    font-weight: 500;
    color: white;
    /* Natural width — no flex:1 to avoid huge gap */
}


.iti .widget-action-group-ops {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Variants - Vibrant Flat */
.iti .widget-action-danger {
    background: #ef4444;
}
.iti .widget-action-danger .widget-badge-value {
    color: #ef4444;
}

.iti .widget-action-success {
    background: #10b981;
}

.iti .widget-action-warning {
    background: #f59e0b;
}
.iti .widget-action-warning .widget-badge-value {
    color: #f59e0b;
}

.iti .widget-action-info {
    background: #3b82f6;
}
.iti .widget-action-info .widget-badge-value {
    color: #3b82f6;
}

/* ========================================
   WIDGET EMPTY STATE
   ======================================== */

.iti .widget-empty-state {
    text-align: center;
    padding: 30px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ced4da;
    color: #6c757d;
}

.iti .widget-empty-state .empty-icon {
    font-size: 32px;
    color: #adb5bd;
    margin-bottom: 15px;
}

.iti .widget-empty-state .empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.iti .widget-empty-state .empty-text {
    font-size: 13px;
    color: #868e96;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}
