:root {
    --bg: #0f1720;
    --panel: #161f2b;
    --panel-2: #1c2836;
    --border: #253242;
    --text: #e7edf3;
    --muted: #8ea0b3;
    --accent: #22c55e;
    --accent-dark: #16a34a;
    --warn: #f59e0b;
    --danger: #ef4444;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--panel);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
}

.sidebar .brand {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 4px;
}

.sidebar .brand small {
    display: block;
    font-weight: 400;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.sidebar nav {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 14px;
}

.sidebar nav a:hover { background: var(--panel-2); color: var(--text); }
.sidebar nav a.active { background: var(--accent); color: #06240f; font-weight: 600; }

.main { flex: 1; padding: 28px 32px; max-width: 1200px; }

.main h1 { font-size: 22px; margin: 0 0 4px; }
.main .subtitle { color: var(--muted); font-size: 14px; margin: 0 0 24px; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
}

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.btn {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.btn:hover { border-color: var(--accent); }
.btn.active { background: var(--accent); color: #06240f; border-color: var(--accent); font-weight: 600; }
.btn.primary { background: var(--accent); color: #06240f; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-dark); }

input[type="date"], input[type="text"], input[type="time"], textarea, select {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}

label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
.field { margin-bottom: 16px; max-width: 420px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--panel-2); }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.badge.conakry { background: #14532d; color: #86efac; }
.badge.interieur { background: #1e3a5f; color: #93c5fd; }
.badge.proche_conakry { background: #4c1d95; color: #d8b4fe; }
.badge.on { background: #14532d; color: #86efac; }
.badge.off { background: #450a0a; color: #fca5a5; }
.badge.programmee { background: #78350f; color: #fcd34d; }

.empty { color: var(--muted); padding: 30px; text-align: center; }

.toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border); border-radius: 999px; transition: .2s;
}
.toggle .slider:before {
    content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
    background: white; border-radius: 50%; transition: .2s;
}
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider:before { transform: translateX(20px); }

.toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--panel-2); border: 1px solid var(--accent);
    color: var(--text); padding: 12px 18px; border-radius: 8px;
    font-size: 13px; opacity: 0; transform: translateY(10px);
    transition: .25s; pointer-events: none; z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: var(--danger); }

.grid-produits {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.produit-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.produit-card .photos { display: flex; gap: 6px; margin-bottom: 10px; }
.produit-card .photos img {
    width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border);
}
.produit-card .photos .photo-empty {
    width: 56px; height: 56px; border-radius: 6px; border: 1px dashed var(--border);
    display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px;
}
.produit-card h3 { margin: 0 0 4px; font-size: 15px; }
.produit-card .prix { color: var(--accent); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.produit-card .code { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.produit-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-backdrop.show { display: flex; }
.modal {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; width: 460px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
}
.modal h2 { margin: 0 0 18px; font-size: 17px; }
.modal .actions-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
textarea.wide, input.wide { width: 100%; }
