:root { --brand: #0649a6; --brand-dark: #04357e; --sidebar: #08295a; --line: #d7e1f0; --muted: #63718a; --paper: #f6f9fe; --card: #ffffff; --ink: #122a4c; --red: #c64646; --yellow: #e0a12f; --purple: #4b69b7; }
.app-shell { background: linear-gradient(135deg, #edf4ff 0%, #f9fbff 52%, #e6f0ff 100%); }
.sidebar { background: var(--sidebar); box-shadow: 12px 0 28px #08295a1a; }
.brand-mark { color: #ffffff; }
.brand-mark img { width: 46px; height: 34px; object-fit: contain; filter: none; }
.mobile-brand img { width: 38px; height: 28px; object-fit: contain; }
.nav-link:hover, .nav-link.active, .nav-link.open { background: #ffffff18; border-color: #91b8ef70; }
.nav-link.active { box-shadow: inset 3px 0 #7cb0ff; }
.nav-link.active .nav-icon, .nav-link:hover .nav-icon { color: #b9d5ff; }
.nav-trigger .chevron, .building-select .select-chevron { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; transition: transform .2s ease, background-color .2s ease, border-color .2s ease; }
.nav-trigger .chevron { margin-left: auto; border: 1px solid #9bb6dc42; background: #ffffff0a; }
.nav-trigger .chevron::before, .building-select .select-chevron::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.nav-trigger:hover .chevron, .nav-trigger.open .chevron { color: #d8e7ff; background: #ffffff14; border-color: #9bb6dc70; }
.nav-trigger.open .chevron { transform: rotate(180deg); }
.sidebar-collapse, .primary-button { background: var(--brand); }
.sidebar-collapse { border-color: #8dbaff; }
.topbar { background: #fbfdffdd; }
.page-heading strong, .profile strong { color: var(--brand); }
.round-button { background: #f4f8ff; border-color: #ccddf5; color: var(--brand); }
.notification-button b { background: var(--brand); }
.theme-toggle { background: #e4efff; }
.theme-toggle span:first-child { color: var(--brand); }
.primary-button:hover { background: var(--brand-dark); }
.building-select { border-color: #c8d9f0; color: #526b91; display: inline-flex; align-items: center; gap: 10px; }
.building-select .select-chevron { width: 22px; height: 22px; margin-left: 4px; color: var(--brand); background: #e8f1ff; border: 1px solid #c8daf5; }
.building-select:hover .select-chevron { background: #dceaff; border-color: #a9c5eb; transform: translateY(1px); }
@media (max-width: 760px) { .brand-mark img { width: 40px; height: 30px; }.mobile-brand img { width: 34px; height: 25px; } }

body:has(.login-layout) { background: #f6f9fe; }
.login-layout { color: #122a4c; }
.brand-panel { background: #0649a6; }
.brand-panel .brand img { width: 48px; height: 34px; object-fit: contain; }
.brand-note { color: #dfeaff; }
.form-panel .eyebrow { color: #0649a6; }
.form-panel input:focus { outline-color: #8dbaff; border-color: #0649a6; }
.form-panel button { background: #0649a6; }

body:has(.site-header) { background: #f6f9fe; }
.site-header .brand img { width: 46px; height: 34px; object-fit: contain; }

html.dark { --brand: #71a7ff; --brand-dark: #9bc2ff; --sidebar: #061a3a; --line: #294266; --muted: #a7bad6; --paper: #0b1730; --card: #10213e; --ink: #edf4ff; --red: #ff8e92; --yellow: #ffd071; --purple: #afc4ff; color-scheme: dark; }
html.dark body, html.dark .app-shell { background: #0b1730; color: var(--ink); }
html.dark .app-shell { background: linear-gradient(135deg, #0b1730 0%, #10213e 54%, #0d1b36 100%); }
html.dark .sidebar { background: #061a3a; box-shadow: 12px 0 28px #0000002b; }
html.dark .topbar { background: #10213ee8; border-color: var(--line); }
html.dark .page-heading span, html.dark .profile small, html.dark .building-select, html.dark .footer { color: var(--muted); }
html.dark .round-button, html.dark .building-select, html.dark .theme-toggle { background: #142947; border-color: var(--line); color: var(--ink); }
html.dark .theme-toggle span:first-child { color: var(--muted); }
html.dark .theme-toggle span:last-child { color: #ffd071; }
html.dark .stat-card, html.dark .panel, html.dark .incident-grid article, html.dark .form-section, html.dark .modal, html.dark .customer-tabs button, html.dark .manager-stat { background: var(--card); border-color: var(--line); color: var(--ink); box-shadow: none; }
html.dark .stat-card.patterned { background-image: linear-gradient(135deg, #10213e, #132947), linear-gradient(#294266 1px, transparent 1px), linear-gradient(90deg, #294266 1px, transparent 1px); }
html.dark .panel-heading, html.dark .panel-foot, html.dark .form-section-title, html.dark .modal-header, html.dark .manager-footer, html.dark .building-table th, html.dark .building-table td, html.dark .customer-tabs button { border-color: var(--line); }
html.dark .form-section-title { background: #142947; }
html.dark input, html.dark select, html.dark textarea, html.dark .manager-toolbar input, html.dark .manager-toolbar select, html.dark .manager-footer select { background: #0b1730; color: var(--ink); border-color: var(--line); }
html.dark input::placeholder, html.dark textarea::placeholder { color: #8aa0c2; }
html.dark .modal-secondary, html.dark .catalog-actions button { background: #142947; border-color: var(--line); color: var(--ink); }
html.dark .modal-option { background: #10213e; border-color: var(--line); color: var(--ink); }
html.dark .modal-option small, html.dark .entity-summary, html.dark .form-hint, html.dark .table-muted { color: var(--muted); }
html.dark .building-table tr:hover td, html.dark .manager-toolbar, html.dark .customer-toolbar { background: #142947; }
html.dark .footer { border-color: var(--line); }

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid #7cb0ff;
	outline-offset: 2px;
}
.panel-heading a { display: inline-flex; align-items: center; min-height: 36px; padding-inline: 6px; }
.topbar button, .content-toolbar button { min-height: 40px; }
body.role-staff .grid-wide { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 760px) {
	.sidebar { width: min(280px, 86vw); }
	.nav-link { min-height: 42px; }
	.submenu a { display: flex; align-items: center; min-height: 40px; }
	.modal { width: min(94vw, 720px); max-height: calc(100dvh - 24px); }
	.modal-content { overflow-x: hidden; }
	.form-actions { position: sticky; bottom: 0; z-index: 2; padding-block: 10px; background: var(--card); }
}

@media (max-width: 600px) {
	.form-grid, .grid-three, .grid-wide, .lower-grid { grid-template-columns: minmax(0, 1fr) !important; }
	.asset-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.status-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.topbar-actions { gap: 6px; }
	.profile-button div { display: none; }
	.form-actions { display: grid; grid-template-columns: 1fr; }
	.form-actions button, .form-actions .profile-file { width: 100%; min-height: 44px; }
}