/* =====================================================================
   JF LLC — Design system
   Nwa pwofon + gradyan zoranj (menm idantite ak flyer la)
   ===================================================================== */
:root {
  --bg: #07080b;
  --bg-2: #0d0f14;
  --panel: rgba(22, 25, 33, .72);
  --panel-solid: #14171e;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f4f1ec;
  --mute: #9aa0ad;
  --dim: #6b7180;
  --o1: #ffb02e;
  --o2: #ff7a00;
  --o3: #ff4d00;
  --grad: linear-gradient(135deg, var(--o1) 0%, var(--o2) 45%, var(--o3) 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,176,46,.16), rgba(255,77,0,.10));
  --ok: #2fd47a;
  --warn: #ffc23d;
  --bad: #ff5a5f;
  --info: #5aa9ff;
  --r: 18px;
  --r-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.7), 0 0 0 1px var(--line);
  --glow: 0 10px 40px -10px rgba(255, 122, 0, .55);
  --display: 'Archivo', 'Manrope', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased;
}
a { color: var(--o1); text-decoration: none; }
a:hover { color: #ffd08a; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0 0 .4em; line-height: 1.08; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
.hidden { display: none !important; }
.mute { color: var(--mute); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.xs { font-size: 11.5px; }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.ico { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }

/* ---------- Background ambiance ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: var(--bg); }
.ambient::before, .ambient::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
  animation: drift 22s ease-in-out infinite alternate;
}
.ambient::before { width: 60vmax; height: 60vmax; left: -20vmax; top: -25vmax; background: radial-gradient(circle, rgba(255,122,0,.35), transparent 65%); }
.ambient::after { width: 50vmax; height: 50vmax; right: -18vmax; bottom: -22vmax; background: radial-gradient(circle, rgba(255,176,46,.20), transparent 65%); animation-delay: -8s; }
.ambient .grid-lines { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); opacity: .35; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .ambient::before, .ambient::after { animation: none; } }

/* ---------- Components ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 50px -30px rgba(0,0,0,.8);
}
.card.glow { position: relative; }
.card.glow::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,176,46,.65), rgba(255,77,0,.1) 40%, transparent 60%, rgba(255,122,0,.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.card h3 { font-size: 17px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

.btn {
  --b: var(--grad);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 20px; cursor: pointer;
  font: 700 14px/1 var(--body); letter-spacing: .01em; color: #160800;
  background: var(--b); box-shadow: var(--glow); transition: transform .15s, box-shadow .2s, filter .2s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); color: #160800; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn.ghost { background: rgba(255,255,255,.05); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: rgba(255,255,255,.09); color: var(--text); }
.btn.green { --b: linear-gradient(135deg, #3ee08a, #10a957); color: #02160a; box-shadow: 0 10px 30px -12px rgba(47,212,122,.6); }
.btn.danger { background: rgba(255,90,95,.12); color: #ff8a8e; box-shadow: inset 0 0 0 1px rgba(255,90,95,.35); }
.btn.sm { padding: 8px 13px; font-size: 13px; }
.btn.xs { padding: 6px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.icon { padding: 9px; border-radius: 12px; }

label { display: block; font-size: 12px; font-weight: 700; color: var(--mute); letter-spacing: .04em; text-transform: uppercase; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%; font: 500 15px/1.4 var(--body); color: var(--text);
  background: rgba(255,255,255,.04); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 90px; 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' fill='none' stroke='%239aa0ad' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
select option { background: #14171e; }
input:focus, select:focus, textarea:focus { border-color: var(--o2); box-shadow: 0 0 0 4px rgba(255,122,0,.15); background: rgba(255,255,255,.06); }
input::placeholder, textarea::placeholder { color: var(--dim); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--o2); padding: 0; }
.check { display: flex; gap: 10px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); font-weight: 600; margin: 8px 0; cursor: pointer; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .03em; white-space: nowrap;
  background: rgba(255,255,255,.07); color: var(--mute); border: 1px solid var(--line);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.s-pending { color: #c9cfdb; }
.pill.s-purchased { color: #b48cff; background: rgba(180,140,255,.1); border-color: rgba(180,140,255,.25); }
.pill.s-received_usa { color: var(--info); background: rgba(90,169,255,.1); border-color: rgba(90,169,255,.25); }
.pill.s-in_transit { color: var(--o1); background: rgba(255,176,46,.1); border-color: rgba(255,176,46,.28); }
.pill.s-arrived { color: #3fe0d0; background: rgba(63,224,208,.1); border-color: rgba(63,224,208,.25); }
.pill.s-delivered { color: var(--ok); background: rgba(47,212,122,.1); border-color: rgba(47,212,122,.25); }
.pill.s-cancelled { color: var(--bad); background: rgba(255,90,95,.1); border-color: rgba(255,90,95,.25); }
.pill.plain::before { display: none; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--grad-soft); color: var(--o1); letter-spacing: .04em; }

/* ---------- Timeline (swivi) ---------- */
.tl { position: relative; margin: 6px 0 4px; padding-left: 4px; }
.tl .e { position: relative; padding: 0 0 20px 38px; }
.tl .e:last-child { padding-bottom: 2px; }
.tl .e::before { content: ''; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--line-2); }
.tl .e:last-child::before { display: none; }
.tl .e.done::before { background: linear-gradient(var(--o2), var(--o2)); }
.tl .dot { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 2px solid var(--line-2); color: var(--dim); }
.tl .e.done .dot { background: var(--grad); border-color: transparent; color: #160800; }
.tl .e.cur .dot { background: var(--bg); border-color: var(--o2); color: var(--o1); box-shadow: 0 0 0 6px rgba(255,122,0,.14); animation: pulse 2s infinite; }
.tl .dot .ico { width: 13px; height: 13px; stroke-width: 3; }
.tl b { display: block; font-size: 15px; }
.tl .e.fut b { color: var(--dim); font-weight: 600; }
.tl span { font-size: 12.5px; color: var(--mute); }
@keyframes pulse { 50% { box-shadow: 0 0 0 11px rgba(255,122,0,0); } }

.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: inherit; box-shadow: var(--glow); transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* ---------- Toast & modal ---------- */
#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 99; background: #1d212b; color: var(--text); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow); max-width: 92vw; }
#toast.err { border-color: rgba(255,90,95,.5); color: #ffb3b5; }
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(3,4,6,.72); backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; animation: fade .18s; }
.modal { width: 100%; max-width: 640px; background: linear-gradient(180deg, #171a22, #111319); border: 1px solid var(--line-2); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); animation: rise .22s cubic-bezier(.2,.8,.2,1); }
.modal.wide { max-width: 860px; }
.modal h2 { font-size: 22px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Tables / lists ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 800; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; transition: background .12s; }
.tbl tr.click:hover td { background: rgba(255,255,255,.03); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.list .it { display: flex; gap: 12px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list .it:last-child { border-bottom: 0; }
.list .it:hover { background: rgba(255,255,255,.02); }
.av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--grad-soft); color: var(--o1); border: 1px solid rgba(255,122,0,.25); flex: none; font-size: 14px; }

.empty { text-align: center; padding: 36px 14px; color: var(--mute); }
.empty .ico { width: 38px; height: 38px; color: var(--dim); margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; height: 18px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ======================================================================
   APP EKIP
   ====================================================================== */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(14,16,21,.95), rgba(9,10,13,.95)); display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 1px var(--line-2); }
.brand b { font-family: var(--display); font-size: 18px; display: block; line-height: 1; }
.brand small { color: var(--mute); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--mute); font-weight: 700; font-size: 14px; position: relative; transition: background .15s, color .15s; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav a.on { color: var(--text); background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(255,122,0,.25); }
.nav a.on .ico { color: var(--o1); }
.nav a .badge { margin-left: auto; background: var(--grad); color: #160800; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 2px 8px; }
.side .me { margin-top: auto; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.main { padding: 26px 30px 90px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { font-size: 30px; margin: 0; }
.topbar .sub { color: var(--mute); font-size: 13.5px; }
.search { position: relative; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.search input { padding-left: 38px; border-radius: 999px; min-width: 240px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; }
.kpi .k { font-size: 12px; color: var(--mute); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kpi .v { font-family: var(--display); font-size: 30px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .h { font-size: 12.5px; color: var(--mute); margin-top: 2px; }
.kpi .ico.bg { position: absolute; right: -10px; bottom: -12px; width: 86px; height: 86px; color: rgba(255,122,0,.10); stroke-width: 1.4; }
.kpi.hero { background: linear-gradient(135deg, rgba(255,176,46,.22), rgba(255,77,0,.14) 60%, rgba(22,25,33,.7)); border-color: rgba(255,122,0,.35); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.pipeline .st { padding: 14px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); cursor: pointer; transition: transform .15s, border-color .15s; }
.pipeline .st:hover { transform: translateY(-2px); border-color: rgba(255,122,0,.4); }
.pipeline .st b { font-family: var(--display); font-size: 26px; display: block; }
.pipeline .st span { font-size: 12px; color: var(--mute); font-weight: 700; }
@media (max-width: 1100px) { .pipeline { grid-template-columns: repeat(3, 1fr); } }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--mute); border-radius: 99px; padding: 7px 14px; font: 700 13px var(--body); cursor: pointer; }
.tabs button.on { background: var(--grad); color: #160800; border-color: transparent; }
.tabs button .n { opacity: .7; margin-left: 4px; }

.sum { display: grid; gap: 6px; font-size: 14px; }
.sum div { display: flex; justify-content: space-between; gap: 10px; }
.sum .tot { font-family: var(--display); font-size: 20px; font-weight: 800; padding-top: 8px; border-top: 1px dashed var(--line-2); margin-top: 4px; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 38px; border-radius: 8px 8px 3px 3px; background: var(--grad); min-height: 3px; box-shadow: var(--glow); }
.bars .b i.neg { background: linear-gradient(#ff8a8e, #ff5a5f); }
.bars .b span { font-size: 11px; color: var(--mute); font-weight: 700; }

.mobile-top, .bottom-nav { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0 25% 0 0; z-index: 60; height: 100%; box-shadow: var(--shadow); }
  .main { padding: 14px 14px 100px; }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; position: sticky; top: 0; z-index: 20; background: rgba(7,8,11,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .mobile-top img { width: 34px; height: 34px; border-radius: 10px; }
  .topbar h1 { font-size: 24px; }
  .search input { min-width: 0; width: 100%; }
  .search { width: 100%; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 30; background: rgba(20,23,30,.88); backdrop-filter: blur(16px); border: 1px solid var(--line-2); border-radius: 20px; padding: 6px; box-shadow: var(--shadow); padding-bottom: calc(6px + env(safe-area-inset-bottom) * .5); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--mute); padding: 7px 0; border-radius: 14px; }
  .bottom-nav a.on { color: var(--o1); background: rgba(255,122,0,.1); }
  .bottom-nav a .ico { width: 21px; height: 21px; }
  .bottom-nav a.fab { color: #160800; background: var(--grad); box-shadow: var(--glow); }
  .tbl.resp thead { display: none; }
  .tbl.resp tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .tbl.resp td { border: 0; padding: 0; }
  .tbl.resp td.hide-m { display: none; }
}

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .box { width: 100%; max-width: 400px; }
.auth .logo { width: 120px; margin: 0 auto 16px; border-radius: 24px; box-shadow: var(--glow); }

/* ---------- Print (resi / etikèt) ---------- */
#print { display: none; }
@media print {
  @page { margin: 10mm; }
  body { background: #fff !important; color: #111 !important; }
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; font: 12px/1.45 var(--body); color: #111; }
  #print .rc { max-width: 720px; margin: 0 auto; }
  #print .rc-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid #ff7a00; padding-bottom: 10px; margin-bottom: 12px; }
  #print .rc-head img { width: 90px; border-radius: 12px; }
  #print h1 { font-size: 22px; margin: 0; }
  #print table { width: 100%; border-collapse: collapse; margin: 8px 0; }
  #print th, #print td { border-bottom: 1px solid #ddd; padding: 6px 4px; text-align: left; }
  #print .r { text-align: right; }
  #print .tot { font-size: 16px; font-weight: 800; }
  #print .label { width: 100mm; border: 2px dashed #111; padding: 10px; margin: 0 auto; page-break-inside: avoid; }
  #print .label .big { font-size: 26px; font-weight: 900; letter-spacing: .05em; }
  #print .qr { width: 110px; height: 110px; }
}
@media (max-width: 900px) { .grid2[style*="grid-template-columns"] { grid-template-columns: 1fr !important; } }
