:root {
    --primary-color: #498f94;
    --secondary-color: #82c9c7;
    --accent-color: #e4e360;
    --text-color: #5d5d5d;
    --background-color: #f5f6fa;
    --border-color: #dcdde1;
    --success-color: #498f94;
    --warning-color: #e4e360;
    --danger-color: #5d5d5d;
    --box-shadow: 0 2px 4px rgba(77, 77, 77, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

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

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 2rem;
}

th:first-child {
    border-top-left-radius: var(--border-radius);
}

th:last-child {
    border-top-right-radius: var(--border-radius);
}

tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--border-radius);
}

tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--border-radius);
}

th[class], th:not(:first-child) {
    text-align: right;
}

th:first-child {
    text-align: left;
}

td:first-child {
    text-align: left;
}

td {
    text-align: right;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* Ajuster l'espacement des cellules */
th, td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--secondary-color);
    color: white;
}

th.highlight, td.highlight {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

tr:hover td {
    background-color: var(--background-color);
}

tr:hover td.highlight {
    background-color: var(--primary-color);
    opacity: 0.9;
}

/* Mise en évidence des valeurs importantes */
td.highlight strong, 
.charge-item .charge-amount {
    position: relative;
}

td.highlight strong::before,
.charge-item .charge-amount:focus::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background-color: var(--accent-color);
    border-radius: var(--border-radius);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

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

.btn-secondary {
    background-color: var(--accent-color);
    color: var(--text-color);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(73, 143, 148, 0.3);
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(228, 227, 96, 0.3);
}

/* Bouton d'ajustement des variables */
.button-container {
    text-align: center;
    margin: 0 auto 2rem auto;
    max-width: 250px;
}

.button-container .btn-primary {
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    width: 100%;
    background-color: var(--accent-color);
    color: var(--text-color);
    font-weight: 500;
}

.button-container .btn-primary:hover {
    background-color: var(--accent-color);
    opacity: 0.9;
    box-shadow: 0 0 0 3px rgba(228, 227, 96, 0.3);
    transform: translateY(-2px);
}

/* Boutons flottants */
.floating-buttons {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 100;
}

.floating-buttons button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    box-shadow: var(--box-shadow);
}

/* Bouton d'ajout de charge */
.add-charge {
    color: var(--primary-color);
    background: none;
    border: 2px dashed var(--border-color);
    cursor: pointer;
    font-weight: 600;
    padding: 0.8rem;
    width: 100%;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-charge:hover {
    border-color: var(--accent-color);
    background: rgba(228, 227, 96, 0.1);
    color: var(--text-color);
}

/* Bouton de suppression */
.charge-item .remove-charge {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1.2rem;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.charge-item .remove-charge:hover {
    background: rgba(93, 93, 93, 0.1);
    color: #ff4444;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin: -2rem -2rem 2rem -2rem;
    padding: 0 1rem;
    background: var(--background-color);
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.tab {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.95rem;
}

/* Masquer la barre de défilement tout en gardant la fonctionnalité */
.tabs::-webkit-scrollbar {
    display: none;
}

.tabs {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tab:hover {
    opacity: 1;
    background: rgba(73, 143, 148, 0.1);
}

.tab.active {
    background: transparent;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    opacity: 1;
    font-weight: 600;
}

/* Edit Section */
.hidden {
    display: none;
}

.charge-group {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.charge-group h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    font-size: 1.2rem;
}

.charge-section {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

.charge-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background-color: var(--accent-color);
    opacity: 0.5;
}

.charge-section h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.charge-item {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.charge-item:hover {
    background: var(--background-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}

.charge-item input {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: rgba(93, 93, 93, 0.85);
    font-weight: 500;
}

.charge-item input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(228, 227, 96, 0.2);
    outline: none;
    color: var(--text-color);
    font-weight: 600;
}

/* Amélioration des onglets */
.tab.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Message de succès */
.success-message {
    background-color: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    box-shadow: var(--box-shadow);
}

.success-message span {
    font-size: 1.2rem;
    font-weight: bold;
}

.success-message.hidden {
    display: none;
}

/* Amélioration des boutons */
.btn-primary:hover {
    box-shadow: 0 0 0 3px rgba(228, 227, 96, 0.3);
}

/* Popup Styles */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.popup.visible {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: var(--transition);
}

.popup.visible .popup-content {
    transform: translateY(0);
}

.close-popup {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

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

.popup-title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.popup-details {
    color: var(--text-color);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item:hover {
    background: var(--background-color);
}

.detail-label {
    font-weight: 500;
}

.detail-value {
    color: var(--primary-color);
    font-weight: 600;
}

/* Rendre les cellules du tableau cliquables */
td {
    cursor: pointer;
    transition: var(--transition);
}

td:hover {
    background-color: rgba(73, 143, 148, 0.1);
}

.number-input {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: right;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    color: rgba(93, 93, 93, 0.85);
    font-weight: 500;
}

.number-input:focus {
    font-weight: 600;
    color: var(--text-color);
}

/* Style pour l'unité monétaire */
.charge-item span {
    color: var(--text-color);
    opacity: 0.7;
    padding-right: 1rem;
}

/* Style de la ligne des totaux */
#totals-row {
    background-color: var(--background-color);
    font-weight: 600;
}

#totals-row td {
    border-top: 2px solid var(--border-color);
    text-align: right;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

#totals-row td:first-child {
    text-align: left;
    color: var(--primary-color);
}

#totals-row td.highlight {
    background-color: var(--primary-color);
    color: white;
}

#totals-row:hover td {
    background-color: var(--background-color);
}

#totals-row:hover td.highlight {
    background-color: var(--primary-color);
}

/* Indicators */
.indicators {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--background-color);
    border-radius: var(--border-radius);
}

.indicator-label {
    color: var(--text-color);
    font-size: 0.9rem;
}

.indicator-value {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header h1 {
    margin-bottom: 0;
    text-align: left;
}

.header button {
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--accent-color);
    color: var(--text-color);
    font-weight: 500;
}

.header button:hover {
    background-color: var(--accent-color);
    opacity: 0.9;
    box-shadow: 0 0 0 3px rgba(228, 227, 96, 0.3);
    transform: translateY(-2px);
} 