/* ============================================================
   SGO Client Portal — frontend design system
   Fintech dashboard aesthetic · RTL · Mobile-first · light+dark
   Brand: SGO black #0a0a0a on #f8f9fa, accent blue.
   ============================================================ */

/* SGO brand font — Tel Aviv Modernist (Regular + Bold). Ranges map the UI's
   intermediate weights (500/600) cleanly onto the two real files. */
@font-face {
	font-family: "Tel Aviv Modernist";
	src: url("fonts/TelAviv-ModernistRegular.ttf") format("truetype");
	font-weight: 100 500; font-style: normal; font-display: swap;
}
@font-face {
	font-family: "Tel Aviv Modernist";
	src: url("fonts/TelAviv-ModernistBold.ttf") format("truetype");
	font-weight: 600 900; font-style: normal; font-display: swap;
}

:root {
	/* brand — SGO (sgo.co.il): black + purple, white bg, black→purple gradient */
	--spc-ink: #0a0a0a;
	--spc-accent: #9D2C94;         /* SGO magenta/purple */
	--spc-accent-2: #6D1F67;       /* SGO deep purple */
	--spc-accent-ink: #ffffff;
	--spc-accent-soft: #f6e9f5;
	--spc-gradient: linear-gradient(120deg, #0a0a0a 0%, #6D1F67 60%, #9D2C94 100%);

	/* surfaces — light premium */
	--spc-bg: #faf9fb;
	--spc-surface: #ffffff;
	--spc-surface-2: #f6f3f7;
	--spc-sidebar: #ffffff;        /* light premium sidebar */
	--spc-sidebar-ink: #6b6470;
	--spc-sidebar-ink-active: #0a0a0a;
	--spc-sidebar-active: #f7ecf6;

	/* text */
	--spc-text: #1d2433;
	--spc-text-soft: #64748b;
	--spc-text-faint: #94a3b8;

	/* lines */
	--spc-border: #e6ebf2;
	--spc-border-2: #eef2f7;

	/* status */
	--spc-ok: #16a34a;      --spc-ok-soft: #e7f6ec;
	--spc-warn: #d97706;    --spc-warn-soft: #fdf1e3;
	--spc-err: #dc2626;     --spc-err-soft: #fdeaea;
	--spc-info: #6D1F67;    --spc-info-soft: #f3e7f2;
	--spc-neutral: #6b6470; --spc-neutral-soft: #efeaf0;

	/* geometry */
	--spc-radius: 16px;
	--spc-radius-sm: 10px;
	--spc-radius-pill: 999px;
	--spc-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
	--spc-shadow-sm: 0 1px 2px rgba(16,24,40,.06);
	--spc-gap: 20px;

	--spc-font: "Tel Aviv Modernist","Heebo","Assistant",-apple-system,"Segoe UI",Arial,sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-spc-theme="light"]) {
		--spc-bg: #120e14;
		--spc-surface: #1b141d;
		--spc-surface-2: #241a26;
		--spc-sidebar: #000000;
		--spc-text: #f0eaf1;
		--spc-text-soft: #a99fad;
		--spc-text-faint: #6b6470;
		--spc-border: #322636;
		--spc-border-2: #271d2a;
		--spc-accent: #c14fb6; --spc-accent-soft: #2c1a2b;
		--spc-ok-soft:#123021; --spc-warn-soft:#3a2a12; --spc-err-soft:#3a1717; --spc-info-soft:#2c1a2b; --spc-neutral-soft:#271d2a;
	}
}
:root[data-spc-theme="dark"] {
	--spc-bg: #120e14; --spc-surface: #1b141d; --spc-surface-2: #241a26; --spc-sidebar: #000000;
	--spc-text: #f0eaf1; --spc-text-soft: #a99fad; --spc-text-faint: #6b6470;
	--spc-border: #322636; --spc-border-2: #271d2a; --spc-accent: #c14fb6; --spc-accent-soft: #2c1a2b;
	--spc-ok-soft:#123021; --spc-warn-soft:#3a2a12; --spc-err-soft:#3a1717; --spc-info-soft:#2c1a2b; --spc-neutral-soft:#271d2a;
}

/* ---------- reset within portal ---------- */
.spc-app *, .spc-app *::before, .spc-app *::after { box-sizing: border-box; }
.spc-app { direction: rtl; font-family: var(--spc-font); background: var(--spc-bg); color: var(--spc-text);
	min-height: 100vh; margin: 0; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.spc-app a { color: inherit; text-decoration: none; }
.spc-app h1,.spc-app h2,.spc-app h3,.spc-app h4 { margin: 0; font-weight: 700; color: var(--spc-text); letter-spacing: -.01em; }
.spc-svg { display: inline-block; vertical-align: middle; flex: none; }

/* entrance — staggered, subtle, reduced-motion safe */
@keyframes spc-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.spc-content > *, .spc-grid > * { animation: spc-rise .38s cubic-bezier(.2,.7,.3,1) both; }
.spc-grid > *:nth-child(2){animation-delay:.04s}.spc-grid > *:nth-child(3){animation-delay:.08s}
.spc-grid > *:nth-child(4){animation-delay:.12s}.spc-grid > *:nth-child(5){animation-delay:.16s}
@media (prefers-reduced-motion: reduce){ .spc-content > *, .spc-grid > * { animation: none; } }

/* ---------- layout ---------- */
.spc-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.spc-sidebar { background: var(--spc-sidebar); color: var(--spc-sidebar-ink); padding: 22px 16px;
	position: sticky; top: 0; height: 100vh; overflow-y: auto; border-inline-end: 1px solid var(--spc-border); }
.spc-sidebar .spc-brand-name { color: var(--spc-text); }
.spc-main { min-width: 0; display: flex; flex-direction: column; }
.spc-content { padding: 26px 30px 60px; max-width: 1240px; width: 100%; margin-inline: auto; }

/* ---------- sidebar ---------- */
.spc-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.spc-brand-logo { width: 40px; height: 40px; border-radius: 11px; background: #0a0a0a;
	display: grid; place-items: center; color: #fff; font-weight: 800; overflow: hidden;
	border: 1px solid rgba(157,44,148,.35); }
.spc-brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.spc-brand-name { color: #fff; font-weight: 800; font-size: 16px; }
.spc-nav { display: flex; flex-direction: column; gap: 2px; }
.spc-nav a { display: flex; align-items: center; gap: 12px; padding: 10.5px 12px; border-radius: 11px;
	color: var(--spc-sidebar-ink); font-weight: 500; font-size: 14.5px; transition: background .14s, color .14s; position: relative; }
.spc-nav a .spc-i { display: grid; place-items: center; width: 22px; height: 22px; opacity: .85; }
.spc-nav a:hover { background: var(--spc-surface-2); color: var(--spc-text); }
.spc-nav a:hover .spc-i { opacity: 1; }
.spc-nav a.is-active { background: var(--spc-sidebar-active); color: var(--spc-sidebar-ink-active); font-weight: 700; }
.spc-nav a.is-active .spc-i { opacity: 1; color: var(--spc-accent); }
.spc-nav a.is-active::before { content:""; position: absolute; inset-inline-start: -16px; top: 50%; transform: translateY(-50%);
	width: 3px; height: 22px; border-radius: 3px; background: var(--spc-accent); }
.spc-nav a .spc-badge { margin-inline-start: auto; }
.spc-nav-sep { color: var(--spc-text-faint); font-size: 11px; font-weight: 700; letter-spacing: .04em;
	text-transform: uppercase; padding: 16px 12px 6px; opacity: .6; }

/* ---------- topbar ---------- */
.spc-topbar { display: flex; align-items: center; gap: 16px; padding: 14px 30px; background: var(--spc-surface);
	border-bottom: 1px solid var(--spc-border); position: sticky; top: 0; z-index: 20; }
.spc-topbar h1 { font-size: 19px; }
.spc-topbar .spc-spacer { margin-inline-start: auto; }
.spc-orgswitch select { font-family: inherit; font-size: 14px; font-weight: 600; color: var(--spc-text);
	background: var(--spc-surface-2); border: 1px solid var(--spc-border); border-radius: var(--spc-radius-pill);
	padding: 8px 14px; cursor: pointer; }
.spc-iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--spc-border);
	background: var(--spc-surface); display: grid; place-items: center; cursor: pointer; position: relative; color: var(--spc-text-soft);
	transition: color .14s, border-color .14s, background .14s; }
.spc-iconbtn:hover { color: var(--spc-accent); border-color: var(--spc-accent); background: var(--spc-accent-soft); }
.spc-iconbtn .spc-dot { position: absolute; top: 8px; inset-inline-end: 9px; width: 8px; height: 8px;
	background: var(--spc-err); border-radius: 50%; border: 2px solid var(--spc-surface); }
.spc-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--spc-accent-soft);
	color: var(--spc-accent); display: grid; place-items: center; font-weight: 800; }

/* ---------- hamburger (mobile) ---------- */
.spc-burger { display: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--spc-border);
	background: var(--spc-surface); cursor: pointer; place-items: center; }

/* ---------- cards ---------- */
.spc-card { background: var(--spc-surface); border: 1px solid var(--spc-border); border-radius: var(--spc-radius);
	box-shadow: var(--spc-shadow); padding: 22px; }
.spc-card-head .spc-svg { color: var(--spc-accent); }
.spc-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.spc-card-head h2, .spc-card-head h3 { font-size: 16px; }
.spc-card-head .spc-spacer { margin-inline-start: auto; }
.spc-grid { display: grid; gap: var(--spc-gap); }
.spc-grid.cols-2 { grid-template-columns: repeat(2,1fr); }
.spc-grid.cols-3 { grid-template-columns: repeat(3,1fr); }
.spc-grid.cols-4 { grid-template-columns: repeat(4,1fr); }

/* ---------- KPI tiles ---------- */
.spc-kpi { background: var(--spc-surface); border: 1px solid var(--spc-border); border-radius: var(--spc-radius);
	box-shadow: var(--spc-shadow-sm); padding: 20px; display: flex; flex-direction: column; gap: 14px;
	transition: box-shadow .18s, transform .18s; }
.spc-kpi:hover { box-shadow: var(--spc-shadow); transform: translateY(-2px); }
.spc-kpi-top { display: flex; align-items: center; gap: 12px; }
.spc-kpi-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
	background: var(--spc-gradient); color: #fff; box-shadow: 0 6px 14px rgba(109,31,103,.24); }
.spc-kpi-label { color: var(--spc-text-soft); font-size: 13.5px; font-weight: 500; }
.spc-kpi-value { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.spc-kpi-trend { font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.spc-kpi-trend.up { color: var(--spc-ok); }
.spc-kpi-trend.down { color: var(--spc-err); }

/* ---------- badges / status pills ---------- */
.spc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--spc-radius-pill);
	font-size: 12.5px; font-weight: 700; background: var(--spc-neutral-soft); color: var(--spc-neutral); }
.spc-badge::before { content:""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.spc-badge.ok { background: var(--spc-ok-soft); color: var(--spc-ok); }
.spc-badge.warn { background: var(--spc-warn-soft); color: var(--spc-warn); }
.spc-badge.err { background: var(--spc-err-soft); color: var(--spc-err); }
.spc-badge.info { background: var(--spc-info-soft); color: var(--spc-info); }
.spc-badge.plain::before { display:none; }

/* ---------- tables ---------- */
.spc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spc-table th { text-align: start; color: var(--spc-text-soft); font-weight: 600; font-size: 12.5px;
	padding: 10px 12px; border-bottom: 1px solid var(--spc-border); white-space: nowrap; }
.spc-table td { padding: 13px 12px; border-bottom: 1px solid var(--spc-border-2); vertical-align: middle; }
.spc-table tr:last-child td { border-bottom: 0; }
.spc-table tr:hover td { background: var(--spc-surface-2); }
.spc-table .num { font-variant-numeric: tabular-nums; }

/* ---------- timeline (maintenance / activity) ---------- */
.spc-timeline { display: flex; flex-direction: column; gap: 2px; }
.spc-tl-item { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 12px 4px; position: relative; }
.spc-tl-rail { display: grid; justify-items: center; }
.spc-tl-dot { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
	background: var(--spc-accent-soft); color: var(--spc-accent); z-index: 1; }
.spc-tl-line { width: 2px; flex: 1; background: var(--spc-border); margin: 2px 0; }
.spc-tl-body { padding-bottom: 4px; }
.spc-tl-title { font-weight: 700; }
.spc-tl-meta { color: var(--spc-text-soft); font-size: 13px; margin-top: 2px; }
.spc-tl-desc { margin-top: 6px; color: var(--spc-text); font-size: 14px; }

/* ---------- buttons ---------- */
.spc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
	font-family: inherit; font-size: 14.5px; font-weight: 600; padding: 10px 18px; border-radius: 12px;
	border: 1px solid transparent; transition: transform .08s ease, filter .14s, background .14s, box-shadow .14s; }
.spc-btn:active { transform: scale(.97); }
.spc-btn .spc-svg { margin-inline-start: -2px; }
.spc-btn.primary { background: var(--spc-gradient); color: var(--spc-accent-ink); box-shadow: 0 6px 16px rgba(157,44,148,.30); }
.spc-btn.primary:hover { filter: brightness(1.08); }
.spc-btn.ghost { background: var(--spc-surface); color: var(--spc-text); border-color: var(--spc-border); }
.spc-btn.ghost:hover { background: var(--spc-surface-2); }
.spc-btn.pay { background: var(--spc-ok); color: #fff; box-shadow: 0 6px 16px rgba(22,163,74,.26); }
.spc-btn.block { width: 100%; }
.spc-btn.sm { padding: 7px 13px; font-size: 13.5px; border-radius: 10px; }

/* ---------- tabs ---------- */
.spc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--spc-border); margin-bottom: 20px; flex-wrap: wrap; }
.spc-tabs a { padding: 11px 16px; font-weight: 600; color: var(--spc-text-soft); border-bottom: 2px solid transparent; }
.spc-tabs a.is-active { color: var(--spc-accent); border-bottom-color: var(--spc-accent); }

/* ---------- states (empty / loading / error) ---------- */
.spc-state { text-align: center; padding: 52px 20px; color: var(--spc-text-soft); }
.spc-state-ico { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center;
	background: var(--spc-accent-soft); color: var(--spc-accent); }
.spc-state h3 { color: var(--spc-text); margin-bottom: 6px; font-size: 17px; }
.spc-state p { max-width: 380px; margin: 0 auto; }
.spc-skeleton { background: linear-gradient(90deg,var(--spc-surface-2) 25%,var(--spc-border-2) 37%,var(--spc-surface-2) 63%);
	background-size: 400% 100%; animation: spc-shimmer 1.3s infinite; border-radius: 8px; }
@keyframes spc-shimmer { 0%{background-position:100% 0} 100%{background-position:-100% 0} }
.spc-banner { padding: 12px 16px; border-radius: 12px; font-weight: 600; margin-bottom: 18px; }
.spc-banner.err { background: var(--spc-err-soft); color: var(--spc-err); }
.spc-banner.ok { background: var(--spc-ok-soft); color: var(--spc-ok); }
.spc-banner.info { background: var(--spc-info-soft); color: var(--spc-info); }

/* ---------- forms ---------- */
.spc-field { margin-bottom: 16px; }
.spc-field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--spc-text); }
.spc-input, .spc-app select.spc-input, .spc-app textarea.spc-input { width: 100%; font-family: inherit; font-size: 15px;
	padding: 11px 14px; border: 1px solid var(--spc-border); border-radius: 12px; background: var(--spc-surface); color: var(--spc-text); }
.spc-input:focus { outline: none; border-color: var(--spc-accent); box-shadow: 0 0 0 3px var(--spc-accent-soft); }

/* ---------- progress (time bank) ---------- */
.spc-progress { height: 12px; border-radius: 999px; background: var(--spc-surface-2); overflow: hidden; }
.spc-progress > span { display: block; height: 100%; background: var(--spc-accent); border-radius: 999px; }
.spc-progress.low > span { background: var(--spc-warn); }
.spc-progress.crit > span { background: var(--spc-err); }

/* ---------- login ---------- */
/* premium login — form on the RIGHT (RTL), floating dark atmosphere card on the LEFT */
.spc-login { min-height: 100vh; display: grid; grid-template-columns: 38% 62%; background: var(--spc-bg); }

/* form side (right in RTL) — card sits toward the inner edge, near the image */
.spc-login-form { display: flex; align-items: center; justify-content: center; padding: 40px clamp(28px, 5vw, 72px); }
.spc-login-card { width: 100%; max-width: 380px; }
.spc-login-logo { margin-bottom: 30px; }
.spc-login-logo .spc-brand-logo { width: 60px; height: 60px; border-radius: 15px; }
.spc-login-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.spc-login-tag { color: var(--spc-text-soft); font-size: 15px; margin: 8px 0 28px; }
.spc-login-foot { color: var(--spc-text-faint); font-size: 12.5px; margin-top: 26px; }
.spc-login-mobilelogo { display: none; }

/* input with leading icon */
.spc-inwrap { position: relative; }
.spc-inwrap .spc-svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--spc-text-faint); pointer-events: none; }
.spc-inwrap .spc-input { padding-inline-start: 44px; height: 50px; }

/* atmosphere card (left in RTL) */
.spc-login-brand { padding: 26px; }
.spc-login-brandcard { position: relative; height: 100%; min-height: 560px; border-radius: 28px; overflow: hidden;
	background: #0a0a0a; box-shadow: 0 30px 70px rgba(10,10,10,.28); }
.spc-login-brandcard-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.spc-login-brandcard-ov { position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(10,10,10,.35) 0%, rgba(10,10,10,.05) 40%, rgba(10,10,10,.82) 100%),
	            linear-gradient(120deg, rgba(109,31,103,.28), transparent 60%); }
.spc-login-brandcard-inner { position: absolute; inset: 0; z-index: 1; padding: 40px; display: flex; flex-direction: column;
	justify-content: space-between; color: #fff; }
.brand-top { display: flex; align-items: center; gap: 12px; }
.brand-top .spc-brand-logo { width: 44px; height: 44px; }
.brand-top b { font-size: 18px; font-weight: 800; }
.brand-mid { margin-top: auto; }
.brand-mid h2 { color: #fff; font-size: 30px; line-height: 1.28; font-weight: 800; letter-spacing: -.02em; max-width: 460px; }
.brand-mid p { color: rgba(255,255,255,.85); font-size: 15.5px; line-height: 1.65; margin: 16px 0 0; max-width: 440px; }
.brand-glass { margin-top: 22px; background: rgba(255,255,255,.1); backdrop-filter: blur(10px);
	border: 1px solid rgba(255,255,255,.16); border-radius: 20px; padding: 20px 22px; max-width: 460px; }
.brand-glass p { color: #fff; font-size: 15px; line-height: 1.6; font-weight: 500; margin: 0; }
.brand-glass .brand-tag { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px;
	color: rgba(255,255,255,.78); font-size: 12.5px; font-weight: 600; }
.brand-glass .brand-tag::before { content:""; width: 20px; height: 2px; border-radius: 2px; background: var(--spc-accent); }

@media (max-width: 900px) {
	.spc-login { grid-template-columns: 1fr; }
	.spc-login-brand { display: none; }
	.spc-login-form { min-height: 100vh; align-content: center; }
	.spc-login-mobilelogo { display: flex; margin-bottom: 22px; }
	.spc-login-mobilelogo .spc-brand-logo { width: 60px; height: 60px; border-radius: 15px; }
}

/* ---------- upsell nudge ---------- */
.spc-nudge { background: linear-gradient(120deg, var(--spc-accent-soft), var(--spc-surface));
	border: 1px solid var(--spc-border); border-radius: var(--spc-radius); padding: 18px 20px; display: flex;
	align-items: center; gap: 16px; }
.spc-nudge-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none;
	background: var(--spc-gradient); color: #fff; box-shadow: 0 6px 14px rgba(109,31,103,.24); }
.spc-nudge .spc-nudge-body { flex: 1; }
.spc-nudge h3 { font-size: 15px; }
.spc-nudge p { margin: 4px 0 0; color: var(--spc-text-soft); font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
	.spc-shell { grid-template-columns: 1fr; }
	.spc-sidebar { position: fixed; inset-inline-start: 0; top: 0; width: 260px; z-index: 60;
		transform: translateX(110%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
	.spc-app.nav-open .spc-sidebar { transform: translateX(0); }
	.spc-app.nav-open::after { content:""; position: fixed; inset: 0; background: rgba(2,6,23,.5); z-index: 50; }
	.spc-burger { display: grid; }
	.spc-grid.cols-4 { grid-template-columns: repeat(2,1fr); }
	.spc-grid.cols-3, .spc-grid.cols-2 { grid-template-columns: 1fr; }
	.spc-content { padding: 18px 16px 50px; }
	.spc-topbar { padding: 12px 16px; }
	.spc-table-wrap { overflow-x: auto; }
}
@media (max-width: 520px) {
	.spc-grid.cols-4 { grid-template-columns: 1fr; }
	.spc-kpi-value { font-size: 26px; }
}
