/* =========================================================
   ParLeTemps — thème partagé (accueil · voix · studio)
   Inspiré de joylayer : sombre pro, accent émeraude, icônes SVG line.
   ========================================================= */
:root {
  --bg-app:        #0E1116;
  --bg-panel:      #161A22;
  --bg-panel-alt:  #1B2029;
  --bg-input:      #0E1116;
  --bg-hover:      #232934;
  --border:        #232934;
  --border-strong: #2D343F;
  --text-primary:  #F2F5F9;
  --text-2:        #B6BCC8;
  --text-3:        #6B7280;
  --text-dim:      #4A5160;
  --accent:        #10B981;
  --accent-hover:  #34D399;
  --accent-soft:   rgba(16, 185, 129, 0.12);
  --accent-line:   rgba(16, 185, 129, 0.30);
  --success:       #10B981;
  --error:         #F87171;
  --warn:          #FBBF24;
  --selected:      #0F766E;
  --radius:        5px;
  --radius-lg:     8px;
  --shadow-1:      0 10px 30px rgba(0,0,0,0.35);
  --shadow-2:      0 20px 60px rgba(0,0,0,0.5);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Menlo, 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Icônes SVG line : héritent la couleur du texte, s'échelonnent avec la police */
.icon {
  width: 1em; height: 1em;
  vertical-align: -0.15em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-lg { width: 1.25em; height: 1.25em; }

/* Header applicatif : marque · centre · actions */
.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 54px;
  flex-shrink: 0;
  padding: 0 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--text-primary); text-decoration: none;
}
.brand:hover { color: var(--accent); }
.brand .brand-mark { width: 19px; height: 19px; color: var(--accent); }
.hdr-spacer { flex: 1; }
.hdr-divider { width: 1px; height: 22px; background: var(--border-strong); margin: 0 2px; }
.hdr-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); text-decoration: none; font-size: 12.5px; font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius);
}
.hdr-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.hdr-link .icon { width: 15px; height: 15px; }

/* Onglets pilule */
.app-tabs {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--bg-input); border: 1px solid var(--border-strong);
  padding: 3px; border-radius: 9px;
}
.app-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 6px;
  font-size: 12px; font-weight: 600; line-height: 1;
  color: var(--text-2); text-decoration: none;
  border: 0; background: transparent; cursor: pointer;
  transition: background .1s, color .1s; white-space: nowrap; font-family: inherit;
}
.app-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.app-tab .icon { width: 14px; height: 14px; }
.app-tab.active {
  background: var(--bg-panel-alt); color: var(--accent);
  box-shadow: 0 1px 0 var(--accent) inset, 0 -1px 0 var(--accent-line) inset;
}

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 8px 15px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; line-height: 1;
  transition: background .1s, opacity .1s, border-color .1s, color .1s; white-space: nowrap;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #05231A; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-panel-alt); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); background: var(--bg-hover); }
.btn-sm { padding: 6px 11px; font-size: 11.5px; }
.btn-lg { padding: 11px 20px; font-size: 14px; }

.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; color: var(--text-2);
  border-radius: var(--radius); cursor: pointer; padding: 0; font-family: inherit;
  transition: background .1s, color .1s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.icon-btn .icon { width: 17px; height: 17px; }

/* Champs */
.field { margin-bottom: 12px; }
.field > label, label.lbl {
  display: block; font-size: 11px; color: var(--text-2); margin-bottom: 6px; font-weight: 600;
  text-transform: none; letter-spacing: 0;
}
input[type="text"], input[type="number"], input[type="url"], input[type="email"],
input[type="password"], input[type="search"], textarea, select {
  width: 100%; padding: 9px 11px;
  background: var(--bg-input); border: 1px solid var(--border-strong);
  color: var(--text-primary); border-radius: var(--radius);
  font-size: 12.5px; font-family: inherit; transition: border-color .1s; outline: 0;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* Sliders */
input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 4px;
  background: var(--border-strong); border-radius: 2px; outline: 0; padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
}
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 0; }

/* Switch */
.switch { position: relative; display: inline-block; width: 34px; height: 18px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider-pill { position: absolute; cursor: pointer; inset: 0; background: var(--text-dim); border-radius: 18px; transition: .15s; }
.switch .slider-pill:before { position: absolute; content: ''; height: 14px; width: 14px; left: 2px; bottom: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + .slider-pill { background: var(--accent); }
.switch input:checked + .slider-pill:before { transform: translateX(16px); }

/* Cartes / panneaux */
.card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.sep { border-top: 1px solid var(--border); margin: 14px 0; }
.hint { font-size: 11.5px; color: var(--text-3); line-height: 1.55; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--bg-input); border: 1px solid var(--border-strong); color: var(--text-2); cursor: pointer; }
.chip:hover { color: var(--text-primary); border-color: var(--accent-line); }
.empty-state { text-align: center; color: var(--text-3); padding: 24px 16px; font-size: 12px; }
.kbd { display: inline-block; padding: 2px 6px; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: 4px; font-family: var(--font-mono); font-size: 10px; color: var(--text-primary); }

/* Toasts (coin bas-droite) */
.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-panel); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  padding: 11px 16px; border-radius: var(--radius); font-size: 12.5px; font-weight: 500;
  box-shadow: var(--shadow-1); pointer-events: auto; animation: toast-in .18s ease-out;
}
.toast.ok, .toast.success { border-left-color: var(--success); }
.toast.err, .toast.error { border-left-color: var(--error); }
.toast.info { border-left-color: var(--accent); }
.toast .icon { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Spinner */
.spin { display: inline-block; animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
