/* ============================================================================
   rz-layout.css  —  Radzen-style ICON SIDEBAR shell (responsive)
   ----------------------------------------------------------------------------
   Pairs with the replacement _Layout.cshtml. Load AFTER site.css:
       <link rel="stylesheet" href="~/css/rz-layout.css" asp-append-version="true" />

   Behaviour
     Desktop  : slim 66px icon rail; hover expands to a 256px panel (overlay,
                content does NOT reflow). A pin button keeps it open.
     Mobile   : rail hidden; hamburger slides in a full 256px drawer + backdrop.
   Only affects the authenticated shell (login page has no .rzl-* elements).
   ============================================================================ */

:root {
	--rzl-rail: 66px;
	--rzl-panel: 256px;
	--rzl-topbar-h: 60px;

	--rzl-surface:       #ffffff;
	--rzl-border:        #e6e8ec;
	--rzl-text:          #3a4453;
	--rzl-text-muted:    #8b93a1;
	--rzl-hover:         #f3f4f6;
	--rzl-primary:       #2563eb;
	--rzl-primary-soft:  rgba(37, 99, 235, .10);
	--rzl-topbar-bg:     #ffffff;
	--rzl-page-bg:       #f5f6f8;
}
[data-theme="dark"] {
	--rzl-surface:       #161b24;
	--rzl-border:        #262c38;
	--rzl-text:          #c7cdd6;
	--rzl-text-muted:    #79808d;
	--rzl-hover:         #1e242f;
	--rzl-primary:       #5b8bf0;
	--rzl-primary-soft:  rgba(91, 139, 240, .15);
	--rzl-topbar-bg:     #161b24;
	--rzl-page-bg:       #0f141b;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.rzl-sidebar {
	position: fixed; top: 0; left: 0; bottom: 0; width: var(--rzl-rail);
	background: var(--rzl-surface); border-right: 1px solid var(--rzl-border);
	z-index: 1045; display: flex; flex-direction: column; overflow: hidden;
	transition: width .18s ease, box-shadow .18s ease;
	font-family: "Inter", system-ui, sans-serif;
}

.rzl-brand {
	display: flex; align-items: center; height: var(--rzl-topbar-h); flex: none;
	border-bottom: 1px solid var(--rzl-border); color: var(--rzl-text); text-decoration: none;
}
.rzl-brand .rzl-ico {
	width: var(--rzl-rail); min-width: var(--rzl-rail); display: flex;
	align-items: center; justify-content: center; font-size: 19px; color: var(--rzl-primary);
}
.rzl-brand .rzl-txt { display: flex; flex-direction: column; line-height: 1.1; }
.rzl-brand .rzl-txt b { font-size: 15px; font-weight: 600; }
.rzl-brand .rzl-txt small { font-size: 11px; color: var(--rzl-text-muted); }

.rzl-role {
	display: flex; align-items: center; height: 40px; margin: 8px 0; flex: none;
}
.rzl-role .rzl-ico {
	width: var(--rzl-rail); min-width: var(--rzl-rail); display: flex;
	align-items: center; justify-content: center;
}
.rzl-role .rzl-pill {
	display: inline-flex; align-items: center; gap: 6px; padding: .2rem .6rem;
	font-size: 12px; font-weight: 600; border-radius: 999px;
	background: var(--rzl-primary-soft); color: var(--rzl-primary); white-space: nowrap;
}
.rzl-role .rzl-ico .rzl-dot {
	width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center;
	justify-content: center; background: var(--rzl-primary-soft); color: var(--rzl-primary); font-size: 13px;
}

/* nav scroll area */
.rzl-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 8px; }
.rzl-nav::-webkit-scrollbar { width: 6px; }
.rzl-nav::-webkit-scrollbar-thumb { background: var(--rzl-border); border-radius: 3px; }

.rzl-group { list-style: none; margin: 0; padding: 4px 0; }
.rzl-group + .rzl-group { border-top: 1px solid var(--rzl-border); }

.rzl-section {
	font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
	color: var(--rzl-text-muted); padding: 6px 16px 2px; height: 24px; overflow: hidden;
	opacity: 0; white-space: nowrap; transition: opacity .12s;
}

.rzl-link {
	display: flex; align-items: center; height: 44px; position: relative;
	color: var(--rzl-text); text-decoration: none; white-space: nowrap;
}
.rzl-link > i {
	width: var(--rzl-rail); min-width: var(--rzl-rail); text-align: center;
	font-size: 16px; flex: none; color: var(--rzl-text-muted);
}
.rzl-link > span { font-size: 14px; opacity: 0; transition: opacity .12s; }
.rzl-link:hover { background: var(--rzl-hover); }
.rzl-link:hover > i { color: var(--rzl-text); }
.rzl-link.active { background: var(--rzl-primary-soft); color: var(--rzl-primary); font-weight: 500; }
.rzl-link.active > i { color: var(--rzl-primary); }
.rzl-link.active::before {
	content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
	border-radius: 0 3px 3px 0; background: var(--rzl-primary);
}

/* footer / pin */
.rzl-foot { flex: none; border-top: 1px solid var(--rzl-border); }
.rzl-pin {
	display: flex; align-items: center; width: 100%; height: 44px; background: none;
	border: none; cursor: pointer; color: var(--rzl-text-muted); white-space: nowrap;
}
.rzl-pin > i { width: var(--rzl-rail); min-width: var(--rzl-rail); text-align: center; font-size: 15px; transition: transform .18s; }
.rzl-pin > span { font-size: 13px; opacity: 0; transition: opacity .12s; }
.rzl-pin:hover { color: var(--rzl-text); background: var(--rzl-hover); }

/* ── Expanded state: hover (desktop) OR pinned OR mobile-open ─────────────── */
@media (min-width: 993px) and (hover: hover) {
	.rzl-sidebar:hover { width: var(--rzl-panel); box-shadow: 6px 0 24px rgba(16,24,40,.10); }
}
.rzl-sidebar:hover .rzl-section,
body.rzl-pinned .rzl-sidebar .rzl-section { opacity: 1; }
.rzl-sidebar:hover .rzl-link > span,
.rzl-sidebar:hover .rzl-pin > span,
body.rzl-pinned .rzl-sidebar .rzl-link > span,
body.rzl-pinned .rzl-sidebar .rzl-pin > span { opacity: 1; }
body.rzl-pinned .rzl-sidebar { width: var(--rzl-panel); }
body.rzl-pinned .rzl-pin > i { transform: rotate(180deg); }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.rzl-topbar {
	position: fixed; top: 0; left: var(--rzl-rail); right: 0; height: var(--rzl-topbar-h);
	display: flex; align-items: center; gap: .75rem; padding: 0 1rem; z-index: 1030;
	background: var(--rzl-topbar-bg); border-bottom: 1px solid var(--rzl-border);
	transition: left .18s ease;
}
body.rzl-pinned .rzl-topbar { left: var(--rzl-panel); }
.rzl-menu-btn, .rzl-icon-btn {
	width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
	background: none; border: none; border-radius: 7px; color: var(--rzl-text); cursor: pointer; font-size: 16px;
}
.rzl-menu-btn:hover, .rzl-icon-btn:hover { background: var(--rzl-hover); }
.rzl-topbar-title { font-size: 1rem; font-weight: 600; color: var(--rzl-text); }
.rzl-spacer { flex: 1; }

.rzl-userchip {
	display: flex; align-items: center; gap: 9px; background: none; border: none; cursor: pointer;
	padding: 4px 8px; border-radius: 8px; color: var(--rzl-text);
}
.rzl-userchip:hover { background: var(--rzl-hover); }
.rzl-avatar {
	width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center;
	justify-content: center; background: var(--rzl-primary); color: #fff; font-size: 13px; font-weight: 600;
}
.rzl-userchip .rzl-uname { font-size: 13.5px; font-weight: 600; line-height: 1.1; }
.rzl-userchip .rzl-urole { font-size: 11.5px; color: var(--rzl-text-muted); line-height: 1.1; }

/* ── Main content ────────────────────────────────────────────────────────── */
.rzl-main {
	margin-left: var(--rzl-rail); margin-top: var(--rzl-topbar-h);
	min-height: calc(100vh - var(--rzl-topbar-h)); background: var(--rzl-page-bg);
	transition: margin-left .18s ease;
}
body.rzl-pinned .rzl-main { margin-left: var(--rzl-panel); }
.rzl-container { padding: 1.5rem; max-width: 1400px; }

.rzl-backdrop {
	position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1040;
	opacity: 0; visibility: hidden; transition: opacity .2s;
}
.rzl-backdrop.show { opacity: 1; visibility: visible; }

/* ── Mobile / tablet ─────────────────────────────────────────────────────── */
@media (max-width: 992px) {
	.rzl-sidebar {
		width: var(--rzl-panel); transform: translateX(-100%);
		transition: transform .22s ease; box-shadow: 6px 0 24px rgba(16,24,40,.18);
	}
	.rzl-sidebar.open { transform: translateX(0); }
	.rzl-sidebar .rzl-section,
	.rzl-sidebar .rzl-link > span,
	.rzl-sidebar .rzl-pin > span { opacity: 1; }      /* labels always shown in drawer */
	.rzl-foot { display: none; }                       /* pin not relevant on mobile */
	.rzl-topbar { left: 0; }
	.rzl-main  { margin-left: 0; }
	.rzl-container { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
	.rzl-sidebar, .rzl-topbar, .rzl-main, .rzl-link > span, .rzl-section { transition: none !important; }
}
