/* Relief et mouvement (chargé après style.css et responsive.css) :
   - ombres « réalistes » en plusieurs couches + reflet clair en haut des cartes (effet 3D léger) ;
   - boutons en relief qui s'enfoncent au clic ; champs avec anneau de focus ;
   - petites cartes qui se soulèvent au survol ;
   - animation d'entrée à chaque ouverture de page (cartes en cascade), fenêtres qui apparaissent en douceur.
   Tout mouvement est coupé si l'appareil demande moins d'animations (prefers-reduced-motion). */
:root {
  --shadow: 0 1px 1px rgba(16,24,40,.04), 0 2px 4px -1px rgba(16,24,40,.05), 0 8px 18px -6px rgba(16,24,40,.10), 0 18px 36px -18px rgba(16,24,40,.14);
  --shadow-hi: 0 2px 3px rgba(16,24,40,.06), 0 8px 14px -4px rgba(16,24,40,.10), 0 22px 40px -14px rgba(16,24,40,.22);
  --shine: inset 0 1px 0 rgba(255,255,255,.65);
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* Thème sombre de l'application (data-theme posé par applyTheme) : reflets discrets, ombres plus profondes */
:root[data-theme="dark"] { --shine: inset 0 1px 0 rgba(255,255,255,.06); --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 24px -10px rgba(0,0,0,.6); --shadow-hi: 0 2px 4px rgba(0,0,0,.45), 0 18px 36px -12px rgba(0,0,0,.7); }
:root[data-theme="dark"] .pp-card, :root[data-theme="dark"] .pf-card, :root[data-theme="dark"] .art-col, :root[data-theme="dark"] .btn-outline, :root[data-theme="dark"] .otbl th { background-image: none; }
:root[data-theme="dark"] .btn-outline { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.4); }

/* Cartes : relief */
.card, .pp-card, .pr-tab, .pf-card, .art-col, .bq-matrix, .otbl-wrap {
  box-shadow: var(--shine), var(--shadow);
}
.card, .pp-card { border-radius: 12px; }
.pp-card, .pf-card, .art-col { background-image: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 42px); }

/* Petites cartes cliquables : se soulèvent */
.pr-tab, .cat-card, .pf-kpi, .pf-p, .sk-card, .tr-card {
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.pr-tab:hover, .cat-card:hover, .pf-kpi:hover, .sk-card:hover, .tr-card:hover { transform: translateY(-2px); box-shadow: var(--shine), var(--shadow-hi); }
.pf-p:hover { transform: translateX(2px); }

/* Boutons en relief */
.btn, .btn-sm, .tab-btn.active, .ot-sm-chip {
  transition: transform .08s, box-shadow .15s, filter .15s, background-color .15s;
}
.btn-primary {
  background-image: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 60%, rgba(0,0,0,.06));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 1px 2px rgba(16,24,40,.18), 0 4px 10px -4px var(--accent);
}
.btn-outline, .btn-sm.btn-outline {
  background-image: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 1px 2px rgba(16,24,40,.08);
}
.btn:hover, .btn-sm:hover { filter: brightness(1.04); }
.btn:active, .btn-sm:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(16,24,40,.15); }

/* Champs : anneau de focus net */
.input:focus, input.input:focus, select.input:focus, textarea.input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* En-têtes de tableau : léger dégradé pour bien les distinguer des lignes */
.otbl th { background-image: linear-gradient(180deg, rgba(255,255,255,.55), rgba(0,0,0,.02)); }
.otbl tbody tr { transition: background-color .12s; }

/* Entrée de page : la page glisse, puis ses cartes arrivent en cascade */
@keyframes otPageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes otCardIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes otPop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.page.active { animation: otPageIn .32s var(--ease) both; }
.page.active .pp-card, .page.active .pr-tab, .page.active .cat-card, .page.active .sk-card, .page.active .tr-card { animation: otCardIn .42s var(--ease) both; }
.page.active .pr-grid > :nth-child(2), .page.active .pr-head > :nth-child(2), .page.active .pp-group-grid > :nth-child(2) { animation-delay: .04s; }
.page.active .pr-grid > :nth-child(3), .page.active .pr-head > :nth-child(3), .page.active .pp-group-grid > :nth-child(3) { animation-delay: .08s; }
.page.active .pr-grid > :nth-child(4), .page.active .pr-head > :nth-child(4), .page.active .pp-group-grid > :nth-child(4) { animation-delay: .12s; }
.page.active .pr-grid > :nth-child(5), .page.active .pr-head > :nth-child(5), .page.active .pp-group-grid > :nth-child(5) { animation-delay: .16s; }
.page.active .pr-grid > :nth-child(n+6), .page.active .pr-head > :nth-child(n+6), .page.active .pp-group-grid > :nth-child(n+6) { animation-delay: .2s; }
.pr-rub:not([hidden]) .pr-grid > * { animation: otCardIn .38s var(--ease) both; }
#modal-overlay.show .modal { animation: otPop .22s var(--ease) both; }
.otbl-pop { animation: otPop .16s var(--ease) both; }

/* Catégories d'articles en cartes (Paramètres > Magasins et stock) */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cat-card { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 10px 14px; background: var(--panel); box-shadow: var(--shine), var(--shadow); overflow: hidden; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cat); }
.cat-card .cat-name { font-weight: 700; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 3px 5px; margin: -3px -5px; font: inherit; font-weight: 700; color: inherit; width: calc(100% + 10px); min-width: 0; }
.cat-card .cat-name:hover { border-color: var(--border); background: var(--input); }
.cat-card .cat-name:focus { outline: none; border-color: var(--accent); background: var(--input); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.cat-card .cat-meta { display: flex; align-items: center; gap: 6px; font-size: .78em; color: var(--muted); }
.cat-card .cat-meta b { color: var(--text); font-size: 1.25em; }
.cat-card .cat-bar { height: 5px; border-radius: 3px; background: rgba(0,0,0,.06); overflow: hidden; }
.cat-card .cat-bar i { display: block; height: 100%; background: var(--cat); border-radius: 3px; }
.cat-card .cat-acts { display: flex; gap: 4px; margin-top: 2px; }
.cat-card .cat-acts button { min-height: 30px; }
.cat-add { display: flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed var(--border); border-radius: 12px; min-height: 96px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.cat-add:hover { border-color: var(--accent); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .page.active, .page.active *, .pr-rub .pr-grid > *, #modal-overlay.show .modal, .otbl-pop { animation: none !important; }
  .pr-tab, .cat-card, .pf-kpi, .pf-p, .sk-card, .tr-card, .btn, .btn-sm { transition: none !important; }
  .pr-tab:hover, .cat-card:hover, .pf-kpi:hover, .sk-card:hover, .tr-card:hover, .pf-p:hover { transform: none; }
}
