* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Arimo", arial, verdana, sans-serif;
}

body {
    background-color: #f4f4f9;
    color: #333;
    padding-bottom: 60px;
}

.tab-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    background: #111;
    background: linear-gradient(#444, #111);
    z-index: 1000;
}

.tab-btn {
    flex: 1;
    padding: 15px 5px;
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border-top: 3px solid transparent;
}

.tab-btn.active {
    color: #04acec;
    border-top: 3px solid #04acec;
    background: #222;
}

.tab-content {
    display: none;
    padding: 15px;
}

.tab-content.active {
    display: block;
}

.search-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.search-bar input, .search-bar select {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.aliment-card {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
}

.aliment-card img {
    width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.aliment-card h3 {
    font-size: 13px;
    margin-top: 5px;
    color: #111;
}

.aliment-card small {
    font-size: 11px;
    color: #666;
    display: block;
    margin-top: 2px;
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assiette-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    gap: 10px;
}

.assiette-item img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

.assiette-item .info {
    flex: 1;
    font-size: 14px;
}

.assiette-item input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.assiette-item .btn-remove {
    padding: 8px 12px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: bold;
}

.actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.actions button, .btn-full-width {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
}

.btn-full-width {
    width: 100%;
    margin-top: 15px;
}

.btn-danger { background: #dc3545; }
.btn-success { background: #28a745; }
.btn-primary { background: #0186ba; }

.stat-row {
    margin-bottom: 15px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.stat-row:active {
    background: #f8f9fa;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
    align-items: center;
}

.stat-header div {
    display: flex;
    align-items: center;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.dot.red { background-color: #dc3545; }
.dot.orange { background-color: #fd7e14; }
.dot.grey { background-color: #6c757d; }
.dot.green { background-color: #28a745; }
.dot.none { display: none; }

.progress-bg {
    background: #e0e0e0;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    background: #dc3545;
    height: 100%;
    transition: width 0.3s ease;
}

.progress-fill.warning {
    background: #ffc107;
}

.progress-fill.success {
    background: #28a745;
}

.nutrient-details {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #444;
    line-height: 1.4;
}

.stat-row.expanded .nutrient-details {
    display: block;
}

.nutrient-details p {
    margin-bottom: 8px;
}

.nutrient-details p:last-child {
    margin-bottom: 0;
}

/* Modale */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    color: #888;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:active {
    color: #333;
}

.modal-content img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.text-muted {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-body {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-body p {
    margin-bottom: 10px;
}

#modalBtnManger {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

/* Profil */
.profil-header {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.profil-header h3 {
    margin-bottom: 10px;
}

.profil-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profil-presets select {
    flex: 1 1 calc(33% - 10px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.profil-form-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profil-input-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profil-input-row label {
    font-size: 14px;
    flex: 1;
}

.profil-input-row input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: right;
    font-size: 14px;
}