:root {
	--rw-primary: #0b7490;
	--rw-primary-hover: #085f76;
	--rw-primary-soft: #e2f3f7;
	--rw-danger: #bd3d42;
	--rw-danger-hover: #993036;
	--rw-success: #287a50;
	--rw-warning: #936313;
	--rw-surface: #ffffff;
	--rw-surface-muted: #f4f7f9;
	--rw-surface-raised: #ffffff;
	--rw-border: #d7e0e5;
	--rw-text: #1b2b34;
	--rw-text-muted: #657681;
	--rw-radius-sm: 6px;
	--rw-radius: 10px;
	--rw-shadow-sm: 0 1px 2px rgba(22, 42, 52, .06), 0 4px 12px rgba(22, 42, 52, .04);
	--rw-shadow-md: 0 12px 32px rgba(22, 42, 52, .12);
}

body {
	color: var(--rw-text);
	background: #f3f6f8;
}

a { color: var(--rw-primary); }
a:hover { color: var(--rw-primary-hover); }

.app-shell {
	box-sizing: border-box;
	padding: 24px 28px 32px;
}

.app-page-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	min-height: 54px;
	margin: 0 0 22px;
	padding: 0 0 18px;
	border-bottom: 1px solid var(--rw-border);
}

.app-page-heading { min-width: 0; }
.app-page-title {
	margin: 0;
	color: var(--rw-text);
	font-size: clamp(24px, 2.2vw, 32px);
	font-weight: 700;
	letter-spacing: -.025em;
	line-height: 1.15;
}

.app-page-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	flex: 0 0 auto;
}

.app-user-menu,
.app-logout {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 34px;
	box-sizing: border-box;
	border: 1px solid var(--rw-border);
	border-radius: var(--rw-radius-sm);
	background: var(--rw-surface);
	color: var(--rw-text) !important;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.app-user-menu { padding: 0 10px; }
.app-logout { width: 34px; padding: 0; }
.app-user-menu:hover,
.app-logout:hover { border-color: #aec1ca; background: var(--rw-surface-muted); }

.app-shell #browse_history {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 7px 0 0;
	padding: 0;
	color: var(--rw-text-muted);
}
.app-shell #browse_history li:before { margin: 0 2px; color: #99a8b1; }
.app-shell #browse_history a,
.app-shell #browse_history li:first-child a,
.app-shell #browse_history li:last-child a {
	color: var(--rw-text-muted);
	font-size: 12px;
	font-weight: 500;
}

.rw-card,
.rw-panel { box-shadow: var(--rw-shadow-sm); }

.dashboard-page {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	align-items: start;
	padding: 0;
}
.dashboard-table {
	float: none;
	width: 100%;
	min-width: 0;
	max-width: none;
	margin: 0;
	border: 1px solid var(--rw-border);
	border-spacing: 0;
	border-radius: var(--rw-radius);
	background: var(--rw-surface);
	box-shadow: var(--rw-shadow-sm);
	overflow: hidden;
}
.dashboard-infrastructure { grid-column: 1 / -1; }
.dashboard-roles { grid-column: 1 / -1; }
.dashboard-page #overview-logs {
	box-sizing: border-box;
	grid-column: 1 / -1;
	width: 100%;
	margin: 0;
}
.dashboard-table .overviewHead,
.dashboard-table tr.overviewHead {
	background: var(--rw-surface-muted) !important;
	color: var(--rw-text);
}
.dashboard-table .overviewHead td,
.dashboard-table .overviewHead th {
	padding: 13px 12px;
	border-bottom: 1px solid var(--rw-border);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .01em;
}
.dashboard-table tr:not(.overviewHead) > td {
	padding: 11px 12px;
	border-bottom: 1px solid #e8eef1;
	vertical-align: middle;
}
.dashboard-table tr:last-child > td { border-bottom: 0; }
.dashboard-table .odd { background: var(--rw-surface) !important; }
.dashboard-table .even { background: #fafcfd !important; }
.dashboard-table a:not(.ui-button) { font-weight: 600; text-decoration: none; }
.dashboard-table a:not(.ui-button):hover { text-decoration: underline; }
.dashboard-table .refresh,
.dashboard-table .service-reload {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid var(--rw-border);
	border-radius: 50%;
	background: var(--rw-surface);
	transition: background .15s ease, border-color .15s ease;
}
.dashboard-table a:hover .refresh,
.dashboard-table a:hover .service-reload { border-color: var(--rw-primary); background: var(--rw-primary-soft); }
.dashboard-table #cpu_div,
.dashboard-table #ram_div {
	box-sizing: border-box;
	min-width: 0;
	padding: 8px 12px !important;
}
.dashboard-table #cpu_div { border-right: 1px solid var(--rw-border); }
.dashboard-table #services_ovw > img { display: block; margin: 22px auto !important; padding: 0 !important; }
.dashboard-table .serverUp,
.dashboard-table .serverDown { border-radius: 999px; }

.service-overview-page { padding: 0; }
.service-page-toolbar {
	box-sizing: border-box;
	margin-bottom: 16px;
	padding: 14px;
	border: 1px solid var(--rw-border);
	border-radius: var(--rw-radius);
	background: var(--rw-surface);
	box-shadow: var(--rw-shadow-sm);
}
.service-card-grid .service-card {
	transition: box-shadow .16s ease, transform .16s ease;
}
.service-card[data-detail-url]:hover {
	box-shadow: 0 8px 20px rgba(28, 49, 60, .12);
	transform: translateY(-1px);
}
.service-card .server-name {
	margin: 0 -12px 12px;
	padding: 12px;
	border-bottom: 1px solid var(--rw-border);
	background: var(--rw-surface-muted);
}
.service-card .server-name > a { color: var(--rw-text) !important; font-size: 16px; font-weight: 700; text-decoration: none; }
.service-card .server-desc {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 14px;
	color: var(--rw-text-muted);
	line-height: 1.45;
}
.service-card .server-desc b { color: var(--rw-text); }
.service-card .overflow_div { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--rw-border); }
.service-card .server-act-links {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-top: 14px;
}
.service-card .server-act-links .ui-button {
	min-height: 32px;
	padding: 0 10px;
	border-color: var(--rw-border) !important;
	border-radius: var(--rw-radius-sm) !important;
	background: var(--rw-surface-muted) !important;
	color: var(--rw-text) !important;
	box-shadow: none !important;
	font: inherit;
	font-weight: 600;
}
.service-card .server-act-links .ui-button:hover { border-color: #aec1ca !important; background: #e9f1f4 !important; }

.config-workspace-toolbar {
	margin: 0 0 16px;
	padding: 14px;
}
.config-toolbar-form {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}
.config-toolbar-form .select2-container { min-width: min(360px, 100%); }
.config-toolbar-form .rw-button { min-height: 34px; padding: 0 11px; }
.config-editor-form { margin: 0; }
.config-editor-form .config-draft-banner,
.config-editor-form .config-validation-result,
.config-editor-form .config-deployment-policy-note,
.config-editor-form .config-editor-note { margin: 14px 0; }
.config-editor-card { box-shadow: var(--rw-shadow-sm); }
.config-editor-actions {
	box-sizing: border-box;
	padding: 12px;
	border: 1px solid var(--rw-border);
	border-radius: var(--rw-radius);
	background: var(--rw-surface);
	box-shadow: var(--rw-shadow-sm);
}
.config-editor-actions .rw-button { min-height: 34px; padding: 0 12px; }
.config-editor-note { margin-left: 0 !important; }
#config-review-dialog,
#change-create-dialog { color: var(--rw-text); }
#change-create-dialog label { display: grid; gap: 5px; }
#change-create-dialog input,
#change-create-dialog textarea,
#change-create-dialog select { box-sizing: border-box; max-width: 100%; }

.login-page {
	display: grid;
	min-height: 100vh;
	margin: 0;
	place-items: center;
	background:
		radial-gradient(circle at 8% 8%, rgba(11, 116, 144, .14), transparent 27rem),
		linear-gradient(135deg, #eef5f7, #f7f9fa 52%, #e6f0f3);
}
#main_div.login-shell {
	box-sizing: border-box;
	width: min(100%, 960px);
	margin: 0;
	padding: 24px;
}
.login-card {
	display: grid;
	grid-template-columns: minmax(260px, 1fr) minmax(280px, 360px);
	gap: clamp(28px, 7vw, 80px);
	align-items: center;
	padding: clamp(28px, 6vw, 64px);
	border: 1px solid rgba(215, 224, 229, .9);
	border-radius: 18px;
	background: rgba(255, 255, 255, .9);
	box-shadow: var(--rw-shadow-md);
}
#logo_span {
	display: block;
	width: min(220px, 100%);
	height: auto;
	float: none;
	margin: 0 0 28px;
}
.login-brand h1 { margin: 0; color: var(--rw-text); font-size: 30px; letter-spacing: -.03em; }
.login-brand p { max-width: 290px; margin: 10px 0 0; color: var(--rw-text-muted); font-size: 16px; line-height: 1.55; }
.login-auth-column { width: 100%; margin: 0; float: none; }
.fontuser,
.fontpassword { position: relative; margin: 0 0 14px; }
.fontuser .form-login,
.fontpassword .form-login {
	box-sizing: border-box;
	width: 100%;
	height: 44px;
	padding: 0 42px;
	border: 1px solid var(--rw-border);
	border-radius: var(--rw-radius-sm);
	background: var(--rw-surface);
	color: var(--rw-text);
	font: inherit;
	font-size: 15px;
}
.fontuser .form-login:focus,
.fontpassword .form-login:focus { border-color: var(--rw-primary); box-shadow: 0 0 0 3px rgba(11, 116, 144, .16); outline: 0; }
.login-leading-icon { position: absolute; top: 14px; left: 14px; color: var(--rw-text-muted); }
.login-password-toggle,
.login-password-toggle.ui-button {
	position: absolute;
	top: 50%;
	right: 7px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0 !important;
	transform: translateY(-50%);
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--rw-primary) !important;
	cursor: pointer;
}
.login-password-toggle [hidden] { display: none; }
.login-submit,
#enter.login-submit {
	width: 100%;
	height: 44px;
	margin-top: 2px;
	border: 1px solid var(--rw-primary);
	border-radius: var(--rw-radius-sm);
	background: var(--rw-primary);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.login-submit:hover,
#enter.login-submit:hover { background: var(--rw-primary-hover); }
.login-card .oidc-login-separator,
.login-card .oidc-login-providers,
.login-card .oidc-login-button { width: 100%; }
.login-card .oidc-login-button { color: var(--rw-primary); border-color: var(--rw-border); }
.login-card .wrong-login { float: none !important; margin: 16px 0 0; }
.login-card .login-error-visible { display: block; }

@media (max-width: 900px) {
	.app-shell { padding: 18px 16px 28px; }
	.app-page-header { margin-bottom: 18px; }
	.dashboard-page { grid-template-columns: 1fr; }
	.dashboard-infrastructure { grid-column: auto; }
}
@media (max-width: 680px) {
	.app-page-header { align-items: flex-start; flex-direction: column-reverse; gap: 12px; }
	.app-page-actions { width: 100%; }
	.login-shell { padding: 14px; }
	.login-card { grid-template-columns: 1fr; gap: 34px; padding: 30px 24px; }
	.login-brand img { width: 180px; margin-bottom: 18px; }
	.dashboard-table { display: block; overflow-x: auto; }
	.dashboard-table #cpu_div,
	.dashboard-table #ram_div { width: 100% !important; float: none !important; }
	.dashboard-table #cpu_div { border-right: 0; border-bottom: 1px solid var(--rw-border); }
	.service-card .server-desc { grid-template-columns: 1fr; }
	.config-toolbar-form { align-items: stretch; flex-direction: column; }
	.config-toolbar-form .select2-container,
	.config-toolbar-form .rw-button { width: 100% !important; }
	.config-editor-actions { align-items: stretch; flex-direction: column; }
	.config-editor-actions .rw-button { width: 100%; }
}
