:root {
    --primary-gold: #b8860b;
    --secondary-gold: #daa520;
    --accent-blue: #4a90e2;
    --success-green: #4caf50;
    --warning-orange: #ff9800;
    --error-red: #dc3545;
    --info-blue: #5bc0de;
    --text-dark: #2E2E2E;
    --text-light: #6C757D;
    --border-light: #E9ECEF;
    --white: #FFFFFF;
    --light-gray: #F1F3F4;
    --background-light: #f9f9f9;
}

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

html {
    height: 100%;
}

body {
    margin: 0;
    padding: 15px;
    min-height: 100%;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    background-color: var(--background-light);
    line-height: 1.4;
    font-size: 14px;
}

.container {
    max-width: 1200px;
    /* Largeur maximale augmentée */
    margin: 0 auto;
    padding: 0 25px;
    /* Marges internes ajustées */
    width: 100%;
}

/* Header style TVA */
.header {
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
    padding: 15px 20px;
    border-radius: 25px;
    margin-bottom: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    position: relative;
}

.logo-circle {
    width: 50px;
    height: 50px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    overflow: hidden;
}

.logo-circle img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.header h1 {
    font-family: 'Trebuchet MS', Arial, sans-serif;
    color: white;
    margin: 0;
    font-size: clamp(16px, 3vw, 24px);
    font-weight: normal;
    flex: 1;
}

/* Bouton aide style TVA */
.help-icon {
    display: inline-block;
    width: 35px;
    height: 35px;
    background-color: #cd1414;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    font-weight: bold;
    cursor: help;
    position: relative;
    font-size: 18px;
    flex-shrink: 0;
    border: none;
    transition: all 0.3s ease;
}

.help-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(205, 20, 20, 0.4);
}

.help-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(5px);
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    text-align: left;
    border-radius: 6px;
    padding: 15px;
    position: absolute;
    z-index: 1000;
    top: 125%;
    right: 0;
    width: 300px;
    transition: all 0.3s;
    transform: translateY(0);
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 20px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.9) transparent;
}

/* Section mouvements de stock */
.mouvements-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
}

.mouvements-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-gold);
    flex-wrap: wrap;
}

.mouvements-header h2 {
    color: var(--primary-gold);
    font-size: 1.4rem;
    margin: 0;
    flex: 1;
}

.link-mouvements {
    background: linear-gradient(135deg, var(--info-blue) 0%, #31b0d5 100%);
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(91, 192, 222, 0.3);
}

.link-mouvements:hover {
    background: linear-gradient(135deg, #31b0d5 0%, var(--info-blue) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(91, 192, 222, 0.4);
    color: white;
    text-decoration: none;
}

.mouvements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.mouvement-card {
    border: 2px solid #333;
    border-radius: 4px;
    background: white;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.mouvement-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: #f8f9fa;
    padding: 8px 10px;
    border-bottom: 1px solid #333;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.card-ref {
    font-weight: bold;
}

.card-designation {
    grid-column: 1 / -1;
    color: #0066cc;
    font-weight: bold;
    margin-top: 2px;
}

.card-body {
    padding: 8px 10px;
}

.card-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 8px;
    padding: 3px 0;
    align-items: center;
    border-bottom: 1px dotted #ccc;
}

.card-row:last-child {
    border-bottom: none;
}

.card-date {
    font-weight: bold;
    width: 60px;
}

.card-doc {
    color: #0066cc;
    font-weight: bold;
}

.card-entree {
    text-align: right;
    font-weight: bold;
    color: #28a745;
    width: 40px;
}

.card-sortie {
    text-align: right;
    font-weight: bold;
    color: #dc3545;
    width: 40px;
}

.card-pu {
    text-align: right;
    width: 40px;
    font-size: 12px;
}

/* Layout principal */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 25px;
    align-items: start;
}

/* Section du tableau */
.stock-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
}

.stock-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-gold);
}

.stock-header h2 {
    color: var(--primary-gold);
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.stock-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 600;
    flex-wrap: wrap;
    gap: 10px;
}

/* Tableau */
.stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 0 auto;
    background-color: white;
}

.stock-table thead {
    background-color: var(--accent-blue);
    color: white;
}

.stock-table th {
    padding: 12px 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    text-align: center;
    border: 1px solid #ddd;
}

.stock-table th:nth-child(1) {
    width: 80px;
}

.stock-table th:nth-child(2) {
    width: 200px;
}

.stock-table th:nth-child(3) {
    width: 80px;
}

.stock-table th:nth-child(4) {
    width: 80px;
}

.stock-table th:nth-child(5) {
    width: 80px;
}

.stock-table th:nth-child(6) {
    width: 50px;
}

.stock-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-light);
}

.stock-table tbody tr:nth-child(even) {
    background: #f5f5f5;
}

.stock-table tbody tr:hover {
    background: linear-gradient(135deg, #FFF8E1 0%, #FEF5E7 100%);
}

.stock-table td {
    padding: 8px 6px;
    text-align: center;
    vertical-align: middle;
    border: 1px solid #ddd;
}

/* Inputs */
.stock-input {
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
    width: 100%;
}

.stock-input:focus {
    outline: 2px solid var(--accent-blue);
    border-color: var(--accent-blue);
}

.date-input {
    width: 70px;
    text-align: center;
}

.doc-input {
    width: 190px;
    text-align: left;
}

.qty-input {
    width: 70px;
    text-align: center;
}

/* Indicateurs de statut */
.status-indicator {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: white;
}

.status-indicator.green {
    background-color: var(--success-green);
    border-color: var(--success-green);
    color: white;
}

.status-indicator.red {
    background-color: var(--error-red);
    border-color: var(--error-red);
    color: white;
}

/* Panel droit */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Section stock initial */
.stock-info-section {
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-gold);
}

.stock-initial-title {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 8px;
}

.stock-initial-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--error-red);
}

/* Section calculs */
.calculations-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--accent-blue);
    transition: all 0.5s ease;
    min-width: 380px;
}

.calculations-section.highlight {
    background: linear-gradient(135deg, var(--light-gray) 0%, #E3F2FD 100%);
    border: 3px solid var(--accent-blue);
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.3);
    transform: scale(1.02);
}

.calc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light);
}

.calc-header h3 {
    color: var(--text-dark);
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.calculation-row {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.calc-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
}

.calc-inputs-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.calc-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 8px 6px;
    font-weight: 600;
    font-size: 1rem;
    margin: 0 4px;
}

.calc-input:focus {
    outline: 2px solid var(--accent-blue);
    border-color: var(--accent-blue);
}

.calc-operator {
    background: var(--warning-orange);
    border: 1px solid #ccc;
    border-radius: 3px;
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    margin: 0 6px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.equals-sign {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--accent-blue);
    margin: 0 8px;
}

.calc-status {
    margin-left: 15px;
    align-self: center;
}

/* Infobulles pour calculs */
.calc-tooltip {
    position: relative;
    display: inline-block;
}

.calc-tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(44, 62, 80, 0.9) 100%);
    color: white;
    text-align: center;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 1000;
    bottom: 130%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 11px;
    line-height: 1.4;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.calc-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.calc-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    transform: translateY(-8px);
}

/* Score de réussite */
.score-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin: 20px auto;
    max-width: 300px;
    font-weight: normal;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.score-title {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.score-display {
    font-size: 24px;
    color: #007bff;
    margin: 5px 0;
    font-weight: bold;
}

/* Système de tentatives */
.tentatives-container {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin: 15px auto;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.tentatives-titre {
    font-size: 14px;
    font-weight: bold;
    color: #856404;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tentatives-info {
    font-size: 12px;
    color: #856404;
    margin-bottom: 8px;
}

.tentatives-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
}

.tentative-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ffc107;
    background: #fff;
    transition: all 0.3s ease;
    position: relative;
}

.tentative-dot.utilisee {
    background: #dc3545;
    border-color: #dc3545;
}

.tentative-dot.actuelle {
    background: #ffc107;
    border-color: #856404;
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3);
}

.tentatives-warning {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    color: #721c24;
}

.tentatives-blocked {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 2px solid #17a2b8;
    color: #0c5460;
}

/* Boutons style TVA */
.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.action-btn {
    position: relative;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    min-width: 120px;
    justify-content: center;
}

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

.btn-verify:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn-refresh:hover {
    background-color: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-clear {
    background-color: var(--error-red);
    color: white;
}

.btn-clear:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-print {
    background-color: var(--info-blue);
    color: white;
}

.btn-print:hover {
    background-color: #31b0d5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Tooltips pour boutons */
.action-btn:hover .btn-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.btn-tooltip {
    visibility: hidden;
    opacity: 0;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    transition: all 0.3s ease;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.btn-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

/* Modal d'alerte personnalisée */
.custom-alert-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid #e1e5e9;
    animation: slideIn 0.3s ease-out;
}

.custom-alert-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 20px;
}

.custom-alert-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 15px;
}

.custom-alert-content {
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 25px;
    text-align: center;
}

.custom-alert-score {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    border: 1px solid #dee2e6;
}

.custom-alert-score-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--accent-blue);
    margin-bottom: 5px;
}

.custom-alert-attempts {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.custom-alert-message {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.custom-alert-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: all 0.2s ease;
}

.custom-alert-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
}

.custom-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: modalSlideIn 0.3s ease-out;
    border-top: 4px solid var(--primary-gold);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--error-red);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.modal-message {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.modal-btn-confirm {
    background-color: var(--error-red);
    color: white;
}

.modal-btn-confirm:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.modal-btn-cancel {
    background: white;
    color: var(--text-dark);
    border: 2px solid var(--border-light);
}

.modal-btn-cancel:hover {
    background: var(--light-gray);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .right-panel {
        flex-direction: row;
        gap: 20px;
    }

    .stock-info-section {
        flex: 0 0 200px;
    }

    .calculations-section {
        flex: 1;
        min-width: auto;
    }

    .mouvements-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .stock-info {
        flex-direction: column;
        gap: 5px;
    }

    .right-panel {
        flex-direction: column;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 200px;
    }

    .modal-content {
        margin: 20% auto;
        width: 350px;
        padding: 25px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .modal-btn {
        width: 100%;
    }

    .btn-tooltip {
        display: none !important;
    }

    .mouvements-grid {
        grid-template-columns: 1fr;
        max-height: 300px;
    }

    .mouvement-card {
        font-size: 12px;
    }

    .mouvements-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

/* Impression optimisée pour 1 page avec sobriété visuelle */
@media print {

    .help-icon,
    .button-container,
    .custom-modal,
    .custom-alert-overlay,
    .action-btn,
    .mouvements-section,
    .link-mouvements,
    button {
        display: none !important;
    }

    .btn-tooltip {
        display: none !important;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    body {
        background: white !important;
        font-size: 8px !important;
        margin: 0 !important;
        padding: 8px !important;
        line-height: 1.2 !important;
        font-family: 'Trebuchet MS', Arial, sans-serif !important;
    }

    .container {
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* Header élégant */
    .header {
        background: linear-gradient(135deg, #b8860b, #daa520) !important;
        color: white !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 8px 15px !important;
        margin-bottom: 10px !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        page-break-inside: avoid !important;
    }

    .logo-circle {
        width: 25px !important;
        height: 25px !important;
        background: white !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    .logo-circle img {
        width: 18px !important;
        height: 18px !important;
    }

    .header h1 {
        font-size: 0.9rem !important;
        color: white !important;
        margin: 0 !important;
        font-weight: 600 !important;
        flex: 1 !important;
    }

    /* Layout principal optimisé */
    .main-layout {
        display: grid !important;
        grid-template-columns: 1fr 200px !important;
        gap: 10px !important;
        page-break-inside: avoid !important;
        margin-bottom: 8px !important;
    }

    /* Section tableau avec style */
    .stock-section {
        background: white !important;
        border: 2px solid #b8860b !important;
        border-radius: 6px !important;
        padding: 8px !important;
        page-break-inside: avoid !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }

    .stock-header {
        border-bottom: 2px solid #b8860b !important;
        padding-bottom: 4px !important;
        margin-bottom: 6px !important;
    }

    .stock-header h2 {
        font-size: 0.75rem !important;
        color: #b8860b !important;
        margin: 0 0 3px 0 !important;
        font-weight: 600 !important;
    }

    .stock-info {
        font-size: 0.55rem !important;
        color: #333 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1px !important;
    }

    /* Tableau avec style professionnel */
    .stock-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 6.5px !important;
        margin: 0 !important;
        background: white !important;
    }

    .stock-table th {
        background: linear-gradient(135deg, #4a90e2, #357abd) !important;
        color: white !important;
        padding: 4px 2px !important;
        border: 1px solid #2c5f8a !important;
        font-size: 6px !important;
        font-weight: 600 !important;
        text-align: center !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
    }

    .stock-table td {
        border: 1px solid #ddd !important;
        padding: 2px !important;
        text-align: center !important;
        background: white !important;
    }

    .stock-table tbody tr:nth-child(even) td {
        background: #f8f9fa !important;
    }

    .stock-input {
        border: none !important;
        background: transparent !important;
        padding: 1px !important;
        font-size: 6.5px !important;
        width: 100% !important;
        text-align: center !important;
        font-family: inherit !important;
        color: #333 !important;
        font-weight: 500 !important;
    }

    /* Indicateurs avec couleurs */
    .status-indicator {
        width: 10px !important;
        height: 10px !important;
        border-radius: 50% !important;
        border: 1px solid #666 !important;
        margin: 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .status-indicator.green {
        background: #28a745 !important;
        border-color: #1e7e34 !important;
    }

    .status-indicator.red {
        background: #dc3545 !important;
        border-color: #bd2130 !important;
    }

    /* Panel droit stylisé */
    .right-panel {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .stock-info-section {
        background: linear-gradient(135deg, #fff3cd, #ffeaa7) !important;
        border: 2px solid #b8860b !important;
        border-radius: 6px !important;
        padding: 8px !important;
        text-align: center !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }

    .stock-initial-title {
        font-size: 0.6rem !important;
        color: #856404 !important;
        font-weight: 600 !important;
        margin-bottom: 4px !important;
    }

    .stock-initial-value {
        font-size: 1.1rem !important;
        font-weight: bold !important;
        color: #dc3545 !important;
    }

    /* Section calculs avec style */
    .calculations-section {
        background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
        border: 2px solid #4a90e2 !important;
        border-radius: 6px !important;
        padding: 8px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }

    .calc-header {
        border-bottom: 1px solid #4a90e2 !important;
        padding-bottom: 3px !important;
        margin-bottom: 6px !important;
    }

    .calc-header h3 {
        font-size: 0.65rem !important;
        color: #1976d2 !important;
        margin: 0 !important;
        font-weight: 600 !important;
    }

    .calculation-row {
        background: rgba(255, 255, 255, 0.7) !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
        padding: 4px !important;
        margin-bottom: 4px !important;
        page-break-inside: avoid !important;
    }

    .calc-title {
        font-size: 0.55rem !important;
        color: #1976d2 !important;
        font-weight: 600 !important;
        margin-bottom: 3px !important;
        text-align: center !important;
        border-bottom: 1px solid #e3f2fd !important;
        padding-bottom: 2px !important;
    }

    .calc-inputs-row {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
    }

    .calc-input {
        width: 22px !important;
        height: 14px !important;
        border: 1px solid #666 !important;
        background: white !important;
        font-size: 6px !important;
        padding: 1px !important;
        text-align: center !important;
        border-radius: 2px !important;
        color: #333 !important;
        font-weight: 500 !important;
    }

    .calc-operator {
        width: 14px !important;
        height: 14px !important;
        background: linear-gradient(135deg, #ff9800, #f57c00) !important;
        color: white !important;
        border: 1px solid #e65100 !important;
        border-radius: 2px !important;
        font-size: 7px !important;
        font-weight: bold !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .equals-sign {
        font-size: 0.7rem !important;
        font-weight: bold !important;
        color: #1976d2 !important;
        margin: 0 2px !important;
    }

    .calc-status {
        margin-left: 4px !important;
    }

    /* Score avec style professionnel */
    .score-container {
        background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
        border: 2px solid #4a90e2 !important;
        border-radius: 6px !important;
        padding: 8px !important;
        margin: 8px auto !important;
        max-width: 180px !important;
        text-align: center !important;
        page-break-inside: avoid !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }

    .score-title {
        font-size: 0.6rem !important;
        color: #1976d2 !important;
        margin-bottom: 3px !important;
        font-weight: 600 !important;
    }

    .score-display {
        font-size: 0.9rem !important;
        color: #1976d2 !important;
        font-weight: bold !important;
    }

    /* Tentatives avec style */
    .tentatives-container {
        background: linear-gradient(135deg, #fff3cd, #ffeaa7) !important;
        border: 2px solid #ffc107 !important;
        border-radius: 6px !important;
        padding: 8px !important;
        margin: 8px auto !important;
        max-width: 180px !important;
        text-align: center !important;
        page-break-inside: avoid !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }

    .tentatives-titre {
        font-size: 0.6rem !important;
        color: #856404 !important;
        margin-bottom: 3px !important;
        font-weight: 600 !important;
    }

    .tentatives-info {
        font-size: 0.55rem !important;
        color: #856404 !important;
        margin-bottom: 4px !important;
    }

    .tentatives-dots {
        display: flex !important;
        justify-content: center !important;
        gap: 3px !important;
        margin: 4px 0 !important;
    }

    .tentative-dot {
        width: 8px !important;
        height: 8px !important;
        border-radius: 50% !important;
        border: 1px solid #ffc107 !important;
        background: white !important;
    }

    .tentative-dot.utilisee {
        background: #dc3545 !important;
        border-color: #bd2130 !important;
    }

    .tentative-dot.actuelle {
        background: #ffc107 !important;
        border-color: #e0a800 !important;
    }

    /* Optimisation de l'espace */
    .tentatives-container.tentatives-blocked {
        background: linear-gradient(135deg, #d1ecf1, #bee5eb) !important;
        border-color: #17a2b8 !important;
    }

    .tentatives-container.tentatives-warning {
        background: linear-gradient(135deg, #f8d7da, #f5c6cb) !important;
        border-color: #dc3545 !important;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}


.footer {
    text-align: center;
    color: #666;
    font-size: 0.7rem;
    font-weight: 400;
    margin-top: 20px;
}