:root {
	--app-primary: #2563eb;
	--app-primary-dark: #1d4ed8;
	--app-sidebar: #2b333d;
	--app-sidebar-end: #252c35;
	--app-bg: #f4f7fa;
	--app-panel: #ffffff;
	--app-text: #242e44;
	--app-muted: #64748b;
	--app-line: #e2e8f0;
	--app-soft: #eff6ff;
	--app-success: #2f9c68;
	--app-warning: #b5814a;
	--app-danger: #c95b59;
	--app-sidebar-width: 220px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
	margin: 0;
	color: var(--app-text);
	background: var(--app-bg);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

a { color: inherit; text-decoration: none; }

.page-container {
	min-height: 100vh;
	background: var(--app-bg);
}

.page-sidebar {
	position: fixed;
	inset: 0 auto 0 0;
	z-index: 1040;
	display: flex;
	width: var(--app-sidebar-width);
	height: 100vh;
	flex-direction: column;
	overflow: hidden;
	color: #e5e7eb;
	background: linear-gradient(180deg, var(--app-sidebar) 0%, var(--app-sidebar-end) 100%);
	box-shadow: 2px 0 12px rgba(15, 23, 42, .08);
}

.sidebar-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 66px;
	padding: 10px 22px 2px;
}

.sidebar-brand img {
	display: block;
	width: 108px;
	max-height: 46px;
	object-fit: contain;
}

.sidebar-module-card {
	display: grid;
	gap: 3px;
	margin: 6px 14px 10px;
	padding: 10px 12px;
	border: 1px solid rgba(255, 255, 255, .08);
	border-radius: 6px;
	background: rgba(255, 255, 255, .045);
	text-align: center;
}

.sidebar-module-card span { color: rgba(226, 232, 240, .66); font-size: 12px; }
.sidebar-module-card strong { color: #fff; font-size: 15px; font-weight: 600; }
.page-sidebar nav { min-height: 0; flex: 1; overflow-y: auto; }
.page-sidebar nav { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .45) transparent; }
.page-sidebar nav::-webkit-scrollbar { width: 5px; }
.page-sidebar nav::-webkit-scrollbar-track { background: transparent; }
.page-sidebar nav::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(148, 163, 184, .38); }

.page-sidebar .accordion-menu {
	display: block;
	margin: 0;
	padding: 0 12px 28px;
	list-style: none;
}

.page-sidebar .accordion-menu .sidebar-title {
	margin: 13px 10px 5px;
	padding: 0;
	color: rgba(148, 163, 184, .74);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
}

.page-sidebar .accordion-menu li a {
	display: flex;
	align-items: center;
	gap: 11px;
	min-height: 43px;
	margin: 1px 0;
	padding: 8px 11px;
	border-radius: 5px;
	color: rgba(226, 232, 240, .86);
	background: transparent;
	font-size: 14px;
	font-weight: 500;
	transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.page-sidebar .accordion-menu li a i { width: 18px; font-size: 16px; text-align: center; }
.page-sidebar .accordion-menu li a:hover { color: #fff; background: rgba(255, 255, 255, .055); }
.page-sidebar .accordion-menu li.active-page a {
	color: #a3ff98;
	background: rgba(255, 255, 255, .055);
	box-shadow: inset 3px 0 0 #83d8ae;
}

.page-content {
	min-height: 100vh;
	margin-left: var(--app-sidebar-width);
	padding: 0;
	background: var(--app-bg);
}

.page-header {
	position: sticky;
	top: 0;
	z-index: 1020;
	height: 70px;
	border-bottom: 1px solid rgba(226, 232, 240, .88);
	background: #fff;
	box-shadow: 0 1px 3px rgba(54, 74, 99, .05);
}

.page-header .navbar { height: 100%; padding: 0 24px; }
.topbar-eyebrow { display: block; color: #94a3b8; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.topbar-title { display: block; color: #1e293b; font-size: 17px; font-weight: 650; line-height: 1.2; }
.logout-form { margin: 0; }
.logout-form .btn { gap: 6px; border-color: #e2e8f0; color: #475569; font-weight: 600; }
.internal-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	padding: 0 11px;
	border: 1px solid rgba(37, 99, 235, .16);
	border-radius: 999px;
	color: var(--app-primary-dark);
	background: rgba(37, 99, 235, .07);
	font-size: 12px;
	font-weight: 650;
}

.current-user { display: inline-flex; align-items: center; gap: 6px; color: #475569; font-size: 12px; font-weight: 600; }
.current-user i { color: #7c91b3; font-size: 17px; }

.topbar-user-menu { position: relative; }
.topbar-user-toggle {
	display: inline-flex;
	height: 36px;
	align-items: center;
	gap: 8px;
	padding: 0 11px;
	border: 1px solid var(--app-line);
	border-radius: 8px;
	color: #475569;
	background: #fff;
	font-size: 13px;
	font-weight: 650;
}
.topbar-user-toggle .bi-person-circle { color: #7c91b3; font-size: 18px; }
.topbar-user-toggle .bi-chevron-down { font-size: 11px; transition: transform .18s ease; }
.topbar-user-menu.open .topbar-user-toggle .bi-chevron-down { transform: rotate(180deg); }
.topbar-user-dropdown {
	position: absolute;
	top: calc(100% + 9px);
	right: 0;
	z-index: 1100;
	display: none;
	width: 210px;
	overflow: hidden;
	border: 1px solid var(--app-line);
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
}
.topbar-user-menu.open .topbar-user-dropdown { display: block; }
.topbar-user-summary { display: grid; gap: 3px; padding: 14px 16px; border-bottom: 1px solid var(--app-line); }
.topbar-user-summary small { color: var(--app-muted); font-size: 11px; }
.topbar-user-summary strong { color: #1e293b; font-size: 14px; }
.topbar-user-dropdown .logout-form button {
	display: flex;
	width: 100%;
	height: 42px;
	align-items: center;
	gap: 9px;
	padding: 0 16px;
	border: 0;
	color: var(--app-danger);
	background: #fff;
	font-size: 13px;
	text-align: left;
}
.topbar-user-dropdown .logout-form button:hover { background: #fff6f6; }

.list-component-pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 18px;
	border-top: 1px solid var(--app-line);
	color: var(--app-muted);
	background: #fff;
	font-size: 12px;
}
.list-page-actions { display: flex; align-items: center; gap: 9px; }
.list-page-number { min-width: 54px; color: #475569; text-align: center; }
.list-component-pager .btn { min-height: 30px; padding: 0 10px; }
.list-component-pager .btn:disabled { cursor: not-allowed; opacity: .48; }
.list-component-pager .btn.disabled { cursor: not-allowed; opacity: .48; pointer-events: none; }

.app-confirm-dialog { position: fixed; inset: 0; z-index: 2000; }
.app-confirm-dialog[hidden] { display: none; }
.app-confirm-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px); }
.app-confirm-card {
	position: relative;
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr);
	gap: 12px;
	width: min(430px, calc(100vw - 32px));
	margin: 16vh auto 0;
	padding: 20px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 26px 70px rgba(15, 23, 42, .28);
}
.app-confirm-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: #b45309; background: #fff7ed; font-size: 18px; }
.app-confirm-card h2 { margin: 1px 0 7px; color: #1e293b; font-size: 17px; }
.app-confirm-message { margin: 0; color: #64748b; font-size: 13px; line-height: 1.65; white-space: pre-line; }
.app-confirm-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 8px; margin-top: 5px; }

.license-entitlement-form { padding-top: 4px; }
.editable-grid input:not([readonly]) { border-color: #cbd5e1; background: #fff; }
.entitlement-switch-field { justify-content: flex-start; }
.entitlement-switch-field .switch-control { min-height: 42px; margin: 0; }
.license-entitlement-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.field-error { color: #b44947 !important; }
.overlay-modal { position: fixed; inset: 0; z-index: 2200; }
.overlay-modal[hidden] { display: none; }
.overlay-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .48); backdrop-filter: blur(2px); }
.overlay-modal-card { position: relative; display: flex; width: min(780px, calc(100vw - 36px)); max-height: min(720px, calc(100vh - 64px)); margin: 32px auto; flex-direction: column; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 28px 80px rgba(15, 23, 42, .3); }
.overlay-modal-card > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; color: #fff; background: #1f2937; }
.overlay-modal-card > header small, .overlay-modal-card > header strong { display: block; }
.overlay-modal-card > header small { margin-bottom: 3px; color: rgba(255, 255, 255, .68); font-size: 9px; letter-spacing: .14em; }
.overlay-modal-card > header strong { font-size: 17px; }
.overlay-modal-close { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 7px; color: #fff; background: rgba(255, 255, 255, .08); }
.overlay-modal-body { min-height: 0; padding: 18px; overflow: auto; background: #f8fafc; }
.change-history-list { display: grid; gap: 10px; }
.change-history-card { padding: 14px 15px; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; }
.change-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.change-history-head strong { color: #273449; font-size: 13px; }
.change-history-head span { color: #94a3b8; font-size: 11px; }
.change-history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.change-history-grid span { display: flex; justify-content: space-between; gap: 8px; color: #64748b; font-size: 12px; }
.change-history-grid b { color: #334155; }

.release-notes-cell { min-width: 240px; max-width: 480px; line-height: 1.55; white-space: pre-line; }

.child-page-dialog { position: fixed; inset: 0; z-index: 1900; }
.child-page-dialog[hidden] { display: none; }
.child-page-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .44); backdrop-filter: blur(2px); }
.child-page-card {
	position: relative;
	display: flex;
	width: min(960px, calc(100vw - 48px));
	height: min(760px, calc(100vh - 72px));
	margin: 36px auto;
	flex-direction: column;
	overflow: hidden;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 28px 80px rgba(15, 23, 42, .3);
}
.child-page-card > header { display: flex; height: 54px; flex: 0 0 54px; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--app-line); }
.child-page-title { font-size: 16px; }
.child-page-close { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 7px; color: #64748b; background: transparent; }
.child-page-close:hover { background: #f1f5f9; }
.child-page-open { overflow: hidden; }
.child-page-content { min-height: 0; flex: 1; overflow: auto; padding: 20px; background: var(--app-bg); }
.child-page-loading, .child-page-error { display: flex; min-height: 240px; align-items: center; justify-content: center; gap: 10px; color: var(--app-muted); }
.child-page-error { flex-direction: column; text-align: center; }
.child-page-error > i { color: #dc2626; font-size: 28px; }
.child-page-error > strong { color: #334155; font-size: 16px; }
.embedded-page { min-height: 100vh; background: var(--app-bg); }
.embedded-main { padding: 0; }
.embedded-title { margin-bottom: 16px; }
.embedded-title h1 { margin: 0; color: #1e293b; font-size: 21px; }
.embedded-title p { margin: 6px 0 0; color: var(--app-muted); font-size: 13px; }
.embedded-form-panel { padding: 20px; }
.embedded-actions { position: sticky; bottom: -20px; margin: 20px -20px -20px; padding: 14px 20px; border-top: 1px solid var(--app-line); background: #fff; }
body.embedded-page .page-sidebar, body.embedded-page .page-header, body.embedded-page .sidebar-backdrop { display: none !important; }
body.embedded-page .page-content { min-height: 0; margin-left: 0; }
body.embedded-page .main-wrapper { padding: 20px; }

@media (max-width: 720px) {
	.child-page-card { width: 100vw; height: 100vh; margin: 0; border-radius: 0; }
	.child-page-content { padding: 14px; }
	.list-component-pager { align-items: stretch; flex-direction: column; }
	.list-page-actions { justify-content: space-between; }
}

.sidebar-mobile-toggle {
	display: none;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid var(--app-line);
	border-radius: 9px;
	color: #475569;
	background: #fff;
	font-size: 21px;
}

.sidebar-backdrop { display: none; }

.main-wrapper {
	width: auto;
	max-width: none;
	margin: 0;
	padding: 24px;
	overflow: visible;
}

.page-title {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 20px;
}

.page-title h1 { margin: 0; color: #1e293b; font-size: 25px; font-weight: 650; }
.page-title p { margin: 6px 0 0; color: var(--app-muted); font-size: 14px; }

.stats-grid, .cards-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.stat-card, .panel, .form-panel, .card-link {
	border: 1px solid rgba(226, 232, 240, .92);
	border-radius: 8px;
	background: var(--app-panel);
	box-shadow: 0 8px 24px rgba(15, 23, 42, .045);
}

.stat-card { position: relative; display: flex; min-height: 142px; align-items: center; gap: 18px; overflow: hidden; padding: 22px; }
.stat-card::after {
	position: absolute;
	top: 0;
	right: 0;
	width: 100%;
	height: 3px;
	border-radius: 0;
	background: linear-gradient(90deg, #86c1ed, #5577f2);
	content: "";
}
.stat-card span { color: var(--app-muted); font-size: 13px; font-weight: 550; }
.stat-card strong { display: block; margin-top: 4px; color: #1e293b; font-size: 30px; font-weight: 650; line-height: 1.15; }
.stat-card small { display: block; margin-top: 6px; color: #94a3b8; font-size: 11px; }
.stat-icon { display: inline-grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 10px; font-size: 21px; }
.stat-icon.warning { color: #a56b25; background: #fff5e5; }
.stat-icon.success { color: #27825a; background: #e9f8f1; }
.stat-icon.primary { color: #4667df; background: #eef3ff; }

.quick-links-grid { margin-top: 16px; }
.card-link { display: flex; min-height: 96px; align-items: center; gap: 13px; padding: 18px; transition: transform .18s ease, box-shadow .18s ease; }
.card-link:hover { color: inherit; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15, 23, 42, .08); }
.card-link > i:first-child { display: inline-grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 8px; color: #5577f2; background: #eef3ff; font-size: 17px; }
.card-link > div { min-width: 0; flex: 1; }
.card-link > i:last-child { color: #b7c2d0; font-size: 14px; }
.card-link strong { display: block; margin-bottom: 5px; color: #1e293b; font-size: 15px; }
.card-link span, .muted { color: var(--app-muted); }

.panel { overflow: hidden; }
.panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 15px 18px;
	border-bottom: 1px solid var(--app-line);
}

.tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.table-wrap { width: 100%; overflow-x: auto; }

.tab, .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 0 13px;
	border: 1px solid #dbe4ef;
	border-radius: 7px;
	color: #475569;
	background: #fff;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.btn { width: auto; gap: 6px; }

.tab:hover, .btn:hover { color: var(--app-primary-dark); border-color: #bfdbfe; background: #f8fbff; }
.tab.active, .btn.primary { color: #fff; border-color: var(--app-primary); background: var(--app-primary); }
.tab.active:hover, .btn.primary:hover { color: #fff; background: var(--app-primary-dark); }
.btn.danger { color: #b91c1c; border-color: #fecaca; background: #fffafa; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.icon-button { width: 40px !important; height: 40px; flex: 0 0 40px; padding: 0; }

.tab-count {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	margin-left: 6px;
	padding: 0 5px;
	border-radius: 999px;
	color: var(--app-primary-dark);
	background: var(--app-soft);
	font-size: 11px;
}
.tab.active .tab-count { color: var(--app-primary-dark); background: #fff; }

.inline-actions { display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; }
.action-form { margin: 0; }
.form-actions { display: flex; align-items: center; gap: 9px; margin-top: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--app-line); text-align: left; vertical-align: top; font-size: 13px; }
th { color: #64748b; background: #f8fafc; font-size: 12px; font-weight: 650; white-space: nowrap; }
tbody tr { transition: background-color .14s ease; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }

.badge {
	display: inline-flex;
	align-items: center;
	min-height: 25px;
	padding: 0 9px;
	border-radius: 999px;
	color: #4667df;
	background: #eef3ff;
	font-size: 11px;
	font-weight: 650;
}
.badge.paid { color: #237d53; background: #e6f7ef; }
.badge.service { color: #94672f; background: #fff6e8; }
.badge.disabled { color: #b44947; background: #fce6e6; }

.money { color: var(--app-success); font-weight: 650; }
.code-text {
	display: inline-block;
	max-width: 320px;
	padding: 3px 7px;
	border-radius: 5px;
	color: #355261;
	background: #e9f0f2;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	white-space: normal;
	word-break: break-all;
}

.form-panel { padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 7px; color: #334155; font-size: 13px; font-weight: 600; }
.form-row input, .form-row select, .form-row textarea {
	width: 100%;
	min-height: 40px;
	padding: 9px 11px;
	border: 1px solid #dbe4ef;
	border-radius: 7px;
	color: var(--app-text);
	background: #fff;
	font: inherit;
	font-size: 14px;
	outline: none;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
	border-color: #86c1ed;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .09);
}
.form-section-title { margin: 0 0 18px; color: #1e293b; font-size: 18px; font-weight: 650; }
.plan-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plan-description-row { grid-column: span 4; }
.field-error { display: block; min-height: 18px; margin-top: 5px; color: var(--app-danger); font-size: 12px; }
.checkbox-line { display: flex !important; align-items: center; gap: 8px; min-height: 40px; }
.checkbox-line input { width: auto; min-height: auto; }

.message {
	margin-bottom: 14px;
	padding: 11px 13px;
	border: 1px solid #ccebdc;
	border-radius: 7px;
	color: #237d53;
	background: #eefaf5;
	font-size: 13px;
}
.message.error { color: #a94442; border-color: #f4cccc; background: #fff1f1; }
.message.error div + div { margin-top: 4px; }
.issue-meta { margin-top: 5px; color: var(--app-muted); font-size: 11px; }
.empty { padding: 28px; color: var(--app-muted); text-align: center; }

.management-title { align-items: center; }
.management-title .btn { gap: 7px; min-height: 38px; padding-inline: 16px; }
.management-panel { overflow: visible; }
.management-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--app-line); }
.search-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.search-input { position: relative; width: min(36vw, 380px); }
.search-input i { position: absolute; top: 50%; left: 12px; z-index: 1; color: #94a3b8; transform: translateY(-50%); }
.search-input input { width: 100%; min-height: 36px; padding: 7px 12px 7px 36px; border: 1px solid #dbe4ef; border-radius: 7px; outline: none; font-size: 13px; }
.search-input input:focus { border-color: #86c1ed; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.toolbar-select { min-height: 36px; padding: 7px 30px 7px 11px; border: 1px solid #dbe4ef; border-radius: 7px; color: #475569; background: #fff; font: inherit; font-size: 13px; outline: none; }
.toolbar-select:focus { border-color: #86c1ed; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.result-count { color: var(--app-muted); font-size: 12px; white-space: nowrap; }
.result-count strong { color: var(--app-text); }
.management-table th, .management-table td { vertical-align: middle; }
.management-table .actions-column { width: 132px; text-align: right; }
.management-table td:last-child { text-align: right; }
.user-cell { display: flex; align-items: center; gap: 11px; min-width: 155px; }
.user-avatar { display: inline-grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #86c1ed, #5577f2); font-size: 14px; font-weight: 700; }
.user-cell strong, .user-cell span, .contact-cell span, .contact-cell small { display: block; }
.user-cell strong { color: #273449; font-size: 13px; }
.user-cell div > span, .contact-cell small { margin-top: 3px; color: #94a3b8; font-size: 11px; }
.contact-cell span { color: #475569; font-size: 12px; }
.role-tags { display: flex; max-width: 260px; gap: 5px; flex-wrap: wrap; }
.role-tag { display: inline-flex; min-height: 23px; align-items: center; padding: 0 8px; border: 1px solid #dbeafe; border-radius: 6px; color: #4667df; background: #f4f7ff; font-size: 11px; font-weight: 600; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; color: #64748b; font-size: 12px; font-weight: 600; }
.status-dot::before { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; content: ""; box-shadow: 0 0 0 3px rgba(148, 163, 184, .14); }
.status-dot.enabled { color: #237d53; }
.status-dot.enabled::before { background: #38a169; box-shadow: 0 0 0 3px rgba(56, 161, 105, .14); }
.status-dot.disabled { color: #a94442; }
.status-dot.disabled::before { background: #dc6b68; box-shadow: 0 0 0 3px rgba(220, 107, 104, .14); }
.table-actions { justify-content: flex-end; }
.icon-action { display: inline-grid; width: 31px; height: 31px; padding: 0; place-items: center; border: 1px solid #dbe4ef; border-radius: 7px; color: #64748b; background: #fff; font-size: 14px; cursor: pointer; }
.icon-action:hover { color: var(--app-primary-dark); border-color: #bfdbfe; background: #f8fbff; }
.icon-action.danger { color: #b44947; }
.role-name-cell { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.role-icon { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; color: #4667df; background: #eef3ff; font-size: 16px; }
.role-name-cell strong { color: #273449; }
.permission-count { color: #64748b; font-size: 12px; }
.permission-count strong { color: #4667df; font-size: 15px; }

.management-modal .modal-dialog { margin-top: 38px; }
.management-modal .modal-content { overflow: hidden; border: 0; border-radius: 12px; box-shadow: 0 24px 70px rgba(15, 23, 42, .22); }
.management-modal .modal-header { align-items: flex-start; padding: 19px 22px; border-bottom-color: var(--app-line); }
.management-modal .modal-title { margin: 2px 0 0; color: #fff; font-size: 19px; font-weight: 650; }
.management-modal .modal-header .btn-close { opacity: .72; filter: brightness(0) invert(1); }
.management-modal .modal-header .btn-close:hover { opacity: 1; }
.modal-eyebrow { color: rgba(255, 255, 255, .72); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.management-modal .modal-body { padding: 22px; background: #fbfcfe; }
.management-modal .modal-footer { padding: 14px 22px; border-top-color: var(--app-line); background: #fff; }
.management-modal .form-row label em { color: #dc6b68; font-style: normal; }
.management-modal .form-row small { display: block; margin-top: 5px; color: #94a3b8; font-size: 11px; }
.management-modal .form-row { margin-bottom: 4px; }
.status-field .switch-control { margin-top: 1px; }
.role-selector, .permission-selector { margin-top: 20px; padding: 17px; border: 1px solid var(--app-line); border-radius: 9px; background: #fff; }
.selector-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.selector-heading strong, .selector-heading span { display: block; }
.selector-heading strong { color: #273449; font-size: 14px; }
.selector-heading span { margin-top: 4px; color: #94a3b8; font-size: 11px; }
.role-option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.role-option { display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 9px 11px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fafcff; cursor: pointer; }
.role-option:has(input:checked) { border-color: #bfdbfe; background: #eff6ff; }
.role-option input, .permission-options input, .permission-group header input, .select-all-control input { accent-color: var(--app-primary); }
.role-option strong, .role-option small { display: block; }
.role-option strong { color: #334155; font-size: 12px; }
.role-option small { margin-top: 2px; color: #94a3b8; font-size: 10px; }
.role-basic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.role-description { grid-column: span 2; }
.role-description textarea { min-height: 70px; }
.select-all-control { display: flex; align-items: center; gap: 6px; color: #475569; font-size: 12px; font-weight: 600; cursor: pointer; }
.permission-group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.permission-group { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 8px; }
.permission-group header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.permission-group header label { display: flex; align-items: center; gap: 7px; margin: 0; color: #334155; font-size: 12px; font-weight: 650; cursor: pointer; }
.permission-group header small { color: #94a3b8; font-size: 10px; }
.permission-options { display: grid; gap: 0; padding: 5px 10px; }
.permission-options > label { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 2px; cursor: pointer; }
.permission-options > label + label { border-top: 1px dashed #edf1f5; }
.permission-options input { margin-top: 3px; }
.permission-options strong, .permission-options small { display: block; }
.permission-options strong { color: #475569; font-size: 11px; font-weight: 600; }
.permission-options small { margin-top: 2px; color: #94a3b8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }

.contact-message-table { min-width: 1120px; }
.contact-message-table .actions-column { width: 72px; }
.contact-message-summary { display: block; width: min(28vw, 330px); overflow: hidden; color: #64748b; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.contact-message-time { white-space: nowrap; }
.contact-message-detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
.contact-message-requirement p { margin: 0; color: #334155; font-size: 13px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.contact-message-modal-footer { justify-content: space-between; }
.contact-status-form { display: flex; align-items: center; gap: 9px; margin: 0; }
.contact-status-form label { margin: 0; color: #64748b; font-size: 12px; font-weight: 600; }
.contact-status-form select { min-height: 34px; padding: 6px 30px 6px 10px; border: 1px solid #dbe4ef; border-radius: 7px; color: #334155; background: #fff; font: inherit; font-size: 13px; }

.detail-panel { margin-bottom: 18px; }
.license-property-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.license-property-field { display: block; min-width: 0; margin: 0; }
.license-property-field.span-2 { grid-column: span 2; }
.license-property-field.full { grid-column: 1 / -1; }
.license-property-field > span { display: block; margin-bottom: 7px; color: #64748b; font-size: 12px; font-weight: 600; }
.license-property-field input, .license-property-field textarea {
	width: 100%;
	min-height: 40px;
	padding: 9px 11px;
	border: 1px solid #dbe4ef;
	border-radius: 7px;
	color: #334155;
	background: #f8fafc;
	font: inherit;
	font-size: 13px;
	outline: none;
}
.license-property-field textarea { min-height: 86px; resize: vertical; }
.license-property-field input[readonly], .license-property-field textarea[readonly] { cursor: text; }
.license-property-field .code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.credential-panel-body { padding: 18px; }
.credential-panel-body > .message { margin-bottom: 14px; }
.credential-field { margin-bottom: 14px; }
.credential-input-group { display: flex; align-items: center; gap: 8px; }
.credential-input-group input { min-width: 0; flex: 1; color: #1e3a5f; background: #f4f8ff; }
.credential-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.credential-actions { display: flex; align-items: center; gap: 9px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--app-line); }
.credential-actions form { margin: 0; }
.credential-action-note { margin-left: auto; color: #b45309; font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; padding: 18px; }
.detail-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
.detail-item { min-width: 0; padding: 12px; border: 1px solid var(--app-line); border-radius: 7px; background: #f8fafc; }
.detail-item.wide { grid-column: span 3; }
.detail-item span { display: block; margin-bottom: 7px; color: var(--app-muted); font-size: 11px; font-weight: 600; }
.detail-item strong { display: block; color: var(--app-text); font-size: 13px; word-break: break-word; }
.device-config { max-height: 180px; margin: 8px 0 0; padding: 9px; overflow: auto; border-radius: 7px; color: #355261; background: #e9f0f2; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.detail-config { max-height: 220px; margin: 0; }
.activation-history { display: grid; gap: 13px; padding: 18px; }
.activation-card { padding: 14px; border: 1px solid var(--app-line); border-radius: 8px; background: #fff; }
.activation-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: #334155; }
.activation-title span { color: var(--app-muted); font-size: 12px; }

.setting-panel { max-width: 900px; }

.installation-package-selection {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 12px;
	padding: 12px 14px;
	border: 1px solid #dbe6f2;
	border-radius: 7px;
	background: #f8fbff;
}

.installation-package-selection[hidden] {
	display: none;
}

.installation-package-selection > i {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	border-radius: 7px;
	color: var(--app-primary);
	background: #eaf2ff;
	font-size: 19px;
}

.installation-package-selection > div {
	min-width: 0;
}

.installation-package-selection strong,
.installation-package-selection span {
	display: block;
}

.installation-package-selection strong {
	overflow: hidden;
	color: #26344d;
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.installation-package-selection span {
	margin-top: 3px;
	color: var(--app-muted);
	font-size: 12px;
}

.installation-package-progress {
	margin-top: 16px;
	padding: 15px 16px;
	border: 1px solid #dbe6f2;
	border-radius: 7px;
	background: #f8fbff;
}

.installation-package-progress[hidden] {
	display: none;
}

.installation-package-progress-head,
.installation-package-progress-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.installation-package-progress-head {
	margin-bottom: 10px;
	color: #334155;
	font-size: 13px;
	font-weight: 650;
}

.installation-package-progress-head strong {
	color: var(--app-primary-dark);
	font-size: 14px;
}

.installation-package-progress-track {
	position: relative;
	height: 9px;
	overflow: hidden;
	border-radius: 999px;
	background: #dfe8f3;
}

.installation-package-progress-track > span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #2563eb, #60a5fa);
	box-shadow: 0 0 14px rgba(37, 99, 235, .28);
	transition: width .18s ease;
}

.installation-package-progress-meta {
	margin-top: 8px;
	color: var(--app-muted);
	font-size: 11px;
}

.installation-package-progress.processing .installation-package-progress-track > span,
.installation-package-progress.indeterminate .installation-package-progress-track > span {
	position: relative;
	overflow: hidden;
}

.installation-package-progress.processing .installation-package-progress-track > span::after,
.installation-package-progress.indeterminate .installation-package-progress-track > span::after {
	position: absolute;
	inset: 0;
	content: "";
	background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .7) 50%, transparent 80%);
	animation: installation-package-progress-shine 1.1s linear infinite;
}

.installation-package-progress.indeterminate .installation-package-progress-track > span {
	width: 45% !important;
	animation: installation-package-progress-indeterminate 1.2s ease-in-out infinite;
}

.installation-package-progress.complete {
	border-color: #bce5ce;
	background: #f0fbf5;
}

.installation-package-progress.complete .installation-package-progress-head strong {
	color: var(--app-success);
}

.installation-package-progress.complete .installation-package-progress-track > span {
	background: linear-gradient(90deg, #2f9c68, #5fc58f);
}

.installation-package-progress.failed {
	border-color: #efcccc;
	background: #fff6f6;
}

.installation-package-progress.failed .installation-package-progress-head span,
.installation-package-progress.failed .installation-package-progress-head strong {
	color: var(--app-danger);
}

@keyframes installation-package-progress-shine {
	from { transform: translateX(-100%); }
	to { transform: translateX(100%); }
}

@keyframes installation-package-progress-indeterminate {
	from { transform: translateX(-100%); }
	to { transform: translateX(230%); }
}
.setting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.setting-row strong { display: block; margin-bottom: 9px; color: #1e293b; font-size: 17px; }
.setting-row p { margin: 5px 0; color: var(--app-muted); line-height: 1.65; }
.switch-control { display: flex; align-items: center; gap: 9px; min-width: 126px; cursor: pointer; font-weight: 600; }
.switch-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #cbd5e1; transition: .2s ease; }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .18); content: ""; transition: .2s ease; }
.switch-control input:checked + .switch-track { background: var(--app-primary); }
.switch-control input:checked + .switch-track::after { transform: translateX(20px); }
.setting-note { margin-top: 18px; padding: 11px 13px; border-radius: 7px; color: #94672f; background: #fff6e8; font-size: 12px; }

.login-page {
	display: grid;
	min-height: 100vh;
	place-items: center;
	padding: 24px;
	background: #243b55;
	background-image: radial-gradient(circle at 16% 14%, rgba(3, 233, 244, .16), transparent 28%), linear-gradient(135deg, #141e30, #243b55);
}
.login-card {
	width: min(92vw, 420px);
	padding: 34px;
	border: 1px solid rgba(3, 233, 244, .18);
	border-radius: 20px;
	color: #fff;
	background: #141e30;
	box-shadow: 0 18px 55px rgba(0, 0, 0, .48);
}
.login-brand { display: grid; justify-items: center; margin-bottom: 24px; text-align: center; }
.login-brand img { width: 150px; max-height: 64px; margin-bottom: 14px; object-fit: contain; }
.login-brand h1 { margin: 0; color: #fff; font-size: 23px; font-weight: 600; }
.login-brand p { margin: 7px 0 0; color: rgba(255, 255, 255, .58); font-size: 12px; }
.login-card .form-row label { color: rgba(255, 255, 255, .72); }
.login-card .form-row input { color: #fff; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .52); border-radius: 0; background: transparent; }
.login-card .form-row input:focus { border-color: #03e9f4; box-shadow: none; }
.login-card .btn.primary { width: 100%; min-height: 42px; margin-top: 8px; border-color: #2563eb; }

/* Isolate the order shell from the platform theme's global collapsed-sidebar and fixed-button rules. */
body:not(.sidebar-hidden) .page-sidebar,
body.sidebar-hidden .page-sidebar {
	width: var(--app-sidebar-width) !important;
	transform: none !important;
	transform-origin: left center;
	overflow: hidden !important;
	z-index: 1040 !important;
}

.page-content {
	padding: 0 !important;
	transform: none !important;
}

.page-header {
	right: auto !important;
	width: 100% !important;
	margin: 0 !important;
}

.page-header .navbar { display: flex !important; }
.page-header .navbar .container-fluid { min-width: 0; padding: 0; }
.page-header .navbar .container-fluid > .d-flex { min-width: 0; }
.page-header .navbar .container-fluid > .d-flex:last-child { flex: 0 0 auto; }
.logout-form, .logout-button, .management-title > .btn, .page-title > .btn { flex: 0 0 auto; }
.logout-button span { display: inline; }
.btn { width: auto !important; min-width: 0; }
.main-wrapper { min-height: calc(100vh - 70px); }
.page-title > div { min-width: 0; }
.form-row input[type="checkbox"], .form-row input[type="radio"] { min-height: 0; }

@media (max-width: 1199.98px) {
	.plan-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.plan-description-row { grid-column: span 2; }
}

@media (max-width: 991.98px) {
	body:not(.sidebar-hidden) .page-sidebar,
	body.sidebar-hidden .page-sidebar { transform: translateX(-100%) !important; transition: transform .22s ease; }
	.page-content { margin-left: 0 !important; }
	body.sidebar-mobile-open:not(.sidebar-hidden) .page-sidebar,
	body.sidebar-mobile-open.sidebar-hidden .page-sidebar { transform: translateX(0) !important; }
	.sidebar-mobile-open .sidebar-backdrop { position: fixed; inset: 0; z-index: 1035; display: block; background: rgba(15, 23, 42, .5); }
	.sidebar-mobile-toggle { display: inline-grid; place-items: center; }
	.main-wrapper { padding: 22px 18px; }
	.page-header .navbar { padding: 0 18px; }
	.stats-grid, .cards-grid { grid-template-columns: 1fr; }
	.detail-grid, .detail-grid.compact { grid-template-columns: 1fr; }
	.detail-item.wide { grid-column: auto; }
	.license-property-grid, .credential-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.role-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
	.internal-badge { display: none; }
	.page-title { align-items: flex-start; flex-direction: column; }
	.form-grid, .plan-form-grid { grid-template-columns: 1fr; }
	.plan-description-row { grid-column: auto; }
	.setting-row { flex-direction: column; }
	.inline-actions { flex-wrap: wrap; }
	.license-property-grid, .credential-meta-grid { grid-template-columns: 1fr; }
	.license-property-field.span-2, .license-property-field.full { grid-column: auto; }
	.credential-actions { align-items: stretch; flex-direction: column; }
	.credential-actions form, .credential-actions .btn { width: 100% !important; }
	.credential-action-note { margin-left: 0; text-align: center; }
	.current-user { display: none; }
	.management-toolbar { align-items: stretch; flex-direction: column; }
	.search-form { align-items: stretch; flex-wrap: wrap; }
	.search-input { width: 100%; }
	.role-option-grid, .permission-group-grid, .role-basic-grid { grid-template-columns: 1fr; }
	.role-description { grid-column: auto; }
	.topbar-eyebrow { display: none; }
	.page-header { height: 62px; }
	.main-wrapper { min-height: calc(100vh - 62px); padding: 18px 14px; }
	.page-title h1 { font-size: 22px; }
	.page-title p { font-size: 13px; }
	.management-modal .modal-dialog { margin: 10px; }
	.management-modal .modal-body { padding: 16px; }
	.management-modal .modal-header, .management-modal .modal-footer { padding-inline: 16px; }
	.contact-message-modal-footer, .contact-status-form { align-items: stretch; flex-direction: column; }
	.contact-message-modal-footer .btn, .contact-status-form .btn, .contact-status-form select { width: 100% !important; }
}

@media (max-width: 479.98px) {
	.logout-button span { display: none; }
	.logout-button { width: 36px !important; padding: 0 !important; }
	.current-user { display: none; }
	.stats-grid, .cards-grid { gap: 12px; }
	.stat-card { min-height: 120px; padding: 17px; }
	.management-title > .btn, .page-title > .btn { width: 100% !important; }
	.search-form .btn { flex: 1 1 auto; }
}
