: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;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

.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;
}

h3{
    color: rgb(13, 27, 139);
    font-size: 20px;
}

.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(20px, 3vw, 24px);
    font-weight: normal;
    flex: 1;
}

.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: 350px;
    transition: all 0.3s;
    transform: translateY(0);
    font-size: 12px;
    line-height: 1.4;
    font-weight: normal;
    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;
}

.instructions-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;
    width: 100%;
}




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

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

.stock-table-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
    margin-bottom: 20px;
    overflow-x: auto;
    width: 90%;
}


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


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


.stock-table-etroit thead {
    background-color: var(--accent-blue);
    color: white;
}
.stock-table th {
    padding: 10px 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    text-align: center;
    border: 1px solid #ddd;
    white-space: nowrap;
}

.stock-table th.narrow-column {
    width: 60px;
    padding: 10px 4px;
}

.stock-table td.narrow-column {
    width: 60px;
    padding: 3px 2px;
}

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

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

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

.stock-table td {
    padding: 3px 4px;
    text-align: center;
    vertical-align: middle;
    border: 0px solid #ddd;
}

.stock-cell-value {
    padding: 5px;
    font-size: 0.8rem;
    
    color: var(--text-dark);
    font-weight: 500;
    border-radius: 3px;
    display: block;
    width: 100%;
    text-align: center;
}

.stock-cell-value-ref {
    padding: 5px;
    font-size: 0.8rem;
   
    color: var(--text-dark);
    font-weight: 500;
    border-radius: 3px;
    display: block;
    width: 100%;
    text-align: left;
}

.stock-input {
    border: 0px solid #ccc;
    border-radius: 3px;
    padding: 5px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

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

.stock-input.editable {
    color: var(--text-dark);
    font-weight: bold;
    background-color: #fff;
    border: 2px solid var(--warning-orange);
}

.stock-input.positive {
    background-color: #e8f5e8;
    border-color: var(--success-green);
}

.stock-input.negative {
    background-color: #ffebee;
    border-color: var(--error-red);
    color: var(--error-red);
}

.radio-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    border: 0;
}

.radio-group input[type="radio"] {
    margin-right: 3px;
}

.radio-group label {

    color: var(--text-dark);
}

.status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background-color: #ffffff;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 10px;
    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;
}

.legend {
    margin: 20px 0;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.4;
}

.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;
}

.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);
    width: 100%;
}

.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-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;
}

.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);
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.show {
    display: flex;
}

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

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-dark);
}

.modal-score {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-dark);
    border: 1px solid #dee2e6;
}

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

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

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
    min-width: 100px;
    font-family: inherit;
}

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

.modal-btn-primary:hover {
    background-color: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.modal-btn-secondary:hover {
    background-color: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px 15px;
    }

    .container {
        padding: 0 10px;
    }

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

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

    .action-btn {
        width: 200px;
    }

    .stock-table {
        font-size: 0.7rem;
    }

    .stock-input {
        font-size: 0.7rem;
        padding: 3px;
    }

    .modal-content {
        padding: 20px;
        margin: 20px;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 0.8cm;
    }

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

    body {
        font-size: 10px !important;
        line-height: 0.8 !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .help-icon,
    .tooltip,
    .button-container,
    .modal-overlay {
        display: none !important;
    }

    .stock-table-container,
    .instructions-section,
    .score-container {
        page-break-inside: avoid;
    }
}