/* ===========================================================
   PROVENT CRM — Design tokens & base styles
   Dark, luxurious. Black + magenta. RTL Hebrew.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800;900&family=Assistant:wght@300;400;500;600;700;800&family=Frank+Ruhl+Libre:wght@400;500;700;900&family=Heebo:wght@300;400;500;700&display=swap');

:root {
  /* ---- palette : default "magenta classic" ---- */
  --bg:            #08080a;
  --bg-2:          #0d0d10;
  --surface:       #141417;
  --surface-2:     #1a1a1f;
  --surface-3:     #212128;
  --line:          rgba(255,255,255,0.07);
  --line-2:        rgba(255,255,255,0.12);

  --txt:           #f4f4f6;
  --txt-2:         #a7a7b2;
  --txt-3:         #6c6c78;

  --mag:           #e6177f;   /* primary magenta */
  --mag-bright:    #ff2d96;
  --mag-deep:      #b00f63;
  --mag-soft:      rgba(230,23,127,0.14);
  --mag-line:      rgba(230,23,127,0.35);
  --mag-glow:      rgba(230,23,127,0.45);

  --gold:          #d8b574;   /* champagne accent */
  --ok:            #2bbf7a;
  --ok-soft:       rgba(43,191,122,0.14);
  --warn:          #e0a93b;
  --warn-soft:     rgba(224,169,59,0.14);
  --bad:           #e5484d;
  --bad-soft:      rgba(229,72,77,0.14);
  --info:          #4a8fe0;
  --info-soft:     rgba(74,143,224,0.14);

  --radius:        16px;
  --radius-sm:     10px;
  --radius-lg:     22px;

  --shadow:        0 12px 40px -12px rgba(0,0,0,0.7);
  --shadow-mag:    0 8px 28px -8px var(--mag-glow);

  --font-ui:       'Rubik', 'Assistant', system-ui, sans-serif;
  --font-display:  'Rubik', 'Assistant', sans-serif;
  --ui-scale:      1;
  --head-scale:    1;

  --sidebar-w:     268px;
}

/* ---- THEME: "neon noir" (cooler, glassier, brighter neon) ---- */
:root[data-theme="neon"] {
  --bg:            #060710;
  --bg-2:          #0a0c18;
  --surface:       #10121f;
  --surface-2:     #161a2b;
  --surface-3:     #1d2236;
  --line:          rgba(150,170,255,0.08);
  --line-2:        rgba(150,170,255,0.16);
  --txt:           #eef1ff;
  --txt-2:         #9aa0c4;
  --txt-3:         #5f6488;
  --mag:           #ff2d96;
  --mag-bright:    #ff5cb0;
  --mag-deep:      #c01070;
  --mag-soft:      rgba(255,45,150,0.16);
  --mag-line:      rgba(255,45,150,0.4);
  --mag-glow:      rgba(255,45,150,0.55);
  --gold:          #8be0ff;
  --shadow-mag:    0 8px 30px -6px var(--mag-glow);
}

/* ---- THEME: "couture" (warm charcoal, refined, editorial serif) ---- */
:root[data-theme="couture"] {
  --bg:            #0c0a0b;
  --bg-2:          #120e10;
  --surface:       #181315;
  --surface-2:     #20191c;
  --surface-3:     #281f23;
  --line:          rgba(255,235,240,0.07);
  --line-2:        rgba(255,235,240,0.13);
  --txt:           #f6f1f2;
  --txt-2:         #b3a4a9;
  --txt-3:         #786a6f;
  --mag:           #c41e6f;
  --mag-bright:    #e84d96;
  --mag-deep:      #8f1450;
  --mag-soft:      rgba(196,30,111,0.13);
  --mag-line:      rgba(196,30,111,0.34);
  --mag-glow:      rgba(196,30,111,0.4);
  --gold:          #d8b574;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     18px;
}

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

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-ui) !important;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

#root { height: 100vh; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #34343d; }

h1,h2,h3,h4 { margin: 0; font-weight: 700; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.font-display { font-family: var(--font-display); zoom: var(--head-scale, 1); line-height: 1.18; }

/* layered ambient bg glow */
.app-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(720px 480px at 88% -8%, var(--mag-soft), transparent 60%),
    radial-gradient(620px 520px at 6% 108%, rgba(120,40,90,0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* selection */
::selection { background: var(--mag); color: #fff; }

/* reduced-motion / print safety: never leave entrance-animated content hidden */
@media (prefers-reduced-motion: reduce), print {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
}

/* generic helpers */
.muted { color: var(--txt-2); }
.dim   { color: var(--txt-3); }
.nowrap{ white-space: nowrap; }
.row   { display: flex; align-items: center; }
.col   { display: flex; flex-direction: column; }
.gap4  { gap: 4px; } .gap6{ gap:6px;} .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap20{ gap:20px;} .gap24{ gap:24px;}
.grow  { flex: 1; }
.spread{ display:flex; align-items:center; justify-content:space-between; }
.wrap  { flex-wrap: wrap; }
.tnum  { font-variant-numeric: tabular-nums; }

/* keyframes */
/* keyframes — transform-only so a paused/frame-0 state stays fully visible
   (preview & screenshot iframes pause CSS animations at frame 0) */
@keyframes fadeUp { from { transform: translateY(10px); } to { transform: none; } }
@keyframes fadeIn { from { transform: translateY(4px); } to { transform: none; } }
@keyframes pop    { from { transform: scale(.97); } to { transform: none; } }
@keyframes pulseMag { 0%,100%{ box-shadow: 0 0 0 0 var(--mag-glow);} 50%{ box-shadow: 0 0 0 6px transparent;} }
@keyframes shimmer { 0%{background-position: -200% 0;} 100%{background-position: 200% 0;} }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================================================
   LAYOUT / SCROLL  (canonical fixed-header + scrollable body)
   =========================================================== */
html, body { height: 100%; }
.shell-root { display: flex; height: 100vh; overflow: hidden; position: relative; }
.shell-main { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; height: 100vh; }
#main-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.page-pad { padding: 32px 36px; max-width: 1400px; margin: 0 auto; zoom: var(--ui-scale, 1); }

/* the sidebar as a panel; becomes an off-canvas drawer on small screens */
.sidebar { width: var(--sidebar-w); flex-shrink: 0; height: 100vh; z-index: 30; }
.sidebar nav { zoom: var(--ui-scale, 1); }
.nav-toggle { display: none; }
.sidebar-backdrop { display: none; }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
/* collapse fixed multi-column layouts to one column; keep auto-fit/fill grids */
@media (max-width: 1000px) {
  [style*="grid-template-columns"]:not([style*="auto-f"]) { grid-template-columns: 1fr !important; }
  .page-pad { padding: 26px 22px; }
}

@media (max-width: 920px) {
  .sidebar {
    position: fixed !important; top: 0; right: 0; z-index: 400 !important;
    transform: translateX(106%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
    box-shadow: -24px 0 70px -12px rgba(0,0,0,.75);
  }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); z-index: 390; animation: fadeInBg .2s ease; }
  .nav-toggle { display: grid !important; }
  .topbar { padding: 11px 16px !important; }
  .page-pad { padding: 20px 16px; }
  .hide-sm { display: none !important; }
}

@media (max-width: 560px) {
  .hide-xs { display: none !important; }
  .page-pad { padding: 16px 13px; }
}

@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
