/**
 * ResiPlan - Module Style Unifié
 * Design moderne et cohérent pour tous les modules BCMS
 */

/* === COULEURS GLOBALES === */
:root {
    /* Gradients principaux */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --gradient-success: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    --gradient-danger: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --gradient-warning: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    --gradient-info: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);

    /* Couleurs de priorité */
    --priority-critical: #dc3545;
    --priority-high: #fd7e14;
    --priority-medium: #ffc107;
    --priority-low: #28a745;

    /* Couleurs de statut */
    --status-active: #28a745;
    --status-draft: #6c757d;
    --status-review: #17a2b8;
    --status-archived: #dc3545;

    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 8px 25px rgba(102, 126, 234, 0.2);

    /* Transitions */
    --transition-base: all 0.3s ease;
}

/* === BODY & BACKGROUND === */
body {
    background: var(--gradient-bg);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* === PAGE HEADER === */
.page-header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.page-header h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1rem;
    opacity: 0.95;
}

/* === STAT CARDS === */
.stat-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    transition: var(--transition-base);
    border-left: 4px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card.primary { border-left-color: #667eea; }
.stat-card.success { border-left-color: #28a745; }
.stat-card.warning { border-left-color: #ffc107; }
.stat-card.danger { border-left-color: #dc3545; }
.stat-card.info { border-left-color: #17a2b8; }

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.3;
}

/* === CHART CONTAINERS === */
.chart-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.chart-container h5 {
    font-weight: 600;
    color: #333;
}

/* === CARDS & ITEMS === */
.form-card,
.library-card,
.detail-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.item-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition-base);
    cursor: pointer;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: #667eea;
}

/* === QUICK ACTIONS === */
.quick-action {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid #667eea;
    transition: var(--transition-base);
    text-decoration: none;
    color: inherit;
    display: block;
}

.quick-action:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    color: inherit;
}

/* === BADGES === */
.priority-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.priority-critical {
    background: var(--priority-critical);
    color: white;
}

.priority-high {
    background: var(--priority-high);
    color: white;
}

.priority-medium {
    background: var(--priority-medium);
    color: #000;
}

.priority-low {
    background: var(--priority-low);
    color: white;
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-active {
    background: var(--status-active);
    color: white;
}

.status-draft {
    background: var(--status-draft);
    color: white;
}

.status-review {
    background: var(--status-review);
    color: white;
}

.status-archived {
    background: var(--status-archived);
    color: white;
}

.badge-custom {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

/* === SECTION HEADERS === */
.section-header {
    border-left: 4px solid #667eea;
    padding-left: 1rem;
    margin: 2rem 0 1rem 0;
    color: #667eea;
    font-weight: 600;
}

/* === TABS === */
.nav-tabs-custom {
    border-bottom: 2px solid #667eea;
}

.nav-tabs-custom .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: var(--transition-base);
}

.nav-tabs-custom .nav-link.active {
    color: #667eea;
    border-bottom: 3px solid #667eea;
    background: transparent;
}

.nav-tabs-custom .nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

/* === LINKED ITEMS === */
.linked-item {
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    transition: var(--transition-base);
}

.linked-item:hover {
    background: #e9ecef;
}

.linked-item .btn-remove {
    opacity: 0;
    transition: opacity 0.3s;
}

.linked-item:hover .btn-remove {
    opacity: 1;
}

/* === ADD ITEM SECTION === */
.add-item-section {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1rem;
    background: #f8f9fa;
    transition: var(--transition-base);
}

.add-item-section:hover {
    border-color: #667eea;
    background: white;
}

/* === RISK BADGES (pour ERP Kinney) === */
.risk-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
}

.risk-critical {
    background: #dc3545;
    color: white;
}

.risk-high {
    background: #fd7e14;
    color: white;
}

.risk-substantial {
    background: #ffc107;
    color: #000;
}

.risk-moderate {
    background: #20c997;
    color: white;
}

.risk-low {
    background: #28a745;
    color: white;
}

/* === INDICATEURS RTO/RPO === */
.rto-indicator,
.rpo-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.rto-value,
.rpo-value {
    font-weight: 600;
    color: #667eea;
}

/* === FORMS === */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 1rem;
    transition: var(--transition-base);
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* === BUTTONS === */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: var(--transition-base);
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

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

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

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

/* === ALERTS === */
.alert {
    border-radius: 10px;
    border-left: 4px solid;
}

.alert-info {
    border-left-color: #17a2b8;
    background: #d1ecf1;
}

.alert-success {
    border-left-color: #28a745;
    background: #d4edda;
}

.alert-warning {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.alert-danger {
    border-left-color: #dc3545;
    background: #f8d7da;
}

/* === PROGRESS BARS === */
.progress {
    border-radius: 10px;
    height: 10px;
    background: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* === TABLES === */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background: var(--gradient-primary);
    color: white;
}

.table thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table tbody tr {
    transition: var(--transition-base);
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* === MODALS === */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

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

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .stat-value {
        font-size: 2rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

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

    .quick-action {
        padding: 1rem;
    }

    .item-card {
        padding: 1rem;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.5s ease;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}
