/* Style CSS pour le système de transport de marchandises */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --text-color: #374151;
    --sidebar-width: 260px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.3), transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(99, 102, 241, 0.2), transparent 50%);
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.login-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.6s ease-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-header h1 {
    font-size: 32px;
    color: var(--dark-color);
    margin-bottom: 8px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: var(--white);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    user-select: none;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.toggle-password:hover {
    opacity: 0.7;
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

.login-info {
    text-align: center;
    margin-top: 20px;
    color: #6b7280;
}

.login-info p {
    margin: 5px 0;
}

.login-info a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.3s;
}

.login-info a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.login-form .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    padding: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 10px;
}

.login-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.login-form .btn-primary:active {
    transform: translateY(0);
}

/* Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 15px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 8px;
    line-height: 1.3;
}

.sidebar-logo {
    width: 140px;
    height: 70px;
    object-fit: contain;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left-color: var(--primary-color);
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.2);
    color: var(--white);
    border-left-color: var(--primary-color);
}

.nav-item .icon {
    margin-right: 12px;
    font-size: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: capitalize;
}

.btn-logout {
    display: block;
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.2);
    color: var(--white);
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.btn-logout:hover {
    background: var(--danger-color);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-header {
    background: var(--white);
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-header h1 {
    font-size: 26px;
    color: var(--dark-color);
    font-weight: 600;
}

.current-date {
    color: #6b7280;
    font-size: 14px;
}

.content {
    padding: 30px;
    flex: 1;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-info h3 {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-info .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-icon {
    font-size: 48px;
    opacity: 0.8;
}

.stat-card.primary { border-left: 4px solid var(--primary-color); }
.stat-card.success { border-left: 4px solid var(--success-color); }
.stat-card.warning { border-left: 4px solid var(--warning-color); }
.stat-card.danger { border-left: 4px solid var(--danger-color); }
.stat-card.info { border-left: 4px solid #3b82f6; }

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.btn-success:hover {
    background: #059669;
}

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

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

.btn-secondary {
    background: #6b7280;
    color: var(--white);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

table thead {
    background: var(--light-color);
}

table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

table tbody tr:hover {
    background: var(--light-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: var(--success-color);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: var(--danger-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-color: var(--primary-color);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: var(--warning-color);
}

/* Filter Section */
.filter-section {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

/* Actions */
.actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    background: transparent;
}

.action-btn-edit {
    background: #dbeafe;
    color: #1e40af;
}

.action-btn-edit:hover {
    background: var(--primary-color);
    color: var(--white);
}

.action-btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.action-btn-delete:hover {
    background: var(--danger-color);
    color: var(--white);
}

.action-btn-view {
    background: #d1fae5;
    color: #065f46;
}

.action-btn-view:hover {
    background: var(--success-color);
    color: var(--white);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 25px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 25px 0;
}

.quick-action-btn {
    background: linear-gradient(135deg, var(--white) 0%, #f8fafc 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 30px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.2);
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, var(--white) 0%, #f1f5f9 100%);
}

.quick-action-btn:hover::before {
    transform: scaleX(1);
}

.quick-action-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.15);
}

.quick-action-icon {
    font-size: 56px;
    margin-bottom: 15px;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.quick-action-text h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 10px;
    line-height: 1.2;
}

.quick-action-text p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
}

/* Styles spécifiques pour les liens directs */
.quick-action-btn[href] {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-color: #cbd5e1;
}

.quick-action-btn[href]:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: var(--primary-color);
}

.quick-action-btn[href] .quick-action-text h3 {
    color: var(--primary-color);
}

.quick-action-btn[href] .quick-action-text p {
    color: #64748b;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 50px auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 25px;
    background: var(--light-color);
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-body {
    padding: 25px;
}

.close {
    color: #6b7280;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--dark-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar-header h2,
    .nav-item span:not(.icon),
    .user-info,
    .sidebar-footer {
        display: none;
    }
    
    .sidebar-logo {
        width: 60px;
        height: 40px;
        padding: 5px;
    }
    
    .sidebar-header {
        min-height: auto;
        padding: 15px 10px;
    }
    
    .main-content {
        margin-left: 80px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 0;
    }
    
    .quick-action-btn {
        padding: 25px 20px;
        border-radius: 12px;
    }
    
    .quick-action-icon {
        font-size: 48px;
        margin-bottom: 12px;
    }
    
    .quick-action-text h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .quick-action-text p {
        font-size: 13px;
    }
    
    .login-container {
        max-width: 100%;
        padding: 10px;
    }
    
    .login-box {
        padding: 25px;
    }
}

/* Print Styles */
@media print {
    @page {
        margin: 2cm;
    }
    
    body {
        background: white;
    }
    
    .sidebar,
    .top-header,
    .filter-section,
    .actions,
    .btn,
    .action-btn,
    .btn-group {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
        page-break-inside: avoid;
    }
    
    /* En-tête d'impression avec logo */
    .print-header {
        display: block !important;
        text-align: center;
        padding: 20px 0;
        border-bottom: 3px solid var(--primary-color);
        margin-bottom: 30px;
    }
    
    .print-logo {
        width: 250px;
        height: 120px;
        object-fit: contain;
        margin: 0 auto 15px;
        display: block;
    }
    
    .print-company-name {
        font-size: 24px;
        font-weight: bold;
        color: var(--dark-color);
        margin: 10px 0;
    }
    
    .print-company-info {
        font-size: 12px;
        color: #666;
    }
    
    .print-date {
        text-align: right;
        font-size: 11px;
        color: #666;
        margin-top: 10px;
    }
    
    /* Pied de page d'impression */
    .print-footer {
        display: block !important;
        text-align: center;
        padding-top: 20px;
        margin-top: 30px;
        border-top: 2px solid #ddd;
        font-size: 10px;
        color: #666;
    }
    
    .badge {
        border: 1px solid #333;
        padding: 3px 8px;
    }
    
    /* Amélioration des tableaux à l'impression */
    table {
        font-size: 11px;
    }
    
    table th {
        background: #f3f4f6 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .stat-card {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    /* Masquer les éléments non pertinents pour l'impression */
    a[href]:after {
        content: none !important;
    }
}
