/* Électro Slim Magic — shared design tokens & primitives (storefront + ERP) */
:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #f1f5f9;
  --bg: #f8fafc;
  --paper: #ffffff;
  --navy: #0b1528;
  --navy-2: #112240;
  --dark: #080e1a;
  --blue: #1e50ff;
  --blue-ink: #1640d6;
  --blue-soft: #eef2ff;
  --royal: #112240;
  --volt: #f59e0b;
  --volt-2: #d97706;
  --volt-soft: #fffbeb;
  --red: #d92d20;
  --red-soft: #fdecea;
  --green: #12805c;
  --green-soft: #e6f5ef;
  --amber: #b54708;
  --amber-soft: #fef0e1;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, .06);
  --shadow-hover: 0 12px 32px -4px rgba(15, 23, 42, .12);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .35);
  --glow: 0 0 50px -10px rgba(30, 80, 255, .35);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.display { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -.025em; line-height: 1.06; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
::selection { background: var(--blue); color: #fff; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; transition: background .18s var(--ease), border-color .18s, color .18s, transform .12s; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--blue-ink); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-ink); }
.btn-volt { background: var(--volt); color: #020617; font-weight: 800; box-shadow: 0 10px 24px -8px rgba(245, 158, 11, .45); }
.btn-volt:hover { background: var(--volt-2); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 15.5px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; color: inherit; position: relative; }
.icon-btn:hover { background: var(--line-2); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Forms */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b6577' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(20, 103, 153, .12); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--red); }
.field .err { font-size: 12.5px; color: var(--red); min-height: 0; }
.input-group { display: flex; align-items: stretch; }
.input-group .prefix { display: grid; place-items: center; padding: 0 12px; border: 1.5px solid var(--line); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--line-2); font-weight: 600; font-size: 14px; color: var(--muted); }
.input-group .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.badge-ink { background: var(--ink); color: #fff; }
.badge-volt { background: var(--volt); color: #020617; font-weight: 800; }
.badge-new { background: #4f46e5; color: #fff; }
.badge-sm { background: #2563eb; color: #fff; }
.badge-red { background: var(--red); color: #fff; }
.badge-blue { background: var(--blue-soft); color: var(--blue-ink); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-grey { background: var(--line-2); color: var(--muted); }
.badge-soft-red { background: var(--red-soft); color: var(--red); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Toasts */
.toasts { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--ink); color: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px;
  animation: toast-in .28s var(--ease); }
.toast.error { background: #7a1610; }
.toast.success .ti { color: var(--volt); }
.toast a { text-decoration: underline; font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Skeleton & empty states */
.skel { background: linear-gradient(90deg, var(--line-2) 0%, #f8f9fb 50%, var(--line-2) 100%); background-size: 200% 100%; animation: skel 1.2s infinite linear; border-radius: 10px; }
@keyframes skel { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 18px; }
.empty .btn { margin-top: 18px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(11, 18, 32, .48); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 22px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
