/* XOR-13748: shared visual language from Ombutel's portal branch,
 * portal-web/src/style.css. Loaded after the existing component styles;
 * AngularJS, Bootstrap, templates and application behavior remain unchanged. */
:root {
	--mt-navy: #061a33;
	--mt-navy-raised: #0a2342;
	--mt-blue: #066cff;
	--mt-blue-hover: #0756d1;
	--mt-accent: #42a5ff;
	--mt-text: #071b3a;
	--mt-muted: #587095;
	--mt-border: #d8e3ef;
	--mt-canvas: #f7f9fc;
	--mt-surface: #fff;
	--mt-subtle: #eef4fa;
	--mt-selected: #eaf2ff;
	--mt-success: #0bbf73;
	--mt-success-text: #087b4b;
	--mt-warning: #f59e0b;
	--mt-warning-text: #946000;
	--mt-danger: #ff3b67;
	--mt-danger-text: #c51d46;
	--mt-shadow: 0 8px 28px #061a3314;
}

html, body {
	background-color: var(--mt-canvas);
	color: var(--mt-text);
	font-family: Inter, "Segoe UI", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

body {
	--mt-sidebar-width: 220px;
	grid-template-columns: var(--mt-sidebar-width) minmax(0, 1fr) auto;
	grid-template-rows: 64px minmax(0, 1fr) 64px;
}

body.collapsed {
	--mt-sidebar-width: 50px;
	grid-template-columns: var(--mt-sidebar-width) minmax(0, 1fr) auto;
}

a { color: var(--mt-blue); }
a:hover { color: var(--mt-blue-hover); }

:focus-visible {
	outline: 3px solid var(--mt-accent);
	outline-offset: 2px;
}

/* Shell */
body > header {
	grid-template-columns: var(--mt-sidebar-width) 50px minmax(0, 1fr) 110px;
	background: var(--mt-surface);
	border-bottom: 1px solid var(--mt-border);
}

header .home {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: var(--mt-navy);
	color: #fff;
	font-size: 18px;
	font-weight: 600;
}

header .home:hover { color: #fff; background: var(--mt-navy-raised); }
header .home .brand-wordmark { width: 150px; max-width: calc(100% - 24px); height: auto; }
header .home .brand-symbol { display: none; width: 32px; height: 40px; object-fit: contain; }
body.collapsed header .home .brand-wordmark { display: none; }
body.collapsed header .home .brand-symbol { display: block; }
header .navbar-toggler, header button.profile, header a.warning { color: var(--mt-muted); }
header .navbar-toggler:hover, header button.profile:hover, header a.warning:hover { color: var(--mt-blue); }
header .navbar-toggler, header button.profile { min-width: 36px; min-height: 36px; border-radius: 8px; }

body > aside {
	display: flex;
	flex-direction: column;
	background: var(--mt-navy);
	padding: 16px 0 12px;
	overflow-y: auto;
}
aside > a { flex-shrink: 0; }
body > aside > a.sidebar-logout { margin-top: auto; }

aside a, aside ul.sub-menu li a {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 4px 10px;
	padding: 11px 12px;
	border: 0;
	border-radius: 8px;
	color: #d7e5f5;
	font-size: 14px;
	font-weight: 500;
}

aside a:hover, aside ul.sub-menu li a:hover {
	background: var(--mt-navy-raised);
	color: #fff;
}

aside a.active, aside ul.sub-menu li a.active {
	background: var(--mt-blue);
	color: #fff;
}

aside ul.sub-menu { margin: 0; padding: 0 0 0 22px; }
aside ul.sub-menu li a { font-size: 13px; }
aside > a > i { font-size: 22px; flex: 0 0 26px; width: 26px; text-align: center; }
aside .settings-chevron { margin-inline-start: auto; font-size: 12px; }
aside.collapsed a { margin: 4px; padding: 10px 0; min-height: 44px; justify-content: center; gap: 0; }
aside a.notify i, aside a.notify span { color: #ffc76b; }

body > footer {
	background: var(--mt-surface);
	border-top: 1px solid var(--mt-border);
	padding: 10px 30px;
	gap: 10px;
}
footer .form-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 8px;
	border: 1px solid transparent;
	border-radius: 5px;
	background: transparent;
	color: var(--mt-blue);
	box-shadow: none;
}
footer .form-action svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
footer .form-action i { font-size: 24px; }
footer .form-action.action-delete { color: #f5224e; }
footer .form-action.action-exit { color: #7297ba; }
footer .form-action:hover { background: var(--mt-selected); }
footer .form-action.action-delete:hover { background: #fff0f3; }
footer .form-action:disabled { opacity: .4; cursor: not-allowed; }

body > section:not(.login) { min-width: 0; padding: 24px 30px; }
section div.dialog_header { margin-bottom: 20px; }
section div.dialog_header h2 {
	grid-column: 1 / -1;
	border: 0;
	margin: 0;
	color: var(--mt-text);
	font-size: 26px;
	font-weight: 600;
	text-align: start;
}
section div.dialog_header h2:hover { color: var(--mt-text); }

section > [data-tabs], section > form, section > .table-responsive {
	background: var(--mt-surface);
	border: 1px solid var(--mt-border);
	border-radius: 10px;
	box-shadow: var(--mt-shadow);
}
section > [data-tabs], section > form { padding: 22px; }
section form label { align-self: center; margin-bottom: 0; }
section form tab.pane.active, section > form { row-gap: 12px; }

/* Forms and toolbar controls, including native inputs without .form-control. */
input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]),
select, textarea, .multiSelect > button {
	max-width: 100%;
	min-width: 0;
	min-height: 42px;
	padding: 8px 12px;
	border: 1px solid var(--mt-border);
	border-radius: 6px;
	background: var(--mt-surface);
	color: var(--mt-text);
	font: inherit;
	box-shadow: none;
}
input::placeholder, textarea::placeholder { color: var(--mt-muted); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--mt-blue); }
input:disabled, select:disabled, textarea:disabled {
	background: var(--mt-subtle);
	color: var(--mt-muted);
	cursor: not-allowed;
}
input.error { border: 2px solid var(--mt-danger); }
.number_error, .required:after { color: var(--mt-danger-text); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--mt-blue); }
.password-container .password-toggle { color: var(--mt-muted); border-color: var(--mt-border); }
.password-container .password-toggle:hover { color: var(--mt-blue); background: var(--mt-subtle); }
.password-container input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]) { padding-right: 44px; }

section div.controls input { padding: 8px 12px; }
section div.controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
div.table-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
div.table-controls > .controls { margin-inline-start: auto; }
section div.totals_row { color: var(--mt-muted); }
section.tenants div.filtered { background: var(--mt-selected); color: var(--mt-blue-hover); border-radius: 6px; padding: 6px 10px; }
section.tenants div.filtered i { color: var(--mt-blue); }

.btn, .md-button { border-radius: 6px; font-size: 14px; font-weight: 500; }
.btn { min-height: 36px; padding: 7px 14px; }
.btn-primary, button.button-create, footer button.button-create,
section a.add button.btn, tab.radius a.add button.btn, section.login button.login {
	color: #fff;
	background: var(--mt-blue);
	border-color: var(--mt-blue);
}
.btn-primary:hover, button.button-create:hover, footer button.button-create:hover,
section a.add button.btn:hover, tab.radius a.add button.btn:hover, section.login button.login:hover {
	color: #fff;
	background: var(--mt-blue-hover);
	border-color: var(--mt-blue-hover);
}
button.button-cancel, footer button.button-cancel, button.button-reset {
	background: var(--mt-surface);
	border: 1px solid var(--mt-border);
	color: var(--mt-muted);
}
button.button-cancel:hover, footer button.button-cancel:hover, button.button-reset:hover {
	background: var(--mt-subtle);
	color: var(--mt-text);
}
.btn-danger, section.tenants button.cancel_all { color: #fff; background: var(--mt-danger-text); border-color: var(--mt-danger-text); }
.btn-danger:hover, section.tenants button.cancel_all:hover { background: #a71639; border-color: #a71639; }
.btn-success { color: #fff; background: var(--mt-success-text); border-color: var(--mt-success-text); }
.btn-success:hover { background: #06663e; border-color: #06663e; }
.btn-warning { color: var(--mt-text); background: #ffe4b4; border-color: #f5ce8b; }
.btn-warning:hover { background: #ffd48a; border-color: #f5ce8b; }
.btn:disabled, .btn.disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Tables and tabs retain their existing column and pane layout. */
section table.table { background: var(--mt-surface); color: var(--mt-text); font-size: 14px; margin-bottom: 0; }
section table.table th { background: var(--mt-subtle); color: var(--mt-muted); font-size: 13px; font-weight: 600; }
section table.table th a { color: inherit; }
section table.table th, section table.table td { border-color: var(--mt-border); padding: 12px; }
section table.table.table-bordered { border: 0; }
section table.table-hover tbody tr:hover { background: var(--mt-canvas); }
section table.table tbody tr.active_row, section table.table tbody tr.active_row:hover { background: var(--mt-selected); }
section.tenants tr.notifications, section.tenants table tr.notification_error { background: var(--mt-subtle); box-shadow: none; }
section.tenants table button { color: var(--mt-muted); }
section table input:not([type="checkbox"]):not([type="radio"]) { min-height: 34px; padding: 5px 8px; }

ul.tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--mt-border); margin-bottom: 22px; }
ul.tabs li a { margin: 0; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--mt-muted); font-size: 14px; font-weight: 500; text-transform: none; }
ul.tabs li a:hover { color: var(--mt-blue); background: var(--mt-canvas); }
ul.tabs li a.active { color: var(--mt-blue); border-bottom-color: var(--mt-blue); }
[sub_header] { margin: 14px 0 4px; padding-bottom: 10px; border-color: var(--mt-border); color: var(--mt-text); font-size: 18px; font-weight: 600; text-transform: none; }
.switch-field label { background: var(--mt-subtle); color: var(--mt-muted); border-color: var(--mt-border); box-shadow: none; }
.switch-field input:checked + label { background: var(--mt-blue); }
.switch-field input:focus-visible + label { outline: 3px solid var(--mt-accent); outline-offset: 2px; }
.multiSelect .checkboxLayer { background: var(--mt-surface); border-color: var(--mt-border); border-radius: 8px; box-shadow: var(--mt-shadow); }
.multiSelect .multiSelectItem:not(.multiSelectItemDisabled):hover,
.multiSelect .multiSelectItemSelected { background: var(--mt-selected); color: var(--mt-text); }
section.tenants md-checkbox.md-checked .md-icon, md-checkbox.md-checked .md-icon { background-color: var(--mt-blue); }
body .md-button.md-primary:not([disabled]) { color: var(--mt-blue); }
body .md-button.md-primary.md-raised:not([disabled]) { background: var(--mt-blue); color: #fff; }
body .md-button.md-primary.md-raised:not([disabled]):hover { background: var(--mt-blue-hover); }
body md-input-container.md-input-focused:not(.md-input-invalid) .md-input { border-color: var(--mt-blue); }
body md-input-container.md-input-focused:not(.md-input-invalid) label { color: var(--mt-blue); }

/* Status colors use darker text variants on light surfaces for readability. */
i.fa-stop, i.fa-trash-alt, i.inactive,
.tenants i.cancelled, .tenants i.failure, .tenants i.error, .tenants i.frozen { color: var(--mt-danger-text); }
i.fa-play, i.active, .tenants i.started, .tenants i.running, .tenants i.success, .tenants i.thawed { color: var(--mt-success-text); }
.tenants i.starting, .tenants i.stopping, .tenants i.cancelling, .tenants i.pending, .tenants i.aborting, .tenants i.freezing { color: var(--mt-warning-text); }
i.fa-refresh, section.reports md-datepicker md-icon { color: var(--mt-blue); }
.alert-danger { background: #fff0f3; color: var(--mt-danger-text); border-color: #ffc4d1; }
.alert-warning { background: #fff7e7; color: var(--mt-warning-text); border-color: #f5ce8b; }
.alert-success { background: #e8faf1; color: var(--mt-success-text); border-color: #a6e8cd; }
.alert-info { background: var(--mt-selected); color: var(--mt-blue-hover); border-color: #c1d9ff; }
.toast-success { background-color: var(--mt-success-text); }
.toast-error { background-color: var(--mt-danger-text); }
.toast-warning { background-color: var(--mt-warning-text); }
.toast-info { background-color: var(--mt-blue-hover); }

/* Bootstrap and Angular Material overlays share the same surfaces. */
.modal-content, md-dialog, div.modal_about, div.popup, div.popover, div.profile_menu {
	background: var(--mt-surface);
	color: var(--mt-text);
	border: 1px solid var(--mt-border);
	border-radius: 12px;
	box-shadow: 0 16px 48px #061a3329;
}
.modal-header, .modal-footer { border-color: var(--mt-border); }
.modal-title, md-dialog h2.md-title { font-size: 18px; font-weight: 600; }
md-dialog md-toolbar { background: var(--mt-navy); color: #fff; }
div.modal-header.type-warning, md-dialog.md-transition-in div.md-header.error, div.popup h2 { background: #fff0f3; color: var(--mt-danger-text); }
.modal-dialog div.warning, md-dialog.md-transition-in div.md-header.warning { background: #fff7e7; color: var(--mt-warning-text); }
md-dialog.md-transition-in div.md-header.prompt { background: var(--mt-selected); color: var(--mt-text); }
md-dialog.md-error-theme md-dialog-actions button.md-button { background: var(--mt-blue) !important; color: #fff !important; }
md-dialog.md-error-theme md-dialog-actions button.md-button.md-primary:hover { background: var(--mt-blue-hover) !important; }
md-dialog.password input[type="password"] { border-bottom-color: var(--mt-blue); }
div.profile_menu div.self-item span.user { color: var(--mt-muted); }
div.profile_menu div.menu-item:hover { background: var(--mt-subtle); }
div.profile_menu div.logout span { color: var(--mt-danger-text); }
div.notification_menu { background: var(--mt-surface); color: var(--mt-text); border: 1px solid var(--mt-border); border-radius: 10px; box-shadow: var(--mt-shadow); }
div.notification_menu div.item:hover { background: var(--mt-subtle); }
div.notification_menu hr { background: var(--mt-border); }

/* Keep the existing theme logo and both password / OIDC sign-in actions. */
section.login {
	grid-column: 1 / -1;
	background: #032540 url("/login-waves.svg") center / cover no-repeat;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 20px;
}
section.login form {
	width: 100%;
	max-width: 420px;
	height: auto;
	padding: 32px;
	grid-template-columns: minmax(0, 1fr);
	justify-items: stretch;
	gap: 16px;
	background: var(--mt-navy-raised);
	border: 1px solid #ffffff26;
	border-radius: 12px;
	box-shadow: 0 24px 64px #00112455;
}
section.login div.logo { place-self: center; }
section.login div.logo img { width: 210px; max-width: 100%; height: auto; }
section.login h2 { color: #fff; font-size: 22px; font-weight: 600; place-self: center; margin: 4px 0 8px; }
section.login button { min-height: 44px; font-size: 14px; font-weight: 600; }
section.login button.login { margin-top: 4px; }
section.login button.oidc { background: var(--mt-surface); border-color: var(--mt-border); color: var(--mt-text); }
section.login button.oidc:hover { background: var(--mt-subtle); border-color: var(--mt-accent); }
section.login span.or { text-align: center; color: #d7e5f5; }

@media (max-width: 900px) {
	body { --mt-sidebar-width: 180px; }
	body > header { grid-template-columns: var(--mt-sidebar-width) 50px minmax(0, 1fr) 100px; }
	body > section:not(.login) { padding: 20px 16px; }
	section > [data-tabs], section > form { padding: 16px; }
	div.table-controls { display: flex; flex-wrap: wrap; justify-content: space-between; }
	div.notification_menu { width: 280px; }
}

@media (max-width: 600px) {
	body > header { grid-template-columns: var(--mt-sidebar-width) 50px minmax(0, 1fr) 90px; }
	body > footer { padding: 8px; gap: 6px; }
	footer .btn { padding-inline: 10px; }
	section div.dialog_header h2 { font-size: 22px; }
	section.login form { padding: 24px; }
	/* Keep dense administration grids usable without changing field ordering. */
	section form tab.pane.active, section:not(.login) > form { min-width: 540px; }
	section > [data-tabs], section:not(.login) > form { overflow-x: auto; }
	div.notification_menu { position: fixed; top: 64px; right: 0; bottom: 0; width: min(340px, calc(100vw - 50px)); z-index: 10; }
	.modal-dialog { max-width: calc(100vw - 24px); margin: 0; }
	div.modal_about, div.popup { width: calc(100vw - 32px); max-width: 600px; }
}
