
    /* ============================================
   CALCULATEUR TVA SUR MARGE - CELER
   Styles CSS conformes à la charte graphique
   ============================================ */

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

:root {
    --celer-blue: #1B3B5F;
    --celer-blue-light: #2d5280;
    --celer-copper: #B87854;
    --celer-copper-dark: #a36848;
    --grey-light: #f8f9fa;
    --grey-medium: #e0e0e0;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #2196F3;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--celer-blue) 0%, var(--celer-blue-light) 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}
.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 40px 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.logo-c {
    font-size: 60px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding: 8px 12px;
    border: 3px solid white;
}

.logo-c-square {
    position: absolute;
    bottom: 16px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: var(--celer-copper);
}

.logo-eler {
    font-size: 60px;
    font-weight: 300;
    letter-spacing: 4px;
}

.header h1 {
    font-size: 2em;
    margin-top: 20px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1em;
    opacity: 0.95;
    color: var(--celer-copper);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.card h2 {
    color: var(--celer-blue);
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid var(--celer-copper);
    padding-bottom: 10px;
}

.card h3 {
    color: var(--celer-blue);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.card h4 {
    color: var(--celer-blue);
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* ============================================
   ACTIVITY SELECTOR
   ============================================ */

.activity-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.activity-card {
    padding: 20px;
    border: 3px solid var(--grey-medium);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    background: white;
}

.activity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(27, 59, 95, 0.2);
}

.activity-card.selected {
    border-color: var(--celer-blue);
    background: linear-gradient(135deg, var(--celer-blue) 0%, var(--celer-blue-light) 100%);
    color: white;
}

.activity-card .icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.activity-card .title {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 5px;
}

.activity-card .description {
    font-size: 0.85em;
    opacity: 0.8;
}

/* ============================================
   METHOD SELECTOR
   ============================================ */

.method-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.method-btn {
    flex: 1;
    padding: 15px;
    border: 3px solid var(--celer-blue);
    background: white;
    color: var(--celer-blue);
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.3s;
}

.method-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(27, 59, 95, 0.3);
}

.method-btn.active {
    background: linear-gradient(135deg, var(--celer-blue) 0%, var(--celer-blue-light) 100%);
    color: white;
}

.method-btn .method-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
    display: block;
}

.method-btn .method-description {
    font-size: 0.8em;
    opacity: 0.8;
    margin-top: 5px;
}

/* ============================================
   FORMS
   ============================================ */

.form-section {
    background: var(--grey-light);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 5px solid var(--celer-copper);
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: var(--celer-blue);
    font-weight: 600;
}

.label-info {
    display: block;
    font-size: 0.85em;
    color: #666;
    font-weight: 400;
    margin-top: 3px;
    font-style: italic;
}

.label-bofip {
    display: inline-block;
    font-size: 0.75em;
    background: var(--celer-copper);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    font-style: normal;
    cursor: help;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--grey-medium);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--celer-blue);
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.radio-option {
    padding: 15px;
    border: 2px solid var(--grey-medium);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.radio-option:hover {
    border-color: var(--celer-blue);
    background: #f0f7ff;
}

.radio-option.selected {
    border-color: var(--celer-blue);
    background: #e7f3ff;
}

.radio-option input[type="radio"] {
    width: auto;
    margin-right: 12px;
}

.radio-option .option-content {
    flex: 1;
}

.radio-option .option-title {
    font-weight: 700;
    color: var(--celer-blue);
    margin-bottom: 3px;
}

.radio-option .option-description {
    font-size: 0.85em;
    color: #666;
}

/* ============================================
   TVA RATE SELECTOR
   ============================================ */

.tva-rate {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.rate-option {
    padding: 12px;
    border: 2px solid var(--grey-medium);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.rate-option:hover {
    border-color: var(--celer-blue);
}

.rate-option.selected {
    background: linear-gradient(135deg, var(--celer-blue) 0%, var(--celer-blue-light) 100%);
    color: white;
    border-color: var(--celer-blue);
}

.rate-option .rate {
    font-size: 1.5em;
    font-weight: bold;
}

.rate-option .description {
    font-size: 0.8em;
    margin-top: 5px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-calculate {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--celer-blue) 0%, var(--celer-blue-light) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
    margin-top: 20px;
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(27, 59, 95, 0.4);
}

.btn-add {
    background: var(--celer-copper);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
    width: 100%;
}

.btn-add:hover {
    background: var(--celer-copper-dark);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

/* ============================================
   RESULTS
   ============================================ */

.results {
    background: var(--grey-light);
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
    border: 3px solid var(--celer-blue);
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--grey-medium);
}

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

.result-label {
    font-weight: 600;
    color: var(--celer-blue);
}

.result-value {
    font-weight: bold;
    color: var(--celer-blue);
    font-size: 1.2em;
}

.result-value.highlight {
    color: var(--celer-copper);
    font-size: 1.5em;
}

.result-value.positive {
    color: var(--success);
}

.result-value.negative {
    color: var(--danger);
}

.total-line {
    background: var(--celer-blue);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.1em;
}

.sub-items {
    margin-left: 20px;
    border-left: 2px solid var(--celer-copper);
    padding-left: 15px;
}

/* ============================================
   INFO BOXES
   ============================================ */

.info-box {
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
    border-left: 5px solid;
}

.info-box.info {
    background: #e7f3ff;
    border-left-color: var(--info);
}

.info-box.success {
    background: #d4edda;
    border-left-color: var(--success);
    color: #155724;
}

.info-box.warning {
    background: #fff3cd;
    border-left-color: var(--warning);
    color: #856404;
}

.info-box.danger {
    background: #f8d7da;
    border-left-color: var(--danger);
    color: #721c24;
}

.info-box h3 {
    margin-bottom: 15px;
}

.info-box ul {
    margin-left: 20px;
}

.info-box li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.info-box p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.definition-box {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9em;
    border-left: 3px solid var(--celer-copper);
}

.definition-box strong {
    color: var(--celer-blue);
}

.bofip-reference {
    background: var(--grey-light);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.85em;
    margin-top: 10px;
    border-left: 3px solid var(--celer-copper);
}

.alert {
    padding: 15px;
    margin-top: 15px;
    border-radius: 8px;
    border-left: 5px solid;
}

/* ============================================
   GLOBALISATION
   ============================================ */

.transaction-item {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--celer-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--grey-medium);
}

.transaction-number {
    font-weight: 700;
    color: var(--celer-blue);
    font-size: 1.1em;
}

.stock-warning {
    background: #fff3cd;
    padding: 15px;
    border-left: 4px solid var(--warning);
    border-radius: 8px;
    margin-top: 15px;
}

/* ============================================
   HELP TOOLTIPS
   ============================================ */

.help-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: var(--info);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 0.8em;
    margin-left: 5px;
    cursor: help;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 300px;
    background-color: var(--celer-blue);
    color: white;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85em;
    line-height: 1.4;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ============================================
   TABS
   ============================================ */

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--grey-medium);
}

.tab {
    padding: 12px 25px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab:hover {
    color: var(--celer-blue);
}

.tab.active {
    color: var(--celer-blue);
    border-bottom-color: var(--celer-copper);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   TABLES
   ============================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table th {
    padding: 10px;
    text-align: left;
    background: var(--celer-blue);
    color: white;
}

table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

table tr:hover {
    background: #f5f5f5;
}

/* ============================================
   LINKS
   ============================================ */

a {
    color: var(--celer-blue);
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5em;
    }

    .logo-c, .logo-eler {
        font-size: 40px;
    }

    .activity-selector {
        grid-template-columns: 1fr;
    }

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

    .input-group {
        grid-template-columns: 1fr;
    }

    .method-selector {
        flex-direction: column;
    }

    .tooltip .tooltiptext {
        width: 250px;
        margin-left: -125px;
    }
    
    .result-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    body {
        background: white;
    }

    .header, .method-selector, .btn-calculate, .btn-add {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
