@charset "UTF-8";

:root {
	--bg: #f4f6fa;
	--surface: #ffffff;
	--surface-2: #f8fafc;
	--border: #e3e8ef;
	--text: #0f172a;
	--muted: #64748b;
	--primary: #0ea5e9;
	--primary-strong: #0284c7;
	--primary-soft: #e0f2fe;
	--indigo: #6366f1;
	--danger: #e11d48;
	--danger-strong: #be123c;
	--success: #16a34a;
	--warning: #d97706;
	--sidebar: #0b1220;
	--sidebar-text: #94a3b8;
	--sidebar-active: #1e293b;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
	--font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0b1120;
		--surface: #111827;
		--surface-2: #0f172a;
		--border: #1f2a3c;
		--text: #e5e7eb;
		--muted: #94a3b8;
		--primary-soft: #0c2a3d;
		--sidebar: #060b16;
		--sidebar-active: #172033;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
		color-scheme: dark;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
	margin: 0;
	padding: 0;
	font-family: var(--font);
	font-size: 14px;
	line-height: 1.5;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

a:link, a:visited { color: var(--primary-strong); text-decoration: none; }
a:hover, a:active { color: var(--indigo); text-decoration: underline; }
@media (prefers-color-scheme: dark) {
	a:link, a:visited { color: #38bdf8; }
}

h1 { font-size: 22px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/*************** app shell ***************/
.app { display: flex; min-height: 100%; }

.sidebar {
	position: fixed;
	inset: 0 auto 0 0;
	width: 248px;
	display: flex;
	flex-direction: column;
	background: var(--sidebar);
	color: var(--sidebar-text);
	overflow-y: auto;
	z-index: 50;
}
.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 20px 20px 16px;
	text-decoration: none !important;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: #fff; font-size: 16px; letter-spacing: .14em; text-transform: uppercase; }
.brand-text small { color: var(--sidebar-text); font-size: 11px; letter-spacing: .04em; }
.brand-large .brand-text strong { color: var(--text); font-size: 18px; }
.brand-large .brand-text small { color: var(--muted); }
.brand-large { padding: 0 0 20px; }

.side-nav { padding: 4px 12px 24px; }
.nav-group { margin-bottom: 14px; }
.nav-label {
	display: block;
	padding: 8px 10px 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #64748b;
}
.side-nav a:link, .side-nav a:visited {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 10px;
	border-radius: 8px;
	color: var(--sidebar-text);
	font-size: 13.5px;
	text-decoration: none;
}
.side-nav a:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.side-nav a.active {
	background: var(--sidebar-active);
	color: #fff;
	box-shadow: inset 3px 0 0 var(--primary);
}
.side-nav a.active .i { color: var(--primary); }

svg.i {
	width: 17px;
	height: 17px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.main-wrapper {
	flex: 1;
	min-width: 0;
	margin-left: 248px;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
.topbar {
	position: sticky;
	top: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 56px;
	padding: 0 28px;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border);
}
.crumb { color: var(--muted); font-size: 13px; }
.crumb .sep { margin: 0 8px; opacity: .6; }
.crumb strong { color: var(--text); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip {
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--primary-soft);
	color: var(--primary-strong);
	font-size: 12px;
	font-weight: 600;
}
.signout:link, .signout:visited {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--muted);
	font-size: 13px;
}
.signout:hover { color: var(--danger); text-decoration: none; }

.app-footer {
	margin-top: auto;
	padding: 18px 28px 24px;
	color: var(--muted);
	font-size: 12px;
}

/*************** content ***************/
.content {
	position: relative;
	margin: 24px 28px 8px;
	padding: 24px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow-x: auto;
}
.content::after { content: ""; display: table; clear: both; }
.content.dashboard { background: transparent; border: 0; box-shadow: none; padding: 0; }
.page-head { margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; }

section {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 8px 0 14px;
}
section::after { content: ""; flex: 1; height: 1px; background: var(--border); }
section span {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
}
.content > section:first-child, .content > div > section:first-child { margin-top: 0; }

/*************** dashboard ***************/
.kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}
.kpi:link, .kpi:visited {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 18px 20px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	color: var(--text);
	text-decoration: none;
	transition: border-color .15s, transform .15s;
}
.kpi:hover { border-color: var(--primary); transform: translateY(-1px); text-decoration: none; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi-value { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.kpi-value.accent {
	background: linear-gradient(90deg, #38bdf8, #6366f1 60%, #a855f7);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.kpi-sub { color: var(--muted); font-size: 12px; }

.panel-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px;
}
.panel {
	display: block;
	margin: 0;
	padding: 20px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.panel::after { display: none; }
.stat-list { list-style: none; margin: 0 0 12px; padding: 0; }
.stat-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 9px 0;
	border-bottom: 1px solid var(--border);
}
.stat-list li:last-child { border-bottom: 0; }
.stat-list strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.panel-link:link, .panel-link:visited { font-size: 13px; font-weight: 600; }

.status-pill {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--muted);
}
.status-available { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.status-charging { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.status-preparing, .status-finishing, .status-suspendedev, .status-suspendedevse, .status-reserved { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.status-faulted { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.status-unavailable { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/*************** tables ***************/
table { width: 100%; border-spacing: 0; }
table.res {
	border-collapse: separate;
	table-layout: auto;
	border: 1px solid var(--border);
	border-radius: 10px;
	overflow: hidden;
	font-size: 13px;
}
table.res th {
	padding: 10px 12px;
	text-align: left;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .02em;
	white-space: nowrap;
	color: var(--muted);
	background: var(--surface-2);
	border-bottom: 1px solid var(--border);
}
table.res th[data-sort] { cursor: pointer; user-select: none; }
table.res th[data-sort]:hover { color: var(--text); }
table.res th.sorting-asc, table.res th.sorting-desc { color: var(--primary-strong); background: var(--primary-soft); }
table.res th .arrow { font-size: 10px; margin-left: 6px; }
table.res td {
	padding: 10px 12px;
	text-align: left;
	word-wrap: break-word;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
}
table.res tbody tr:last-child td { border-bottom: 0; }
table.res tbody tr:hover { background: var(--surface-2); }
table.res td form { margin: 0; }
table.action td:last-child, table.action th:last-child { text-align: right; width: 140px; }
table.sll { padding-bottom: 40px; }

table.userInput, table.userInputFullPage { max-width: 760px; border-collapse: collapse; }
table.userInput td, table.userInputFullPage td { padding: 6px 8px; vertical-align: middle; }
table.userInput td:first-child, table.userInputFullPage td:first-child {
	width: 38%;
	text-align: right;
	color: var(--muted);
	font-weight: 500;
}
table.userInput th:first-child { text-align: right; }
table.userInput thead th { padding: 14px 8px 6px; text-align: left; font-size: 14px; color: var(--text); }
table.userInput thead th:first-child { text-align: right; }

/*** Table for charge point details ***/
table.cpd {
	width: 100%;
	max-width: 900px;
	border-collapse: separate;
	border: 1px solid var(--border);
	border-radius: 10px;
	overflow: hidden;
}
table.cpd th { text-align: left; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
table.cpd td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.cpd tr:last-child td { border-bottom: 0; }
table.cpd td:first-child { width: 240px; color: var(--muted); background: var(--surface-2); font-weight: 500; }

.deviceModel .connectorPanel { margin: 10px 16px 16px; max-width: calc(100% - 32px); overflow-x: auto; }
.deviceModel table.evseConnectors { table-layout: auto; width: 100%; }
.deviceModel table.evseConnectors select { width: auto; max-width: 100%; }
.deviceModel table.evseConnectors input[type="number"] { width: 110px; max-width: 100%; }
table.res.deviceModel tr.evseOdd { background: var(--surface); }
table.res.deviceModel tr.evseEven { background: var(--surface-2); }
table.res.deviceModel tr.evseConnectorsRow { background: var(--surface-2); }

/*************** forms ***************/
input[type="text"], input[type="number"], input[type="password"], input[type="email"], input[type="file"],
input[type="text"].dateTimePicker, select, textarea {
	width: 100%;
	max-width: 420px;
	margin: 2px 0;
	padding: 7px 10px;
	font: inherit;
	font-size: 13.5px;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}
select[multiple] { min-height: 120px; }
textarea { height: 6em; resize: vertical; }
input:focus, select:focus, textarea:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

input[type="submit"], input[type="button"], button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 96px;
	height: 34px;
	padding: 0 16px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: background .15s, transform .05s;
}
input[type="submit"] { color: #fff; background: var(--primary-strong); border: 0; }
input[type="submit"]:hover { background: #0369a1; }
input[type="submit"].blueSubmit { background: var(--indigo); }
input[type="submit"].blueSubmit:hover { background: #4f46e5; }
input[type="submit"].redSubmit { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }
input[type="submit"].redSubmit:hover { background: var(--danger); color: #fff; }
input[type="button"], button { color: var(--text); background: var(--surface); border: 1px solid var(--border); margin: 0 0 5px 5px; }
input[type="button"]:hover, button:hover { background: var(--surface-2); }
input[type="submit"]:active, input[type="button"]:active { transform: translateY(1px); }
input[type="submit"]:disabled, input[type="submit"]:hover:disabled { background: #94a3b8; cursor: not-allowed; }

#add_space { padding-top: 16px; }
.add-margin-bottom { margin-bottom: 20px; }
.submit-button { margin-top: 20px; }
.inline { display: inline-block; }

form.stacked { display: flex; flex-direction: column; gap: 6px; }
form.stacked label { font-size: 13px; font-weight: 600; margin-top: 8px; }
form.stacked input[type="text"], form.stacked input[type="password"] { max-width: none; height: 40px; }
form.stacked input[type="submit"] { margin-top: 18px; height: 42px; font-size: 14px; }

/*************** operations: left menu ***************/
.left-menu {
	float: left;
	width: 236px;
	margin: 0;
	padding: 0;
}
.left-menu ul { list-style: none; margin: 0; padding: 0; }
.left-menu li a:link, .left-menu li a:visited {
	display: block;
	padding: 7px 12px;
	margin-bottom: 2px;
	border-radius: 8px;
	color: var(--text);
	font-size: 13px;
	text-decoration: none;
}
.left-menu li a:hover { background: var(--surface-2); text-decoration: none; }
.left-menu li a.highlight { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
ul hr, .left-menu hr { height: 1px; margin: 8px 4px; border: 0; background: var(--border); }
.op-content, .op15-content, .op16-content, .right-content {
	margin: 0 0 0 236px;
	padding: 0 0 0 24px;
	border-left: 1px solid var(--border);
}
.op-content { min-height: 350px; }
.op15-content { min-height: 470px; }
.op16-content { min-height: 800px; }
.right-content div { display: none; }
.right-content div:first-child { display: block; }

/*************** messages ***************/
.info, .warning, .error {
	text-align: left;
	margin: 0 0 16px;
	padding: 12px 16px;
	border: 1px solid;
	border-radius: 10px;
	font-size: 13.5px;
}
.info { color: #075985; background: #f0f9ff; border-color: #bae6fd; }
.warning { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.error { color: #9f1239; background: #fff1f2; border-color: #fecdd3; }
.main-wrapper > .error { margin: 24px 28px 0; }
@media (prefers-color-scheme: dark) {
	.info { color: #bae6fd; background: #0c2a3d; border-color: #0e4766; }
	.warning { color: #fde68a; background: #2d2106; border-color: #5c4209; }
	.error { color: #fecdd3; background: #3a0d16; border-color: #6b1a2a; }
	.status-available { background: #052e16; color: #86efac; border-color: #14532d; }
	.status-charging { background: #082f49; color: #7dd3fc; border-color: #0c4a6e; }
	.status-preparing, .status-finishing, .status-suspendedev, .status-suspendedevse, .status-reserved { background: #2d2106; color: #fcd34d; border-color: #5c4209; }
	.status-faulted { background: #3a0d16; color: #fda4af; border-color: #6b1a2a; }
	.status-unavailable { background: #1e293b; color: #cbd5e1; border-color: #334155; }
}

a.tooltip { position: relative; color: var(--muted); text-decoration: none; }
a.tooltip img { width: 15px; height: 15px; opacity: .6; }
a.tooltip span { display: none; }
a.tooltip:hover { cursor: default; }
a.tooltip:hover span {
	position: absolute;
	top: 1.8em;
	left: 0;
	z-index: 1001;
	display: block;
	width: 280px;
	padding: 10px 12px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.45;
	color: #e2e8f0;
	background: #0f172a;
	border-radius: 8px;
	box-shadow: var(--shadow);
}

#diffElements span a:link, #diffElements span a:visited { color: var(--text); text-decoration: none; cursor: default; }
#diffElements span a:hover, #diffElements span a:active { color: var(--danger); }
#diffElements input, #diffElements select { width: 130px; }

/*************** sign in ***************/
.signin-page .main-wrapper {
	margin: 0;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, #38bdf8 22%, transparent), transparent),
		radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, #a855f7 18%, transparent), transparent),
		var(--bg);
}
.signin-card {
	width: 100%;
	max-width: 400px;
	margin: auto 16px 0;
	padding: 32px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
	box-shadow: var(--shadow);
}
.signin-card h1 { margin-bottom: 4px; }
.signin-card .error { margin-top: 12px; }
.signin-page .app-footer { margin-top: auto; text-align: center; }

/*************** jQuery UI date picker ***************/
.ui-widget { font-family: var(--font); font-size: 13px; }
.ui-datepicker { border-radius: 10px; box-shadow: var(--shadow); }

/*************** small screens ***************/
@media (max-width: 1100px) {
	.sidebar { width: 216px; }
	.main-wrapper { margin-left: 216px; }
	.content { margin: 16px; padding: 18px; }
	.left-menu { width: 200px; }
	.op-content, .op15-content, .op16-content, .right-content { margin-left: 200px; padding-left: 16px; }
}
@media (max-width: 760px) {
	.sidebar { position: static; width: 100%; max-height: none; }
	.app { flex-direction: column; }
	.main-wrapper { margin-left: 0; }
	.side-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
	.nav-group { margin: 0; }
	.left-menu { float: none; width: 100%; margin-bottom: 16px; }
	.op-content, .op15-content, .op16-content, .right-content { margin: 0; padding: 0; border: 0; min-height: 0; }
	.content { margin: 16px; padding: 16px; }
	table.userInput td:first-child, table.userInputFullPage td:first-child { width: 40%; }
}
