:root {
    --bg: #F8F9FA;
    --text-main: #04091d;
    --text-muted: #64748B;
    --white: #FFFFFF;
    --accent: #ffcc00; /* Un bleu pro pour remplacer l'excès de jaune */
    --accent-hover: #ffe26f;
    --yellow: #FFCC00; /* Gardé uniquement pour la rareté */
    --card: #FFFFFF;
    --border: #E2E8F0;
    --danger: #FFCC00;
    --success: #10B981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --radius: 12px;
    --transition: 0.15s ease;
    --max-width: 1200px;
    --font: 'Segoe UI', Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
}

button,
input,
a {
    font: inherit;
}

.app {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 20px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.eyebrow {
    margin: 0 0 4px 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    font-weight: 700;
}

.topbar h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
}

.export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    background: var(--white);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
}

.export-btn:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

.main-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 28px;
    align-items: stretch;
}

.counter-card,
.list-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.counter-card {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.counter-label {
    margin: 0 0 10px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.counter {
    font-size: clamp(5rem, 12vw, 8rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 24px;
    color: var(--text-main);
}

/* Animations d'incrément sobres sans lueurs */
.counter.animate-down { animation: pulseDown 0.2s ease; }
.counter.animate-up { animation: pulseUp 0.2s ease; }

@keyframes pulseDown {
    50% { color: var(--danger); }
}

@keyframes pulseUp {
    50% { color: var(--success); }
}

.actions {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 16px;
}

.action-btn {
    flex: 1;
    min-height: 56px;
    border: none;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s ease;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn-minus {
    background: #FFCC00;
    color: #fff;
}

.action-btn-minus:hover {
    background: #ffe26f;
}

.action-btn-plus {
    background: var(--accent);
    color: var(--white);
}

.action-btn-plus:hover {
    background: var(--accent-hover);
}

.small-stats {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.list-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 60vh;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.list-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.badge {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    background: #F1F5F9;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.empty-state {
    margin: 12px 0 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.clients-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.client-item {
    background: #F8F9FA;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Utilisation rare du jaune demandée pour l'élément récent */
.client-item.latest {
    border-left: 4px solid var(--yellow);
    background: #FFFBEB;
}

.client-name {
    margin: 0 0 2px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.client-date {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.client-time {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

/* Modales et Pop-ups sobres */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4); /* Fond assombri mais doux */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
    z-index: 999;
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-text {
    margin: 0 0 16px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #F8F9FA;
    color: var(--text-main);
    outline: none;
    transition: border-color var(--transition);
}

.input:focus {
    border-color: var(--accent);
    background: var(--white);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.primary-btn,
.secondary-btn {
    flex: 1;
    min-height: 44px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background var(--transition);
}

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

.primary-btn:hover {
    background: var(--accent-hover);
}

.secondary-btn {
    background: #F1F5F9;
    color: var(--text-main);
}

.secondary-btn:hover {
    background: #E2E8F0;
}

/* Toast épuré */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(10px);
    background: var(--text-main);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: var(--danger);
}

/* Media queries ajustés */
@media (max-width: 900px) {
    .main-layout { grid-template-columns: 1fr; }
    .counter-card, .list-card { min-height: auto; }
}

/* Bouton Voir Plus spécifique */
.show-more-container {
    padding: 10px 0;
    text-align: center;
}

.show-less-link {
    background: none;
    border: none;
    color: var(--text-muted);
    text-decoration: underline;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 10px;
    align-self: center;
}

/* On change l'accent pour du Bleu Marine Pro au lieu du Jaune partout */
:root {
    --accent: #1e293b; /* Bleu très foncé presque noir */
    --accent-hover: #334155;
    --yellow: #FFCC00;
}

/* Le bouton -1 devient sobre */
.action-btn-minus {
    background: var(--accent);
    color: var(--white);
}

.action-btn-minus:hover {
    background: var(--accent-hover);
}

/* Le bouton +1 devient très discret (gris) */
.action-btn-plus {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.action-btn-plus:hover {
    background: #e2e8f0;
}

/* Suppression des ombres portées inutiles pour plus de sobriété */
.counter-card, .list-card, .modal {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}