/* ══════════════════════════════════════════════
   Design System — Honey Brand (repris de index_francia.html)
   Partagé par toutes les pages de la plateforme.
   ══════════════════════════════════════════════ */
:root {
  --bg:        #EDE8D8;
  --srf:       #FFFFFF;
  --srf2:      #FAF8F3;
  --srf3:      #F2EDE2;
  --brd:       #DDD3BB;
  --brd2:      #C8B894;
  --amber:     #D97706;
  --amber-dk:  #B45309;
  --amber-lt:  #FEF3C7;
  --amber-g:   rgba(217,119,6,0.08);
  --amber-g2:  rgba(217,119,6,0.04);
  --text:      #1C1710;
  --text-2:    #6B5C45;
  --text-3:    #9E8A6E;
  --green:     #059669;
  --red:       #DC2626;
  --shadow:    0 12px 48px rgba(0,0,0,0.10), 0 0 0 1px var(--brd);
  --r:         12px;
  --r-lg:      18px;
}
body.dark {
  --bg:        #0B0905;
  --srf:       #131009;
  --srf2:      #1C160D;
  --srf3:      #241C0F;
  --brd:       #2A2015;
  --brd2:      #3C2E1C;
  --amber:     #F5A623;
  --amber-dk:  #C87B00;
  --amber-lt:  rgba(245,166,35,0.10);
  --amber-g:   rgba(245,166,35,0.10);
  --amber-g2:  rgba(245,166,35,0.05);
  --text:      #EDE1C9;
  --text-2:    #9A876A;
  --text-3:    #5A4D38;
  --green:     #4DC878;
  --red:       #E05A5A;
  --shadow:    0 24px 80px rgba(0,0,0,0.55), 0 0 0 1px var(--brd);
}

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

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 2 L54 16 L54 44 L28 58 L2 44 L2 16Z M28 58 L54 72 L54 100 M28 58 L2 72 L2 100 M56 16 L82 2 M56 44 L82 58 M0 16 L-26 2 M0 44 L-26 58' fill='none' stroke='%23E1DCCC' stroke-width='1'/%3E%3C/svg%3E");
  min-height: 100vh;
  padding: 20px 16px;
  color: var(--text);
  transition: background-color .25s, color .25s;
}
body.dark {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 2 L54 16 L54 44 L28 58 L2 44 L2 16Z M28 58 L54 72 L54 100 M28 58 L2 72 L2 100 M56 16 L82 2 M56 44 L82 58 M0 16 L-26 2 M0 44 L-26 58' fill='none' stroke='%231E1608' stroke-width='1'/%3E%3C/svg%3E");
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--srf);
  border-radius: var(--r-lg);
  border: 1px solid var(--brd);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: background .25s, border-color .25s, box-shadow .25s;
}
.container.narrow { max-width: 460px; }

/* ── Header ── */
.header {
  background: linear-gradient(135deg, #92400E 0%, #B45309 35%, #D97706 70%, #FBBF24 100%);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
}
.header-accent { display: none; }
.header-logo { font-size: 2em; line-height: 1; flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25)); }
.header-title { flex: 1; text-align: center; }
.header-title h1 { font-size: 1.35em; font-weight: 800; color: #FFFBEB; letter-spacing: -0.02em; margin-bottom: 1px; text-shadow: 0 1px 4px rgba(0,0,0,0.20); }
.header-title h1 span { color: #FDE68A; }
.header-title p { font-size: 0.8em; color: rgba(255,240,200,0.75); font-weight: 400; }
.header-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }

.btn-icon {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 9px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.14);
  cursor: pointer; font-size: 0.78em; font-weight: 600;
  color: #FFFBEB; font-family: inherit; transition: all .18s; text-decoration: none;
}
.btn-icon:hover { background: rgba(255,255,255,0.30); }

body.dark .header { background: var(--srf); border-bottom: 1px solid var(--brd); }
body.dark .header-accent { display: block; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--amber) 0%, transparent 60%); opacity: 0.6; }
body.dark .header-logo { filter: none; }
body.dark .header-title h1 { color: var(--text); text-shadow: none; }
body.dark .header-title h1 span { color: var(--amber); }
body.dark .header-title p { color: var(--text-2); }
body.dark .btn-icon { background: var(--srf2); border: 1px solid var(--brd); color: var(--text-2); }
body.dark .btn-icon:hover { background: var(--amber-g); border-color: var(--brd2); }

/* ── Contenu ── */
.content { padding: 24px 28px; }

/* ── Titre de section ── */
.section-title {
  color: var(--text-2); font-weight: 700; font-size: 0.7em;
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--amber); border-radius: 50%; flex-shrink: 0; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--brd); }

/* ── Spinner ── */
.spinner-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px; color: var(--amber); font-weight: 600; font-size: 0.88em; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--brd2); border-top-color: var(--amber); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tableau récap ── */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--brd); border-top: 2.5px solid var(--amber); margin-bottom: 28px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
thead tr { background: var(--srf2); border-bottom: 1px solid var(--brd); }
thead th { padding: 11px 14px; text-align: center; font-weight: 600; color: var(--text-3); font-size: 0.74em; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
thead th:first-child { text-align: left; }
tbody tr { border-bottom: 1px solid var(--brd); cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--amber-g); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 11px 14px; text-align: center; color: var(--text); font-size: 0.91em; }
tbody td:first-child { text-align: left; font-weight: 700; color: var(--amber); white-space: nowrap; }
.d-pos { color: var(--green); font-weight: 700; }
.d-neg { color: var(--red); font-weight: 700; }
.d-neu { color: var(--text-3); }
.loading { text-align: center !important; color: var(--text-3); padding: 28px !important; font-weight: 400 !important; font-size: 0.88em !important; }

/* Batterie */
.batt-cell { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.9em; }
.batt-mini { width: 30px; height: 7px; background: var(--brd2); border-radius: 4px; overflow: hidden; }
.batt-fill { height: 100%; border-radius: 4px; transition: width .4s; }

/* ── Carte ── */
#map { height: 400px; border-radius: var(--r); border: 1px solid var(--brd); overflow: hidden; margin-bottom: 24px; }
#map .leaflet-bottom.leaflet-left { margin-bottom: 26px; }

/* ── Cartes (blocs) ── */
.panel { background: var(--srf); border-radius: var(--r); border: 1px solid var(--brd); padding: 18px 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 24px; }

/* ── Formulaires ── */
.field-label { display: block; font-size: 0.78em; font-weight: 600; color: var(--text-2); margin: 14px 0 5px; text-transform: uppercase; letter-spacing: .04em; }
.field-input {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1.5px solid var(--brd); background: var(--srf2); color: var(--text);
  font-size: 1em; font-family: inherit; transition: border-color .15s;
}
.field-input:focus { outline: none; border-color: var(--amber); }
.field-hint { font-size: 0.78em; color: var(--text-3); margin-top: 5px; }

.btn-primary {
  margin-top: 20px; width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #B45309, #D97706 70%, #FBBF24);
  color: #FFFBEB; font-weight: 700; font-size: 1em; font-family: inherit; cursor: pointer;
  transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-soft { background: var(--srf2); color: var(--text); border: 1.5px solid var(--brd); }
.btn-danger { background: var(--red); color: #fff; border: none; }

.msg { margin-top: 14px; font-size: 0.9em; padding: 9px 12px; border-radius: 10px; }
.msg.error { background: rgba(220,38,38,0.10); color: var(--red); }
.msg.ok { background: rgba(5,150,105,0.10); color: var(--green); }

.foot-link { margin-top: 18px; text-align: center; font-size: 0.9em; color: var(--text-2); }
.foot-link a { color: var(--amber-dk); text-decoration: none; font-weight: 700; }
.foot-link a:hover { color: var(--amber); }

/* ── Pied de page ── */
.footer { padding: 14px 28px; text-align: center; color: var(--text-3); font-size: 0.75em; border-top: 1px solid var(--brd); }
.footer a { color: var(--amber-dk); text-decoration: none; }
.footer a:hover { color: var(--amber); }

/* ── Liste des balances rattachées ── */
.device-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--srf2); margin-bottom: 8px; border: 1px solid var(--brd); }
.device-row .d-name { font-weight: 700; color: var(--text); }
.device-row .d-id { font-size: 0.78em; color: var(--text-3); font-family: monospace; }
.device-row .d-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.device-row .d-actions button, .device-row .d-actions a { width: auto; margin: 0; padding: 6px 11px; font-size: 0.8em; border-radius: 8px; cursor: pointer; text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 600px) {
  body { padding: 8px 6px; }
  .header { padding: 14px; }
  .header-title h1 { font-size: 1.1em; }
  .header-right { flex-shrink: 1; width: 100%; justify-content: center; }
  .content { padding: 14px 12px; }
  table { font-size: 0.78em; }
  thead th, tbody td { padding: 9px 8px; }
  #map { height: 260px; }
  .batt-mini { display: none; }
}
