/* =========================================================================
   Qualgod HRMS — white-label app shell
   ========================================================================= */

.qg-app {
	--qg-primary: #e93e40;
	--qg-accent: #c0292f;
	--qg-dark: #97282a;
	--qg-tint: #fdecec;

	--qg-ink: #16202b;
	--qg-ink-2: #4b5765;
	--qg-ink-3: #78828f;
	--qg-muted: #78828f;
	--qg-line: #e3e7ec;
	--qg-line-2: #eef1f4;
	--qg-bg: #f4f6f8;
	--qg-panel: #ffffff;
	--qg-danger: #b3261e;
	--qg-warn: #a86800;
	--qg-ok: #1a7f37;

	--qg-r: 12px;
	--qg-r-sm: 8px;
	--qg-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .05);

	margin: 0;
	padding: 0;
	background: var(--qg-bg);
	color: var(--qg-ink);
	font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.qg-app *,
.qg-app *::before,
.qg-app *::after {
	box-sizing: border-box;
}

.qg-app h1,
.qg-app h2,
.qg-app h3,
.qg-app p,
.qg-app ul,
.qg-app ol,
.qg-app dl,
.qg-app figure {
	margin: 0;
}

/* :where() keeps this at single-class specificity so that any component
   class below — buttons, nav items, chips — can set its own colour without
   needing an override. */
.qg-app :where(a) {
	color: var(--qg-primary);
	text-decoration: none;
}

.qg-app :where(a):hover {
	text-decoration: underline;
}

/* Fallback for engines without :where(). */
.qg-side a,
.qg-side a:hover,
.qg-btn,
.qg-btn:hover,
.qg-chip,
.qg-skip,
.qg-topbar-user,
.qg-topbar-user:hover {
	color: inherit;
	text-decoration: none;
}

.qg-app a.qg-btn-primary,
.qg-app a.qg-btn-primary:hover,
.qg-app a.qg-btn-danger,
.qg-app a.qg-btn-danger:hover {
	color: #fff;
	text-decoration: none;
}

.qg-i {
	width: 19px;
	height: 19px;
	flex: 0 0 auto;
}

.qg-skip {
	position: absolute;
	left: -9999px;
}

.qg-skip:focus {
	left: 12px;
	top: 12px;
	z-index: 100;
	background: #fff;
	padding: 8px 14px;
	border-radius: var(--qg-r-sm);
}

/* ---------------------------------------------------------------- Layout */

.qg-shell {
	display: flex;
	min-height: 100vh;
}

.qg-side {
	flex: 0 0 248px;
	width: 248px;
	background: #fff;
	color: var(--qg-ink);
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	height: 100vh;
	box-shadow: 1px 0 0 var(--qg-line), 4px 0 24px rgba(16, 24, 40, .06);
	z-index: 20;
	/* The nav and the footer buttons have padding of their own, so they stop
	   shrinking well before zero. Without this they spill across the page
	   while the sidebar is collapsing. */
	overflow: hidden;
}

.qg-side-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 18px 16px 14px;
}

.qg-side-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--qg-ink);
	min-width: 0;
}

.qg-side-brand:hover {
	text-decoration: none;
}

.qg-side-brand img {
	max-width: 132px;
	max-height: 40px;
	height: auto;
	border-radius: 6px;
}

.qg-side-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: var(--qg-primary);
	color: #fff;
	font-weight: 700;
	font-size: 17px;
}

.qg-side-brand img + .qg-side-name {
	display: none;
}

.qg-side-name {
	font-weight: 650;
	letter-spacing: -0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.qg-side-close {
	display: none;
	background: none;
	border: 0;
	color: var(--qg-muted);
	cursor: pointer;
	padding: 4px;
}

.qg-side-collapse {
	background: none;
	border: 0;
	color: var(--qg-muted);
	cursor: pointer;
	padding: 4px;
	border-radius: var(--qg-r-sm);
	line-height: 0;
}

.qg-side-collapse:hover {
	background: var(--qg-tint);
	color: var(--qg-ink);
}

.qg-side-off .qg-side {
	flex-basis: 0;
	width: 0;
	box-shadow: none;
	/* Clipping alone still leaves the links in the tab order, so a hidden
	   sidebar would swallow keyboard focus into nothing. */
	visibility: hidden;
	pointer-events: none;
}

/* The sidebar animates, but only once the first paint has happened, so a
   remembered "hidden" state does not slide shut in front of the user. */
.qg-ready .qg-side {
	transition: flex-basis .18s ease, width .18s ease;
}

.qg-nav {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 4px 10px 10px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.qg-nav-item {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 9px 12px;
	border-radius: var(--qg-r-sm);
	color: var(--qg-ink-2, #495262);
	font-size: 14.5px;
	font-weight: 500;
	transition: background .14s, color .14s;
}

.qg-nav-item .qg-i {
	color: var(--qg-muted);
	transition: color .14s;
}

.qg-nav-item:hover {
	background: var(--qg-tint);
	color: var(--qg-primary);
	text-decoration: none;
}

.qg-nav-item:hover .qg-i {
	color: var(--qg-primary);
}

.qg-nav-item.is-active {
	background: var(--qg-tint);
	color: var(--qg-primary);
	font-weight: 650;
	box-shadow: inset 3px 0 0 var(--qg-primary);
}

.qg-nav-item.is-active .qg-i {
	color: var(--qg-primary);
}

.qg-nav-sub {
	font-size: 13.5px;
	color: var(--qg-muted);
}

.qg-side-foot {
	border-top: 1px solid var(--qg-line);
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.qg-install-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--qg-primary);
	border-radius: var(--qg-r-sm);
	background: var(--qg-tint);
	color: var(--qg-primary);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	margin-bottom: 4px;
}

.qg-install-btn:hover {
	background: var(--qg-primary);
	color: #fff;
}

.qg-side-scrim {
	display: none;
}

.qg-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

/* --------------------------------------------------------------- Top bar */

.qg-topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 22px;
	background: rgba(255, 255, 255, .88);
	backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--qg-line);
}

.qg-burger {
	display: none;
	background: none;
	border: 0;
	padding: 6px;
	cursor: pointer;
	color: var(--qg-ink);
}

/* The way back when the sidebar is hidden. On phones the burger does this
   job, so this one steps aside there. */
.qg-sidebtn {
	background: none;
	border: 0;
	padding: 6px;
	cursor: pointer;
	color: var(--qg-muted);
	border-radius: var(--qg-r-sm);
	line-height: 0;
}

.qg-sidebtn:hover {
	background: var(--qg-tint);
	color: var(--qg-ink);
}

.qg-topbar-title {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1 1 auto;
}

.qg-topbar-title strong {
	font-weight: 650;
	letter-spacing: -0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.qg-role-chip {
	font-size: 11.5px;
	font-weight: 600;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--qg-tint);
	color: var(--qg-primary);
	white-space: nowrap;
}

.qg-topbar-user {
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--qg-ink);
}

.qg-topbar-user:hover {
	text-decoration: none;
}

.qg-topbar-name {
	font-size: 14px;
	font-weight: 550;
}

.qg-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--qg-primary);
	color: #fff;
	font-weight: 650;
	font-size: 14px;
	flex: 0 0 auto;
}

.qg-avatar-sm {
	width: 28px;
	height: 28px;
	font-size: 12.5px;
}

.qg-main {
	flex: 1 1 auto;
	padding: 24px 22px 40px;
	max-width: 1480px;
	width: 100%;
}

.qg-foot {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	padding: 16px 22px 24px;
	font-size: 12.5px;
	color: var(--qg-ink-3);
	border-top: 1px solid var(--qg-line);
}

/* ------------------------------------------------------------ Page heads */

.qg-page-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.qg-page-head h1 {
	font-size: 25px;
	font-weight: 680;
	letter-spacing: -0.022em;
	line-height: 1.2;
}

.qg-sub {
	color: var(--qg-ink-3);
	font-size: 14px;
	margin-top: 3px !important;
	max-width: 70ch;
}

.qg-back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--qg-ink-3);
	margin-bottom: 4px;
}

.qg-back .qg-i {
	width: 15px;
	height: 15px;
}

.qg-client-head {
	display: flex;
	align-items: center;
	gap: 14px;
}

/* ---------------------------------------------------------------- Pieces */

.qg-muted { color: var(--qg-ink-3); }
.qg-small { font-size: 13px; }
.qg-block { display: block; }
.qg-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.qg-ok { color: var(--qg-ok); font-weight: 700; }
.qg-text-danger { color: var(--qg-danger) !important; }
.qg-strong { font-weight: 620; color: var(--qg-ink); }

.qg-card {
	background: var(--qg-panel);
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
	padding: 20px 22px;
	margin-bottom: 18px;
}

.qg-card-flush {
	padding: 0;
	overflow: hidden;
}

.qg-card h2 {
	font-size: 13px;
	font-weight: 680;
	text-transform: uppercase;
	letter-spacing: .055em;
	color: var(--qg-ink-3);
	margin-bottom: 14px;
}

.qg-card h2:not(:first-child) {
	margin-top: 28px;
	padding-top: 18px;
	border-top: 1px solid var(--qg-line-2);
}

/*
 * When the card is itself a form, its nonce and hidden fields come before
 * the heading. They take no space, but they do make the heading stop being
 * the first child — which drew a divider and a gap above the very first
 * line of the card.
 */
.qg-card > h2:first-of-type {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.qg-card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.qg-card-head h2 {
	margin: 0;
}

.qg-card-head a {
	font-size: 13px;
	font-weight: 600;
}

.qg-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	align-items: start;
}

/* Grid and flex children default to min-width:auto, which lets a wide
   table or a long number push the whole page sideways on a phone. */
.qg-grid-2 > *,
.qg-stats > *,
.qg-main > * {
	min-width: 0;
}

/* ----------------------------------------------------------------- Stats */

.qg-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 14px;
	margin-bottom: 22px;
}

.qg-stats-sm {
	grid-template-columns: repeat(auto-fit, minmax(170px, 220px));
}

.qg-stat {
	background: var(--qg-panel);
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
	padding: 15px 17px;
	position: relative;
	overflow: hidden;
}

.qg-stat::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 3px;
	background: var(--qg-primary);
}

.qg-stat-warn::before {
	background: var(--qg-warn);
}

.qg-stat span {
	display: block;
	font-size: 12.5px;
	color: var(--qg-ink-3);
	margin-bottom: 5px;
}

.qg-stat strong {
	display: block;
	font-size: 23px;
	font-weight: 680;
	letter-spacing: -0.025em;
	line-height: 1.15;
	white-space: nowrap;
}


.qg-stat em {
	display: block;
	font-style: normal;
	font-size: 12px;
	color: var(--qg-ink-3);
	margin-top: 3px;
}

/* --------------------------------------------------------------- Buttons */

.qg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 9px 16px;
	border-radius: var(--qg-r-sm);
	border: 1px solid transparent;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	transition: background .14s, border-color .14s, color .14s, opacity .14s;
}

.qg-btn:hover {
	text-decoration: none;
}

.qg-btn .qg-i {
	width: 17px;
	height: 17px;
}

.qg-btn-primary {
	background: var(--qg-primary);
	color: #fff;
}

.qg-btn-primary:hover {
	background: var(--qg-accent);
	color: #fff;
}

.qg-btn-ghost {
	background: #fff;
	border-color: var(--qg-line);
	color: var(--qg-ink);
}

.qg-btn-ghost:hover {
	border-color: var(--qg-ink-3);
	color: var(--qg-ink);
}

.qg-btn-danger {
	background: #fff;
	border-color: #e3bdba;
	color: var(--qg-danger);
}

.qg-btn-danger:hover {
	background: var(--qg-danger);
	color: #fff;
}

.qg-btn-sm {
	padding: 5px 11px;
	font-size: 13px;
	border-radius: 7px;
}

.qg-btn-block {
	width: 100%;
}

.qg-btn[disabled] {
	opacity: .45;
	cursor: not-allowed;
}

.qg-x {
	background: none;
	border: 0;
	color: var(--qg-ink-3);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 5px;
}

.qg-x:hover {
	background: #fbeceb;
	color: var(--qg-danger);
}

/* --------------------------------------------------------------- Notices */

.qg-note {
	border-radius: var(--qg-r-sm);
	padding: 12px 15px;
	margin-bottom: 18px;
	font-size: 14px;
	border: 1px solid;
}

.qg-note-success { background: #edf7f0; border-color: #bfe0c9; color: #12612c; }
.qg-note-error   { background: #fcefee; border-color: #edc4c1; color: #8e1f19; }
.qg-note-warning { background: #fdf5e6; border-color: #ead9b0; color: #7a4d00; }
.qg-note-info    { background: #eef4fb; border-color: #c6d9ef; color: #194d87; }

.qg-note a { color: inherit; text-decoration: underline; }

/* ------------------------------------------------------------- Filterbar */

.qg-filterbar {
	display: flex;
	gap: 9px;
	align-items: center;
	flex-wrap: wrap;
	background: var(--qg-panel);
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r);
	padding: 11px 13px;
	margin-bottom: 18px;
	box-shadow: var(--qg-shadow);
}

/* Controls inside a filter bar size to their content instead of filling
   the row, so the bar reads as one line on a desktop. */
.qg-app .qg-filterbar select,
.qg-app .qg-filterbar input[type="text"],
.qg-app .qg-filterbar input[type="search"],
.qg-app .qg-filterbar input[type="date"],
.qg-app .qg-filterbar input[type="number"] {
	width: auto;
	min-width: 150px;
	flex: 0 1 auto;
}

.qg-filterbar .qg-search {
	flex: 1 1 220px;
	max-width: 340px;
}

.qg-app .qg-filterbar .qg-search input {
	width: 100%;
	min-width: 0;
}

.qg-filterbar label {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	color: var(--qg-muted);
	white-space: nowrap;
}

@media (max-width: 720px) {
	.qg-app .qg-filterbar select,
	.qg-app .qg-filterbar input[type="text"],
	.qg-app .qg-filterbar input[type="search"],
	.qg-app .qg-filterbar input[type="date"],
	.qg-app .qg-filterbar input[type="number"],
	.qg-app .qg-filterbar .qg-search {
		width: 100%;
		max-width: none;
		flex: 1 1 100%;
	}

	/* The button that actually fetches the data goes full width too — on a
	   phone a small ghost button at the end of a stacked form is easy to
	   miss entirely, which is how a filter looks like it does nothing. */
	.qg-filterbar .qg-filterapply {
		width: 100%;
		justify-content: center;
	}
}

.qg-filterapply {
	flex: none;
}

.qg-search {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 220px;
	max-width: 340px;
}

.qg-search .qg-i {
	position: absolute;
	left: 10px;
	color: var(--qg-ink-3);
	width: 17px;
	height: 17px;
}

.qg-search input {
	width: 100%;
	padding-left: 34px !important;
}

.qg-search-sm {
	max-width: 220px;
	flex: 0 1 220px;
}

/* ---------------------------------------------------------------- Inputs */

.qg-app input[type="text"],
.qg-app input[type="search"],
.qg-app input[type="email"],
.qg-app input[type="url"],
.qg-app input[type="number"],
.qg-app input[type="date"],
.qg-app input[type="password"],
.qg-app input[type="tel"],
.qg-app select,
.qg-app textarea {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	background: #fff;
	color: var(--qg-ink);
	font: inherit;
	font-size: 14.5px;
	line-height: 1.4;
	transition: border-color .14s, box-shadow .14s;
	-webkit-appearance: none;
	appearance: none;
}

.qg-app select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%2378828f' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 11px center;
	padding-right: 32px;
}

.qg-app input:focus,
.qg-app select:focus,
.qg-app textarea:focus {
	outline: none;
	border-color: var(--qg-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--qg-primary) 16%, transparent);
}

.qg-app textarea {
	min-height: 76px;
	resize: vertical;
}

.qg-app input[disabled] {
	background: var(--qg-line-2);
	color: var(--qg-ink-3);
}

.qg-f {
	display: block;
	margin-bottom: 15px;
}

.qg-f > span:first-child {
	display: block;
	font-size: 13px;
	font-weight: 620;
	margin-bottom: 5px;
	color: var(--qg-ink-2);
}

.qg-f > span i {
	color: var(--qg-danger);
	font-style: normal;
}

.qg-f em {
	display: block;
	font-style: normal;
	font-size: 12.5px;
	color: var(--qg-ink-3);
	margin-top: 5px;
	line-height: 1.5;
}

.qg-f-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 16px;
}

.qg-f-row-3 {
	grid-template-columns: repeat(3, 1fr);
}

.qg-f-row .qg-f {
	min-width: 0;
}

.qg-prefix {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	overflow: hidden;
	background: #fff;
}

.qg-prefix i {
	display: flex;
	align-items: center;
	padding: 0 9px;
	background: var(--qg-line-2);
	color: var(--qg-ink-3);
	font-style: normal;
	font-size: 13px;
	white-space: nowrap;
}

.qg-prefix input {
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.qg-colour input[type="color"] {
	width: 100%;
	height: 42px;
	padding: 3px;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	background: #fff;
	cursor: pointer;
}

.qg-pw {
	position: relative;
	display: block;
}

.qg-pw-toggle {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: 0;
	color: var(--qg-ink-3);
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	padding: 4px 7px;
	border-radius: 5px;
}

.qg-pw-toggle:hover {
	background: var(--qg-line-2);
}

.qg-checks {
	display: flex;
	flex-direction: column;
	gap: 9px;
	margin-bottom: 16px;
}

.qg-checks label,
.qg-check-inline {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 14px;
	cursor: pointer;
}

.qg-checks input[type="checkbox"],
.qg-check-inline input[type="checkbox"] {
	margin-top: 3px;
	width: 16px;
	height: 16px;
	accent-color: var(--qg-primary);
	flex: 0 0 auto;
}

.qg-total {
	background: var(--qg-tint);
	border-radius: var(--qg-r-sm);
	padding: 10px 14px;
	font-size: 13.5px;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	margin-bottom: 8px;
}

.qg-formbar {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	margin: 4px 0 24px;
}

.qg-formbar-sticky {
	position: sticky;
	bottom: 0;
	background: rgba(244, 246, 248, .92);
	backdrop-filter: blur(8px);
	padding: 12px 0;
	border-top: 1px solid var(--qg-line);
	margin-bottom: 0;
	z-index: 10;
}

/* ----------------------------------------------------------------- Logos */

.qg-logo-box {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.qg-logo-prev {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 180px;
	height: 76px;
	border: 1px dashed var(--qg-line);
	border-radius: var(--qg-r-sm);
	background: var(--qg-line-2);
	overflow: hidden;
	flex: 0 0 auto;
}

.qg-logo-prev-sq {
	width: 92px;
	height: 92px;
}

.qg-logo-prev img {
	max-width: 100%;
	max-height: 100%;
	height: auto;
}

.qg-logo-prev span {
	font-size: 12.5px;
	color: var(--qg-ink-3);
}

.qg-logo-box input[type="file"] {
	font-size: 13px;
	flex: 1 1 200px;
}

/* ---------------------------------------------------------------- Tables */

.qg-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.qg-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.qg-table th {
	text-align: left;
	font-size: 11.5px;
	font-weight: 680;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--qg-ink-3);
	padding: 10px 14px;
	border-bottom: 1px solid var(--qg-line);
	white-space: nowrap;
	background: #fcfdfd;
}

.qg-table td {
	padding: 11px 14px;
	border-bottom: 1px solid var(--qg-line-2);
	vertical-align: middle;
}

.qg-table tbody tr:last-child td {
	border-bottom: 0;
}

.qg-table-rows tbody tr:hover {
	background: #fafbfc;
}

.qg-table .r,
.qg-table th.r,
.qg-table td.r {
	text-align: right;
}

.qg-table .c {
	text-align: center;
}

.qg-cb {
	width: 38px;
}

.qg-person {
	display: flex;
	align-items: center;
	gap: 10px;
}

.qg-person em {
	display: block;
	font-style: normal;
	font-size: 12px;
	color: var(--qg-ink-3);
}

.qg-chip {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 650;
	background: var(--qg-line-2);
	color: var(--qg-ink-2);
	text-transform: capitalize;
	white-space: nowrap;
}

.qg-chip-plain { background: var(--qg-tint); color: var(--qg-primary); }
.qg-chip-active, .qg-chip-finalized, .qg-chip-paid { background: #e6f5eb; color: #156b33; }
.qg-chip-draft, .qg-chip-processed, .qg-chip-sent { background: #fdf3e0; color: #87560a; }
.qg-chip-inactive { background: #f3f4f6; color: #6b7280; }

.qg-dl a {
	display: inline-block;
	margin-right: 10px;
	font-size: 12.5px;
	white-space: nowrap;
}

/* ----------------------------------------------------------------- Lists */

.qg-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
}

.qg-list li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--qg-line-2);
}

.qg-list li:last-child {
	border-bottom: 0;
}

.qg-list-main {
	flex: 1 1 auto;
	min-width: 0;
}

.qg-list-main strong {
	display: block;
	font-weight: 620;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.qg-list-main em {
	display: block;
	font-style: normal;
	font-size: 12.5px;
	color: var(--qg-ink-3);
}

.qg-list-actions {
	display: flex;
	gap: 6px;
	flex: 0 0 auto;
}

.qg-thumb {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--qg-tint);
	color: var(--qg-primary);
	font-weight: 700;
	overflow: hidden;
	flex: 0 0 auto;
}

.qg-thumb img {
	max-width: 100%;
	max-height: 100%;
	height: auto;
}

.qg-thumb-lg {
	width: 56px;
	height: 56px;
	border-radius: 12px;
	font-size: 20px;
}

/* ----------------------------------------------------------- Client grid */

.qg-cardgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 16px;
}

.qg-clientcard {
	--qg-card-accent: var(--qg-primary);
	background: var(--qg-panel);
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
	padding: 18px;
	border-top: 3px solid var(--qg-card-accent);
}

.qg-clientcard-top {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 14px;
}

.qg-clientcard-top h3 {
	font-size: 16px;
	font-weight: 660;
	letter-spacing: -0.015em;
}

.qg-clientcard-top p {
	font-size: 13px;
	color: var(--qg-ink-3);
}

.qg-clientcard-meta {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px 14px;
	margin-bottom: 14px;
}

.qg-clientcard-meta dt {
	font-size: 11.5px;
	color: var(--qg-ink-3);
	text-transform: uppercase;
	letter-spacing: .04em;
}

.qg-clientcard-meta dd {
	margin: 1px 0 0;
	font-size: 14px;
	font-weight: 600;
}

.qg-clientcard-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	border-top: 1px solid var(--qg-line-2);
	padding-top: 12px;
}

/* ------------------------------------------------------------- Deflist */

.qg-deflist {
	display: grid;
	gap: 10px;
}

.qg-deflist dt {
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--qg-ink-3);
}

.qg-deflist dd {
	margin: 1px 0 0;
	font-weight: 600;
}

/* --------------------------------------------------------- Payroll grid */

.qg-runbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	background: var(--qg-panel);
	border: 1px solid var(--qg-line);
	border-left: 3px solid var(--qg-primary);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
	padding: 13px 16px;
	margin-bottom: 14px;
}

.qg-runbar-main {
	display: flex;
	align-items: center;
	gap: 11px;
	flex-wrap: wrap;
}

.qg-runbar-main strong {
	font-size: 16px;
	font-weight: 660;
}

.qg-runbar-actions {
	display: flex;
	gap: 7px;
	align-items: center;
	flex-wrap: wrap;
}

.qg-runbar-actions form {
	margin: 0;
}

.qg-gridtools {
	display: flex;
	gap: 9px;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.qg-gridscroll {
	overflow: auto;
	max-height: 68vh;
	-webkit-overflow-scrolling: touch;
}

.qg-paygrid {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	min-width: 1640px;
	font-size: 13.5px;
}

.qg-paygrid thead th {
	position: sticky;
	top: 0;
	z-index: 3;
	background: var(--qg-dark);
	color: #fff;
	font-size: 10.5px;
	font-weight: 650;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: 9px 6px;
	text-align: center;
	white-space: nowrap;
}

.qg-paygrid thead th.qg-stick {
	left: 0;
	z-index: 4;
	text-align: left;
	padding-left: 14px;
}

.qg-paygrid td {
	padding: 5px 6px;
	border-bottom: 1px solid var(--qg-line-2);
	text-align: center;
}

.qg-paygrid td.qg-stick {
	position: sticky;
	left: 0;
	z-index: 2;
	background: #fff;
	min-width: 230px;
	text-align: left;
	padding-left: 14px;
	box-shadow: 1px 0 0 var(--qg-line);
}

.qg-paygrid tbody tr:nth-child(even) td.qg-stick {
	background: #fbfcfd;
}

.qg-paygrid tbody tr:nth-child(even) {
	background: #fcfdfd;
}

.qg-paygrid td.qg-stick strong {
	display: block;
	font-weight: 620;
}

.qg-paygrid td.qg-stick em {
	display: block;
	font-style: normal;
	font-size: 11.5px;
	color: var(--qg-ink-3);
}

.qg-paygrid input.n {
	width: 78px;
	padding: 5px 7px !important;
	font-size: 13px !important;
	text-align: right;
	border-radius: 6px !important;
}

.qg-paygrid input.t {
	width: 160px;
	padding: 5px 7px !important;
	font-size: 13px !important;
	border-radius: 6px !important;
}

.qg-col-key {
	background: #fffaf0;
}

.qg-paygrid .qg-lop {
	border-color: #e2b96a !important;
	font-weight: 650;
}

.qg-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: var(--qg-warn);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
}

/* -------------------------------------------------------------- Bulk bar */

.qg-bulkbar {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	background: var(--qg-panel);
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
	padding: 11px 13px;
	margin-bottom: 14px;
	font-size: 13px;
}

.qg-bulkbar select {
	width: auto;
	min-width: 230px;
}

.qg-bulk-totals {
	margin-left: auto;
	color: var(--qg-ink-3);
}

/* ------------------------------------------------------------ Action bar */

.qg-actionbar {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.qg-actionbar form {
	margin: 0;
}

.qg-docshell {
	background: #e9edf1;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r);
	padding: 24px;
	margin-bottom: 18px;
	overflow-x: auto;
}

.qg-docshell .qg-doc {
	box-shadow: 0 2px 14px rgba(16, 24, 40, .1);
}

.qg-copyrow {
	display: flex;
	gap: 8px;
}

.qg-copyrow input {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12.5px;
}

/* ----------------------------------------------------------------- Menus */

.qg-menu {
	position: relative;
}

.qg-menu-list {
	display: none;
	position: absolute;
	right: 0;
	top: calc(100% + 5px);
	min-width: 240px;
	background: #fff;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	box-shadow: 0 10px 34px rgba(16, 24, 40, .14);
	z-index: 30;
	overflow: hidden;
}

.qg-menu.is-open .qg-menu-list {
	display: block;
}

.qg-menu-list a {
	display: block;
	padding: 9px 14px;
	font-size: 13.5px;
	color: var(--qg-ink);
	border-bottom: 1px solid var(--qg-line-2);
}

.qg-menu-list a:last-child {
	border-bottom: 0;
}

.qg-menu-list a:hover {
	background: var(--qg-tint);
	text-decoration: none;
}

/* ------------------------------------------------------------------ Tabs */

.qg-tabs {
	display: flex;
	gap: 3px;
	overflow-x: auto;
	border-bottom: 1px solid var(--qg-line);
	margin-bottom: 18px;
	-webkit-overflow-scrolling: touch;
}

.qg-tabs a {
	padding: 10px 15px;
	font-size: 13.5px;
	font-weight: 620;
	color: var(--qg-ink-3);
	border-bottom: 2px solid transparent;
	white-space: nowrap;
}

.qg-tabs a:hover {
	color: var(--qg-ink);
	text-decoration: none;
}

.qg-tabs a.is-active {
	color: var(--qg-primary);
	border-bottom-color: var(--qg-primary);
}

/* ----------------------------------------------------------- Empty state */

.qg-empty-state {
	text-align: center;
	padding: 56px 20px;
	background: var(--qg-panel);
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
}

.qg-empty-state .qg-i {
	width: 40px;
	height: 40px;
	color: var(--qg-ink-3);
	opacity: .55;
	margin-bottom: 12px;
}

.qg-empty-state h2 {
	font-size: 18px;
	font-weight: 660;
	margin-bottom: 6px;
}

.qg-empty-state p {
	color: var(--qg-ink-3);
	max-width: 46ch;
	margin: 0 auto 14px;
}

.qg-onboarding ol,
.qg-steps {
	margin: 0 0 0 20px;
	padding: 0;
	line-height: 1.95;
	font-size: 14.5px;
}

/* ----------------------------------------------------------- Collapsible */

.qg-collapse summary {
	cursor: pointer;
	font-size: 13px;
	font-weight: 680;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--qg-ink-3);
	list-style: none;
}

.qg-collapse summary::-webkit-details-marker {
	display: none;
}

.qg-collapse summary::before {
	content: "+ ";
}

.qg-collapse[open] summary::before {
	content: "– ";
}

.qg-collapse[open] summary {
	margin-bottom: 14px;
}

.qg-importrow {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
}

.qg-importrow form {
	display: flex;
	gap: 8px;
	align-items: center;
	margin: 0;
}

.qg-importrow input[type="file"] {
	font-size: 13px;
	max-width: 100%;
}

.qg-importrow form {
	flex-wrap: wrap;
	max-width: 100%;
}

/* ------------------------------------------------------------ Role picks */

.qg-rolegrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.qg-rolecard {
	background: var(--qg-panel);
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r);
	padding: 14px 16px;
}

.qg-rolecard h3 {
	font-size: 14px;
	font-weight: 660;
	margin-bottom: 4px;
}

.qg-rolecard p {
	font-size: 12.5px;
	color: var(--qg-ink-3);
	line-height: 1.5;
}

.qg-roles {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 18px;
}

.qg-rolepick {
	display: flex;
	gap: 11px;
	align-items: flex-start;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	padding: 11px 13px;
	cursor: pointer;
	transition: border-color .14s, background .14s;
}

.qg-rolepick:hover {
	border-color: var(--qg-primary);
}

.qg-rolepick input {
	margin-top: 4px;
	accent-color: var(--qg-primary);
	flex: 0 0 auto;
}

.qg-rolepick strong {
	display: block;
	font-weight: 640;
	font-size: 14px;
}

.qg-rolepick em {
	display: block;
	font-style: normal;
	font-size: 12.5px;
	color: var(--qg-ink-3);
	line-height: 1.5;
	margin-top: 2px;
}

.qg-rolepick:has(input:checked) {
	border-color: var(--qg-primary);
	background: var(--qg-tint);
}

.qg-rolepane {
	display: none;
	border-top: 1px solid var(--qg-line-2);
	padding-top: 16px;
}

.qg-rolepane.is-on {
	display: block;
}

.qg-rolepane h3 {
	font-size: 14px;
	font-weight: 660;
	margin-bottom: 4px;
}

.qg-pickbar {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	margin: 12px 0 10px;
}

.qg-picklist {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 6px;
	max-height: 320px;
	overflow-y: auto;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	padding: 10px;
	background: #fcfdfd;
}

.qg-pickitem {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	padding: 7px 9px;
	border-radius: 7px;
	cursor: pointer;
	font-size: 13.5px;
}

.qg-pickitem:hover {
	background: #fff;
}

.qg-pickitem input {
	margin-top: 3px;
	accent-color: var(--qg-primary);
}

.qg-pickitem strong {
	display: block;
	font-weight: 600;
}

.qg-pickitem em {
	display: block;
	font-style: normal;
	font-size: 11.5px;
	color: var(--qg-ink-3);
}

.qg-pickitem[hidden] {
	display: none;
}

/* ---------------------------------------------------------- Invoice form */

.qg-itemtable textarea {
	min-height: 54px;
	font-size: 13.5px;
}

.qg-itemtable .w-sac { width: 110px; }
.qg-itemtable .w-num { width: 108px; }

.qg-calcrow {
	display: flex;
	gap: 26px;
	align-items: flex-start;
	flex-wrap: wrap;
	margin-top: 14px;
}

.qg-calcrow > .qg-f-row {
	flex: 1 1 320px;
	max-width: 420px;
}

.qg-calctot {
	flex: 0 0 300px;
	width: 300px;
	border-collapse: collapse;
	font-size: 14px;
}

.qg-calctot th {
	text-align: left;
	font-weight: 500;
	color: var(--qg-ink-3);
	padding: 6px 10px;
}

.qg-calctot td {
	text-align: right;
	font-weight: 640;
	padding: 6px 10px;
}

.qg-calctot tr.t th,
.qg-calctot tr.t td {
	background: var(--qg-primary);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	border-radius: 0;
}

.qg-calctot tr.t th { border-radius: var(--qg-r-sm) 0 0 var(--qg-r-sm); }
.qg-calctot tr.t td { border-radius: 0 var(--qg-r-sm) var(--qg-r-sm) 0; }

/* ----------------------------------------------------------- PT settings */

.qg-ptstate {
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	padding: 12px 14px;
	margin-bottom: 12px;
	background: #fcfdfd;
}

.qg-ptstate-head {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}

.qg-ptstate-head input {
	max-width: 260px;
	font-weight: 620;
}

.qg-pttable input {
	min-width: 90px;
}

.qg-pttable td {
	padding: 6px 8px;
}

.qg-pttable select {
	min-width: 100px;
}

.qg-ptstate-opts {
	margin: 10px 0 4px;
}

/* ---------------------------------------------------- Statutory & tax */

.qg-mini-edit td {
	padding: 6px 8px;
}

.qg-mini-edit input {
	min-width: 140px;
}

.qg-checks-2 {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: 9px 18px;
}

.qg-checks-2 em {
	display: block;
	font-style: normal;
	font-size: 12px;
	margin-top: 2px;
}

.qg-table-compact td,
.qg-table-compact th {
	padding: 8px 10px;
	font-size: 13.5px;
}

.qg-table .qg-row-total td {
	font-weight: 700;
	background: var(--qg-tint);
	border-bottom: 0;
}

.qg-table .qg-sub-total td {
	font-weight: 650;
	border-top: 1px solid var(--qg-line);
}

.qg-taxtable td:first-child {
	color: var(--qg-ink-2);
}

.qg-taxtable .is-chosen {
	background: rgba( 233, 62, 64, .045 );
}

.qg-taxtable th.is-chosen {
	color: var(--qg-primary);
}

.qg-taxtable .qg-row-total .is-chosen {
	background: rgba( 233, 62, 64, .1 );
}

.qg-grid-tax {
	grid-template-columns: minmax( 0, 1.15fr ) minmax( 0, 1fr );
	align-items: start;
}

.qg-card-pad {
	padding: 18px 20px 0;
}

.qg-plain {
	margin: 6px 0 0;
	padding-left: 18px;
}

.qg-plain li + li {
	margin-top: 4px;
}

.qg-quarter-form {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 14px;
}

.qg-quarter-form .qg-f {
	margin: 0;
}

.qg-quarter-form select {
	width: auto;
	min-width: 96px;
}

.qg-stat-table td:first-child {
	min-width: 170px;
}

.qg-stat-table td:first-child .qg-small {
	display: block;
}

.qg-segmented {
	display: inline-flex;
	border: 1px solid var(--qg-line);
	border-radius: 999px;
	padding: 3px;
	background: #fff;
	gap: 2px;
}

.qg-segmented a {
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: var(--qg-ink-2);
	text-decoration: none;
}

.qg-segmented a.is-active {
	background: var(--qg-primary);
	color: #fff;
}

.qg-shortcode code {
	background: var(--qg-dark);
	color: #fff;
	padding: 3px 9px;
	border-radius: 6px;
	font-size: 13px;
}

/* ------------------------------------------------------------ Danger box */

.qg-danger {
	display: flex;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	border: 1px solid #ecd2d0;
	background: #fdf7f7;
	border-radius: var(--qg-r);
	padding: 16px 18px;
	margin-bottom: 24px;
	max-width: 760px;
}

.qg-danger h3 {
	font-size: 14px;
	font-weight: 660;
	color: var(--qg-danger);
	margin-bottom: 3px;
}

.qg-danger p {
	font-size: 13px;
	color: var(--qg-ink-3);
	max-width: 52ch;
}

.qg-inline-form {
	display: inline-block;
	margin: 0;
}

/* ====================================================== Auth (bare) pages */

.qg-app-bare {
	background:
		radial-gradient(1100px 520px at 50% -10%, color-mix(in srgb, var(--qg-primary) 16%, transparent), transparent 70%),
		var(--qg-bg);
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 28px 18px;
}

.qg-auth {
	width: 100%;
	max-width: 420px;
}

.qg-auth-card {
	background: var(--qg-panel);
	border: 1px solid var(--qg-line);
	border-radius: 16px;
	box-shadow: 0 2px 4px rgba(16, 24, 40, .04), 0 20px 48px rgba(16, 24, 40, .1);
	padding: 32px 30px 28px;
}

.qg-auth-brand {
	text-align: center;
	margin-bottom: 22px;
}

.qg-auth-brand img {
	max-width: 190px;
	max-height: 64px;
	height: auto;
	margin-bottom: 14px;
}

.qg-auth-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 15px;
	background: var(--qg-primary);
	color: #fff;
	font-size: 25px;
	font-weight: 700;
	margin-bottom: 14px;
}

.qg-auth-brand h1 {
	font-size: 21px;
	font-weight: 680;
	letter-spacing: -0.022em;
}

.qg-auth-brand p {
	font-size: 13.5px;
	color: var(--qg-ink-3);
	margin-top: 4px !important;
}

.qg-auth-lead {
	font-size: 14px;
	color: var(--qg-ink-2);
	margin-bottom: 18px !important;
}

.qg-auth-form .qg-f {
	margin-bottom: 16px;
}

.qg-auth-form .qg-check-inline {
	margin-bottom: 18px;
	font-size: 13.5px;
	color: var(--qg-ink-2);
}

.qg-auth-links {
	text-align: center;
	margin-top: 16px !important;
	font-size: 13.5px;
}

.qg-auth-note {
	text-align: center;
	font-size: 12.5px;
	color: var(--qg-ink-3);
	margin-top: 16px !important;
	line-height: 1.55;
}

.qg-auth-foot {
	text-align: center;
	font-size: 12.5px;
	color: var(--qg-ink-3);
	margin-top: 18px !important;
}

/* ======================================================== Responsiveness */

@media (max-width: 1180px) {
	.qg-grid-2 {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 900px) {
	.qg-f-row,
	.qg-f-row-3 {
		grid-template-columns: 1fr;
	}

	.qg-side {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 60;
		transform: translateX(-100%);
		transition: transform .22s ease;
		box-shadow: 0 0 40px rgba(0, 0, 0, .3);
	}

	.qg-nav-open .qg-side {
		transform: none;
	}

	.qg-side-close {
		display: block;
	}

	.qg-burger {
		display: block;
	}

	.qg-grid-tax {
		grid-template-columns: minmax( 0, 1fr );
	}

	.qg-sidebtn,
	.qg-side-collapse {
		display: none;
	}

	.qg-side-off .qg-side {
		flex-basis: auto;
		width: 248px;
		visibility: visible;
		pointer-events: auto;
	}

	.qg-nav-open .qg-side-scrim {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(10, 18, 26, .45);
		z-index: 50;
	}

	.qg-main {
		padding: 18px 15px 36px;
	}

	.qg-topbar {
		padding: 10px 15px;
	}

	.qg-topbar-name {
		display: none;
	}

	.qg-page-head h1 {
		font-size: 21px;
	}

	.qg-docshell {
		padding: 10px;
	}

	.qg-bulk-totals {
		margin-left: 0;
		width: 100%;
	}

	.qg-calctot {
		flex: 1 1 100%;
		width: 100%;
	}
}

@media (max-width: 560px) {
	.qg-cardgrid {
		grid-template-columns: 1fr;
	}

	.qg-stats {
		grid-template-columns: 1fr 1fr;
	}

	.qg-stat strong {
		font-size: 17px;
		letter-spacing: -0.01em;
	}

	.qg-auth-card {
		padding: 26px 20px 22px;
	}

	.qg-actionbar .qg-btn span {
		display: none;
	}

	.qg-actionbar .qg-btn {
		padding: 9px 12px;
	}
}

/* ---------------------------------------------------------------- Print */

@media print {
	.qg-side,
	.qg-topbar,
	.qg-foot,
	.qg-page-head,
	.qg-actionbar,
	.qg-share,
	.qg-note,
	.qg-danger {
		display: none !important;
	}

	.qg-app {
		background: #fff;
	}

	.qg-main {
		padding: 0;
	}

	.qg-docshell {
		background: none;
		border: 0;
		padding: 0;
	}

	.qg-docshell .qg-doc {
		box-shadow: none;
		border: 0;
	}
}

/* Test-email row in Settings → Email. */
.qg-testmail {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.qg-app .qg-testmail input[type="email"] {
	width: auto;
	flex: 1 1 260px;
	max-width: 360px;
}

/* The sidebar is light now, so the mobile drawer needs its own shadow. */
@media (max-width: 1000px) {
	.qg-side {
		box-shadow: 0 0 0 1px var(--qg-line), 10px 0 40px rgba(16, 24, 40, .18);
	}
}

/* ------------------------------------------------------- Weekly off picker */

.qg-daypick {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 2px;
}

.qg-daypick-item {
	position: relative;
	cursor: pointer;
}

.qg-daypick-item input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.qg-daypick-item span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	padding: 8px 6px;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	background: #fff;
	font-size: 13px;
	font-weight: 600;
	color: var(--qg-muted);
	transition: background .12s, color .12s, border-color .12s;
}

.qg-daypick-item input:checked + span {
	background: var(--qg-primary);
	border-color: var(--qg-primary);
	color: #fff;
}

.qg-daypick-item input:focus-visible + span {
	outline: 2px solid var(--qg-primary);
	outline-offset: 2px;
}

/* ------------------------------------------------------- Repeating rows */

.qg-rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 10px;
}

.qg-row-item {
	position: relative;
	display: flex;
	gap: 12px;
	align-items: flex-end;
	flex-wrap: wrap;
	background: var(--qg-tint, #fbfbfc);
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	padding: 12px 42px 12px 12px;
}

.qg-row-item .qg-f {
	margin: 0;
	flex: 0 0 170px;
}

.qg-row-item .qg-f-grow {
	flex: 1 1 220px;
	min-width: 160px;
}

.qg-row-item .qg-f-narrow {
	flex: 0 0 130px;
}

.qg-row-flags {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-bottom: 4px;
}

.qg-row-flags .qg-check-inline {
	font-size: 12.5px;
	white-space: nowrap;
}

.qg-row-remove {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 26px;
	height: 26px;
	border: 1px solid var(--qg-line);
	border-radius: 50%;
	background: #fff;
	color: var(--qg-muted);
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
}

.qg-row-remove:hover {
	border-color: #c0392b;
	color: #c0392b;
}

.qg-subpane {
	border-left: 3px solid var(--qg-line);
	padding-left: 16px;
	margin: 10px 0 18px;
}

.qg-faillist {
	list-style: none;
	margin: 6px 0 14px;
	padding: 0;
	font-size: 12.5px;
}

.qg-faillist li {
	padding: 7px 0;
	border-bottom: 1px solid var(--qg-line);
	display: flex;
	gap: 12px;
}

.qg-faillist strong {
	flex: 0 0 110px;
	color: var(--qg-muted);
	font-weight: 600;
}

@media (max-width: 720px) {
	.qg-row-item .qg-f,
	.qg-row-item .qg-f-grow,
	.qg-row-item .qg-f-narrow {
		flex: 1 1 100%;
	}
}

.qg-tagmini {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 7px;
	border-radius: 20px;
	background: #e8f3ec;
	color: #15683a;
	font-size: 10px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	vertical-align: middle;
}

.qg-tagmini.is-ded {
	background: #fdeceb;
	color: #a02a22;
}

.qg-payroll-grid th.col-ded,
.qg-payroll-grid td.col-ded {
	background: #fdf4f3;
}

/* ---------------------------------------------------- Dark sidebar option */

.qg-side-dark .qg-side {
	background: var(--qg-dark);
	color: #fff;
	box-shadow: 1px 0 0 rgba(255, 255, 255, .06), 4px 0 24px rgba(16, 24, 40, .18);
}

.qg-side-dark .qg-side-name,
.qg-side-dark .qg-side a {
	color: rgba(255, 255, 255, .82);
}

.qg-side-dark .qg-nav-item {
	color: rgba(255, 255, 255, .78);
}

.qg-side-dark .qg-nav-item .qg-i {
	color: rgba(255, 255, 255, .55);
}

.qg-side-dark .qg-nav-item:hover,
.qg-side-dark .qg-nav-item:hover .qg-i {
	background: rgba(255, 255, 255, .08);
	color: #fff;
}

.qg-side-dark .qg-nav-item.is-active,
.qg-side-dark .qg-nav-item.is-active .qg-i {
	background: var(--qg-primary);
	color: #fff;
	box-shadow: none;
}

.qg-side-dark .qg-nav-sub {
	color: rgba(255, 255, 255, .6);
}

.qg-side-dark .qg-side-foot {
	border-top-color: rgba(255, 255, 255, .12);
}

.qg-side-dark .qg-install-btn {
	background: rgba(255, 255, 255, .06);
	border-color: rgba(255, 255, 255, .25);
	color: #fff;
}

.qg-side-dark .qg-install-btn:hover {
	background: var(--qg-primary);
	border-color: var(--qg-primary);
}

.qg-side-dark .qg-side-close {
	color: #fff;
}

.qg-f-half {
	max-width: 320px;
}

/* ------------------------------------------------------- Payroll import */

.qg-importcard {
	padding: 0;
	margin-bottom: 16px;
}

.qg-importcard > summary {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	list-style: none;
}

.qg-importcard > summary::-webkit-details-marker {
	display: none;
}

.qg-importcard > summary .qg-i {
	color: var(--qg-primary);
}

.qg-importcard[open] > summary {
	border-bottom: 1px solid var(--qg-line);
}

.qg-importcard > *:not(summary) {
	padding-left: 18px;
	padding-right: 18px;
}

.qg-importcard > *:last-child {
	padding-bottom: 16px;
}

.qg-import-note {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: wrap;
}

.qg-import-note p {
	margin: 4px 0 0;
}

.qg-smalllist {
	margin: 8px 0 0 16px;
	padding: 0;
	font-size: 12.5px;
}

.qg-importrow {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
	margin: 10px 0;
}

.qg-importrow form {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	margin: 0;
	max-width: 100%;
}

.qg-importrow input[type="file"] {
	font-size: 13px;
	max-width: 100%;
}

/* ----------------------------------------------- Approvals & claims */

.qg-section-title {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--qg-muted);
	margin: 26px 0 12px;
}

.qg-approval {
	margin-bottom: 16px;
}

.qg-approval-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px;
	flex-wrap: wrap;
}

.qg-approval-head h2 {
	margin: 0;
}

.qg-approval-head p {
	margin: 2px 0 0;
}

.qg-approval-figures {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
	margin: 16px 0;
}

.qg-approval-figures > div {
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	padding: 11px 13px;
}

.qg-approval-figures span {
	display: block;
	font-size: 12px;
	color: var(--qg-muted);
	margin-bottom: 4px;
}

.qg-approval-figures strong {
	font-size: 18px;
	white-space: nowrap;
}

.qg-approval-figures .is-primary {
	border-color: var(--qg-primary);
	background: var(--qg-tint);
}

.qg-approval-figures .is-primary strong {
	color: var(--qg-primary);
}

.qg-approval-links {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0 0 14px;
}

.qg-approval-form {
	border-top: 1px solid var(--qg-line);
	padding-top: 14px;
}

.qg-approval-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin: 6px 0 10px;
}

.qg-claim {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.qg-claim-main {
	flex: 1 1 280px;
	min-width: 0;
}

.qg-claim-main h3 {
	margin: 0 0 3px;
	font-size: 15px;
}

.qg-claim-main p {
	margin: 0;
	font-size: 13px;
}

.qg-claim-note {
	margin-top: 6px !important;
	color: var(--qg-ink-2, #495262);
}

.qg-claim-amount {
	font-size: 20px;
	font-weight: 680;
	white-space: nowrap;
}

.qg-claim-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	flex: 1 1 320px;
	justify-content: flex-end;
}

.qg-claim-actions input[type="text"] {
	flex: 1 1 150px;
	min-width: 120px;
	max-width: 260px;
}

.qg-chip-bad {
	background: #fdeceb;
	color: #a02a22;
}

.qg-chip-info {
	background: #eaf1fb;
	color: #1b4e8f;
}

/* ------------------------------------------------------------------
 * Attendance punching
 * --------------------------------------------------------------- */

.qg-cardtitle {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 650;
	letter-spacing: -.01em;
}

.qg-empty-mini {
	margin: 0;
	color: var(--qg-muted);
	font-size: 13px;
}

.qg-row-muted td {
	color: var(--qg-ink-3);
}

.qg-tag-warn {
	background: #fdf3e3;
	color: var(--qg-warn);
}

.qg-punchwrap {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 16px;
	align-items: start;
}

.qg-punchwrap > * {
	min-width: 0;
}

.qg-punchcard {
	text-align: center;
	border-top: 3px solid var(--qg-primary);
}

.qg-punchcard-out {
	border-top-color: var(--qg-warn);
}

.qg-punchclock strong {
	display: block;
	font-size: 42px;
	line-height: 1.05;
	font-weight: 700;
	letter-spacing: -.03em;
	font-variant-numeric: tabular-nums;
}

.qg-punchclock span {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: var(--qg-muted);
	text-transform: uppercase;
	letter-spacing: .06em;
}

.qg-punchwho {
	margin: 10px 0 16px;
	font-weight: 600;
}

.qg-punchwho span {
	font-weight: 400;
	color: var(--qg-muted);
}

.qg-selfie {
	position: relative;
	display: block;
	width: 148px;
	height: 148px;
	margin: 0 auto 14px;
	border: 1px dashed var(--qg-line);
	border-radius: 50%;
	background: var(--qg-bg);
	cursor: pointer;
	overflow: hidden;
	display: grid;
	place-items: center;
}

.qg-selfie svg {
	width: 30px;
	height: 30px;
	color: var(--qg-ink-3);
}

.qg-selfie-label {
	position: absolute;
	bottom: 26px;
	left: 0;
	right: 0;
	font-size: 11px;
	color: var(--qg-muted);
}

.qg-selfie input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
}

.qg-selfie img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: none;
}

.qg-selfie img.is-set {
	display: block;
}

.qg-punchgeo {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
	margin: 0 0 14px;
	font-size: 12.5px;
	color: var(--qg-muted);
}

.qg-punchgeo svg {
	width: 15px;
	height: 15px;
	flex: none;
}

.qg-punchgeo.is-ok {
	color: var(--qg-ok);
}

.qg-punchgeo.is-bad {
	color: var(--qg-danger);
}

.qg-punchbtn {
	width: 100%;
	justify-content: center;
	padding: 13px 18px;
	font-size: 15px;
}

.qg-punchbtn.is-busy {
	opacity: .6;
}

.qg-punchhint {
	margin: 10px 0 0;
	font-size: 12px;
	color: var(--qg-muted);
}

.qg-punchlist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 6px;
}

.qg-punchlist li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: var(--qg-r-sm);
	background: var(--qg-bg);
	font-size: 13px;
}

.qg-punchlist li strong {
	min-width: 32px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--qg-muted);
}

.qg-punchlist li span {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.qg-punchlist .qg-punch-in {
	box-shadow: inset 2px 0 0 var(--qg-ok);
}

.qg-punchlist .qg-punch-out {
	box-shadow: inset 2px 0 0 var(--qg-warn);
}

.qg-punchtotal {
	margin: 12px 0 0;
	font-size: 13px;
	font-weight: 600;
}

.qg-punchtotal em {
	font-weight: 400;
	font-style: normal;
	color: var(--qg-muted);
}

.qg-punchcells {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.qg-punchcell {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--qg-line-2);
	font-size: 11.5px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	color: var(--qg-ink-2);
}

a.qg-punchcell {
	text-decoration: none;
}

.qg-punchcell-off {
	background: #fdf3e3;
	color: var(--qg-warn);
}

@media (max-width: 860px) {
	.qg-punchwrap {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ------------------------------------------------------------------
 * Projects and phase billing
 * --------------------------------------------------------------- */

.qg-duecard {
	border-left: 3px solid var(--qg-primary);
}

.qg-duelist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.qg-duelist li {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding: 10px 12px;
	border-radius: var(--qg-r-sm);
	background: var(--qg-bg);
}

.qg-duelist li > div {
	flex: 1 1 220px;
	min-width: 0;
}

.qg-duelist strong {
	display: block;
	font-size: 14px;
}

.qg-duelist em {
	font-style: normal;
	font-size: 12px;
	color: var(--qg-muted);
}

.qg-dueamount {
	font-weight: 650;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.qg-projgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 14px;
}

.qg-projgrid > * {
	min-width: 0;
}

.qg-projcard {
	display: block;
	text-decoration: none;
	color: inherit;
	transition: box-shadow .15s ease, transform .15s ease;
}

.qg-projcard:hover {
	box-shadow: 0 2px 4px rgba(16, 24, 40, .06), 0 12px 28px rgba(16, 24, 40, .08);
	transform: translateY(-1px);
}

.qg-projtop {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}

.qg-projtop strong {
	display: block;
	font-size: 15px;
	letter-spacing: -.01em;
}

.qg-projtop em {
	font-style: normal;
	font-size: 12.5px;
	color: var(--qg-muted);
}

.qg-progbar {
	height: 6px;
	border-radius: 999px;
	background: var(--qg-line-2);
	overflow: hidden;
}

.qg-progbar span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--qg-primary);
}

.qg-projfoot {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 8px;
	font-size: 12px;
	color: var(--qg-muted);
}

.qg-projdue {
	margin: 10px 0 0;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--qg-primary);
}

/* ---- the phase list on one project ---- */

.qg-phases {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: grid;
	gap: 10px;
	counter-reset: phase;
}

.qg-phase {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 16px;
	background: var(--qg-panel);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
}

.qg-phasemark {
	flex: none;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--qg-line-2);
	color: var(--qg-ink-3);
}

.qg-phasemark svg {
	width: 16px;
	height: 16px;
}

.qg-phase-complete .qg-phasemark {
	background: #fdf3e3;
	color: var(--qg-warn);
}

.qg-phase-invoiced .qg-phasemark {
	background: #e7f5ec;
	color: var(--qg-ok);
}

.qg-phasebody {
	flex: 1 1 240px;
	min-width: 0;
}

.qg-phasebody > strong {
	font-size: 14.5px;
}

.qg-phasemeta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--qg-muted);
}

.qg-phaseright {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.qg-phaseamount {
	font-size: 16px;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.qg-phaseactions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.qg-tag-ok {
	background: #e7f5ec;
	color: var(--qg-ok);
}

.qg-phaserow .qg-f-full {
	flex: 1 1 100%;
}

.qg-phaserow.is-locked {
	opacity: .85;
}

.qg-phaserow.is-locked input[readonly] {
	background: var(--qg-bg);
	cursor: not-allowed;
}

/* ---- sending an invoice ---- */

.qg-sendrow {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
	margin-top: 4px;
}

@media (max-width: 720px) {
	.qg-phase {
		flex-wrap: wrap;
	}

	.qg-phaseright {
		align-items: flex-start;
		width: 100%;
	}

	.qg-phaseactions {
		justify-content: flex-start;
	}
}

/* Sign-in code box */

.qg-auth-form .qg-otp {
	font-size: 24px;
	letter-spacing: 10px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	padding: 12px;
}

.qg-linkbtn {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: var(--qg-primary);
	cursor: pointer;
	text-decoration: underline;
}

.qg-note-warn {
	border-left: 3px solid var(--qg-warn);
	background: #fdf7ec;
	color: #6b4700;
}

/* ------------------------------------------------------------------
 * Billing calendar
 * --------------------------------------------------------------- */

.qg-billboard {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.qg-billboard > * {
	min-width: 0;
}

.qg-billbox {
	background: var(--qg-panel);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
	border-top: 3px solid var(--qg-line);
	padding: 12px 14px;
}

.qg-billbox.is-bad {
	border-top-color: var(--qg-danger);
}

.qg-billbox.is-warn {
	border-top-color: var(--qg-warn);
}

.qg-billbox.is-calm {
	border-top-color: var(--qg-ok);
}

.qg-billbox summary {
	display: flex;
	align-items: baseline;
	gap: 8px;
	cursor: pointer;
	list-style: none;
}

.qg-billbox summary::-webkit-details-marker {
	display: none;
}

.qg-billcount {
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.qg-billlabel {
	flex: 1 1 auto;
	font-size: 13px;
	font-weight: 600;
}

.qg-billvalue {
	font-size: 12.5px;
	color: var(--qg-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.qg-billlist {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	display: grid;
	gap: 6px;
}

.qg-billlist li {
	display: flex;
	align-items: baseline;
	gap: 8px;
	font-size: 12.5px;
	padding-top: 6px;
	border-top: 1px solid var(--qg-line-2);
}

.qg-billlist a {
	flex: 1 1 auto;
	min-width: 0;
	text-decoration: none;
}

.qg-billlist strong {
	display: block;
	font-weight: 600;
	font-size: 12.5px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.qg-billlist em {
	font-style: normal;
	color: var(--qg-muted);
	font-size: 11.5px;
}

.qg-billwhen {
	white-space: nowrap;
	color: var(--qg-muted);
	font-size: 11.5px;
}

.qg-billamount {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.qg-phasesum {
	margin: 4px 0 0;
	font-size: 12.5px;
	color: var(--qg-muted);
}

.qg-phasesum.is-ok {
	color: var(--qg-ok);
	font-weight: 600;
}

.qg-phasesum.is-off {
	color: var(--qg-warn);
	font-weight: 600;
}

/* ------------------------------------------------------------------
 * Service tiles on a client's home screen
 * --------------------------------------------------------------- */

.qg-servicegrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 14px;
	margin-bottom: 20px;
}

.qg-servicegrid > * {
	min-width: 0;
}

.qg-servicecard {
	display: block;
	padding: 20px;
	background: var(--qg-panel);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
	border-top: 3px solid var(--qg-primary);
	text-decoration: none;
	color: inherit;
	transition: box-shadow .15s ease, transform .15s ease;
}

.qg-servicecard:hover {
	box-shadow: 0 2px 4px rgba(16, 24, 40, .06), 0 14px 30px rgba(16, 24, 40, .1);
	transform: translateY(-2px);
}

.qg-serviceicon {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 10px;
	background: var(--qg-tint);
	color: var(--qg-primary);
	margin-bottom: 12px;
}

.qg-serviceicon svg {
	width: 21px;
	height: 21px;
}

.qg-servicecard strong {
	display: block;
	font-size: 16px;
	letter-spacing: -.01em;
	margin-bottom: 5px;
}

.qg-servicecard em {
	display: block;
	font-style: normal;
	font-size: 13px;
	color: var(--qg-muted);
	line-height: 1.5;
}

.qg-serviceopen {
	display: inline-block;
	margin-top: 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--qg-primary);
}

/* ------------------------------------------------------------------
 * Skill matrix and training
 * --------------------------------------------------------------- */

.qg-matrix {
	min-width: 0;
}

.qg-matrix thead th em {
	display: block;
	font-style: normal;
	font-weight: 400;
	font-size: 10px;
	opacity: .75;
	text-transform: none;
	letter-spacing: 0;
}

.qg-matrix td.qg-cell {
	text-align: center;
	padding: 4px;
}

.qg-matrix td.qg-cell.is-short {
	background: #fdf3e3;
}

.qg-app .qg-scorepick {
	width: 56px;
	padding: 5px 6px;
	text-align: center;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.qg-scorepick.qg-score-0 {
	color: var(--qg-ink-3);
}

.qg-scorepick.qg-score-1,
.qg-scorepick.qg-score-2 {
	color: var(--qg-danger);
}

.qg-scorepick.qg-score-3 {
	color: var(--qg-ink);
}

.qg-scorepick.qg-score-4,
.qg-scorepick.qg-score-5 {
	color: var(--qg-ok);
}

.qg-checkscroll {
	max-height: 230px;
	overflow-y: auto;
	padding: 8px 10px;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	background: var(--qg-bg);
}

/* ---- the feedback form ---- */

.qg-feedback .qg-cardtitle {
	margin-bottom: 4px;
}

.qg-ratingrow {
	display: flex;
	gap: 8px;
	margin: 6px 0 16px;
	flex-wrap: wrap;
}

.qg-ratingpick {
	flex: 1 1 86px;
	position: relative;
	text-align: center;
	padding: 12px 6px;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	cursor: pointer;
	background: #fff;
	transition: border-color .12s ease, background .12s ease;
}

.qg-ratingpick input {
	position: absolute;
	opacity: 0;
	inset: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
	margin: 0;
}

.qg-ratingpick:hover {
	border-color: var(--qg-primary);
}

.qg-ratingpick:has(input:checked) {
	border-color: var(--qg-primary);
	background: var(--qg-tint);
}

.qg-ratingnum {
	display: block;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.1;
}

.qg-ratingword {
	display: block;
	font-size: 11px;
	color: var(--qg-muted);
	margin-top: 2px;
}

/* ------------------------------------------------------------------
 * Service tiles a client has not been given
 * --------------------------------------------------------------- */

.qg-servicecard.is-locked {
	border-top-color: var(--qg-line);
	background: var(--qg-bg);
	box-shadow: none;
	cursor: pointer;
}

.qg-servicecard.is-locked:hover {
	transform: none;
	box-shadow: var(--qg-shadow);
}

.qg-servicecard.is-locked summary {
	list-style: none;
	cursor: pointer;
}

.qg-servicecard.is-locked summary::-webkit-details-marker {
	display: none;
}

.qg-servicecard.is-locked .qg-serviceicon {
	background: var(--qg-line-2);
	color: var(--qg-ink-3);
}

.qg-servicecard.is-locked strong {
	display: block;
	font-size: 16px;
	letter-spacing: -.01em;
	margin-bottom: 5px;
	color: var(--qg-ink-3);
}

.qg-servicecard.is-locked em {
	display: block;
	font-style: normal;
	font-size: 13px;
	color: var(--qg-ink-3);
	line-height: 1.5;
}

.qg-servicelocked {
	display: inline-block;
	margin-top: 12px;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--qg-line-2);
	color: var(--qg-ink-3);
	font-size: 11.5px;
	font-weight: 600;
}

.qg-servicewhy {
	margin: 12px 0 0;
	padding-top: 12px;
	border-top: 1px solid var(--qg-line);
	font-size: 12.5px;
	color: var(--qg-ink-2);
	line-height: 1.55;
}

/* ---- picking services on the client form ---- */

.qg-servicepicks {
	display: grid;
	gap: 8px;
	margin-bottom: 10px;
}

.qg-servicepick {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 11px 13px;
	border: 1px solid var(--qg-line);
	border-radius: var(--qg-r-sm);
	background: #fff;
	cursor: pointer;
}

.qg-servicepick input {
	margin-top: 3px;
	flex: none;
}

.qg-servicepick strong {
	display: block;
	font-size: 13.5px;
}

.qg-servicepick em {
	display: block;
	font-style: normal;
	font-size: 12px;
	color: var(--qg-muted);
	line-height: 1.45;
}

.qg-servicepick:has(input:checked) {
	border-color: var(--qg-primary);
	background: var(--qg-tint);
}

.qg-servicepick.is-soon {
	opacity: .65;
	cursor: not-allowed;
	background: var(--qg-bg);
}

.qg-servicepick.is-soon em {
	color: var(--qg-warn);
}

/* ------------------------------------------------------------------
 * The sections inside a service
 * --------------------------------------------------------------- */

.qg-sectiongrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 12px;
}

.qg-sectiongrid > * {
	min-width: 0;
}

.qg-sectiontile {
	display: block;
	padding: 16px;
	background: var(--qg-panel);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
	text-decoration: none;
	color: inherit;
	transition: box-shadow .15s ease, transform .15s ease;
}

.qg-sectiontile:hover {
	box-shadow: 0 2px 4px rgba(16, 24, 40, .06), 0 12px 26px rgba(16, 24, 40, .09);
	transform: translateY(-1px);
}

.qg-sectionicon {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 9px;
	background: var(--qg-tint);
	color: var(--qg-primary);
	margin-bottom: 10px;
}

.qg-sectionicon svg {
	width: 18px;
	height: 18px;
}

.qg-sectiontile strong {
	display: block;
	font-size: 14.5px;
	letter-spacing: -.01em;
	margin-bottom: 3px;
}

.qg-sectiontile em {
	display: block;
	font-style: normal;
	font-size: 12.5px;
	color: var(--qg-muted);
	line-height: 1.45;
}

@media (max-width: 560px) {
	.qg-sectiongrid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.qg-sectiontile {
		padding: 13px;
	}

	.qg-sectiontile em {
		display: none;
	}

	.qg-servicegrid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.qg-dashservices {
	margin-bottom: 18px;
}

/* Customer ledger */

.qg-dealhead {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.qg-dealhead .qg-cardtitle {
	margin-bottom: 2px;
}

.qg-markrow {
	display: flex;
	gap: 6px;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
}

.qg-app .qg-markrow input[type="text"] {
	width: 120px;
	padding: 5px 8px;
	font-size: 12.5px;
}

/* ------------------------------------------------------------------
 * Activity trail and recycle bin
 * --------------------------------------------------------------- */

.qg-tabcount {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--qg-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}

.qg-activity {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.qg-act {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 13px 15px;
	background: var(--qg-panel);
	border-radius: var(--qg-r);
	box-shadow: var(--qg-shadow);
	border-left: 3px solid var(--qg-line);
}

.qg-act-delete {
	border-left-color: var(--qg-danger);
}

.qg-act-create {
	border-left-color: var(--qg-ok);
}

.qg-act-update {
	border-left-color: var(--qg-warn);
}

.qg-act-restore,
.qg-act-revert {
	border-left-color: var(--qg-primary);
}

.qg-actmain {
	flex: 1 1 auto;
	min-width: 0;
}

.qg-actmain > strong {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--qg-ink-3);
}

.qg-actmain > strong span {
	display: inline;
	margin-left: 6px;
	font-size: 14px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: -.01em;
	color: var(--qg-ink);
}

.qg-actmeta {
	margin: 4px 0 0;
	font-size: 12.5px;
	color: var(--qg-muted);
}

.qg-actside {
	flex: none;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.qg-actdiff {
	margin-top: 8px;
	font-size: 12.5px;
}

.qg-actdiff summary {
	cursor: pointer;
	color: var(--qg-primary);
}

.qg-difftable {
	width: 100%;
	border-collapse: collapse;
	margin-top: 8px;
	table-layout: fixed;
}

.qg-difftable th,
.qg-difftable td {
	padding: 4px 8px;
	font-size: 12px;
	text-align: left;
	vertical-align: top;
	border-top: 1px solid var(--qg-line-2);
	overflow-wrap: anywhere;
}

.qg-difftable th {
	width: 30%;
	font-weight: 600;
	color: var(--qg-muted);
	text-transform: capitalize;
}

.qg-difftable .qg-was {
	color: var(--qg-danger);
	text-decoration: line-through;
}

.qg-difftable .qg-now {
	color: var(--qg-ok);
	font-weight: 600;
}

@media (max-width: 720px) {
	.qg-act {
		flex-wrap: wrap;
	}

	.qg-actside {
		width: 100%;
		justify-content: flex-start;
	}
}
