/* ============================================================================
   PNetLab self-created dashboard — design system + shell
   Hand-written, no build step, no !important. Edit freely.
   Design language mirrors the prior pnetlab-enhance-v2 look (teal headers,
   white surfaces, Apple system font, steel-blue accent) but standalone, so
   nothing here has to fight Bootstrap/store specificity.
   ============================================================================ */

:root {
	--pnq-primary:        #25332c;   /* teal-green header/sidebar */
	--pnq-primary-light:  #3c5146;
	--pnq-primary-hover:  #2e3e35;
	--pnq-on-primary:     #e8f0ec;   /* off-white text on teal */
	--pnq-on-primary-dim: #a9bcb1;

	--pnq-bg:             #f4f6f5;   /* page background */
	--pnq-surface:        #ffffff;   /* cards / panels */
	--pnq-surface-2:      #f0f2f1;   /* subtle rows / inputs */
	--pnq-text:           #1d1d1f;
	--pnq-text-muted:     #6b6f6d;

	--pnq-accent:         #3c708a;   /* steel-blue */
	--pnq-accent-hover:   #335f74;
	--pnq-accent-soft:    rgba(60, 112, 138, 0.12);

	--pnq-danger:         #b3261e;
	--pnq-danger-soft:    rgba(179, 38, 30, 0.10);
	--pnq-ok:             #2e7d44;
	--pnq-warn:           #c77700;

	--pnq-border:         rgba(0, 0, 0, 0.10);
	--pnq-border-strong:  rgba(0, 0, 0, 0.18);
	--pnq-shadow:         0 1px 3px rgba(0,0,0,0.08), 0 6px 20px rgba(0,0,0,0.06);
	--pnq-radius:         10px;
	--pnq-radius-sm:      7px;

	--pnq-sidebar-w:      230px;
	--pnq-topbar-h:       56px;
	--pnq-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
	--pnq-mono: "SFMono-Regular", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
	font-family: var(--pnq-font);
	color: var(--pnq-text);
	background: var(--pnq-bg);
	font-size: 14px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
a { color: var(--pnq-accent); text-decoration: none; }
a:hover { color: var(--pnq-accent-hover); }
h1, h2, h3 { margin: 0 0 .4em; font-weight: 600; }

/* ---- boot overlay ---------------------------------------------------------- */
.boot {
	position: fixed; inset: 0; z-index: 50;
	display: flex; align-items: center; justify-content: center;
	background: var(--pnq-bg);
}
.boot-spin {
	width: 34px; height: 34px; border-radius: 50%;
	border: 3px solid var(--pnq-accent-soft);
	border-top-color: var(--pnq-accent);
	animation: pnq-spin .8s linear infinite;
}
@keyframes pnq-spin { to { transform: rotate(360deg); } }

/* ---- app shell (grid) ------------------------------------------------------ */
.app {
	display: grid;
	grid-template-columns: var(--pnq-sidebar-w) 1fr;
	grid-template-rows: var(--pnq-topbar-h) 1fr;
	grid-template-areas: "topbar topbar" "sidebar content";
	height: 100vh;
}
.app.is-loading { visibility: hidden; }

/* ---- topbar ---------------------------------------------------------------- */
.topbar {
	grid-area: topbar;
	background: var(--pnq-primary);
	color: var(--pnq-on-primary);
	display: flex; align-items: center; justify-content: space-between;
	padding: 0 18px;
	box-shadow: 0 1px 0 rgba(0,0,0,0.15);
	z-index: 10;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.topbar-brand .fa { color: var(--pnq-accent); font-size: 20px; }
.topbar-logo { height: 28px; width: auto; display: block; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { color: var(--pnq-on-primary-dim); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.topbar-user span { color: var(--pnq-on-primary); }
.topbar-logout {
	background: transparent; border: 1px solid transparent; color: var(--pnq-on-primary-dim);
	cursor: pointer; font-size: 16px; padding: 6px 9px; border-radius: var(--pnq-radius-sm);
	transition: background-color .15s ease, color .15s ease;
}
.topbar-logout:hover { background: var(--pnq-primary-hover); color: #fff; }

/* ---- sidebar --------------------------------------------------------------- */
.sidebar {
	grid-area: sidebar;
	background: var(--pnq-primary);
	display: flex; flex-direction: column;
	padding: 12px 10px;
	gap: 2px;
	overflow: auto;
}
.sidebar-spacer { flex: 1 1 auto; }
.nav-item {
	display: flex; align-items: center; gap: 12px;
	color: #ffffff;
	padding: 10px 12px; border-radius: var(--pnq-radius-sm);
	font-size: 14px; font-weight: 500;
	transition: background-color .15s ease, color .15s ease;
	cursor: pointer;
}
.nav-item .fa { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover { background: var(--pnq-primary-hover); color: #fff; }
.nav-item.active { background: var(--pnq-primary-light); color: #fff; box-shadow: inset 3px 0 0 var(--pnq-accent); }
.nav-item--ghost { color: var(--pnq-on-primary-dim); font-weight: 400; font-size: 13px; opacity: .85; }
.nav-item--ghost:hover { opacity: 1; }

/* ---- content area ---------------------------------------------------------- */
.content { grid-area: content; overflow: auto; padding: 22px 24px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.view-title { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.view-title .fa { color: var(--pnq-accent); }

/* ---- cards ----------------------------------------------------------------- */
.card {
	background: var(--pnq-surface);
	border: 1px solid var(--pnq-border);
	border-radius: var(--pnq-radius);
	box-shadow: var(--pnq-shadow);
	padding: 18px 20px;
	margin-bottom: 18px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ---- buttons --------------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; gap: 7px;
	font: inherit; font-weight: 500; font-size: 13.5px;
	padding: 8px 14px; border-radius: var(--pnq-radius-sm);
	border: 1px solid var(--pnq-border-strong); background: var(--pnq-surface); color: var(--pnq-text);
	cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
	white-space: nowrap;
}
.btn:hover { background: var(--pnq-surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .fa { font-size: 13px; }
.btn-primary { background: var(--pnq-primary); border-color: var(--pnq-primary); color: #fff; }
.btn-primary:hover { background: var(--pnq-primary-hover); }
.btn-accent { background: var(--pnq-accent); border-color: var(--pnq-accent); color: #fff; }
.btn-accent:hover { background: var(--pnq-accent-hover); }
.btn-danger { background: var(--pnq-surface); border-color: var(--pnq-danger); color: var(--pnq-danger); }
.btn-danger:hover { background: var(--pnq-danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--pnq-text-muted); }
.btn-ghost:hover { background: var(--pnq-surface-2); color: var(--pnq-text); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-icon { padding: 7px 9px; }

/* ---- toolbar --------------------------------------------------------------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1 1 auto; }

/* ---- forms ----------------------------------------------------------------- */
.input, select.input, textarea.input {
	font: inherit; width: 100%;
	padding: 8px 11px; border-radius: var(--pnq-radius-sm);
	border: 1px solid var(--pnq-border-strong); background: var(--pnq-surface); color: var(--pnq-text);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, select.input:focus, textarea.input:focus {
	outline: none; border-color: var(--pnq-accent); box-shadow: 0 0 0 3px var(--pnq-accent-soft);
}
.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--pnq-text-muted); margin-bottom: 5px; }

/* ---- tables ---------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--pnq-border); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--pnq-text-muted); font-weight: 600; }
.table tbody tr { transition: background-color .12s ease; }
.table tbody tr:hover { background: var(--pnq-surface-2); }
.table .row-actions { text-align: right; white-space: nowrap; opacity: 0; transition: opacity .12s ease; }
.table tbody tr:hover .row-actions { opacity: 1; }

/* ---- misc utilities -------------------------------------------------------- */
.muted { color: var(--pnq-text-muted); }
.mono { font-family: var(--pnq-mono); font-size: 12.5px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--pnq-accent-soft); color: var(--pnq-accent); }
.badge-ok { background: rgba(46,125,68,0.12); color: var(--pnq-ok); }
.badge-warn { background: rgba(199,119,0,0.12); color: var(--pnq-warn); }
.badge-off { background: var(--pnq-surface-2); color: var(--pnq-text-muted); }
.empty { text-align: center; color: var(--pnq-text-muted); padding: 40px 20px; }
.empty .fa { font-size: 30px; opacity: .4; display: block; margin-bottom: 10px; }
.spin { display: inline-block; animation: pnq-spin .8s linear infinite; }

/* ---- toasts ---------------------------------------------------------------- */
.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast {
	display: flex; align-items: center; gap: 9px;
	background: var(--pnq-surface); color: var(--pnq-text);
	border: 1px solid var(--pnq-border); border-left: 3px solid var(--pnq-accent);
	border-radius: var(--pnq-radius-sm); box-shadow: var(--pnq-shadow);
	padding: 11px 15px; font-size: 13.5px; min-width: 240px; max-width: 380px;
	animation: pnq-toast-in .22s ease;
}
.toast .fa { font-size: 15px; color: var(--pnq-accent); }
.toast-ok { border-left-color: var(--pnq-ok); } .toast-ok .fa { color: var(--pnq-ok); }
.toast-error { border-left-color: var(--pnq-danger); } .toast-error .fa { color: var(--pnq-danger); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease; }
@keyframes pnq-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- modal ----------------------------------------------------------------- */
.modal-backdrop {
	position: fixed; inset: 0; z-index: 70;
	background: rgba(20, 28, 24, 0.42);
	display: flex; align-items: center; justify-content: center;
	padding: 20px; animation: pnq-fade .15s ease;
}
.modal {
	background: var(--pnq-surface); border-radius: var(--pnq-radius);
	box-shadow: 0 12px 48px rgba(0,0,0,0.28);
	width: 100%; max-width: 440px; max-height: 90vh; overflow: auto;
	animation: pnq-modal-in .18s ease;
}
.modal-lg { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--pnq-border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 18px; color: var(--pnq-text-muted); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--pnq-text); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--pnq-border); }
@keyframes pnq-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pnq-modal-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ---- loading overlay ------------------------------------------------------- */
.load-overlay {
	position: fixed; inset: 0; z-index: 65;
	background: rgba(244, 246, 245, 0.45);
	display: flex; align-items: center; justify-content: center;
}

/* ---- breadcrumb ------------------------------------------------------------ */
.breadcrumb2 { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; }
.crumb { cursor: pointer; color: var(--pnq-accent); padding: 3px 6px; border-radius: 5px; display: inline-flex; align-items: center; gap: 6px; }
.crumb:hover { background: var(--pnq-accent-soft); }
.crumb.is-current { color: var(--pnq-text); cursor: default; font-weight: 600; }
.crumb.is-current:hover { background: transparent; }
.crumb-sep { color: var(--pnq-text-muted); opacity: .6; }

/* ---- file manager ---------------------------------------------------------- */
.fm-table { width: 100%; border-collapse: collapse; }
.fm-table th, .fm-table td { padding: 9px 12px; border-bottom: 1px solid var(--pnq-border); vertical-align: middle; }
.fm-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--pnq-text-muted); font-weight: 600; text-align: left; }
.fm-table tbody tr { transition: background-color .12s ease; }
.fm-table tbody tr:hover { background: var(--pnq-surface-2); }
.fm-check { width: 34px; text-align: center; }
.fm-name { cursor: pointer; display: inline-flex; align-items: center; gap: 9px; font-weight: 500; color: var(--pnq-text); word-break: break-all; }
.fm-name:hover { color: var(--pnq-accent); }
.fm-name .fa-folder { color: #dfba49; }
.fm-name .fa-folder-open-o { color: #dfba49; }
.fm-name .fa-file-o, .fm-name .fa-flask { color: var(--pnq-accent); }
.fm-name .fa-level-up { color: var(--pnq-text-muted); }
.fm-mtime { color: var(--pnq-text-muted); font-size: 12.5px; white-space: nowrap; text-align: right; }
.fm-actions { text-align: right; white-space: nowrap; opacity: 0; transition: opacity .12s ease; }
.fm-table tbody tr:hover .fm-actions { opacity: 1; }
.fm-actions .btn { margin-left: 4px; }

/* ---- bulk action bar ------------------------------------------------------- */
.bulkbar {
	display: flex; align-items: center; gap: 10px;
	background: var(--pnq-primary); color: var(--pnq-on-primary);
	border-radius: var(--pnq-radius); padding: 10px 14px; margin-bottom: 14px;
	box-shadow: var(--pnq-shadow); animation: pnq-toast-in .18s ease;
}
.bulkbar .count { font-weight: 600; }
.bulkbar .spacer { flex: 1 1 auto; }
.bulkbar .btn { background: var(--pnq-primary-light); border-color: transparent; color: #fff; }
.bulkbar .btn:hover { background: var(--pnq-primary-hover); }
.bulkbar .btn-danger { background: transparent; border-color: rgba(255,255,255,0.4); color: #fff; }

.input.invalid { border-color: var(--pnq-danger); box-shadow: 0 0 0 3px var(--pnq-danger-soft); }

/* ---- gauges (System page) -------------------------------------------------- */
.gauge { margin-bottom: 16px; }
.gauge:last-child { margin-bottom: 0; }
.gauge-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.gauge-head .label { font-weight: 600; }
.gauge-head .val { font-variant-numeric: tabular-nums; color: var(--pnq-text-muted); font-size: 13px; }
.gauge-bar { height: 10px; border-radius: 999px; background: var(--pnq-surface-2); overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 999px; background: var(--pnq-accent); transition: width .4s ease, background-color .3s ease; }
.gauge-fill.warn { background: var(--pnq-warn); }
.gauge-fill.danger { background: var(--pnq-danger); }

/* ---- stat tiles ------------------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 12px; }
.stat { background: var(--pnq-surface-2); border-radius: var(--pnq-radius-sm); padding: 14px; text-align: center; }
.stat-num { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-num.live { color: var(--pnq-accent); }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--pnq-text-muted); margin-top: 4px; }

/* ---- key/value rows + switches --------------------------------------------- */
.kv { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--pnq-border); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--pnq-text-muted); }
.kv .v { font-weight: 600; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--pnq-border-strong); border-radius: 999px; transition: background-color .2s ease; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s ease; }
.switch input:checked + .slider { background: var(--pnq-accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: .5; cursor: progress; }

/* ---- card / grid view (Labs) ----------------------------------------------- */
.view-toggle { display: inline-flex; border: 1px solid var(--pnq-border-strong); border-radius: var(--pnq-radius-sm); overflow: hidden; }
.view-toggle button { border: none; background: var(--pnq-surface); padding: 7px 11px; cursor: pointer; color: var(--pnq-text-muted); font-size: 14px; }
.view-toggle button:hover { background: var(--pnq-surface-2); }
.view-toggle button.active { background: var(--pnq-primary); color: #fff; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 16px; }
.lab-card, .folder-card { position: relative; background: var(--pnq-surface); border: 1px solid var(--pnq-border); border-radius: var(--pnq-radius); box-shadow: var(--pnq-shadow); overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.lab-card:hover, .folder-card:hover { box-shadow: 0 6px 22px rgba(0,0,0,0.13); transform: translateY(-1px); }
.card-preview { height: 142px; background: linear-gradient(180deg, #f7f9f8, #eef1f0); display: flex; align-items: center; justify-content: center; cursor: pointer; border-bottom: 1px solid var(--pnq-border); overflow: hidden; }
.card-preview svg { width: 100%; height: 100%; display: block; }
.card-preview .ph { font-size: 30px; color: var(--pnq-text-muted); opacity: .5; }
.card-meta { padding: 11px 12px 4px; display: flex; align-items: center; gap: 8px; }
.card-meta .nm { flex: 1 1 auto; font-weight: 600; word-break: break-word; cursor: pointer; line-height: 1.3; }
.card-meta .nm:hover { color: var(--pnq-accent); }
.card-sub { padding: 0 12px 11px; font-size: 12px; color: var(--pnq-text-muted); }
.folder-card .card-body { padding: 26px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; }
.folder-card .card-body > .fa { font-size: 42px; color: #dfba49; }
.folder-card .card-body > .fa-level-up { color: var(--pnq-text-muted); }
.folder-card .nm { font-weight: 600; text-align: center; word-break: break-word; }
.card-check { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(255,255,255,0.85); border-radius: 5px; padding: 3px 5px; line-height: 0; opacity: 0; transition: opacity .12s ease; cursor: pointer; }
.lab-card:hover .card-check, .folder-card:hover .card-check, .card-check.on { opacity: 1; }
.card-actions { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 72%; opacity: 0; transition: opacity .12s ease; }
.lab-card:hover .card-actions, .folder-card:hover .card-actions { opacity: 1; }
.card-actions .btn { background: rgba(255,255,255,0.92); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.card-actions .btn:hover { background: #fff; }
/* Running Labs card view: status area in place of a topology preview. */
.rl-card-body { height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; cursor: pointer; border-bottom: 1px solid var(--pnq-border); background: linear-gradient(180deg, #f7f9f8, #eef1f0); }
.rl-card-body .fa { font-size: 28px; color: var(--pnq-accent); opacity: .85; }
.rl-card-body.is-running .fa { color: var(--pnq-ok); }
/* Running Labs card actions: an always-visible bottom bar (Open/Stop/Destroy). */
.rl-card-actions { display: flex; border-top: 1px solid var(--pnq-border); }
.rl-card-actions .rl-act { flex: 1 1 0; border: none; background: transparent; padding: 9px 0; cursor: pointer; color: var(--pnq-text-muted); display: flex; align-items: center; justify-content: center; transition: background-color .12s ease, color .12s ease; }
.rl-card-actions .rl-act + .rl-act { border-left: 1px solid var(--pnq-border); }
.rl-card-actions .rl-act .fa { font-size: 15px; line-height: 1; }
.rl-card-actions .rl-act:hover { background: var(--pnq-surface-2); color: var(--pnq-text); }
.rl-card-actions .rl-act-open:hover { color: var(--pnq-accent); }
.rl-card-actions .rl-act-destroy { color: var(--pnq-danger); }
.rl-card-actions .rl-act-destroy:hover { background: var(--pnq-danger-soft); color: var(--pnq-danger); }

/* ---- tile cards (Images grid / Docker Devices) ----------------------------- */
.tile-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { position: relative; background: var(--pnq-surface); border: 1px solid var(--pnq-border); border-radius: var(--pnq-radius); box-shadow: var(--pnq-shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s ease, transform .15s ease; }
.tile:hover { box-shadow: 0 6px 22px rgba(0,0,0,0.12); transform: translateY(-1px); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.tile-icon { text-align: center; font-size: 34px; color: var(--pnq-accent); padding: 4px 0; }
.tile-icon img { height: 48px; width: auto; display: inline-block; }
.tile-name { font-weight: 600; word-break: break-word; font-size: 13.5px; line-height: 1.3; }
.tile-des { font-size: 12.5px; color: var(--pnq-text-muted); flex: 1 1 auto; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.dev-log { font-family: var(--pnq-mono); font-size: 11.5px; color: var(--pnq-text-muted); white-space: pre-wrap; max-height: 90px; overflow: auto; background: var(--pnq-surface-2); border-radius: 6px; padding: 8px; display: none; }

/* ---- progress bar (jobs) --------------------------------------------------- */
.progress { height: 10px; border-radius: 999px; background: var(--pnq-surface-2); overflow: hidden; margin: 12px 0 6px; }
.progress-bar { height: 100%; width: 0; background: var(--pnq-accent); border-radius: 999px; transition: width .4s ease; }
.progress-bar.done { background: var(--pnq-ok); }
.progress-bar.err { background: var(--pnq-danger); }

/* ---- lab import progress panel (replaces the full-screen spinner) ---------- */
.import-progress {
	position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
	width: min(440px, 92vw); z-index: 61;
	background: var(--pnq-surface); border: 1px solid var(--pnq-border);
	border-radius: var(--pnq-radius); box-shadow: var(--pnq-shadow);
	padding: 14px 18px;
}
.import-progress-title { font-size: 14px; font-weight: 600; color: var(--pnq-text); display: flex; align-items: center; gap: 8px; }
.import-progress-title .fa { color: var(--pnq-accent); }
.import-progress .progress { margin: 10px 0 4px; }
.import-progress-label { font-size: 12px; }

/* ---- checklist (import) ---------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.checklist { border: 1px solid var(--pnq-border); border-radius: var(--pnq-radius-sm); overflow: hidden; margin-bottom: 14px; }
.checklist-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--pnq-surface-2); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--pnq-text-muted); }
.checklist-body { max-height: 300px; overflow: auto; }
.checklist-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--pnq-border); }
.checklist-item:hover { background: var(--pnq-surface-2); }
.checklist-item .ci-name { flex: 1 1 auto; word-break: break-all; }
.checklist-item .ci-meta { color: var(--pnq-text-muted); font-size: 12.5px; white-space: nowrap; }

/* ---- sidebar version footer ------------------------------------------------ */
.sidebar-version { display: flex; align-items: center; gap: 10px; color: #ffffff; padding: 10px 12px; border-radius: var(--pnq-radius-sm); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.sidebar-version:hover { background: var(--pnq-primary-hover); color: #fff; }
.sidebar-version.active { background: var(--pnq-primary-light); color: #fff; box-shadow: inset 3px 0 0 var(--pnq-accent); }
.sidebar-version .fa { font-size: 15px; width: 18px; text-align: center; }
.sidebar-version .sv-text { display: flex; flex-direction: column; line-height: 1.25; font-size: 12px; min-width: 0; }
.sidebar-version .sv-text strong { font-size: 13px; color: inherit; }
.sidebar-version .sv-text span { color: rgba(255, 255, 255, 0.82); overflow: hidden; text-overflow: ellipsis; }
.sidebar-version.active .sv-text span { color: #cfe0d8; }

/* ---- version page ---------------------------------------------------------- */
.ver-banner { padding: 4px 0 16px; border-bottom: 1px solid var(--pnq-border); margin-bottom: 8px; }
.ver-big { font-size: 22px; font-weight: 700; }

/* ---- tabs ------------------------------------------------------------------ */
.tabs { display: inline-flex; gap: 4px; background: var(--pnq-surface-2); border-radius: var(--pnq-radius-sm); padding: 3px; }
.tabs .tab { border: none; background: transparent; padding: 7px 16px; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 500; font-size: 13.5px; color: var(--pnq-text-muted); }
.tabs .tab:hover { color: var(--pnq-text); }
.tabs .tab.active { background: var(--pnq-surface); color: var(--pnq-text); box-shadow: var(--pnq-shadow); }

/* ---- permission grid (role editor) ----------------------------------------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; margin-top: 6px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--pnq-surface-2); border-radius: 6px; cursor: pointer; font-size: 13px; }
.perm-item:hover { background: #e7ecea; }

/* ============================================================================
   Apple-style glass theme — translucent frosted surfaces over a soft tinted
   backdrop. The palette is unchanged (teal #25332c chrome, steel-blue #3c708a
   accent, dark text); only the surface FILLS become glass + a backdrop blur.
   ============================================================================ */

/* Soft tinted backdrop so the frosted layers have colour to refract. */
body {
	background: linear-gradient(135deg, #eef2f1 0%, #e8edeb 45%, #e2e8e6 100%);
	background-attachment: fixed;
}
body::before {
	content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
	background:
		radial-gradient(38% 48% at 16% 20%, rgba(60, 112, 138, 0.20), transparent 70%),
		radial-gradient(42% 52% at 84% 16%, rgba(37, 51, 44, 0.18), transparent 70%),
		radial-gradient(48% 58% at 72% 90%, rgba(60, 112, 138, 0.16), transparent 72%);
}
.boot { background: linear-gradient(135deg, #eef2f1, #e2e8e6); }

/* Top bar + sidebar: frosted teal glass (colour retained). */
.topbar {
	background: rgba(33, 46, 40, 0.80);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	backdrop-filter: blur(20px) saturate(180%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.sidebar {
	background: rgba(33, 46, 40, 0.78);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	backdrop-filter: blur(20px) saturate(180%);
	border-right: 1px solid rgba(255, 255, 255, 0.07);
	position: relative;
}
.sidebar::before {   /* diagonal sheen */
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), transparent 42%);
}
.sidebar > * { position: relative; }   /* keep nav above the sheen */
.nav-item:hover { background: rgba(255, 255, 255, 0.08); }
.nav-item.active { background: rgba(255, 255, 255, 0.14); box-shadow: inset 3px 0 0 var(--pnq-accent); }
.sidebar-version:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar-version.active { background: rgba(255, 255, 255, 0.14); }
.topbar-logout:hover { background: rgba(255, 255, 255, 0.12); }

/* Content cards: white frosted glass. */
.card {
	background: rgba(255, 255, 255, 0.62);
	-webkit-backdrop-filter: blur(22px) saturate(180%);
	backdrop-filter: blur(22px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.55);
	box-shadow: 0 1px 2px rgba(20, 40, 30, 0.05), 0 10px 34px rgba(20, 40, 30, 0.09);
}

/* Grid cards (labs/folders/tiles): lighter frost. */
.lab-card, .folder-card, .tile {
	background: rgba(255, 255, 255, 0.55);
	-webkit-backdrop-filter: blur(16px) saturate(170%);
	backdrop-filter: blur(16px) saturate(170%);
	border: 1px solid rgba(255, 255, 255, 0.5);
	box-shadow: 0 1px 2px rgba(20, 40, 30, 0.05), 0 8px 26px rgba(20, 40, 30, 0.08);
}
.card-preview, .rl-card-body { background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(238, 241, 240, 0.30)); }

/* Modals + toasts: stronger frost; blur the page behind the modal. */
.modal-backdrop {
	background: rgba(20, 28, 24, 0.34);
	-webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.modal {
	background: rgba(255, 255, 255, 0.82);
	-webkit-backdrop-filter: blur(30px) saturate(180%);
	backdrop-filter: blur(30px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.6);
}
.toast {
	background: rgba(255, 255, 255, 0.80);
	-webkit-backdrop-filter: blur(16px) saturate(180%);
	backdrop-filter: blur(16px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.5); border-left: 3px solid var(--pnq-accent);
}

/* Inputs sit on glass — slightly translucent. */
.input, select.input, textarea.input { background: rgba(255, 255, 255, 0.72); }

/* ---- responsive ------------------------------------------------------------ */
@media (max-width: 760px) {
	.app {
		grid-template-columns: 1fr;
		grid-template-rows: var(--pnq-topbar-h) auto 1fr;
		grid-template-areas: "topbar" "sidebar" "content";
	}
	.sidebar { flex-direction: row; flex-wrap: wrap; padding: 8px; }
	.sidebar-spacer { display: none; }
	.nav-item span { display: none; }
	.nav-item--ghost span { display: inline; }
	.topbar-user span { display: none; }
}
