/*
 * admin_website - stylesheet modelled on the OpenWrt / LuCI "openwrt2020"
 * theme: a cyan menu bar, a dark navy sidebar and light, borderless panels.
 */

:root {
	--main-bright-color: #00b5e2;
	--main-dark-color: #002b49;
	--secondary-bright-color: #ffffff;
	--secondary-dark-color: #212322;
	--danger-color: #cc1111;
	--warning-color: #cc8800;
	--success-color: #5cb85c;

	--base-font-size: 16px;
	--regular-font: "Galano Grotesque", "Segoe UI", system-ui, -apple-system,
		"Helvetica Neue", Arial, sans-serif;
	--mono-font: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono",
		Menlo, monospace;

	--panel-gap: 1.25rem;
	--rule-color: #e3ebf0;
}

/* Authenticated home launcher: no admin sidebar or polling. */
#maincontent.landing-content {
	width: min(1100px, 100%);
	margin: 0 auto;
	padding: 3rem 1.5rem;
}
.landing-intro { color: #576b79; margin-bottom: 2rem; }
.service-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 1rem;
	margin-top: 1rem;
}
.service-card {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1.5rem;
	min-height: 140px;
	border-radius: 8px;
	background: var(--main-dark-color);
	color: white;
}
.service-card strong { font-size: 1.25rem; }
.service-card > span, .service-card small { color: #c0d5e3; }
a.service-card:hover, a.service-card:focus-visible {
	background: #00476a;
	outline: 3px solid var(--main-bright-color);
	outline-offset: 3px;
	text-decoration: none;
}
.service-unconfigured { opacity: 0.65; }
.landing-admin { margin-top: 2rem; }

/*
 * resets and base style
 */

*,
*::before,
*::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	text-decoration: none;
	list-style: none;
	color: inherit;
	font-family: var(--regular-font);
	font-size: 100%;
	background: none;
	border: none;
	appearance: none;
}

html {
	height: 100%;
	width: 100%;
}

body {
	background: var(--secondary-bright-color);
	color: var(--secondary-dark-color);
	font-size: var(--base-font-size);
	cursor: default;
	display: flex;
	flex-direction: column;
	min-height: 100%;
	min-width: 100%;
}

a {
	color: var(--main-bright-color);
}

a:hover {
	text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: bold;
	margin: 0 0 0.5rem 0;
}

h1 { font-size: 160%; }
h2 { font-size: 150%; }
h3 { font-size: 125%; }
h4 { font-size: 115%; }
h5 { font-size: 105%; }
h6 { font-size: 100%; }

p,
ul {
	margin: 0 0 0.75em 0;
}

ul > li {
	list-style: disc;
}

code,
pre,
.mono {
	font-family: var(--mono-font);
}

.mono {
	font-size: 0.86rem;
}

.nowrap {
	white-space: nowrap;
}

.muted {
	color: #7d8891;
}

.skiplink {
	display: none;
}

.skiplink:focus {
	display: block;
	position: absolute;
	z-index: 100;
	top: 0;
	left: 0;
	padding: 0.5em 1em;
	background: var(--main-dark-color);
	color: var(--secondary-bright-color);
}

/*
 * menu bar
 */

#menubar {
	background-color: var(--main-bright-color);
	padding: 0 1em 0 0.75em;
	min-height: 70px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	color: var(--secondary-bright-color);
	flex: 0;
	width: 100%;
	box-shadow: inset 0 0 1px var(--main-dark-color);
}

#menubar .brand {
	display: flex;
	align-items: center;
	gap: 0.75em;
	color: var(--secondary-bright-color);
	flex: 0 0 auto;
}

#menubar .brand:hover {
	text-decoration: none;
}

#menubar .brand img {
	display: block;
	width: 44px;
	height: 44px;
}

#menubar .hostname {
	font-weight: bold;
	font-size: 1.6em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#menubar .distversion {
	flex: 1 1 auto;
	font-size: 0.9rem;
	opacity: 0.85;
	padding-left: 1em;
}

#indicators {
	flex: 0 1 auto;
	margin-left: auto;
	max-width: 100%;
	flex-wrap: wrap;
	justify-content: flex-end;
	text-align: right;
	display: flex;
	align-items: center;
	gap: 0.25em;
}

#indicators > * {
	background: var(--secondary-bright-color);
	color: var(--main-bright-color);
	display: inline-block;
	font-size: 0.85em;
	margin: 0.125em;
	cursor: pointer;
	white-space: nowrap;
	line-height: 1.8em;
	border-radius: 0.5rem;
	padding: 0 0.7em;
}

#indicators > [data-style="inactive"] {
	background: var(--main-bright-color);
	color: var(--secondary-bright-color);
	border: 2px solid var(--secondary-bright-color);
	line-height: calc(1.8em - 4px);
	padding: 0 calc(0.7em - 2px);
}

#indicators > .indicator-user {
	cursor: default;
}

#indicators > .logout-form {
	background: none;
	margin: 0;
	padding: 0;
	cursor: default;
}

#indicators > .logout-form button {
	background: var(--secondary-bright-color);
	color: var(--main-bright-color);
	font-family: inherit;
	font-size: 0.85em;
	line-height: 1.8em;
	border: 0;
	border-radius: 0.5rem;
	padding: 0 0.7em;
	cursor: pointer;
}

#indicators > .logout-form button:hover,
#indicators > .logout-form button:focus-visible {
	background: var(--main-bright-color);
	color: var(--secondary-bright-color);
	outline: none;
}

/*
 * horizontal section menu
 */

#modemenu {
	background: var(--main-bright-color);
	padding: 0.5rem 1rem;
	display: flex;
	align-items: center;
	color: var(--secondary-bright-color);
	box-shadow: inset 0 0 1px var(--main-dark-color);
	font-size: 1rem;
	flex-wrap: wrap;
}

#modemenu > * {
	margin: 0.125rem;
}

#modemenu > .active {
	font-weight: bold;
	border-bottom: 2px solid var(--secondary-bright-color);
}

#modemenu a {
	color: var(--secondary-bright-color);
	padding: 0 0.25em;
}

#modemenu a:hover {
	text-decoration: none;
	opacity: 0.8;
}

/*
 * layout
 */

#maincontainer {
	flex-direction: row;
	display: flex;
	flex: 1 0 auto;
	align-items: stretch;
}

#sidebar-toggle { flex: 0 0 auto; width: 2.25rem; height: 2.25rem; margin-right: .75rem; padding: 0; border: 1px solid currentColor; border-radius: .35rem; background: transparent; color: inherit; font: inherit; font-size: 1.3rem; cursor: pointer; }
#sidebar-toggle:hover, #sidebar-toggle:focus-visible { background: rgba(255, 255, 255, .18); }
#indicators > [data-auto-control] { display: inline-flex; align-items: center; gap: .4em; background: transparent; color: inherit; }
#indicators #auto-updates { appearance: auto; display: inline-block; width: 1rem; height: 1rem; margin: 0; padding: 0; }
.traffic-aggregation { display: flex; align-items: center; flex-wrap: wrap; gap: .5em; margin: .6em 0; }
.traffic-aggregation select { appearance: auto; -webkit-appearance: auto; min-width: 8rem; padding: .4rem .5rem; border: 1px solid #c7d3da; border-radius: .25rem; background: var(--secondary-bright-color); cursor: pointer; }
.traffic-aggregation select:focus-visible { outline: 2px solid var(--main-bright-color); outline-offset: 3px; }
.sidebar-collapsed #mainmenu { display: none; }
.table-controls { margin: .5em 0; font-size: .9em; }
.table-controls > div { display: flex; flex-wrap: wrap; gap: .5em 1em; padding: .5em; }
.table-controls > div > div { display: flex; align-items: center; gap: .35em; }
.table-controls input[type="checkbox"], [data-live-control] input { appearance: auto; width: 1em; height: 1em; }
table [hidden], [data-auto-control][hidden], #sidebar-toggle[hidden] { display: none !important; }

#mainmenu {
	flex: 0 0 auto;
	max-width: max-content;
	background: var(--main-dark-color);
	color: var(--main-bright-color);
	padding: 1em;
}

#mainmenu > div {
	position: sticky;
	top: 1em;
}

#mainmenu ul {
	padding: 0;
	margin: 0 0 0 0.5em;
	line-height: 1.5em;
}

#mainmenu ul > li {
	list-style: none;
}

#mainmenu .l1 > li > a {
	font-weight: bold;
	font-size: 1.02em;
	display: flex;
	align-items: center;
	gap: 0.5em;
	color: var(--main-bright-color);
	padding: 0.15em 0;
}

#mainmenu .l1 > li > a:hover {
	text-decoration: none;
	opacity: 0.75;
}

#mainmenu li.selected > a {
	color: var(--secondary-bright-color);
}

#mainmenu .mainmenu-title {
	flex: 1 1 auto;
}

#mainmenu .planned {
	flex: 0 0 auto;
	font-size: 0.62rem;
	font-weight: normal;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border: 1px solid currentColor;
	border-radius: 0.5rem;
	padding: 0 0.4em;
	opacity: 0.7;
}

#maincontent {
	flex: 1 1 auto;
	min-width: 0;
	padding: 1.25em 1.25em 1.5em 1.25em;
}

/*
 * panels
 */

.cbi-section {
	margin: 0 0 var(--panel-gap) 0;
}

.cbi-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 0.5em;
	border-bottom: 1px solid var(--rule-color);
	padding-bottom: 0.35em;
}

.cbi-title h3 {
	font-size: 1.15rem;
	color: var(--main-dark-color);
	margin: 0;
}

.dashboard {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
	gap: 0 var(--panel-gap);
	align-items: start;
}

.dashboard > .cbi-section {
	margin-bottom: var(--panel-gap);
}

.panel-wide {
	grid-column: 1 / -1;
}

.panel-body {
	overflow: hidden;
}

/*
 * tables
 */

table {
	width: 100%;
	margin: 0 0 0.5rem 0;
	position: relative;
	border-collapse: collapse;
}

th {
	text-align: left;
	font-weight: bold;
	padding: 0.4em 0.5em;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #5c6873;
	border-bottom: 1px solid var(--rule-color);
}

td {
	border-top: 1px solid var(--rule-color);
	padding: 0.45em 0.5em;
	vertical-align: middle;
}

tbody tr:first-child td {
	border-top: none;
}

.table.kv td:first-child {
	color: #5c6873;
	font-weight: normal;
}

.table.kv td.left {
	text-align: left;
}

.td.left {
	text-align: left;
}

.mount {
	color: #7d8891;
	font-size: 0.9em;
}

.table.list tbody tr:hover {
	background: #f6fbfd;
}

.table.log .log-warning td {
	color: #8a5c00;
}

.table.log .log-error td {
	color: var(--danger-color);
}

.table.log .log-notice td {
	color: #356d8a;
}

/*
 * progress bars
 */

.cbi-progressbar {
	border-radius: 0.25em;
	position: relative;
	min-width: 12rem;
	height: 1.4em;
	box-shadow: 0 0 2px var(--main-dark-color);
	overflow: hidden;
	margin: 0.125rem 0;
	background: var(--secondary-bright-color);
}

.cbi-progressbar > div {
	background: var(--main-bright-color);
	height: 100%;
	transition: width 0.25s ease-in;
	width: 0%;
}

.progress-legend {
	font-size: 0.78rem;
	color: #5c6873;
}

/*
 * labels
 */

.label {
	background: var(--main-bright-color);
	color: var(--secondary-bright-color);
	font-size: 0.75rem;
	font-weight: bold;
	padding: 0.15rem 0.5rem;
	border-radius: 0.5rem;
	white-space: nowrap;
	display: inline-block;
}

.label.warning {
	background: var(--danger-color);
}

.label.success {
	background: var(--success-color);
}

.label.notice {
	background: var(--secondary-bright-color);
	color: var(--main-bright-color);
	border: 1px solid var(--main-bright-color);
}

.label.toggle {
	cursor: pointer;
	user-select: none;
	background: var(--secondary-bright-color);
	color: var(--main-bright-color);
	border: 1px solid var(--main-bright-color);
	transition: background 0.15s ease, color 0.15s ease;
}

.label.toggle:hover {
	background: var(--main-bright-color);
	color: var(--secondary-bright-color);
}

/*
 * network interfaces
 */

.iface-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
	gap: 0.75rem;
}

.iface-card {
	border: 1px solid var(--rule-color);
	border-radius: 0.35rem;
	overflow: hidden;
	background: var(--secondary-bright-color);
}

.iface-card-head {
	display: flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.45em 0.65em;
	background: var(--main-bright-color);
	color: var(--secondary-bright-color);
}

.iface-card.iface-wan .iface-card-head {
	background: var(--main-dark-color);
}

.iface-card.iface-wlan .iface-card-head {
	background: #1d7fa8;
}

.iface-card.iface-lo .iface-card-head {
	background: #7d8891;
}

.iface-card.down .iface-card-head {
	background: #6b7680;
}

.iface-kind {
	font-size: 0.68rem;
	font-weight: bold;
	letter-spacing: 0.08em;
	opacity: 0.85;
}

.iface-name {
	flex: 1 1 auto;
	font-weight: bold;
}

.iface-card-head .label {
	background: var(--secondary-bright-color);
	color: var(--main-dark-color);
}

.iface-card-body {
	padding: 0.5em 0.65em;
}

.iface-line {
	display: flex;
	gap: 0.75em;
	font-size: 0.85rem;
	padding: 0.1em 0;
}

.iface-key {
	flex: 0 0 5.5em;
	color: #7d8891;
}

.iface-value {
	flex: 1 1 auto;
	word-break: break-word;
}

/*
 * alerts and placeholders
 */

.alert-message:not(.modal) {
	box-shadow: 0 0 3px var(--secondary-dark-color);
	padding: 0.75em 1em;
	margin: 0 0 1em 0;
	background: var(--main-bright-color);
	color: var(--secondary-bright-color);
	border-radius: 0.25em;
}

.alert-message h4 {
	margin-bottom: 0.25em;
}

.alert-message p {
	margin: 0;
}

.alert-message.info {
	background: var(--main-bright-color);
	color: var(--secondary-bright-color);
}

.alert-message.warning {
	background: var(--warning-color);
	color: var(--secondary-bright-color);
}

.alert-message.danger {
	background: var(--danger-color);
	color: var(--secondary-bright-color);
}

.alert-message.success {
	background: var(--success-color);
	color: var(--secondary-bright-color);
}

.alert-message.notice {
	background: var(--secondary-bright-color);
	color: var(--main-bright-color);
	border: 1px solid var(--main-bright-color);
}

.placeholder-section {
	max-width: 46rem;
}

.placeholder-hint {
	font-size: 0.88rem;
	color: #5c6873;
}

.feature-list {
	list-style: disc;
	padding-left: 1.25em;
	margin-bottom: 1em;
}

.feature-list > li {
	list-style: disc;
	margin: 0.15em 0;
}

/*
 * footer
 */

p.luci {
	flex: 0;
	font-size: 0.7em;
	padding: 0.5em 1em;
	text-align: right;
	background: var(--main-bright-color);
	color: var(--secondary-bright-color);
	margin: 0;
}

p.luci strong {
	font-weight: bold;
}

/*
 * htmx
 */

.htmx-request .label.toggle {
	opacity: 0.6;
}

.htmx-swapping {
	opacity: 0.4;
	transition: opacity 0.15s ease-out;
}

/*
 * responsive
 */

/*
 * traffic priority
 */

.qos-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	margin-top: 0.75rem;
}

.qos-actions form,
.qos-inline {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
}

.qos-inline {
	margin: 0 0 0.25rem 0;
}

.qos-hint {
	margin: 0 0 0.6rem 0;
	color: #5c6873;
	font-size: 0.85rem;
}

.qos-peers td {
	vertical-align: top;
}

.qos-priority {
	min-width: 14rem;
	white-space: nowrap;
}

.qos-priority-view,
.qos-priority-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
}

.qos-priority-view[hidden],
.qos-priority-form[hidden] {
	display: none;
}

.qos-priority-form select {
	width: auto;
	min-width: 9.5rem;
	background: var(--secondary-bright-color);
	color: var(--secondary-dark-color);
	border: 1px solid #c7d3da;
	border-radius: 0.25rem;
	padding: 0.35rem 0.45rem;
	font-size: 0.88rem;
}

.qos-edit {
	background: #e8eef2;
	color: var(--main-dark-color);
}

.qos-revert {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.qos-fold summary {
	cursor: pointer;
	font-weight: bold;
	color: var(--main-dark-color);
	padding: 0.35rem 0;
	border-bottom: 1px solid var(--rule-color);
	margin-bottom: 0.5rem;
}

.qos-confirm {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.82rem;
	color: #5c6873;
	white-space: nowrap;
}

.cbi-button {
	background: var(--main-bright-color);
	color: var(--secondary-bright-color);
	border-radius: 0.3rem;
	padding: 0.35rem 0.75rem;
	font-size: 0.85rem;
	font-weight: bold;
	cursor: pointer;
	line-height: 1.4;
}

.cbi-button:hover {
	opacity: 0.88;
	text-decoration: none;
}

.cbi-button-apply {
	background: var(--main-bright-color);
}

.cbi-button-reset {
	background: var(--danger-color);
}

.qos-rules td {
	vertical-align: top;
}

.qos-target {
	font-size: 0.78rem;
	color: #7d8891;
	margin-top: 0.15rem;
}

.qos-add-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
	gap: 0.9rem;
	margin-top: 1rem;
}

.qos-card {
	border: 1px solid var(--rule-color);
	border-radius: 0.35rem;
	padding: 0.75rem;
	background: #fbfdfe;
}

.qos-card h4 {
	margin-bottom: 0.6rem;
	color: var(--main-dark-color);
}

.qos-card label {
	display: block;
	font-size: 0.82rem;
	color: #5c6873;
	margin-bottom: 0.55rem;
}

.qos-card input[type="text"],
.qos-card select,
.qos-rules select,
.qos-actions input[type="text"] {
	display: block;
	width: 100%;
	margin-top: 0.2rem;
	border: 1px solid #c7d3da;
	border-radius: 0.25rem;
	background: var(--secondary-bright-color);
	color: var(--secondary-dark-color);
	padding: 0.35rem 0.45rem;
	font-size: 0.88rem;
}

.qos-rules select {
	width: auto;
	min-width: 9.5rem;
	margin-top: 0;
}

.qos-card input[type="checkbox"],
.qos-confirm input[type="checkbox"] {
	margin-right: 0.2rem;
}

.qos-card button {
	margin-top: 0.25rem;
}

.prio-high {
	background: var(--success-color) !important;
	color: var(--secondary-bright-color) !important;
}

.prio-normal {
	background: var(--main-bright-color) !important;
	color: var(--secondary-bright-color) !important;
}

.prio-low {
	background: #7d8891 !important;
	color: var(--secondary-bright-color) !important;
}

.qos-preview summary {
	cursor: pointer;
	font-weight: bold;
	color: var(--main-dark-color);
	padding: 0.35rem 0;
}

.qos-preview pre {
	background: #f4f8fa;
	border: 1px solid var(--rule-color);
	border-radius: 0.3rem;
	padding: 0.65rem;
	overflow-x: auto;
	font-size: 0.78rem;
	line-height: 1.45;
	max-height: 24rem;
	margin-bottom: 0.75rem;
}

details > summary {
	list-style: none;
}

details > summary::before {
	content: "▸ ";
}

details[open] > summary::before {
	content: "▾ ";
}

/*
 * firewall / traffic rules
 */

.firewall-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin: 0 0 0.9rem 0;
	border-bottom: 1px solid var(--rule-color);
}

.firewall-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.45rem 0.75rem;
	border: 1px solid transparent;
	border-bottom: 0;
	border-radius: 0.3rem 0.3rem 0 0;
	font-size: 0.88rem;
	color: var(--main-dark-color);
}

.firewall-tab:hover {
	text-decoration: none;
	background: #eaf1f5;
}

.firewall-tab.active {
	background: var(--secondary-bright-color);
	border-color: var(--rule-color);
	font-weight: bold;
}

.firewall-tab.planned {
	color: #7d8891;
	cursor: default;
}

.firewall-tab.planned:hover {
	background: transparent;
}

.firewall-hint {
	margin: 0 0 0.6rem 0;
	color: #5c6873;
	font-size: 0.85rem;
}

.router-rule {
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--rule-color);
}

.router-editor fieldset {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

.router-editor input:not([type="checkbox"]):not([type="hidden"]),
.router-editor select {
	max-width: 100%;
	padding: 0.35rem 0.45rem;
	border: 1px solid #c7d3da;
	border-radius: 0.25rem;
	background: var(--secondary-bright-color);
	color: var(--secondary-dark-color);
	font: inherit;
}

.router-rule summary {
	cursor: pointer;
	font-weight: bold;
}

.router-rule-form {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 0.75rem;
	padding: 0.75rem 0;
}

.router-rule-form label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.router-rule-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.firewall-summary {
	width: auto;
	min-width: min(32rem, 100%);
	margin-bottom: 0.9rem;
}

.firewall-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.6rem;
	margin-top: 0.75rem;
}

.firewall-filter label {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	font-size: 0.8rem;
	color: #5c6873;
}

.firewall-filter select,
.firewall-filter input[type="search"] {
	min-width: 8.5rem;
	background: var(--secondary-bright-color);
	color: var(--secondary-dark-color);
	border: 1px solid #c7d3da;
	border-radius: 0.25rem;
	padding: 0.35rem 0.45rem;
	font-size: 0.88rem;
}

.firewall-filter input[type="search"] {
	min-width: 13rem;
}

.firewall-clear {
	align-self: center;
	font-size: 0.85rem;
	padding-bottom: 0.35rem;
}

.firewall-table h4 {
	margin: 0.9rem 0 0.45rem 0;
	color: var(--main-dark-color);
}

.firewall-chain {
	border-top: 1px solid var(--rule-color);
	padding-top: 0.55rem;
	margin-top: 0.55rem;
}

.firewall-chain-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
	margin: 0 0 0.45rem 0;
}

.firewall-rules td {
	vertical-align: top;
}

.rule-parts > div {
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem 0.75rem;
	padding: 0.2rem 0;
}

.rule-parts dt {
	flex: 0 0 11rem;
	color: #5c6873;
	font-size: 0.8rem;
}

.rule-parts dd {
	flex: 1 1 10rem;
	min-width: 0;
	overflow-wrap: anywhere;
}

.rule-unsupported {
	color: #8a5c00;
}

.firewall-rules .mono {
	overflow-wrap: anywhere;
}

.firewall-raw {
	margin-top: 0.25rem;
}

.firewall-raw summary {
	font-size: 0.78rem;
	color: #7d8891;
	cursor: pointer;
}

.firewall-raw pre {
	background: #f4f8fa;
	border: 1px solid var(--rule-color);
	border-radius: 0.3rem;
	padding: 0.5rem;
	overflow-x: auto;
	font-size: 0.75rem;
	margin: 0.3rem 0 0 0;
	max-height: 24rem;
	line-height: 1.5;
}

.firewall-raw summary:focus-visible,
.qos-fold summary:focus-visible,
.qos-preview summary:focus-visible {
	outline: 2px solid var(--main-bright-color);
	outline-offset: 3px;
}

/*
 * login page
 */

.login-page,
body[data-page="login"] {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	background: #eef3f6;
}

.login-wrap {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.5rem 1rem;
}

.login-card {
	width: min(27rem, 100%);
	background: var(--secondary-bright-color);
	border-top: 0.25rem solid var(--main-bright-color);
	border-radius: 0.35rem;
	box-shadow: 0 2px 8px rgba(0, 43, 73, 0.18);
	padding: 1.75rem;
}

.login-card h1 {
	font-size: 1.45rem;
	color: var(--main-dark-color);
	margin-bottom: 0.25rem;
}

.login-hint {
	color: #5a6b78;
	font-size: 0.9rem;
	margin-bottom: 1.25rem;
}

.login-card label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
	color: var(--main-dark-color);
}

.login-card input[type="password"] {
	width: 100%;
	padding: 0.6rem 0.7rem;
	border: 1px solid #c3d2dc;
	border-radius: 0.25rem;
	font-size: 1rem;
	margin-bottom: 1rem;
	background: #fbfdff;
}

.login-card input[type="password"]:focus {
	outline: 2px solid var(--main-bright-color);
	outline-offset: 1px;
}

.login-card button {
	width: 100%;
	background: var(--main-bright-color);
	color: var(--secondary-bright-color);
	border: 0;
	border-radius: 0.25rem;
	padding: 0.65rem;
	font-family: inherit;
	font-size: 1rem;
	cursor: pointer;
}

.login-card button:hover,
.login-card button:focus-visible {
	background: var(--main-dark-color);
	outline: none;
}

.login-card .alert-message {
	margin-bottom: 1rem;
}

.login-note {
	margin-top: 1rem;
	color: #6b7b87;
	font-size: 0.8rem;
	text-align: center;
}

@media only screen and (max-width: 800px) {
	body {
		flex-direction: column;
	}

	#menubar {
		padding: 0 0.5em;
		min-height: 60px;
	}

	#menubar .brand img {
		width: 34px;
		height: 34px;
	}

	#menubar .hostname {
		font-size: 1.25em;
	}

	#menubar .distversion {
		display: none;
	}

	#modemenu {
		padding: 0.35em 0.5em;
		font-size: 0.9rem;
	}

	#maincontainer {
		flex-direction: column;
	}

	#mainmenu {
		max-width: none;
		padding: 0.6em 0.75em;
	}

	#mainmenu > div {
		position: static;
	}

	#mainmenu ul {
		margin: 0;
		display: flex;
		flex-wrap: wrap;
		gap: 0.25em 1em;
	}

	#mainmenu .l1 > li > a {
		font-size: 0.9rem;
	}

	#maincontent {
		padding: 0.85em;
	}

	.dashboard {
		grid-template-columns: 1fr;
	}

	.cbi-progressbar {
		min-width: 8rem;
	}
}
.client-access-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}
.client-access-form select,
.client-access-form input[type="number"] {
    appearance: auto;
    min-height: 2.25rem;
    padding: .35rem .6rem;
    border: 1px solid #a8bac6;
    border-radius: .3rem;
    background: var(--secondary-bright-color);
    color: var(--secondary-dark-color);
    font-size: .88rem;
}
.client-access-form select { min-width: 10rem; cursor: pointer; }
.client-access-form input[type="number"] { width: 10rem; }
.client-access-form .cbi-button {
    min-height: 2.25rem;
    border: 1px solid var(--main-dark-color);
    padding: .35rem .85rem;
}
.client-access-form .client-pause { background: var(--main-dark-color); }
.client-access-form .client-resume {
    background: var(--main-bright-color);
    color: var(--main-dark-color);
}
.client-access-form select:focus-visible,
.client-access-form input:focus-visible,
.client-access-form button:focus-visible {
    outline: 2px solid var(--main-bright-color);
    outline-offset: 2px;
}
.client-access-form button:disabled { opacity: .6; cursor: wait; }
.client-access-form [hidden] { display: none; }

/* Device Traffic must restore native controls removed by the global reset.
 * Match the form action so this also fixes already-installed page markup and
 * works after htmx navigation without relying on the body's initial page ID. */
form[action="/admin/network/device-traffic"] {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin: 0.75rem 0;
}

form[action="/admin/network/device-traffic"] label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	line-height: 1.5;
}

form[action="/admin/network/device-traffic"] input:not([type="hidden"]):not([type="checkbox"]) {
	appearance: auto;
	-webkit-appearance: auto;
	border: 1px solid #c7d3da;
	border-radius: 0.25rem;
	background: var(--secondary-bright-color);
	padding: 0.4rem 0.5rem;
	min-width: 10rem;
}

form[action="/admin/network/device-traffic"] input[type="checkbox"] {
	appearance: auto;
	-webkit-appearance: auto;
	width: 1.1rem;
	height: 1.1rem;
	flex: 0 0 1.1rem;
	accent-color: var(--main-bright-color);
	cursor: pointer;
}

form[action="/admin/network/device-traffic"] input:focus-visible,
form[action="/admin/network/device-traffic"] button:focus-visible {
	outline: 2px solid var(--main-bright-color);
	outline-offset: 3px;
}
