/**
 * NAPSA ERM Standard Components CSS
 * Version 1.0 | December 2025
 *
 * This file contains standardized styles for all NAPSA ERM pages.
 * Include this file in addition to Bootstrap and base styles.
 */

/* ==========================================================================
   1. CSS VARIABLES
   ========================================================================== */

:root {
    /* Brand Colors */
    --napsa-blue: #002868;
    --napsa-blue-light: #1e3a8a;
    --napsa-blue-dark: #001a42;
    --napsa-orange: #FFA500;
    --napsa-green: #90EE90;
    --napsa-gold: #FFD700;

    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-white: #ffffff;

    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-dark: #1f2937;

    /* Border Colors */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #9ca3af;

    /* Status Colors */
    --status-success: #10b981;
    --status-success-bg: #dcfce7;
    --status-success-text: #166534;
    --status-warning: #f59e0b;
    --status-warning-bg: #fef3c7;
    --status-warning-text: #92400e;
    --status-danger: #ef4444;
    --status-danger-bg: #fef2f2;
    --status-danger-text: #dc2626;
    --status-info: #3b82f6;
    --status-info-bg: #dbeafe;
    --status-info-text: #1e40af;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #002868 0%, #1e3a8a 100%);
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --gradient-info: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);

    /* Module Gradients */
    --gradient-risk: linear-gradient(135deg, #FFA500 0%, #ff8c00 100%);
    --gradient-compliance: linear-gradient(135deg, #90EE90 0%, #7dd87d 100%);
    --gradient-controls: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-projects: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
    --gradient-executive: linear-gradient(135deg, #FFD700 0%, #ffc107 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: all 0.15s ease;
    --transition-base: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}


/* ==========================================================================
   2. PAGE HEADER
   ========================================================================== */

.page-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Module-specific headers */
.page-header.risk { background: var(--gradient-risk); }
.page-header.compliance { background: var(--gradient-compliance); color: var(--text-primary); }
.page-header.controls { background: var(--gradient-controls); }
.page-header.projects { background: var(--gradient-projects); }
.page-header.executive { background: var(--gradient-executive); color: var(--text-primary); }


/* ==========================================================================
   3. STATISTICS CARDS
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-base);
    border: 1px solid var(--border-light);
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stats-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stats-icon.primary { background: var(--gradient-primary); }
.stats-icon.success { background: var(--gradient-success); }
.stats-icon.warning { background: var(--gradient-warning); }
.stats-icon.danger { background: var(--gradient-danger); }
.stats-icon.info { background: var(--gradient-info); }
.stats-icon.purple { background: var(--gradient-purple); }

.stats-content {
    flex: 1;
    min-width: 0;
}

.stats-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stats-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}


/* ==========================================================================
   4. FILTER SECTION
   ========================================================================== */

.filters-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.filters-section .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.filters-section .form-control,
.filters-section .form-select {
    border-radius: var(--radius-md);
    border-color: var(--border-light);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
}

.filters-section .form-control:focus,
.filters-section .form-select:focus {
    border-color: var(--napsa-blue);
    box-shadow: 0 0 0 3px rgba(0, 40, 104, 0.1);
}

.filters-section .input-group-text {
    background: var(--bg-secondary);
    border-color: var(--border-light);
    color: var(--text-muted);
}


/* ==========================================================================
   5. TABLES
   ========================================================================== */

.table-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.table-standard {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table-standard thead th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
}

.table-standard tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--bg-tertiary);
}

.table-standard tbody tr:hover {
    background-color: rgba(0, 40, 104, 0.02);
}

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

.table-standard tbody tr.clickable {
    cursor: pointer;
}

/* Table action buttons */
.table-actions {
    display: flex;
    gap: 0.25rem;
}

.table-actions .btn {
    padding: 0.375rem 0.5rem;
}


/* ==========================================================================
   6. CARDS
   ========================================================================== */

.content-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition-base);
}

.content-card:hover {
    box-shadow: var(--shadow-md);
}

.content-card .card-header {
    background: var(--bg-secondary);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.content-card .card-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-card .card-body {
    padding: 1.25rem;
}

/* Module border variants */
.content-card.risk-border { border-left: 4px solid var(--napsa-orange); }
.content-card.compliance-border { border-left: 4px solid var(--napsa-green); }
.content-card.controls-border { border-left: 4px solid #6366f1; }
.content-card.projects-border { border-left: 4px solid #2563eb; }


/* ==========================================================================
   7. BUTTONS
   ========================================================================== */

.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #001a42 0%, #1e3a8a 100%);
    box-shadow: 0 4px 6px rgba(0, 40, 104, 0.3);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    border: none;
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
    color: white;
}

.btn-warning {
    background: var(--gradient-warning);
    border: none;
    color: white;
}

.btn-warning:hover {
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    border: none;
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
    color: white;
}

.btn-info {
    background: var(--gradient-info);
    border: none;
    color: white;
}

.btn-info:hover {
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    color: white;
}

.btn-outline-primary {
    border-color: var(--napsa-blue);
    color: var(--napsa-blue);
}

.btn-outline-primary:hover {
    background: var(--napsa-blue);
    color: white;
}

.btn-outline-secondary {
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}


/* ==========================================================================
   8. FORMS
   ========================================================================== */

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--napsa-blue);
    box-shadow: 0 0 0 3px rgba(0, 40, 104, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.is-invalid {
    border-color: var(--status-danger);
}

.form-control.is-valid {
    border-color: var(--status-success);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}


/* ==========================================================================
   9. MODALS
   ========================================================================== */

.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.modal-header-gradient {
    background: var(--gradient-primary);
    border: none;
    padding: 1.25rem 1.5rem;
}

.modal-header-gradient .modal-title {
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header-gradient .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: 1rem 1.5rem;
}

/* Step indicator */
.modal-steps {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.modal-step {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: var(--transition-slow);
}

.modal-step.active .step-circle {
    background: var(--gradient-primary);
    color: white;
}

.modal-step.completed .step-circle {
    background: var(--gradient-success);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.modal-step.active .step-label {
    color: var(--text-primary);
    font-weight: 500;
}

.step-connector {
    width: 60px;
    height: 2px;
    background: var(--border-light);
    margin-top: 18px;
    transition: var(--transition-slow);
}

.modal-step.completed + .step-connector {
    background: var(--status-success);
}


/* ==========================================================================
   10. TABS
   ========================================================================== */

.nav-tabs-custom {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    padding: 0;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-radius: 0;
    font-weight: 500;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    transition: var(--transition-base);
}

.nav-tabs-custom .nav-link:hover {
    background: var(--bg-secondary);
    color: var(--napsa-blue);
}

.nav-tabs-custom .nav-link.active {
    background: var(--napsa-blue);
    color: white;
    border: none;
}

.nav-tabs-custom .nav-link i {
    margin-right: 0.5rem;
}


/* ==========================================================================
   11. BADGES
   ========================================================================== */

.badge-status {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-status.success {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.badge-status.warning {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.badge-status.danger {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

.badge-status.info {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.badge-status.neutral {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Risk level badges */
.badge-risk {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.badge-risk.critical { background: linear-gradient(135deg, #dc2626, #ef4444); }
.badge-risk.high { background: linear-gradient(135deg, #ea580c, #f97316); }
.badge-risk.medium { background: linear-gradient(135deg, #ca8a04, #eab308); }
.badge-risk.low { background: linear-gradient(135deg, #16a34a, #22c55e); }


/* ==========================================================================
   12. LOADING STATES
   ========================================================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-overlay .loading-content {
    text-align: center;
}

.loading-overlay .loading-content p {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.spinner-custom {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-light);
    border-top-color: var(--napsa-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button loading state */
.btn .btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}


/* ==========================================================================
   13. EMPTY STATES
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-state-icon i {
    font-size: 2rem;
    color: var(--text-muted);
}

.empty-state h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* Error state */
.empty-state.error .empty-state-icon {
    background: var(--status-danger-bg);
}

.empty-state.error .empty-state-icon i {
    color: var(--status-danger);
}


/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */

@media (max-width: 767.98px) {
    .page-header {
        padding: 1rem !important;
    }

    .page-header-content {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stats-value {
        font-size: 1.5rem;
    }

    .filters-section .col-md-3,
    .filters-section .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .table-container {
        overflow-x: auto;
    }

    .nav-tabs-custom .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .modal-steps {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .step-connector {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header-actions {
        flex-direction: column;
    }

    .page-header-actions .btn {
        width: 100%;
    }
}


/* ==========================================================================
   15. UTILITY CLASSES
   ========================================================================== */

/* Text utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Cursor utilities */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Hover utilities */
.hover-lift {
    transition: var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* Animation utilities */
.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}


/* ==========================================================================
   16. ENHANCED ANIMATIONS & MICRO-INTERACTIONS
   ========================================================================== */

/* Pulse animation for live indicators */
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--status-success);
    background: var(--status-success-bg);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--status-success);
    border-radius: 50%;
    margin-right: 0.375rem;
    animation: pulse-dot 2s infinite;
}

/* Bounce animation */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.animate-bounce {
    animation: bounce 1s ease infinite;
}

/* Scale animation */
@keyframes scale-in {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.animate-scale-in {
    animation: scale-in 0.3s ease;
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.animate-shake {
    animation: shake 0.6s ease;
}

/* Skeleton loading */
@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-md);
}


/* ==========================================================================
   17. TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast-modern {
    min-width: 280px;
    max-width: 400px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transform: translateX(120%);
    opacity: 0;
    transition: var(--transition-slow);
    border-left: 4px solid transparent;
}

.toast-modern.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-modern.success {
    border-left-color: var(--status-success);
}

.toast-modern.warning {
    border-left-color: var(--status-warning);
}

.toast-modern.danger {
    border-left-color: var(--status-danger);
}

.toast-modern.info {
    border-left-color: var(--status-info);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.toast-modern.success .toast-icon {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.toast-modern.warning .toast-icon {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.toast-modern.danger .toast-icon {
    background: var(--status-danger-bg);
    color: var(--status-danger);
}

.toast-modern.info .toast-icon {
    background: var(--status-info-bg);
    color: var(--status-info);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}


/* ==========================================================================
   18. PROGRESS INDICATORS
   ========================================================================== */

/* Horizontal progress bar */
.progress-bar-modern {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-modern .progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-bar-modern .progress-fill.success {
    background: var(--gradient-success);
}

.progress-bar-modern .progress-fill.warning {
    background: var(--gradient-warning);
}

.progress-bar-modern .progress-fill.danger {
    background: var(--gradient-danger);
}

.progress-bar-modern .progress-fill.info {
    background: var(--gradient-info);
}

.progress-bar-modern .progress-fill.primary {
    background: var(--gradient-primary);
}

/* Circular progress */
.progress-circle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle .progress-bg {
    stroke: var(--bg-tertiary);
}

.progress-circle .progress-value {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-circle .progress-text {
    position: absolute;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Step progress indicator */
.step-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 1.5rem 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 3px;
    background: var(--bg-tertiary);
    transition: background 0.3s ease;
}

.step-item.completed:not(:last-child)::after {
    background: var(--status-success);
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 3px solid var(--bg-tertiary);
    transition: var(--transition-slow);
    z-index: 1;
}

.step-item.active .step-circle {
    background: var(--napsa-blue);
    border-color: var(--napsa-blue);
    color: white;
    box-shadow: 0 0 0 4px rgba(0, 40, 104, 0.2);
}

.step-item.completed .step-circle {
    background: var(--status-success);
    border-color: var(--status-success);
    color: white;
}

.step-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

.step-item.active .step-label {
    color: var(--napsa-blue);
    font-weight: 600;
}

.step-item.completed .step-label {
    color: var(--status-success);
}


/* ==========================================================================
   19. WIZARD SPECIFIC STYLES
   ========================================================================== */

.wizard-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.wizard-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem 2rem;
}

.wizard-header h2 {
    margin: 0 0 0.25rem;
    font-weight: 700;
    font-size: 1.5rem;
}

.wizard-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.wizard-content {
    padding: 2rem;
}

.wizard-section {
    margin-bottom: 2rem;
}

.wizard-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-section-title i {
    color: var(--napsa-blue);
}

.wizard-footer {
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wizard-footer .btn {
    min-width: 120px;
}

/* Form group enhancements for wizard */
.wizard-content .form-label {
    font-weight: 600;
    color: var(--text-primary);
}

.wizard-content .form-label .text-danger {
    margin-left: 0.25rem;
}

.wizard-content .form-label .fa-question-circle {
    color: var(--text-muted);
    cursor: help;
}


/* ==========================================================================
   20. KRI-SPECIFIC STYLES
   ========================================================================== */

/* KRI Status indicators */
.kri-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kri-status.green {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.kri-status.amber {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.kri-status.red {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

.kri-status.critical {
    background: #450a0a;
    color: #fecaca;
}

/* KRI Trend indicators */
.kri-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.kri-trend.improving {
    color: var(--status-success);
}

.kri-trend.stable {
    color: var(--text-muted);
}

.kri-trend.deteriorating {
    color: var(--status-danger);
}

/* KRI Threshold visualization */
.kri-threshold-bar {
    position: relative;
    height: 40px;
    background: linear-gradient(
        to right,
        var(--status-success) 0%,
        var(--status-success) 33%,
        var(--status-warning) 33%,
        var(--status-warning) 66%,
        var(--status-danger) 66%,
        var(--status-danger) 100%
    );
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.kri-threshold-marker {
    position: absolute;
    top: -8px;
    width: 4px;
    height: calc(100% + 16px);
    background: var(--text-primary);
    border-radius: 2px;
    transform: translateX(-50%);
}

.kri-threshold-marker::before {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--text-primary);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* KRI Gauge */
.kri-gauge {
    width: 200px;
    height: 100px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.kri-gauge .gauge-bg {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 20px solid var(--bg-tertiary);
    border-bottom-color: transparent;
    border-radius: 50%;
    top: 0;
}

.kri-gauge .gauge-fill {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 20px solid;
    border-bottom-color: transparent;
    border-radius: 50%;
    top: 0;
    transform: rotate(45deg);
    transition: transform 0.5s ease;
}

.kri-gauge .gauge-value {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}


/* ==========================================================================
   21. ENHANCED FORM FEEDBACK
   ========================================================================== */

/* Input with validation states */
.form-control.validated {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    border-color: var(--status-success);
}

.form-control.error {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    border-color: var(--status-danger);
}

/* Inline validation message */
.validation-message {
    font-size: 0.8rem;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.validation-message.success {
    color: var(--status-success);
}

.validation-message.error {
    color: var(--status-danger);
}

/* Character counter */
.char-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: var(--status-warning);
}

.char-counter.danger {
    color: var(--status-danger);
}

/* Input group enhancements */
.input-group-modern {
    position: relative;
}

.input-group-modern .form-control {
    padding-left: 2.5rem;
}

.input-group-modern .input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 5;
    pointer-events: none;
}

.input-group-modern .form-control:focus + .input-icon {
    color: var(--napsa-blue);
}


/* ==========================================================================
   22. QUICK ACTION CARDS
   ========================================================================== */

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-action-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
}

.quick-action-card:hover {
    border-color: var(--napsa-blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-action-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.quick-action-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.quick-action-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}


/* ==========================================================================
   23. KEYBOARD SHORTCUTS INDICATOR
   ========================================================================== */

kbd {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-family: inherit;
    color: var(--text-secondary);
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.shortcuts-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.shortcuts-hint kbd {
    margin: 0 0.125rem;
}
