/* Written fresh for the App Review demo — shares no stylesheet with any
   production site. Colors sampled from the ProjectAllies palette
   (external/projectallies.com/web/css/config.pa.css). Layout: the app pages
   put the navigation in a sidebar down the left; the login and privacy
   pages, which have no navigation, keep a slim top bar. */

:root {
	--bg-main: #f5faf9;
	--bg-topbar: #ddf0ea;
	--bg-card: #ffffff;
	--bg-footer: #3c8674;
	--text-main: #1b1e21;
	--text-sub: #2c3e50;
	--text-footer: #ffffff;
	--primary: #069ed9;
	--primary-hover: #078fc0;
	--primary-dark: #0779a2;
	--primary-text: #ffffff;
	--highlight: #069ed9;
	--accent: #3c8674;
	--border: 1px solid #d6dbe1;
	--radius: 12px;
	--shadow: 0 10px 15px rgba(2, 6, 23, .02);
	--sidebar-width: 236px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	display: grid;
	grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
	grid-template-rows: auto 1fr auto;
	font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: var(--bg-main);
	color: var(--text-main);
	line-height: 1.5;
}

/* Pages without a sidebar: top bar, content, footer, each spanning the page. */
.topbar {
	grid-column: 1 / -1;
	grid-row: 1;
	background: var(--bg-topbar);
	border-bottom: var(--border);
	padding: 14px 28px;
}

.topbar .brand {
	font-size: 17px;
	font-weight: 700;
	color: var(--text-main);
}

.page {
	grid-column: 1 / -1;
	grid-row: 2;
	width: 100%;
	max-width: 1000px;
	margin: 0 auto;
	padding: 36px 28px;
}

.footer {
	grid-column: 1 / -1;
	grid-row: 3;
	background: var(--bg-footer);
	color: var(--text-footer);
	text-align: center;
	padding: 16px;
	font-size: 13px;
}

.footer a {
	color: var(--text-footer);
}

/* App pages: the sidebar takes the left column for the full height; the
   content and the footer sit to its right. */
.sidebar {
	grid-column: 1;
	grid-row: 1 / -1;
	position: sticky;
	top: 0;
	align-self: start;
	height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg-card);
	border-right: var(--border);
}

.sidebar ~ .page {
	grid-column: 2;
	grid-row: 1 / 3;
	margin: 0;
	max-width: none;
}

.sidebar ~ .footer {
	grid-column: 2;
}

.sidebar .brand {
	display: block;
	padding: 18px 20px;
	font-size: 16px;
	font-weight: 700;
	color: var(--text-main);
	text-decoration: none;
	background: var(--bg-topbar);
	border-bottom: var(--border);
}

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

.navGroup {
	margin: 14px 8px 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--accent);
}

.nav a {
	color: var(--text-sub);
	text-decoration: none;
	font-size: 14px;
	padding: 8px 12px;
	border-radius: 6px;
	border-left: 3px solid transparent;
	white-space: nowrap;
}

.nav a:hover {
	background: var(--bg-main);
	color: var(--text-main);
}

.nav a.active {
	background: var(--bg-topbar);
	color: var(--primary-dark);
	border-left-color: var(--primary);
	font-weight: 600;
}

.session {
	font-size: 13px;
	color: var(--text-sub);
}

.sidebar .session {
	padding: 14px 20px;
	border-top: var(--border);
}

.sidebar .session a {
	display: block;
	margin-top: 4px;
	color: var(--highlight);
}

.card {
	background: var(--bg-card);
	border: var(--border);
	border-top: 3px solid var(--accent);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 32px;
	max-width: 460px;
	margin: 4vh auto 0;
	text-align: center;
}

.card.wide {
	max-width: 1400px;
	margin-top: 0;
	text-align: left;
}

.card.wide h1 {
	text-align: left;
}

h1 {
	font-size: 22px;
	margin: 0 0 12px;
	color: var(--text-sub);
}

h2 {
	font-size: 16px;
	margin: 24px 0 8px;
	color: var(--text-main);
}

p {
	margin: 0 0 8px;
	color: var(--text-sub);
}

.button {
	display: inline-block;
	background: var(--primary);
	border: 1px solid var(--primary-dark);
	color: var(--primary-text);
	text-decoration: none;
	border-radius: 8px;
	padding: 11px 24px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.button:hover {
	background: var(--primary-hover);
}

.button.small {
	padding: 5px 12px;
	font-size: 13px;
	font-weight: 400;
}

.button.ghost {
	background: var(--bg-card);
	color: var(--text-main);
	border: var(--border);
}

form {
	text-align: left;
	margin-top: 20px;
}

.field {
	margin-bottom: 14px;
}

.field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 4px;
	color: var(--text-sub);
}

.field input,
.field select,
.field textarea {
	width: 100%;
	padding: 10px 12px;
	font-size: 15px;
	border: var(--border);
	border-radius: 6px;
	background: #f9fafb;
	color: var(--text-main);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
	outline: 2px solid var(--primary);
	outline-offset: -1px;
}

form .button {
	width: 100%;
	margin-top: 6px;
}

.error {
	background: #fdecea;
	border: 1px solid #f5c6c0;
	border-radius: 6px;
	padding: 10px 14px;
	color: #8a2318;
	font-size: 14px;
}

.success {
	background: #e7f6ec;
	border: 1px solid #b7e0c3;
	border-radius: 6px;
	padding: 10px 14px;
	color: #1d6b35;
	margin: 0 0 12px;
}

.notice {
	background: #e8f4fb;
	border: 1px solid #b9dcf0;
	border-radius: 6px;
	padding: 10px 14px;
	color: #0b5d85;
	margin: 0 0 12px;
}

.meta {
	font-size: 13px;
	color: var(--highlight);
}

table {
	width: 100%;
	border-collapse: collapse;
	background: var(--bg-card);
	border: var(--border);
	font-size: 14px;
}

th, td {
	text-align: left;
	padding: 8px 12px;
	border-bottom: var(--border);
	color: var(--text-sub);
}

th {
	background: var(--bg-topbar);
	color: var(--text-main);
	font-weight: 600;
}

.controls {
	display: flex;
	align-items: flex-end;
	gap: 14px;
	flex-wrap: wrap;
	margin: 12px 0 4px;
}

.controls label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	color: var(--text-sub);
}

.controls select,
.controls input[type="date"] {
	padding: 8px 10px;
	border: var(--border);
	border-radius: 6px;
	background: var(--bg-card);
	color: var(--text-main);
	font-size: 14px;
}

.controls .button {
	flex: 0 0 auto;
	align-self: flex-end;
	width: auto;
	margin: 0;
}

.tableWrap {
	overflow-x: auto;
	margin-top: 8px;
}

.tableWrap table {
	min-width: 1200px;
}

.tableWrap th {
	white-space: nowrap;
}

.tableWrap td {
	white-space: nowrap;
	font-size: 13px;
}

.tableWrap th a {
	color: inherit;
	text-decoration: none;
	display: block;
}

.tableWrap th a:hover {
	text-decoration: underline;
}

.tableWrap td a {
	color: var(--highlight);
}

.tableWrap td a.button {
	color: var(--primary-text);
}

.tableWrap td.wrapText {
	white-space: normal;
	word-break: break-word;
	min-width: 260px;
	max-width: 460px;
}

/* Per-row management actions: the pause form sits inline beside the modal
   buttons, none of them stretched to the cell. */
.rowActions {
	white-space: nowrap;
}

.rowActions form {
	display: inline;
	margin: 0;
}

.rowActions .button {
	margin-right: 4px;
}

.rowActions form .button {
	width: auto;
	margin-top: 0;
}

/* The management list (DataTables): it has few columns, so it does not
   need the report table's minimum width, and DataTables' right-alignment of
   the columns it detects as numeric is undone to match every other table on
   the site. */
.tableWrap #manageTable {
	min-width: 0;
}

#manageTable th.dt-type-numeric,
#manageTable td.dt-type-numeric {
	text-align: left;
}

.page.pageWide {
	max-width: none;
}

.page.pageWide .card.wide {
	max-width: none;
}

.modal {
	border: var(--border);
	border-radius: var(--radius);
	padding: 24px;
	max-width: 480px;
	width: 90%;
}

.modal::backdrop {
	background: rgba(27, 30, 33, 0.5);
}

.modal h2 {
	margin-top: 0;
}

/* Narrow screens: the sidebar becomes a block above the content and its
   links wrap into rows under their group labels. */
@media (max-width: 860px) {
	body {
		grid-template-columns: minmax(0, 1fr);
	}

	.sidebar {
		grid-column: 1;
		grid-row: 1;
		position: static;
		height: auto;
		border-right: none;
		border-bottom: var(--border);
	}

	.sidebar ~ .page {
		grid-column: 1;
		grid-row: 2;
	}

	.sidebar ~ .footer {
		grid-column: 1;
	}

	.nav {
		flex-direction: row;
		flex-wrap: wrap;
		overflow: visible;
	}

	.navGroup {
		flex-basis: 100%;
		margin: 8px 8px 2px;
	}

	.page {
		padding: 20px 14px;
	}
}
