/* ==========================================================================
   Storm B2B — Agent panel (light + Storm blue, sidebar layout, RTL)
   ========================================================================== */

.storm-panel {
	--s-blue: #2563eb;
	--s-blue-d: #1d4ed8;
	--s-blue-l: #eff4ff;
	--s-ink: #0f172a;
	--s-muted: #64748b;
	--s-line: #e6e9f2;
	--s-bg: #f4f6fb;
	--s-card: #ffffff;
	--s-green: #16a34a;
	--s-amber: #d97706;
	--s-radius: 16px;
	--s-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);

	direction: rtl;
	display: flex;
	gap: 0;
	background: var(--s-bg);
	border-radius: var(--s-radius);
	overflow: hidden;
	box-shadow: var(--s-shadow);
	font-family: inherit;
	color: var(--s-ink);
	min-height: 640px;
	position: relative;
}

.storm-panel *,
.storm-panel *::before,
.storm-panel *::after { box-sizing: border-box; }

/* ---------- Sidebar ---------- */
.storm-panel__side {
	width: 248px;
	flex: 0 0 248px;
	background: linear-gradient(180deg, #1e3a8a 0%, #1d4ed8 55%, #2563eb 100%);
	color: #dbe6ff;
	padding: 22px 16px;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.storm-brand { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; }
.storm-brand__logo {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: 2px;
	color: #fff;
}
.storm-brand__sub { font-size: 12px; color: #b9caf5; }

.storm-userbox {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 14px;
	padding: 16px 12px;
}
.storm-avatar {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: #fff;
	color: var(--s-blue-d);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	font-weight: 800;
}
.storm-userbox__name { color: #fff; font-weight: 700; font-size: 15px; }
.storm-userbox__type { color: #b9caf5; font-size: 12px; }

.storm-nav { display: flex; flex-direction: column; gap: 4px; }
.storm-nav--foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; }
.storm-nav__item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	background: transparent;
	border: 0;
	color: #cdd9f7;
	font: inherit;
	font-size: 14.5px;
	text-align: right;
	padding: 11px 14px;
	border-radius: 12px;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s, color .15s;
}
.storm-nav__item:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.storm-nav__item.is-active {
	background: #fff;
	color: var(--s-blue-d);
	font-weight: 700;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.storm-ic { flex: 0 0 auto; }

/* ---------- Main ---------- */
.storm-panel__main { flex: 1 1 auto; padding: 24px 26px; min-width: 0; }

.storm-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 22px;
	flex-wrap: wrap;
}
.storm-topbar__hello { display: flex; flex-direction: column; gap: 3px; }
.storm-topbar__greet { font-size: 20px; font-weight: 800; }
.storm-topbar__date { font-size: 13px; color: var(--s-muted); }

/* ---------- Level badge ---------- */
.storm-lvl {
	display: inline-block;
	padding: 5px 14px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 700;
	background: #e2e8f0;
	color: #334155;
	white-space: nowrap;
}
.storm-lvl--lg { padding: 8px 18px; font-size: 14px; }
.storm-lvl--inactive { background: #f1f5f9; color: #64748b; }
.storm-lvl--base     { background: #e0f2fe; color: #0369a1; }
.storm-lvl--active   { background: #dcfce7; color: #15803d; }
.storm-lvl--power    { background: #ede9fe; color: #6d28d9; }
.storm-lvl--master   { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }

/* ---------- Sections ---------- */
.storm-section { display: none; animation: storm-fade .25s ease; }
.storm-section.is-active { display: block; }
@keyframes storm-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.storm-section__title { font-size: 18px; font-weight: 800; margin: 0 0 16px; }

/* ---------- Cards ---------- */
.storm-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 16px;
	margin-bottom: 22px;
}
.storm-card {
	background: var(--s-card);
	border: 1px solid var(--s-line);
	border-radius: 14px;
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	position: relative;
	overflow: hidden;
}
.storm-card::before {
	content: "";
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	width: 4px;
	height: 100%;
	background: var(--s-blue);
}
.storm-card--level::before  { background: var(--s-blue); }
.storm-card--wallet::before { background: var(--s-green); }
.storm-card--sum::before    { background: var(--s-amber); }
.storm-card__title { font-size: 13px; color: var(--s-muted); }
.storm-card__value { font-size: 24px; font-weight: 800; color: var(--s-ink); }
.storm-card__sub { font-size: 12px; color: #94a3b8; }

/* ---------- Progress ---------- */
.storm-progress {
	background: var(--s-card);
	border: 1px solid var(--s-line);
	border-radius: 14px;
	padding: 18px 20px;
	margin-bottom: 22px;
}
.storm-progress__head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 10px; color: #334155; }
.storm-progress__bar { background: #eef2f7; border-radius: 999px; height: 12px; overflow: hidden; }
.storm-progress__fill {
	background: linear-gradient(90deg, var(--s-blue), var(--s-green));
	height: 100%;
	border-radius: 999px;
	transition: width .5s ease;
}
.storm-progress--max { text-align: center; color: var(--s-green); font-weight: 700; }

/* ---------- Alert ---------- */
.storm-alert { border-radius: 12px; padding: 13px 16px; margin-bottom: 22px; font-size: 13.5px; }
.storm-alert--risk { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; }

/* ---------- Generic card wrapper + rates + chart ---------- */
.storm-rates,
.storm-chart-wrap,
.storm-recent-orders,
.storm-panel-card {
	background: var(--s-card);
	border: 1px solid var(--s-line);
	border-radius: 14px;
	padding: 18px 20px;
	margin-bottom: 22px;
}
.storm-rates h3,
.storm-chart-wrap h3,
.storm-recent-orders h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.storm-chart-wrap { position: relative; }
.storm-chart-wrap canvas { max-height: 260px; }

/* ---------- Tables ---------- */
.storm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.storm-table thead th {
	color: var(--s-muted);
	font-weight: 700;
	font-size: 12.5px;
	text-align: right;
	padding: 10px 12px;
	border-bottom: 2px solid var(--s-line);
}
.storm-table tbody td { padding: 12px; text-align: right; border-bottom: 1px solid #f1f4f9; }
.storm-table tbody tr:last-child td { border-bottom: 0; }
.storm-table tbody tr:hover { background: var(--s-blue-l); }

.storm-status {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: #eef2f7;
	color: #475569;
	font-size: 12px;
	font-weight: 600;
}

.storm-amount--pos { color: var(--s-green); font-weight: 700; }
.storm-amount--neg { color: #dc2626; font-weight: 700; }

.storm-batch--expired { opacity: .55; }
.storm-batch--consumed { opacity: .75; }

/* ---------- Misc ---------- */
.storm-muted { color: var(--s-muted); font-size: 13px; }
.storm-linkbtn {
	margin-top: 12px;
	background: var(--s-blue-l);
	color: var(--s-blue-d);
	border: 0;
	border-radius: 10px;
	padding: 9px 16px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.storm-linkbtn:hover { background: #dbe7ff; }

.storm-account table th { color: var(--s-muted); font-weight: 600; width: 200px; }

.storm-notice {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #9a3412;
	padding: 16px 20px;
	border-radius: 12px;
	margin: 16px 0;
}

/* ---------- Burger / overlay (mobile) ---------- */
.storm-panel__burger { display: none; }
.storm-panel__overlay { display: none; }

/* ==========================================================================
   Checkout payment + cashback preview (shared front-end, outside the panel)
   ========================================================================== */
.storm-checkout-payment {
	background: #f8fafc;
	border: 1px solid #e6e9f2;
	border-radius: 14px;
	padding: 18px 20px;
	margin: 16px 0;
	direction: rtl;
}
.storm-checkout-payment h3 { margin-top: 0; }
.storm-pay-types { list-style: none; margin: 12px 0; padding: 0; }
.storm-pay-types li { margin-bottom: 8px; }
.storm-wallet-summary strong { font-weight: 800; color: #1d4ed8; }
.storm-cash-amount-row input { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; }

.storm-cashback-preview {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	border-radius: 12px;
	padding: 14px 18px;
	margin: 12px 0;
	font-size: 14px;
	direction: rtl;
}
.storm-cashback-preview__value { font-weight: 800; color: #047857; font-size: 18px; }
.storm-cashback-preview__rate { color: #059669; margin-inline-start: 6px; }
.storm-cashback-preview__errors { color: #b91c1c; margin: 8px 0 0; padding-inline-start: 18px; }
.storm-cashback-preview__note { color: #6b7280; font-size: 12px; margin: 6px 0 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 782px) {
	.storm-panel { display: block; border-radius: 12px; min-height: 0; }

	.storm-panel__burger {
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		position: sticky;
		top: 8px;
		margin: 10px;
		width: 44px;
		height: 44px;
		padding: 0 11px;
		background: var(--s-blue);
		border: 0;
		border-radius: 12px;
		cursor: pointer;
		z-index: 30;
	}
	.storm-panel__burger span { display: block; height: 2px; background: #fff; border-radius: 2px; }

	.storm-panel__side {
		position: fixed;
		inset-block: 0;
		right: 0;
		left: auto;
		width: 260px;
		flex: none;
		transform: translateX(105%);
		transition: transform .25s ease;
		z-index: 50;
		border-radius: 0;
	}
	.storm-panel.storm-side-open .storm-panel__side { transform: translateX(0); }

	.storm-panel__overlay {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(15, 23, 42, .45);
		opacity: 0;
		pointer-events: none;
		transition: opacity .25s ease;
		z-index: 40;
	}
	.storm-panel.storm-side-open .storm-panel__overlay { opacity: 1; pointer-events: auto; }

	.storm-panel__main { padding: 4px 14px 20px; }
	.storm-topbar__greet { font-size: 17px; }
	.storm-table { font-size: 13px; }
	.storm-table thead th,
	.storm-table tbody td { padding: 9px 8px; }
}
