:root {
    --primary: #4CAF50;
    --danger: #f44336;
    --bg: #f5f5f5;
    --surface: #ffffff;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background: var(--surface);
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#list-selector {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 16px;
    background: white;
}

.icon-btn {
    background: #e0e0e0;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.btn-close {
    background-color: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 90px;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-item {
    background: var(--surface);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.list-item.checked span.item-name {
    text-decoration: line-through;
    color: #888;
}

.item-name {
    flex: 1;
    font-size: 18px;
}

.item-qty {
    background: #e0e0e0;
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(255,255,255,0.9) 20%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

footer button {
    pointer-events: auto;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    cursor: pointer;
}

.btn-fab {
    background: var(--primary);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 32px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
}

/* Modales globales */
dialog {
    width: 90%;
    max-width: 400px;
    border: none;
    border-radius: 12px;
    padding: 20px;
}
dialog::backdrop { background: rgba(0,0,0,0.6); }

/* --- Modale de recherche --- */
dialog#modal-search[open] {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-shrink: 0;
    align-items: center;
}
.modal-header h3 { margin: 0; flex: 1; }

#search-input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

#search-results {
    overflow-y: auto;
    flex-grow: 1;
    margin: 0;
    padding-right: 5px;
}

.search-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-qty {
    width: 50px;
    height: 40px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
}

.btn-add-item {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
}

.hidden { display: none; }

/* --- Modale de confirmation --- */
#modal-confirm {
    text-align: center;
}

.confirm-content p {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 500;
}

.confirm-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    flex: 1;
}
