:root {
    color-scheme: light;
    --navy: #0c1b2a;
    --navy-soft: #122638;
    --ink: #182b3a;
    --muted: #7c8b96;
    --line: #e3e9e9;
    --teal: #20b89a;
    --teal-dark: #138a76;
    --paper: #fbfcfa;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-width: 320px;
    background: var(--paper);
    color: var(--ink);
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: #096b5d; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, 1fr) minmax(480px, 1fr); }
.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    overflow: hidden;
    padding: 42px clamp(38px, 6vw, 92px) 36px;
    color: #fff;
    background: radial-gradient(ellipse at 83% 70%, rgba(27, 93, 91, .30), transparent 42%), var(--navy);
}
.brand, .dashboard-brand { display: inline-flex; align-items: center; gap: 13px; width: fit-content; color: #f5faf9; font: 600 12px "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: .13em; }
.brand strong { color: #84d6c0; font-weight: 600; }
.brand-mark { display: inline-flex; gap: 3px; align-items: end; height: 27px; width: 27px; padding: 5px 4px; border: 1px solid rgba(125, 218, 191, .45); border-radius: 8px; transform: rotate(45deg); }
.brand-mark span { display: block; width: 4px; background: #66d0ad; border-radius: 4px; transform: rotate(-45deg); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 13px; opacity: .82; }
.brand-mark span:nth-child(3) { height: 18px; }
.brand-copy { position: relative; z-index: 1; max-width: 540px; padding: 0 0 4vh; }
.eyebrow { margin: 0 0 17px; color: #73cbb1; font: 700 10px "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: .17em; }
.brand-copy h1 { margin: 0 0 21px; font: 600 clamp(35px, 4vw, 55px)/1.15 "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: -.045em; }
.brand-copy h1 em { color: #65cdb0; font-style: normal; }
.brand-copy > p:last-child { max-width: 430px; margin: 0; color: #a2b2bc; font-size: 15px; line-height: 1.8; }
.brand-footer { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: #91a2ad; font: 600 9px "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: .1em; }
.live-dot { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #4ad0a4; box-shadow: 0 0 0 4px rgba(74, 208, 164, .12); }
.footer-separator { color: #526674; }
.contour { position: absolute; border: 1px solid rgba(78, 160, 148, .12); border-radius: 50%; pointer-events: none; }
.contour-one { width: 660px; height: 660px; right: -390px; bottom: -200px; }
.contour-two { width: 500px; height: 500px; right: -310px; bottom: -115px; }
.form-panel { display: flex; flex-direction: column; justify-content: center; position: relative; min-height: 100vh; padding: 72px clamp(38px, 8vw, 128px) 78px; }
.form-wrap { width: 100%; max-width: 390px; margin: auto; }
.form-heading { margin-bottom: 31px; }
.form-heading .eyebrow { margin-bottom: 11px; color: #178f7c; font-size: 9px; }
.form-heading h2 { margin: 0 0 8px; color: var(--ink); font: 700 30px/1.25 "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: -.04em; }
.form-heading > p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
form label { display: block; margin: 18px 0 7px; color: #334654; font-size: 12px; font-weight: 600; }
input:not([type=hidden]) { display: block; width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px; outline: none; background: #fff; color: var(--ink); font: 13px "Avenir Next", Avenir, "Segoe UI", sans-serif; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: #aab5bb; }
input:focus { border-color: #57bfa4; box-shadow: 0 0 0 3px rgba(32, 184, 154, .12); }
.form-row { display: flex; justify-content: space-between; margin: 12px 0 22px; font-size: 11px; }
.form-row a, .switch a { font-weight: 600; }
form button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 48px; margin-top: 24px; border: 0; border-radius: 7px; background: var(--teal); color: #062c29; cursor: pointer; font: 700 13px "Avenir Next", Avenir, "Segoe UI", sans-serif; transition: background .15s, transform .15s; }
form button:hover { background: #36c9a8; transform: translateY(-1px); }
form button span { font-size: 17px; }
.switch { margin: 22px 0 0; color: #7c8b96; text-align: center; font-size: 12px; }
.security-note { display: flex; justify-content: center; gap: 7px; margin: 39px 0 0; color: #9aa6aa; font-size: 10px; }
.security-note span { color: #2ba98e; font-size: 13px; }
.notice { margin: 0 0 20px; padding: 12px 14px; border: 1px solid #b9e5d7; border-radius: 7px; background: #effaf5; color: #246d58; font-size: 12px; line-height: 1.6; }
.field-error, .invalid-link { margin: 0 0 12px; color: #ad3d3d; font-size: 12px; line-height: 1.5; }
.form-footer { position: absolute; right: 24px; bottom: 27px; left: 24px; color: #a1aaac; text-align: center; font-size: 10px; }
.form-footer span { padding: 0 7px; color: #52b79d; }
.mobile-brand { display: none; }
.dashboard-body { min-height: 100vh; background: #f5f8f6; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; padding: 22px max(28px, calc((100vw - 1080px) / 2)); background: var(--navy); }
.dashboard-header form { margin: 0; }
.logout-button { width: auto; height: auto; margin: 0; padding: 10px 17px; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #e6f1ee; font-size: 12px; }
.logout-button:hover { background: rgba(255,255,255,.1); }
.dashboard-content { max-width: 1080px; margin: 0 auto; padding: 90px 28px; }
.dashboard-content h1 { margin: 0 0 13px; font: 700 36px "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: -.04em; }
.dashboard-message { color: var(--muted); }
.dashboard-card { display: flex; align-items: center; gap: 14px; max-width: 470px; margin-top: 40px; padding: 20px; border: 1px solid #e3e9e6; border-radius: 10px; background: #fff; }
.dashboard-card strong { font-size: 13px; }
.dashboard-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.scope-section { max-width: 650px; margin-top: 42px; }
.scope-section h2, .admin-section h2 { margin: 0; color: var(--ink); font: 700 19px "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: -.02em; }
.scope-list, .region-list { margin: 16px 0 0; padding: 0; list-style: none; }
.scope-list li, .region-list li { display: flex; justify-content: space-between; gap: 14px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: #fff; font-size: 12px; }
.scope-list li:first-child, .region-list li:first-child { border-radius: 7px 7px 0 0; }
.scope-list li:last-child, .region-list li:last-child { border-bottom: 0; border-radius: 0 0 7px 7px; }
.scope-list li span, .region-list small { color: var(--muted); font-size: 11px; }
.scope-hint { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.admin-link { display: inline-flex; align-items: center; gap: 12px; margin-top: 28px; padding: 13px 18px; border-radius: 7px; background: #dff5ed; color: #126954; font-size: 12px; font-weight: 700; }
.admin-link:hover { background: #d0efe4; color: #0d5949; }
.admin-content { max-width: 1120px; margin: 0 auto; padding: 62px 28px 80px; }
.admin-content > h1, .access-denied h1 { margin: 0 0 12px; font: 700 32px "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: -.04em; }
.admin-content > .dashboard-message { max-width: 700px; margin: 0 0 30px; line-height: 1.7; }
.admin-section { margin-top: 30px; padding: 25px; border: 1px solid #e3e9e6; border-radius: 10px; background: #fff; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
.section-heading .eyebrow { margin-bottom: 6px; color: var(--teal-dark); }
.admin-section h2 span { margin-left: 5px; color: #8a999f; font: 500 12px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.user-list { display: grid; gap: 14px; }
.user-card { margin: 0; padding: 19px; border: 1px solid #e5ebea; border-radius: 8px; }
.user-identity { display: flex; align-items: center; gap: 12px; }
.avatar { display: grid; flex: 0 0 37px; width: 37px; height: 37px; place-items: center; border-radius: 50%; background: #e3f5ef; color: #138a76; font-size: 14px; font-weight: 700; }
.user-identity > div:nth-child(2) { min-width: 0; flex: 1; }
.user-identity strong { font-size: 13px; }
.user-identity p { overflow: hidden; margin: 4px 0 0; color: var(--muted); text-overflow: ellipsis; font-size: 11px; }
.status-badge { padding: 6px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-pending { background: #fff4df; color: #92630f; }
.status-active { background: #e6f6ee; color: #237b55; }
.status-suspended { background: #fcebea; color: #a74844; }
.user-access-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 15px; }
.user-card label, .region-form label { margin: 0 0 6px; color: #536671; font-size: 11px; }
.user-card select, .region-form select { display: block; width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; outline: none; background: #fff; color: var(--ink); font: 12px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.user-card select:focus, .region-form select:focus { border-color: #57bfa4; box-shadow: 0 0 0 3px rgba(32, 184, 154, .12); }
.region-picker { margin: 16px 0 0; padding: 13px; border: 1px solid #e8edeb; border-radius: 6px; }
.region-picker legend { padding: 0 5px; color: #536671; font-size: 11px; font-weight: 600; }
.region-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; }
.region-option { display: flex; align-items: center; gap: 7px; min-height: 30px; cursor: pointer; }
.region-option input { accent-color: var(--teal-dark); }
.region-option span { font-size: 11px; }
.region-option small { margin-left: 3px; color: var(--muted); font-size: 10px; }
.user-save-row { display: flex; align-items: end; gap: 13px; margin-top: 14px; }
.reason-field { flex: 1; }
.reason-field input, .region-form input { display: block; width: 100%; height: 40px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; outline: none; background: #fff; color: var(--ink); font: 12px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.reason-field input:focus, .region-form input:focus { border-color: #57bfa4; box-shadow: 0 0 0 3px rgba(32, 184, 154, .12); }
.save-button { flex: 0 0 auto; width: auto; height: 40px; margin: 0; padding: 0 15px; font-size: 11px; }
.region-admin { margin-top: 20px; }
.region-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 16px; border: 1px solid #e8edeb; border-radius: 7px; }
.region-form .save-button { align-self: end; justify-self: start; }
.region-list li small { margin-left: auto; }
.empty-state { padding: 14px; border-radius: 6px; background: #f6f9f7; color: var(--muted); font-size: 12px; }
.admin-error { margin: 0 0 18px; padding: 12px 14px; border: 1px solid #f1c8c5; border-radius: 7px; background: #fff4f3; color: #a13e3a; font-size: 12px; line-height: 1.6; }
.hazard-admin { max-width: 1120px; margin: 0 auto; }
.hazard-admin > .dashboard-message { margin: 0 0 20px; line-height: 1.7; }
.hazard-create-panel { padding: 20px; }
.hazard-create-panel .panel-heading { margin-bottom: 13px; }
.hazard-create-panel .panel-heading h2 { color: #314751; font: 650 13px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.hazard-create-panel .panel-heading p { margin: 5px 0 0; color: #929da0; font-size: 10px; }
.hazard-types-section { margin-top: 25px; }
.hazard-types-section .section-heading { margin-bottom: 12px; }
.hazard-types-section .section-heading .eyebrow { margin-bottom: 6px; color: var(--teal-dark); }
.hazard-types-section h2 { margin: 0; color: var(--ink); font: 700 19px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.hazard-types-section h2 span { margin-left: 5px; color: #8a999f; font: 500 12px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.hazard-type-list { display: grid; gap: 12px; }
.hazard-type-card { padding: 17px 19px; }
.hazard-type-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.hazard-icon { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border: 1px solid #e4ece8; border-radius: 9px; background: #f5faf7; color: #27856e; font-size: 19px; }
.hazard-type-heading > div { min-width: 0; flex: 1; }
.hazard-type-heading h3 { margin: 0; color: #344b56; font-size: 13px; }
.hazard-type-heading p { margin: 4px 0 0; color: #879499; font-size: 10px; }
.hazard-type-heading code { color: #667a7f; font-size: 10px; }
.hazard-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px 13px; margin: 0; }
.hazard-form label, .hazard-delete-form label { min-width: 0; margin: 0; color: #536671; font-size: 10px; }
.hazard-form input:not([type=hidden]), .hazard-delete-form input:not([type=hidden]) { height: 38px; margin-top: 5px; padding: 0 10px; border-radius: 6px; font-size: 11px; }
.hazard-form input[type=color] { padding: 4px; cursor: pointer; }
.hazard-form input:disabled { background: #f4f7f5; color: #829093; }
.hazard-form textarea { display: block; width: 100%; min-height: 58px; margin-top: 5px; padding: 9px 10px; resize: vertical; border: 1px solid var(--line); border-radius: 6px; outline: none; background: #fff; color: var(--ink); font: 11px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.hazard-form textarea:focus { border-color: #57bfa4; box-shadow: 0 0 0 3px rgba(32, 184, 154, .12); }
.hazard-form .hazard-description { grid-column: span 2; }
.hazard-form .hazard-active { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 38px; cursor: pointer; }
.hazard-form .hazard-active input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--teal-dark); }
.hazard-form .hazard-reason { grid-column: span 2; }
.hazard-form .save-button { align-self: end; justify-self: start; }
.hazard-form-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 13px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #edf1ef; }
.hazard-form-actions > .save-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; height: 40px; margin: 0; padding: 0 18px; border: 0; border-radius: 7px; background: var(--teal); color: #062c29; cursor: pointer; font: 700 11px "Avenir Next", Avenir, "Segoe UI", sans-serif; transition: background .15s, transform .15s; }
.hazard-form-actions > .save-button:hover { background: #36c9a8; transform: translateY(-1px); }
.hazard-form-actions > .save-button:focus-visible { outline: 3px solid rgba(32, 184, 154, .3); outline-offset: 2px; }
.hazard-delete-form { display: flex; align-items: end; gap: 9px; margin: 0; }
.hazard-delete-form { margin-left: auto; }
.hazard-delete-form .hazard-delete-button { width: auto; height: 40px; margin: 0; padding: 0 14px; border: 1px solid #f0ceca; border-radius: 7px; background: #fff5f4; color: #a13e3a; cursor: pointer; font: 700 10px "Avenir Next", Avenir, "Segoe UI", sans-serif; transition: background .15s, border-color .15s; }
.hazard-delete-form .hazard-delete-button:hover { border-color: #e7aaa5; background: #ffebe9; transform: none; }
.hazard-delete-hint { margin: 0; color: #89969a; font-size: 10px; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-actions form { margin: 0; }
.header-link { color: #b6c6cc; font-size: 12px; }
.header-link:hover { color: #fff; }
.access-denied { max-width: 560px; margin: 15vh auto; padding: 36px; border: 1px solid #e3e9e6; border-radius: 10px; background: #fff; }
.access-denied .eyebrow { color: var(--teal-dark); }
.access-denied > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.7; }
.app-body { min-width: 320px; min-height: 100vh; background: #f3f6f5; }
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 258px; padding: 22px 15px 13px; border-right: 1px solid #e5ebe9; background: #fff; }
.sidebar-brand { flex: 0 0 auto; gap: 11px; margin: 0 0 23px 5px; color: #193044; font-size: 10px; letter-spacing: .1em; }
.sidebar-brand strong { color: #248b78; }
.sidebar-brand .brand-mark { width: 26px; height: 26px; border-color: #c0e5d9; }
.workspace-switcher { display: flex; align-items: center; gap: 10px; padding: 10px 9px; border: 1px solid #e8edeb; border-radius: 8px; background: #fbfcfb; }
.workspace-mark { display: grid; flex: 0 0 31px; width: 31px; height: 31px; place-items: center; border-radius: 7px; background: #e4f5ee; color: #20876e; font: 800 13px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.workspace-switcher > span:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.workspace-switcher strong { color: #314653; font-size: 11px; }
.workspace-switcher small { color: #8a999f; font-size: 9px; }
.workspace-chevron { color: #819097; font-size: 15px; }
.app-nav { overflow: auto; flex: 1; margin: 14px -5px 12px; padding: 0 5px; scrollbar-width: thin; }
.nav-group { margin: 0 0 17px; }
.nav-group-label { margin: 0 0 6px 9px; color: #9ba7aa; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 36px; margin: 2px 0; padding: 0 10px; border-radius: 6px; color: #65757f; font-size: 11px; font-weight: 500; transition: background .15s, color .15s; }
.nav-link:hover { background: #f4f8f6; color: #1d685b; }
.nav-link.is-active { background: #e9f6f0; color: #18745f; font-weight: 700; }
.nav-icon { display: grid; flex: 0 0 17px; width: 17px; place-items: center; color: #829197; font-size: 15px; }
.nav-link.is-active .nav-icon { color: #19876d; }
.nav-count { display: grid; min-width: 18px; height: 18px; margin-left: auto; padding: 0 5px; place-items: center; border-radius: 12px; background: #fff0dc; color: #a36d18; font-size: 9px; font-weight: 700; }
.sidebar-bottom { flex: 0 0 auto; }
.sidebar-help { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; padding: 10px 8px; border-radius: 7px; background: #f7f9f8; color: #829097; }
.sidebar-help > span:first-child { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid #d9e4df; border-radius: 50%; font-size: 11px; }
.sidebar-help > span:last-child, .account-copy { display: grid; gap: 3px; min-width: 0; }
.sidebar-help strong { color: #52646d; font-size: 10px; }
.sidebar-help small { color: #9aa6aa; font-size: 9px; }
.sidebar-account { display: flex; align-items: center; gap: 9px; padding: 11px 2px 2px; border-top: 1px solid #edf0ef; }
.account-avatar, .topbar-avatar { display: grid; flex: 0 0 31px; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: #e6f3ed; color: #24775f; font-size: 11px; font-weight: 700; }
.account-copy { flex: 1; }
.account-copy strong { overflow: hidden; color: #3c4e58; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.account-copy small { overflow: hidden; color: #97a2a5; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.sidebar-account form { margin: 0; }
.account-logout { display: grid; width: 28px; height: 28px; margin: 0; padding: 0; place-items: center; border: 0; background: transparent; color: #8a989e; cursor: pointer; font-size: 14px; }
.account-logout:hover { background: #f0f4f2; color: #24594d; transform: none; }
.app-main { width: calc(100% - 258px); min-width: 0; min-height: 100vh; margin-left: 258px; }
.app-topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; height: 62px; padding: 0 35px; border-bottom: 1px solid #e7ecea; background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
.breadcrumb { display: flex; align-items: center; gap: 11px; color: #97a3a6; font-size: 10px; }
.breadcrumb strong { color: #40535e; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 15px; color: #839198; font-size: 10px; }
.system-status { display: flex; align-items: center; gap: 7px; color: #608075; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #36ae83; box-shadow: 0 0 0 3px #e7f5ee; }
.muted-dot { background: #aab6b6; box-shadow: 0 0 0 3px #f0f3f2; }
.topbar-divider { width: 1px; height: 19px; background: #e6ebea; }
.topbar-date { color: #73828a; }
.topbar-avatar { flex-basis: 29px; width: 29px; height: 29px; }
.sidebar-toggle { display: none; }
.app-content { max-width: 1500px; margin: 0 auto; padding: 30px 35px 40px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 24px; }
.page-heading .eyebrow { margin: 0 0 6px; color: #248a72; font-size: 9px; }
.page-heading h1 { margin: 0; color: #172e3d; font: 700 25px "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: -.035em; }
.update-label { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #e7ecea; border-radius: 6px; background: #fff; color: #839197; font-size: 9px; }
.update-ring { color: #438f79; font-size: 14px; }
.dashboard-welcome { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 19px; }
.dashboard-welcome h2 { margin: 0 0 5px; color: #273d4b; font: 650 16px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.dashboard-welcome p { margin: 0; color: #879499; font-size: 10px; }
.scope-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #e4ebe8; border-radius: 20px; background: #fff; color: #64766f; font-size: 9px; white-space: nowrap; }
.scope-chip-dot { width: 6px; height: 6px; border-radius: 50%; background: #32a77f; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric-card { min-width: 0; padding: 15px 16px 13px; border: 1px solid #e6ece9; border-radius: 8px; background: #fff; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #77868c; font-size: 10px; }
.metric-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; font-size: 15px; }
.metric-icon.mint { background: #e6f5ee; color: #249274; }
.metric-icon.amber { background: #fff3e3; color: #bf8532; }
.metric-icon.blue { background: #eaf1fb; color: #6689bc; }
.metric-icon.violet { background: #f0edfb; color: #8773bd; }
.metric-value { display: block; margin-top: 8px; color: #203846; font: 700 25px "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: -.04em; }
.metric-value.metric-unavailable { color: #aab5b6; }
.metric-foot { margin: 4px 0 0; color: #97a2a4; font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(285px, 1fr); gap: 14px; margin-top: 15px; }
.panel { min-width: 0; border: 1px solid #e5ebe8; border-radius: 8px; background: #fff; }
.map-panel, .incident-panel { padding: 17px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 0; color: #314751; font: 650 12px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.panel-heading p { margin: 4px 0 0; color: #929da0; font-size: 9px; }
.panel-tag { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid #edf0ef; border-radius: 20px; color: #879397; font-size: 8px; white-space: nowrap; }
.map-canvas { position: relative; display: grid; min-height: 260px; margin-top: 15px; overflow: hidden; place-items: center; border: 1px solid #edf1ef; border-radius: 6px; background-color: #f7faf8; background-image: linear-gradient(rgba(219,229,224,.46) 1px, transparent 1px), linear-gradient(90deg, rgba(219,229,224,.46) 1px, transparent 1px); background-size: 34px 34px; }
.map-lines { position: absolute; border: 1px solid rgba(130,177,157,.16); border-radius: 43% 57% 58% 42% / 41% 44% 56% 59%; transform: rotate(-20deg); pointer-events: none; }
.map-lines-one { width: 62%; height: 120%; }
.map-lines-two { width: 43%; height: 90%; transform: rotate(35deg); }
.map-empty { position: relative; z-index: 1; max-width: 280px; padding: 18px; text-align: center; }
.map-empty-icon { display: grid; width: 35px; height: 35px; margin: 0 auto 10px; place-items: center; border: 1px solid #dcebe3; border-radius: 10px; background: #fff; color: #58a58a; font-size: 18px; }
.map-empty strong, .incident-empty strong { color: #52656d; font-size: 10px; }
.map-empty p, .incident-empty p { margin: 6px 0 10px; color: #919ea1; font-size: 9px; line-height: 1.6; }
.map-empty a { font-size: 9px; font-weight: 700; }
.map-attribution { position: absolute; right: 8px; bottom: 6px; color: #a8b2b1; font-size: 7px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 12px; color: #75858a; font-size: 8px; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.normal { background: #40b38a; }
.legend-dot.watch { background: #e0b347; }
.legend-dot.alert { background: #e77862; }
.legend-dot.offline { background: #a7afb2; }
.panel-link { color: #27856e; font-size: 9px; font-weight: 600; white-space: nowrap; }
.incident-empty { display: flex; min-height: 190px; flex-direction: column; align-items: center; justify-content: center; padding: 18px 8px; text-align: center; }
.incident-empty-mark { display: grid; width: 32px; height: 32px; margin-bottom: 9px; place-items: center; border-radius: 50%; background: #ebf7f0; color: #4aab80; font-size: 15px; }
.incident-empty p { max-width: 210px; margin-bottom: 0; }
.source-status { padding-top: 13px; border-top: 1px solid #edf0ef; }
.source-status-heading, .source-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.source-status-heading { margin-bottom: 10px; }
.source-status-heading strong { color: #4c6069; font-size: 9px; }
.source-status-heading a { color: #2a8d73; font-size: 8px; }
.source-row { padding: 7px 0; color: #839096; font-size: 8px; }
.source-row > span { display: inline-flex; align-items: center; gap: 7px; }
.source-row strong { color: #a0aaaa; font-size: 8px; font-weight: 500; }
.source-indicator { width: 6px; height: 6px; border-radius: 50%; background: #c1c9c7; }
.setup-panel { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 14px; padding: 16px 18px; }
.setup-copy { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.setup-icon { display: grid; flex: 0 0 31px; width: 31px; height: 31px; place-items: center; border-radius: 8px; background: #e8f5ef; color: #309678; font-size: 15px; }
.setup-copy strong { color: #445a62; font-size: 10px; }
.setup-copy p { max-width: 320px; margin: 4px 0 0; color: #929da0; font-size: 8px; line-height: 1.5; }
.setup-steps { display: grid; flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.setup-steps a { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 8px; border: 1px solid #e9eeec; border-radius: 5px; color: #6c7c81; font-size: 8px; white-space: nowrap; }
.setup-steps a:hover { border-color: #b8dfd0; background: #f5fbf8; }
.setup-steps a span { color: #2c9678; font-size: 8px; font-weight: 700; }
.setup-steps a b { margin-left: auto; color: #92a09f; }
.dashboard-admin-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 19px; margin-top: 13px; padding: 12px 15px; color: #79888d; font-size: 9px; }
.dashboard-admin-summary > span { display: flex; align-items: center; gap: 7px; }
.dashboard-admin-summary strong { color: #354d58; font-size: 10px; }
.dashboard-admin-summary a { margin-left: auto; color: #2a896f; font-size: 9px; font-weight: 700; }
.module-intro { display: flex; align-items: center; gap: 15px; margin: 4px 0 18px; padding: 20px; border: 1px solid #e4ece7; border-radius: 8px; background: linear-gradient(110deg, #fff, #f5faf7); }
.module-intro-mark { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; border-radius: 12px; background: #e8f5ee; color: #2c9678; font-size: 20px; }
.module-intro h2 { margin: 0 0 5px; color: #334b56; font: 650 13px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.module-intro p { max-width: 670px; margin: 0; color: #849297; font-size: 10px; line-height: 1.7; }
.module-status-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px; }
.module-status-heading { display: flex; align-items: flex-start; gap: 11px; }
.module-status-heading > .status-dot { flex: 0 0 7px; margin-top: 4px; }
.module-status-heading strong { color: #52636a; font-size: 10px; }
.module-status-heading p { max-width: 600px; margin: 5px 0 0; color: #89979a; font-size: 9px; line-height: 1.65; }
.app-content > .admin-content { max-width: none; margin: 0; padding: 0; }
.admin-page-title { margin: 0 0 9px; color: #253d49; font: 650 16px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.app-content .admin-section { margin-top: 15px; padding: 18px; }
.app-content .admin-content > .dashboard-message { margin-bottom: 18px; font-size: 10px; }
.app-content .section-heading { margin-bottom: 13px; }
.app-content .region-list li { font-size: 10px; }
.app-content .region-list small { font-size: 9px; }
.app-content .user-card { padding: 14px; }
.app-content .user-card input:not([type=hidden]) { height: 40px; }
.app-content input[type="checkbox"] { display: inline-block; width: 14px; height: 14px; margin: 0; padding: 0; }
.app-content .region-option { margin: 0; }
.app-content .admin-error, .app-content .notice { margin: 0 0 13px; }
.sidebar-backdrop { display: none; }
.alert-summary, .history-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.alert-summary > div, .history-summary > div { display: grid; gap: 7px; padding: 13px 15px; border: 1px solid #e5ebe8; border-radius: 7px; background: #fff; }
.alert-summary span, .history-summary > div > span { color: #7e8c90; font-size: 9px; }
.alert-summary strong, .history-summary > div > strong { color: #29414c; font: 700 20px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.alert-summary .summary-watch { color: #b9892e; }
.alert-summary .summary-alert { color: #d27e36; }
.alert-summary .summary-warning { color: #c94f47; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 20px 0 13px; }
.list-toolbar h2 { margin: 0; color: #334a55; font: 650 13px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.list-toolbar p { margin: 5px 0 0; color: #8a979b; font-size: 9px; line-height: 1.5; }
.create-alert-link, .export-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 13px; border: 1px solid #cce7dc; border-radius: 6px; background: #edf8f2; color: #24765e; font-size: 9px; font-weight: 700; white-space: nowrap; }
.create-alert-link:hover, .export-link:hover { background: #e2f3ea; color: #155d49; }
.alert-filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; padding: 12px; border: 1px solid #e6ece9; border-radius: 7px; background: #fff; }
.alert-filter-form label, .create-alert-form label { display: grid; flex: 1 1 120px; gap: 5px; margin: 0; color: #687a80; font-size: 8px; font-weight: 600; }
.alert-filter-form .filter-search { flex-basis: 185px; }
.alert-filter-form input, .alert-filter-form select, .create-alert-form input, .create-alert-form select, .alert-actions input, .alert-actions select, .field-note-form input { width: 100%; height: 34px; margin: 0; padding: 0 9px; border: 1px solid #e2e9e6; border-radius: 5px; outline: none; background: #fff; color: #40545e; font: 9px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.alert-filter-form input:focus, .alert-filter-form select:focus, .create-alert-form input:focus, .create-alert-form select:focus, .alert-actions input:focus, .alert-actions select:focus, .field-note-form input:focus { border-color: #74bea4; box-shadow: 0 0 0 2px rgba(32,184,154,.1); }
.filter-submit { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: auto; min-height: 34px; margin: 0; padding: 0 12px; border-radius: 5px; font-size: 9px; }
.filter-submit:hover { transform: none; }
.filter-reset { display: inline-flex; align-items: center; min-height: 34px; padding: 0 5px; color: #718188; font-size: 9px; }
.result-count { margin: 13px 2px 10px; color: #8a979b; font-size: 9px; }
.result-count strong { color: #50656c; }
.alert-list { display: grid; gap: 11px; }
.alert-card { overflow: hidden; border: 1px solid #e3eae7; border-radius: 8px; background: #fff; }
.alert-card-main { padding: 15px 17px 12px; }
.alert-card-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.severity-pill { padding: 5px 8px; border-radius: 20px; font-size: 8px; font-weight: 700; }
.severity-watch { background: #fff5df; color: #9a711f; }
.severity-alert { background: #fff0e3; color: #bb6d2d; }
.severity-warning { background: #feebea; color: #b84d47; }
.hazard-label, .alert-id { color: #7a898e; font-size: 8px; }
.alert-id { padding-left: 7px; border-left: 1px solid #e7ecea; }
.alert-card-heading time { margin-left: auto; color: #929da0; font-size: 8px; }
.alert-card-main > h2 { margin: 11px 0 3px; color: #304752; font: 650 14px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.alert-region { margin: 0; color: #89969a; font-size: 9px; }
.alert-region span { padding: 0 4px; color: #b4bdbb; }
.trigger-summary { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin-top: 14px; padding: 11px 12px; border-radius: 6px; background: #f7f9f8; }
.trigger-summary > span { display: grid; gap: 5px; min-width: 0; }
.trigger-summary small { color: #8d999b; font-size: 8px; }
.trigger-summary strong { overflow-wrap: anywhere; color: #50636a; font-size: 9px; font-weight: 600; }
.trigger-summary i { color: #899598; font-size: 8px; font-style: normal; font-weight: 400; }
.handling-summary { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.handling-chip { padding: 5px 8px; border: 1px solid #e9eeec; border-radius: 20px; color: #748388; font-size: 8px; }
.handling-chip.acknowledged { border-color: #d4ebdf; background: #f1faf5; color: #398064; }
.handling-chip.unacknowledged { border-color: #f2e5ca; background: #fffaf0; color: #a17d38; }
.handling-chip.closed-chip { border-color: #dfe8e5; background: #f4f7f6; }
.close-reason { margin: 12px 0 0; padding: 9px 11px; border-left: 2px solid #81bea7; background: #f7faf8; color: #63747a; font-size: 9px; line-height: 1.6; }
.event-details { border-top: 1px solid #edf1ef; }
.event-details summary { display: flex; align-items: center; gap: 7px; padding: 10px 17px; color: #64777c; cursor: pointer; font-size: 9px; font-weight: 600; list-style: none; }
.event-details summary::-webkit-details-marker { display: none; }
.event-details summary::before { content: "›"; color: #369477; font-size: 16px; transform: rotate(0); }
.event-details[open] summary::before { transform: rotate(90deg); }
.event-details summary span { display: grid; min-width: 16px; height: 16px; padding: 0 4px; place-items: center; border-radius: 10px; background: #eef4f1; color: #72827e; font-size: 8px; }
.event-timeline { display: grid; gap: 10px; padding: 3px 17px 13px 21px; }
.timeline-entry { display: flex; gap: 10px; }
.timeline-dot { flex: 0 0 7px; width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: #5cad8e; box-shadow: 0 0 0 3px #eaf5ef; }
.timeline-entry strong { color: #556970; font-size: 9px; }
.timeline-entry strong small { color: #8e9a9d; font-size: 8px; font-weight: 400; }
.timeline-entry p { margin: 4px 0; color: #75858a; font-size: 9px; line-height: 1.5; }
.timeline-entry time { color: #9ba6a6; font-size: 8px; }
.alert-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 10px 14px; border-top: 1px solid #edf1ef; background: #fcfdfc; }
.alert-actions form, .field-note-form { display: flex; align-items: center; gap: 5px; margin: 0; }
.alert-actions .assign-form select { width: 155px; }
.alert-actions .note-form, .alert-actions .close-form { flex: 1 1 220px; }
.action-button { flex: 0 0 auto; width: auto; min-height: 32px; margin: 0; padding: 0 9px; border: 1px solid #e1e8e5; border-radius: 5px; background: #fff; color: #58716f; cursor: pointer; font: 600 8px "Avenir Next", Avenir, "Segoe UI", sans-serif; white-space: nowrap; }
.action-button:hover { border-color: #b8ded0; background: #f3faf6; color: #1e765e; transform: none; }
.action-button.primary-action { border-color: #c8e8da; background: #eaf7f0; color: #24765e; }
.action-button.close-action { border-color: #efd8d5; color: #a35b55; }
.action-button.close-action:hover { border-color: #e6bcb7; background: #fff5f4; color: #984942; }
.field-note-form { padding: 10px 14px; border-top: 1px solid #edf1ef; }
.field-note-form input { flex: 1; }
.empty-alerts { display: grid; min-height: 220px; margin-top: 11px; padding: 25px; place-content: center; justify-items: center; text-align: center; }
.empty-alerts > span { display: grid; width: 39px; height: 39px; margin-bottom: 10px; place-items: center; border-radius: 50%; background: #eaf7f0; color: #47a77c; font-size: 17px; }
.empty-alerts h2 { margin: 0 0 6px; color: #4c6168; font: 650 12px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.empty-alerts p { max-width: 350px; margin: 0; color: #8a979a; font-size: 9px; line-height: 1.7; }
.history-summary { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: stretch; }
.history-summary .export-link { align-self: center; }
.create-alert-panel { margin-top: 18px; padding: 0; }
.create-alert-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 16px; color: #368568; cursor: pointer; list-style: none; }
.create-alert-panel > summary::-webkit-details-marker { display: none; }
.create-alert-panel > summary > span:first-child { display: grid; gap: 4px; }
.create-alert-panel > summary strong { color: #405961; font-size: 10px; }
.create-alert-panel > summary small { color: #8d999b; font-size: 8px; }
.create-alert-panel > summary > span:last-child { font-size: 17px; }
.create-alert-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; padding: 3px 16px 16px; }
.create-alert-form label { flex: initial; }
.create-alert-form input, .create-alert-form select { height: 37px; }
.create-alert-form .create-alert-disclaimer { grid-column: 1 / -1; margin: 1px 0; color: #8c989a; font-size: 8px; line-height: 1.6; }
.create-alert-form .filter-submit { justify-self: start; }
.setup-required { margin-top: 16px; padding: 16px; }
.setup-required strong { color: #4d6168; font-size: 10px; }
.setup-required p { margin: 5px 0 0; color: #8b989b; font-size: 9px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.dashboard-event-list { display: grid; padding: 5px 0 10px; }
.dashboard-event-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid #edf1ef; }
.dashboard-event-row:last-child { border-bottom: 0; }
.dashboard-event-severity { flex: 0 0 auto; padding: 5px 7px; border-radius: 15px; font-size: 7px; font-weight: 700; }
.dashboard-event-copy { display: grid; flex: 1; gap: 4px; min-width: 0; }
.dashboard-event-copy strong { overflow: hidden; color: #52656b; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.dashboard-event-copy small { overflow: hidden; color: #929da0; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.dashboard-event-row time { color: #849397; font-size: 8px; }
.admin-content > .alert-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 850px) {
    .auth-layout { grid-template-columns: minmax(300px, .8fr) minmax(420px, 1.2fr); }
    .brand-panel { padding: 34px 34px 29px; }
    .brand-copy h1 { font-size: 39px; }
    .form-panel { padding: 60px 48px 70px; }
}
@media (max-width: 650px) {
    .auth-layout { display: block; min-height: 100vh; background: var(--paper); }
    .brand-panel { display: none; }
    .form-panel { min-height: 100vh; padding: 28px 25px 70px; }
    .mobile-brand { display: flex; align-items: center; gap: 10px; width: fit-content; margin: 0 auto 52px; color: var(--navy); font: 800 14px "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: .1em; }
    .form-wrap { max-width: 410px; }
    .form-footer { bottom: 21px; }
    .app-sidebar { width: 245px; transform: translateX(-100%); transition: transform .2s ease; }
    .app-main { width: 100%; margin-left: 0; }
    .sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-backdrop { position: fixed; z-index: 15; inset: 0; display: block; background: rgba(10,25,35,.38); }
    .app-topbar { height: 57px; padding: 0 19px; }
    .sidebar-toggle { display: grid; width: 31px; height: 31px; margin: 0; padding: 0; place-items: center; border: 1px solid #e6ece9; border-radius: 6px; background: #fff; color: #526a70; cursor: pointer; font-size: 14px; }
    .breadcrumb { flex: 1; margin-left: 12px; font-size: 9px; }
    .topbar-actions { gap: 9px; font-size: 9px; }
    .topbar-actions .topbar-date, .topbar-divider { display: none; }
    .app-content { padding: 25px 20px 32px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(250px, 1fr); }
    .setup-panel { align-items: flex-start; flex-direction: column; }
    .setup-steps { width: 100%; }
    .admin-content { padding: 0; }
    .app-content .admin-section { padding: 14px; }
    .region-options { grid-template-columns: 1fr; }
    .region-form { grid-template-columns: 1fr; }
    .user-save-row { align-items: stretch; flex-direction: column; }
    .app-content .save-button { width: 100%; }
    .create-alert-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .alert-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-content > .alert-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .access-denied { margin: 8vh 18px; padding: 27px; }
}
@media (max-width: 650px) {
    .app-content { padding: 20px 14px 28px; }
    .page-heading { align-items: flex-start; margin-bottom: 19px; }
    .page-heading h1 { font-size: 21px; }
    .update-label { padding: 7px; font-size: 8px; }
    .dashboard-welcome { align-items: flex-start; flex-direction: column; gap: 10px; }
    .metric-grid { gap: 8px; }
    .metric-card { padding: 12px; }
    .metric-top { font-size: 9px; }
    .metric-icon { width: 25px; height: 25px; }
    .metric-value { font-size: 22px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .map-canvas { min-height: 220px; }
    .incident-empty { min-height: 150px; }
    .setup-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .setup-steps a { font-size: 8px; }
    .setup-copy p { max-width: 260px; }
    .dashboard-admin-summary { gap: 10px 16px; padding: 12px 2px; }
    .dashboard-admin-summary a { flex-basis: 100%; margin: 0; }
    .module-status-panel { align-items: flex-start; flex-direction: column; }
    .breadcrumb > span:first-child { display: none; }
    .breadcrumb { gap: 7px; }
    .app-content .user-access-fields { grid-template-columns: 1fr; gap: 8px; }
    .app-content .user-identity { flex-wrap: wrap; }
    .app-content .status-badge { margin-left: 46px; }
    .app-content .region-form { padding: 12px; }
    .hazard-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hazard-form .hazard-description, .hazard-form .hazard-reason { grid-column: 1 / -1; }
    .hazard-form .save-button { width: 100%; }
    .hazard-form-actions, .hazard-delete-form { align-items: stretch; flex-direction: column; }
    .hazard-form-actions > .save-button, .hazard-delete-form .hazard-delete-button { width: 100%; }
    .hazard-delete-form label { width: 100%; }
    .hazard-delete-form { margin-left: 0; }
    .list-toolbar { align-items: flex-start; }
    .alert-filter-form label { flex-basis: calc(50% - 9px); }
    .alert-filter-form .filter-search { flex-basis: 100%; }
    .create-alert-form { grid-template-columns: 1fr; }
    .create-alert-form .create-alert-disclaimer { grid-column: auto; }
    .create-alert-form .filter-submit { justify-self: stretch; width: 100%; }
    .trigger-summary { grid-template-columns: 1fr 1fr; }
    .trigger-summary > span:first-child { grid-column: 1 / -1; }
    .alert-card-main { padding: 13px; }
    .alert-card-heading time { flex-basis: 100%; margin-left: 0; }
    .alert-actions { align-items: stretch; }
    .alert-actions form, .alert-actions .assign-form, .alert-actions .note-form, .alert-actions .close-form { flex: 1 1 100%; }
    .alert-actions .assign-form select { flex: 1; }
    .alert-actions .note-form input, .alert-actions .close-form input { flex: 1; min-width: 0; }
    .alert-actions .action-button { min-height: 35px; }
    .history-summary .export-link { justify-self: start; }
    .history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .alert-summary > div, .history-summary > div { padding: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.tab-bar { display: flex; gap: 6px; margin: 0 0 18px; padding: 4px; width: fit-content; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.tab-bar a { padding: 8px 15px; border-radius: 6px; color: #5d7078; font-size: 11px; font-weight: 700; text-decoration: none; }
.tab-bar a.active { background: var(--teal); color: #062c29; }
.hazard-form select { display: block; width: 100%; height: 38px; margin-top: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; outline: none; background: #fff; color: var(--ink); font: 11px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.hazard-form select:focus { border-color: #57bfa4; box-shadow: 0 0 0 3px rgba(32, 184, 154, .12); }
.location-hazards { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.location-hazards legend { padding: 0; margin-bottom: 6px; color: #536671; font-size: 10px; }
.hazard-form .check-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #40545e; font-size: 11px; cursor: pointer; }
.hazard-form .check-chip input { width: auto; height: auto; margin: 0; }
.edit-details { margin-top: 12px; padding-top: 12px; border-top: 1px solid #edf1ef; }
.edit-details > summary { width: fit-content; margin-bottom: 12px; color: #1b8d77; font-size: 11px; font-weight: 700; cursor: pointer; }
.location-coords { margin: 4px 0 0; color: #6a7c84; font-size: 10px; }
.location-hazard-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 0; }
.location-hazard-tags span { padding: 3px 8px; border-radius: 999px; background: #e9f6f2; color: #1b7a68; font-size: 9px; font-weight: 700; }
.location-filter { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr 1fr auto; gap: 9px; margin-bottom: 16px; }
.location-filter input, .location-filter select { height: 40px; min-width: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: 11px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.location-filter .save-button { width: auto; height: 40px; margin: 0; padding: 0 18px; border: 0; border-radius: 7px; background: var(--teal); color: #062c29; cursor: pointer; font: 700 11px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
@media (max-width: 900px) { .location-filter { grid-template-columns: 1fr 1fr; } }

.location-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.location-map-panel { padding: 0; overflow: hidden; }
.map-filter { grid-template-columns: 1.4fr 1fr 1fr auto; }
.location-map { position: relative; height: 560px; overflow: hidden; background: #e6efec linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px) 0 0 / 48px 48px, linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px) 0 0 / 48px 48px; cursor: grab; touch-action: none; outline: none; user-select: none; }
.location-map.dragging { cursor: grabbing; }
.map-tiles, .map-markers { position: absolute; inset: 0; }
.map-tile { position: absolute; top: 0; left: 0; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.map-tile.failed { display: none; }
.map-pin, .map-pin-sample, .map-list-icon { display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.map-pin { position: absolute; top: -17px; left: -17px; width: 34px; height: 34px; padding: 6px; border: 2px solid #fff; border-radius: 50% 50% 50% 8px; box-shadow: 0 3px 10px rgba(16, 36, 43, .35); cursor: pointer; will-change: transform; }
.map-pin svg, .map-pin-sample svg, .map-list-icon svg { width: 100%; height: 100%; }
.map-pin.inactive, .map-pin-sample.inactive { filter: grayscale(1); opacity: .6; }
.map-pin.selected { z-index: 3; box-shadow: 0 0 0 4px rgba(32, 184, 154, .45), 0 3px 10px rgba(16, 36, 43, .35); }
.map-pin:focus-visible { outline: 3px solid #062c29; }
.map-controls { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.map-controls button { width: 34px; height: 34px; padding: 0; border: 1px solid #d5dfdb; border-radius: 7px; background: #fff; color: #314852; font: 700 16px "Avenir Next", Avenir, sans-serif; cursor: pointer; box-shadow: 0 2px 6px rgba(16, 36, 43, .15); }
.map-controls button:hover { background: #f1f8f5; }
.map-attribution, .map-coords { position: absolute; bottom: 0; padding: 3px 8px; background: rgba(255, 255, 255, .85); color: #40545e; font-size: 9px; z-index: 4; }
.map-attribution { right: 0; }
.map-coords { left: 0; font-variant-numeric: tabular-nums; }
.map-popup { position: absolute; top: 0; left: 0; z-index: 6; width: 230px; max-width: calc(100% - 16px); margin: 0; padding: 12px 14px; border-radius: 9px; background: #fff; box-shadow: 0 8px 24px rgba(16, 36, 43, .28); cursor: default; will-change: transform; }
.map-popup strong { display: block; margin-right: 18px; font-size: 12px; color: #1c3039; }
.map-popup p { margin: 5px 0 0; color: #536671; font-size: 10px; line-height: 1.4; }
.map-popup-close { position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; padding: 0; border: 0; background: transparent; color: #6a7c84; font-size: 18px; cursor: pointer; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 11px 16px; border-top: 1px solid #edf1ef; color: #536671; font-size: 10px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-pin-sample { width: 22px; height: 22px; padding: 4px; border-radius: 50% 50% 50% 5px; background: #6b7c85; }
.location-map-list { max-height: 622px; padding: 8px; overflow: auto; }
.location-map-list ul { margin: 0; padding: 0; list-style: none; }
.location-map-list button { display: flex; align-items: center; gap: 10px; width: 100%; height: auto; margin: 0; padding: 9px; border: 0; border-radius: 8px; background: transparent; color: #1c3039; text-align: left; cursor: pointer; font: 11px "Avenir Next", Avenir, sans-serif; transform: none; }
.location-map-list button:hover, .location-map-list button.active { background: #eaf6f2; transform: none; }
.location-map-list strong { display: block; font-size: 11px; }
.location-map-list small { color: #6a7c84; font-size: 9px; }
.map-list-icon { flex: none; width: 28px; height: 28px; padding: 5px; border-radius: 50% 50% 50% 6px; }
@media (max-width: 900px) { .location-map-layout { grid-template-columns: 1fr; } .location-map { height: 420px; } .map-filter { grid-template-columns: 1fr 1fr; } .location-map-list { max-height: 320px; } }

.sensor-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.sensor-summary-item { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #536671; text-decoration: none; font-size: 10px; }
.sensor-summary-item strong { color: #1c3039; font-size: 20px; }
.sensor-summary-item .sensor-latest { font-size: 13px; line-height: 27px; }
.sensor-summary-item.health-healthy strong { color: #1b8d77; }
.sensor-summary-item.health-delayed strong { color: #c0392b; }
.sensor-summary-item.health-maintenance strong { color: #b7791f; }
.health-badge { padding: 4px 10px; border-radius: 999px; background: #eef2f1; color: #536671; font-size: 10px; font-weight: 700; white-space: nowrap; }
.health-badge.health-healthy { background: #e0f4ee; color: #1b7a68; }
.health-badge.health-delayed { background: #fdeaea; color: #b03030; }
.health-badge.health-maintenance { background: #fff3dc; color: #9a6a12; }
.health-badge.health-unknown { background: #e8eef3; color: #4a6072; }
.sensor-filter { grid-template-columns: 1.3fr 1fr 1fr 1.2fr auto; }
.sensor-record-form { margin-left: 0; display: flex; align-items: end; gap: 9px; flex-wrap: wrap; }
.sensor-record-form label { min-width: 150px; }
.sensor-record-form .record-button { height: 40px; margin: 0; padding: 0 14px; width: auto; border: 1px solid #bfe3d9; border-radius: 7px; background: #eaf7f3; color: #17705e; cursor: pointer; font: 700 10px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.sensor-record-form .record-button:hover { background: #d9f0e8; transform: none; }
@media (max-width: 900px) { .sensor-summary { grid-template-columns: repeat(2, 1fr); } .sensor-filter { grid-template-columns: 1fr 1fr; } }

.threshold-card header { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.threshold-card h3 small { color: #64748b; font-weight: 600; }
.threshold-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.threshold-action { display: flex; gap: 8px; align-items: center; }
.threshold-action input { min-width: 180px; }
.threshold-action .save-button, .threshold-action .danger-button, .hazard-delete-form .danger-button { min-height: 38px; padding: 0 14px; border-radius: 8px; border: 0; font-weight: 700; cursor: pointer; }
.threshold-action .save-button { background: #1d4ed8; color: #fff; }
.threshold-action .danger-button, .hazard-delete-form .danger-button { background: #fee2e2; color: #b91c1c; }
.severity-chip { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.severity-watch { background: #fef9c3; color: #854d0e; }
.severity-alert { background: #ffedd5; color: #c2410c; }
.severity-warning { background: #fee2e2; color: #b91c1c; }
.approval-draft, .approval-retired, .approval-superseded { background: #e2e8f0; color: #475569; }
.approval-pending { background: #fef3c7; color: #92400e; }
.approval-approved { background: #dcfce7; color: #166534; }
.approval-rejected { background: #fee2e2; color: #b91c1c; }
.check-row { flex-direction: row; align-items: center; gap: 8px; }

.health-dot { display: inline-block; flex: none; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: #94a3b8; box-shadow: 0 0 0 1px rgba(16, 36, 43, .25); }
.map-pin .health-dot { position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; }
i.health-dot.health-healthy { background: #1b8d77; }
i.health-dot.health-delayed { background: #d63a2f; }
i.health-dot.health-maintenance { background: #e0a32a; }
i.health-dot.health-unknown { background: #4a90c2; }
i.health-dot.health-inactive, i.health-dot.health-none { background: #94a3b8; }
.map-health-legend { margin-top: 6px; }
.map-popup-sensors-title { margin: 8px 0 4px; font-weight: 700; font-size: 12px; }
.map-popup-sensor { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; margin-bottom: 3px; }
.map-popup-sensor .health-dot { margin-top: 3px; }
.location-map-list li button .health-dot { margin-left: auto; }

.threshold-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.approval-tile { border-top: 4px solid #cbd5e1; }
.approval-tile-pending { border-top-color: #f59e0b; }
.approval-tile-approved { border-top-color: #16a34a; }
.approval-tile-rejected { border-top-color: #dc2626; }
.create-details > summary { cursor: pointer; list-style: none; font-weight: 700; color: #0f766e; padding: 4px 0; }
.create-details > summary::-webkit-details-marker { display: none; }
.create-details[open] > summary { margin-bottom: 14px; }
.threshold-card { background: #fff; border: 1px solid #dfe8ec; border-left: 6px solid #94a3b8; border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(16, 36, 43, .05); }
.threshold-card.severity-border-watch { border-left-color: #eab308; }
.threshold-card.severity-border-alert { border-left-color: #f97316; }
.threshold-card.severity-border-warning { border-left-color: #dc2626; }
.threshold-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.threshold-hazard { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #0f766e; }
.threshold-rule h3 { margin: 2px 0 4px; font-size: 18px; }
.threshold-condition { margin: 0; font-size: 15px; color: #475569; }
.threshold-condition strong { font-size: 26px; color: #10242b; margin: 0 2px; }
.threshold-condition .op { display: inline-block; min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 6px; background: #eef2f6; font-weight: 700; }
.threshold-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.version-chip { padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef2f6; color: #475569; }
.threshold-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px dashed #dfe8ec; }
.threshold-meta dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #8a9aa5; }
.threshold-meta dd { margin: 2px 0 0; font-size: 14px; color: #10242b; }
.threshold-note { margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: #f3f7f9; font-size: 13px; color: #475569; }
.threshold-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf2f5; }
.threshold-action { display: flex; gap: 8px; align-items: center; }
.threshold-action input { min-width: 170px; min-height: 38px; padding: 0 10px; border: 1px solid #cdd9df; border-radius: 8px; }
.threshold-action .save-button, .threshold-action .danger-button { min-height: 38px; padding: 0 14px; border-radius: 8px; border: 0; font-weight: 700; cursor: pointer; width: auto; }
.threshold-action .save-button { background: #0f9d8a; color: #fff; }
.threshold-action .danger-button { background: #fee2e2; color: #b91c1c; }
.threshold-card .edit-details { margin-top: 12px; }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-pill.approval-approved { background: #dcfce7; color: #166534; }
@media (max-width: 900px) { .threshold-meta { grid-template-columns: 1fr 1fr; } .threshold-summary { grid-template-columns: 1fr 1fr; } }
.sensor-summary.threshold-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.threshold-summary .sensor-summary-item { width: auto; }
.threshold-action .save-button, .threshold-action .danger-button { height: 38px; min-height: 38px; padding: 0 14px; line-height: 1; }
.threshold-action input { height: 38px; min-height: 38px; } .threshold-actions { align-items: center; }
.threshold-action { margin: 0; flex-direction: row; } .threshold-action button { margin: 0; align-self: center; }

.parameter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.parameter-card { background: #fff; border: 1px solid #dfe8ec; border-top: 4px solid #0f9d8a; border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(16, 36, 43, .05); }
.parameter-card.is-off { border-top-color: #cbd5e1; opacity: .8; }
.parameter-head { display: flex; gap: 12px; align-items: flex-start; }
.parameter-head > div { flex: 1; min-width: 0; }
.parameter-head h3 { margin: 2px 0 4px; font-size: 17px; }
.parameter-head code { font-size: 12px; color: #64748b; background: #f1f5f8; padding: 2px 6px; border-radius: 6px; }
.parameter-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, #0f9d8a, #1d6fb8); }
.parameter-card.is-off .parameter-icon { background: #94a3b8; }
.parameter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.parameter-chips span { padding: 4px 10px; border-radius: 999px; background: #eef2f6; color: #475569; font-size: 12px; font-weight: 600; }
.parameter-chips .chip-unit { background: #e0f4ee; color: #0f766e; }
.parameter-desc { margin: 10px 0 0; font-size: 13px; color: #64748b; }
.parameter-card .edit-details { margin-top: 12px; }
@media (max-width: 900px) { .parameter-grid { grid-template-columns: 1fr; } }

.rule-card.is-off { opacity: .8; }
.rule-flow { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin-top: 14px; }
.rule-step-box { flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: #f3f7f9; }
.rule-step-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #0f766e; }
.rule-arrow { align-self: center; font-size: 22px; color: #94a3b8; }
.condition-pill { display: inline-block; padding: 4px 10px; border-radius: 8px; background: #fff; border: 1px solid #dfe8ec; font-size: 13px; font-weight: 600; }
.rule-channels { font-size: 12px; color: #64748b; }
.escalation-timeline { margin-top: 16px; padding-top: 14px; border-top: 1px dashed #dfe8ec; }
.escalation-timeline ol { list-style: none; margin: 10px 0; padding: 0 0 0 14px; border-left: 3px solid #cfe3e0; display: grid; gap: 10px; }
.escalation-timeline li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; position: relative; }
.escalation-timeline li::before { content: ""; position: absolute; left: -22px; width: 11px; height: 11px; border-radius: 50%; background: #0f9d8a; border: 2px solid #fff; }
.step-time { padding: 3px 9px; border-radius: 999px; background: #e0f4ee; color: #0f766e; font-size: 12px; font-weight: 700; }
.escalation-timeline li small { color: #64748b; margin-left: 6px; }
.rule-fieldset { border: 1px solid #dfe8ec; border-radius: 10px; padding: 10px 12px; min-width: 0; }
.rule-fieldset legend { font-size: 12px; font-weight: 700; color: #475569; padding: 0 6px; }
.channel-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.channel-check, .condition-check { display: flex; flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.channel-check span { padding: 5px 12px; border-radius: 999px; background: #eef2f6; font-size: 13px; font-weight: 600; }
.channel-check input:checked + span { background: #0f9d8a; color: #fff; }
.condition-check { padding: 6px 4px; }
.condition-check small { color: #64748b; margin-left: 6px; }

.member-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.member-list li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #f6f9fb; }
.member-list li.is-off { opacity: .6; }
.member-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #d9efe9; color: #0f766e; font-weight: 800; }
.member-info { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; }
.member-info small { color: #64748b; font-size: 12px; }
.warn-chip { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700; }
.member-edit { flex: 1 1 100%; }
.member-edit > summary { cursor: pointer; color: #0f766e; font-size: 12px; font-weight: 700; }

.token-reveal { margin: 0 0 16px; padding: 14px 16px; border-radius: 10px; background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; }
.token-reveal code { display: block; margin-top: 8px; padding: 10px; border-radius: 7px; background: #fff; font-size: 13px; word-break: break-all; user-select: all; }
.token-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.token-list li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: #f6f9fb; }
.token-list li.is-off { opacity: .65; }
.token-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.token-actions input, .config-row input { height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font: 11px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.token-actions .save-button, .config-row .save-button { width: auto; height: 34px; margin: 0; padding: 0 14px; border: 0; border-radius: 7px; background: var(--teal); color: #062c29; cursor: pointer; font: 700 11px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.config-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) 80px 80px 70px minmax(110px, 1fr) auto; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 6px; border-radius: 10px; background: #f6f9fb; }
.api-doc { margin: 10px 0 0; padding: 14px; border-radius: 8px; background: #0f172a; color: #e2e8f0; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-x: auto; }
.reading-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.reading-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.reading-table th { padding: 10px 12px; text-align: left; background: #f1f5f9; color: #475569; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.reading-table td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.reading-table small { display: block; color: #64748b; font-size: 11px; }
.ingest-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #e2e8f0; color: #334155; }
.ingest-accepted { background: #d1fae5; color: #065f46; }
.ingest-late, .ingest-out-of-range { background: #fef3c7; color: #92400e; }
.ingest-invalid { background: #fee2e2; color: #991b1b; }
@media (max-width: 900px) { .config-row { grid-template-columns: 1fr 1fr; } }
.token-actions .danger-button { width: auto; height: 34px; margin: 0; padding: 0 14px; border-radius: 7px; font-size: 11px; }
.token-actions input { width: 130px; }
.token-list .member-info { flex: 1 1 200px; }
.threshold-summary:has(> :nth-child(5)) { grid-template-columns: repeat(5, 1fr); }

.report-filter { grid-template-columns: repeat(4, 1fr) auto; align-items: end; }
.report-filter label { display: grid; gap: 4px; color: #64748b; font-size: 11px; font-weight: 700; }
.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 16px 0; }
.report-card { padding: 16px; }
.report-card h3 { margin: 0 0 10px; font-size: 14px; }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bar-list li { display: grid; grid-template-columns: minmax(90px, 1.2fr) 3fr 30px; gap: 10px; align-items: center; font-size: 12px; }
.bar-list strong { text-align: right; }
.bar-track { height: 10px; border-radius: 999px; background: #e8eef3; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #14b8a6, #0f766e); }
.export-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
@media (max-width: 900px) { .report-filter, .report-grid { grid-template-columns: 1fr; } }
.bar-w-5 { width: 5%; }
.bar-w-10 { width: 10%; }
.bar-w-15 { width: 15%; }
.bar-w-20 { width: 20%; }
.bar-w-25 { width: 25%; }
.bar-w-30 { width: 30%; }
.bar-w-35 { width: 35%; }
.bar-w-40 { width: 40%; }
.bar-w-45 { width: 45%; }
.bar-w-50 { width: 50%; }
.bar-w-55 { width: 55%; }
.bar-w-60 { width: 60%; }
.bar-w-65 { width: 65%; }
.bar-w-70 { width: 70%; }
.bar-w-75 { width: 75%; }
.bar-w-80 { width: 80%; }
.bar-w-85 { width: 85%; }
.bar-w-90 { width: 90%; }
.bar-w-95 { width: 95%; }
.bar-w-100 { width: 100%; }

.health-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 16px 18px; border-radius: 12px; border: 1px solid; }
.health-banner div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.health-banner small { color: inherit; opacity: .8; }
.health-ok { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.health-warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.health-bad { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.health-dot { width: 14px; height: 14px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px rgba(0, 0, 0, .06); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.check-list li { display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; padding: 10px 12px; border-radius: 10px; background: #f6f9fb; }
.check-list small { grid-column: 2; color: #64748b; font-size: 12px; }
.check-state { grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.check-ok { background: #d1fae5; color: #065f46; }
.check-warn { background: #fef3c7; color: #92400e; }
.check-fail { background: #fee2e2; color: #991b1b; }
.health-figure { margin: 4px 0; font-size: 13px; }
.health-figure strong { font-size: 26px; }
.health-badge-healthy { background: #d1fae5; color: #065f46; }
.health-badge-delayed { background: #fee2e2; color: #991b1b; }
.health-badge-unknown, .health-badge-maintenance { background: #fef3c7; color: #92400e; }
@media (max-width: 900px) { .check-list { grid-template-columns: 1fr; } .threshold-summary:has(> :nth-child(5)) { grid-template-columns: repeat(2, 1fr); } }

.scope-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.user-card .edit-details { margin-top: 10px; }
.user-card .token-actions { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.user-card .token-actions input { width: 220px; }
.scope-chips .chip-unit { padding: 3px 10px; border-radius: 999px; background: #e6f4f1; color: #0f766e; font-size: 11px; font-weight: 700; }

.audit-filter { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr 1fr 1fr auto; gap: 9px; align-items: end; margin-bottom: 14px; }
.audit-filter label { display: grid; gap: 4px; color: #64748b; font-size: 11px; font-weight: 700; }
.audit-filter input, .audit-filter select { height: 40px; min-width: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: 11px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.audit-filter .save-button { width: auto; height: 40px; margin: 0; padding: 0 18px; border: 0; border-radius: 7px; background: var(--teal); color: #062c29; cursor: pointer; font: 700 11px "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.audit-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 12px; color: #64748b; }
.audit-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 12px; }
.audit-item { position: relative; padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--line); border-left: 4px solid #94a3b8; }
.audit-item::before { content: ""; position: absolute; left: -23px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; }
.audit-good { border-left-color: #10b981; } .audit-good::before { background: #10b981; }
.audit-warn { border-left-color: #f59e0b; } .audit-warn::before { background: #f59e0b; }
.audit-danger { border-left-color: #ef4444; } .audit-danger::before { background: #ef4444; }
.audit-info { border-left-color: #3b82f6; } .audit-info::before { background: #3b82f6; }
.audit-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.audit-badge { font-weight: 800; font-size: 13px; }
.audit-source { padding: 1px 9px; border-radius: 999px; background: #eef2f6; color: #475569; font-size: 11px; font-weight: 700; }
.audit-head time { margin-left: auto; color: #64748b; font-size: 11px; }
.audit-actor { margin: 4px 0 0; font-size: 12px; }
.audit-actor small { color: #64748b; }
.audit-reason { margin: 4px 0 0; color: #475569; font-size: 12px; font-style: italic; }
.audit-details { margin-top: 6px; }
.audit-details summary { cursor: pointer; color: #0f766e; font-size: 11px; font-weight: 700; }
.audit-details pre { margin: 6px 0 0; padding: 10px; border-radius: 8px; background: #0f172a; color: #e2e8f0; font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.audit-pager { display: flex; justify-content: space-between; margin-top: 16px; }
.audit-pager a { color: #0f766e; font-weight: 700; font-size: 12px; }
@media (max-width: 1000px) { .audit-filter { grid-template-columns: 1fr 1fr; } }

.section-note { margin: 4px 0 0; color: #75858a; font-size: 11px; }
.weather-source { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid #e0e8e4; border-radius: 99px; background: #fff; color: #536671; font-size: 11px; font-weight: 700; }
.weather-source i { width: 8px; height: 8px; border-radius: 50%; background: #d9822b; }
.weather-source.live i { background: #2fa87a; }
.weather-source.error i { background: #d1493f; }
.weather-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 16px 0; }
.weather-summary article { padding: 14px 16px; border: 1px solid #e5ebe8; border-radius: 8px; background: #fff; }
.weather-summary article > span { display: block; color: #75858a; font-size: 11px; }
.weather-summary article > strong { display: block; margin-top: 6px; color: #1c3039; font-size: 22px; }
.weather-summary small { color: #8a999d; font-size: 11px; font-weight: 600; }
.weather-summary .weather-clock { font-size: 18px; }
.weather-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.weather-card { padding: 16px; }
.weather-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.weather-card h3 { margin: 0; font-size: 14px; color: #1c3039; }
.weather-card header p { margin: 3px 0 0; color: #75858a; font-size: 11px; }
.weather-level { flex: none; padding: 4px 9px; border-radius: 99px; font-size: 10px; font-weight: 700; background: #eef2f1; color: #536671; }
.weather-level.level-light { background: #e2f0fb; color: #1f68a3; }
.weather-level.level-moderate { background: #dff3ee; color: #17806b; }
.weather-level.level-heavy { background: #fdf0d8; color: #a8680f; }
.weather-level.level-extreme { background: #fbe3e0; color: #b53a31; }
.weather-rain { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 10px; }
.weather-rain strong { color: #1c3039; font-size: 34px; }
.weather-rain span { color: #75858a; font-size: 12px; }
.weather-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.weather-metrics div { padding: 8px 10px; border-radius: 6px; background: #f6f9f8; }
.weather-metrics dt { color: #75858a; font-size: 10px; }
.weather-metrics dd { margin: 3px 0 0; color: #1c3039; font-size: 13px; font-weight: 700; }
.weather-metrics small { color: #75858a; font-weight: 600; }
.weather-card footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf1ef; color: #75858a; font-size: 10px; flex-wrap: wrap; }
@media (max-width: 900px) { .weather-summary { grid-template-columns: 1fr 1fr; } }

.weather-level.river-watch { background: #fdf0d8; color: #a8680f; }
.weather-level.river-alert { background: #fde4d0; color: #b4541a; }
.weather-level.river-warning { background: #fbe3e0; color: #b53a31; }
.weather-level.river-normal { background: #dff3ee; color: #17806b; }
.river-trend { margin-left: auto; font-size: 11px; font-style: normal; font-weight: 700; color: #75858a; }
.river-trend.trend-rising { color: #b53a31; }
.river-trend.trend-falling { color: #17806b; }
.river-gauge { height: 8px; margin-bottom: 12px; overflow: hidden; border-radius: 99px; background: #edf1ef; }
.river-fill { display: block; height: 100%; border-radius: 99px; transition: width .4s; }
.river-fill.river-normal { background: #2fa87a; }
.river-fill.river-watch { background: #e0a13a; }
.river-fill.river-alert { background: #e07a3a; }
.river-fill.river-warning { background: #d1493f; }
.river-thresholds { font-size: 10px !important; font-weight: 600 !important; line-height: 1.5; }
.bar-w-0 { width: 0; }

.weather-detail-link { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700; color: #17806b; text-decoration: none; }
.weather-detail-link:hover { text-decoration: underline; }
.monitor-body { margin: 0; background: #eef3f1; color: #1c2b33; min-height: 100vh; }
.monitor-page { max-width: 1400px; margin: 0 auto; padding: 24px; display: grid; gap: 18px; }
.monitor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.monitor-head h1 { margin: 4px 0; font-size: 30px; }
.monitor-head p { margin: 0; color: #75858a; font-size: 13px; }
.monitor-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.monitor-now { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 12px; }
.monitor-now article { background: #fff; border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; box-shadow: 0 1px 2px rgba(20, 40, 40, .06); }
.monitor-now article > span { font-size: 12px; color: #75858a; }
.monitor-now article strong { font-size: 24px; }
.monitor-now article small { font-size: 12px; font-weight: 500; color: #75858a; }
.monitor-now .monitor-main strong { font-size: 40px; }
.monitor-now .weather-level { justify-self: start; }
.monitor-charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.monitor-chart { background: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(20, 40, 40, .06); }
.monitor-chart.wide { grid-column: 1 / -1; }
.monitor-chart header { display: flex; justify-content: space-between; align-items: baseline; }
.monitor-chart h2 { margin: 0; font-size: 14px; }
.monitor-chart header span { font-size: 11px; color: #75858a; }
.monitor-chart canvas { width: 100%; height: 200px; display: block; margin-top: 8px; }
.monitor-chart.wide canvas { height: 260px; }
.monitor-table { padding: 16px; overflow-x: auto; }
.monitor-table h2 { margin: 0 0 10px; font-size: 14px; }
.monitor-table table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.monitor-table th, .monitor-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #edf1ef; }
.monitor-table th { color: #75858a; font-weight: 600; font-size: 11px; }
@media (max-width: 900px) { .monitor-now { grid-template-columns: repeat(2, 1fr); } .monitor-charts { grid-template-columns: 1fr; } }
.monitor-now article strong > span { font-size: inherit; color: inherit; }
.monitor-now-5 { grid-template-columns: 1.4fr repeat(5, 1fr); }
.monitor-now .river-trend { margin-left: 0; font-size: 20px; }

.ews-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ews-tabs, .ews-stations { display: flex; gap: 8px; flex-wrap: wrap; }
.ews-tabs a, .ews-stations a, .ews-account a { padding: 7px 14px; border: 1px solid #d5e0dc; border-radius: 999px; background: #fff; color: #17352d; font-weight: 700; font-size: 13px; text-decoration: none; }
.ews-tabs a.active, .ews-stations a.active { background: #27856e; border-color: #27856e; color: #fff; }
.ews-account { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ews-account form { margin: 0; }
.ews-account button { padding: 7px 14px; border: 1px solid #d5e0dc; border-radius: 999px; background: #fff; font-weight: 700; cursor: pointer; }
.ews-stations { margin-bottom: 12px; }
.chip-ews { background: #e3f2ee; color: #1d6b58; }

.danger-button { background: #b3261e; border-color: #b3261e; }

.spec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; margin: 0 0 14px; }
.spec-list dt { font-size: 12px; color: #5c746c; }
.spec-list dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.spec-list .spec-notes { grid-column: 1 / -1; }

.sensor-qr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.sensor-qr-actions a { text-decoration: none; display: inline-block; }
.label-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 13px; }
.label-toolbar a:not(.save-button) { color: #17352d; font-weight: 700; text-decoration: none; }
.label-toolbar a.save-button { text-decoration: none; }
.label-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.qr-label { margin: 0; padding: 14px; background: #fff; border: 2px solid #17352d; border-radius: 10px; text-align: center; break-inside: avoid; }
.qr-canvas { width: 170px; height: 170px; margin: 0 auto 8px; }
.qr-canvas svg { width: 100%; height: 100%; display: block; }
.qr-label figcaption { display: grid; gap: 2px; font-size: 13px; }
.qr-label figcaption code { font-size: 12px; }
@media print {
  .label-toolbar { display: none; }
  .label-body, .label-body .monitor-page { background: #fff; padding: 0; }
  .label-grid { grid-template-columns: repeat(3, 1fr); }
}

.sensor-card-qr { display: grid; justify-items: center; gap: 6px; margin-left: 12px; }
.sensor-card-qr .qr-canvas { width: 96px; height: 96px; margin: 0; padding: 4px; background: #fff; border: 1px solid #d5e0dc; border-radius: 8px; display: block; }
.sensor-card-qr .record-button { text-decoration: none; font-size: 12px; padding: 5px 10px; }

.sensor-card { border-left: 4px solid #94a3b8; }
.sensor-card-healthy { border-left-color: #1b8d77; }
.sensor-card-delayed { border-left-color: #d63a2f; }
.sensor-card-maintenance { border-left-color: #e0a32a; }
.sensor-card-unknown { border-left-color: #4a90c2; }
.sensor-heading { align-items: flex-start; }
.sensor-card-side { display: grid; justify-items: end; gap: 6px; margin-left: auto; flex: none; }
.sensor-card-side .health-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; font-size: 11px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.sensor-card-side .health-dot { width: 8px; height: 8px; border: 0; box-shadow: none; }
.sensor-card-side .qr-canvas { width: 64px; height: 64px; margin: 0; padding: 3px; background: #fff; border: 1px solid #d5e0dc; border-radius: 8px; display: block; }
.qr-print-link { color: #1b7a68; font-size: 11px; font-weight: 700; text-decoration: none; }
.qr-print-link:hover { text-decoration: underline; }

.ews-account { gap: 8px; }
.ews-account a, .ews-account button, .ews-account > span, .ews-tabs a, .ews-stations a {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  height: 36px; min-height: 36px; padding: 0 16px; margin: 0; line-height: 1; font-size: 13px; font-weight: 700;
  border-radius: 999px; white-space: nowrap; width: auto;
}
.ews-account > span { background: #e3f2ee; color: #1d6b58; border: 1px solid #cfe5de; }
.ews-account button { border: 1px solid #d5e0dc; background: #fff; color: #b3261e; }
.ews-account button:hover { background: #fdeaea; border-color: #f0c4c0; }
.ews-account a:hover { background: #f3f8f6; }

.sensor-history .history-range{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-bottom:14px}
.sensor-history .history-range label{display:grid;gap:4px;font-size:.82rem;font-weight:600}
.sensor-history .history-range input{height:36px;padding:0 8px;border:1px solid #cfd9d1;border-radius:8px}
.sensor-history .history-range .save-button,.sensor-history .history-range .ghost-link{height:36px;display:inline-flex;align-items:center;padding:0 14px;border-radius:8px}
.sensor-history .ghost-link{border:1px solid #cfd9d1;text-decoration:none;color:#1f5f3f;font-weight:600}
.history-chart{width:100%;height:260px;margin:12px 0}
.history-table{width:100%;border-collapse:collapse;font-size:.88rem}
.history-table th,.history-table td{padding:6px 10px;text-align:left;border-bottom:1px solid #e8eee9}
.table-scroll{overflow-x:auto;max-height:360px;overflow-y:auto}
.sensor-history .history-range .save-button,.sensor-history .history-range .ghost-link{font-size:.85rem;font-family:inherit}

.map-full-body{margin:0;height:100vh;display:flex;flex-direction:column;background:#eef3f1;color:#1c2b33}
.map-full-bar{display:flex;align-items:center;gap:16px;padding:10px 18px;background:#fff;border-bottom:1px solid #dfe7e1}
.map-full-bar a{text-decoration:none;color:#1f5f3f;font-weight:600}
.map-full-bar span{margin-left:auto;color:#5b6b60;font-size:.88rem}
.location-map.full-map{flex:1;height:auto;min-height:0}
.map-full-legend{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:center;padding:8px 18px;background:#fff;border-top:1px solid #dfe7e1;font-size:.82rem}
.map-full-legend span{display:inline-flex;align-items:center;gap:6px}

.map-controls .map-control-link{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border:1px solid #d5dfdb;border-radius:7px;background:#fff;color:#314852;font:700 16px "Avenir Next",Avenir,sans-serif;text-decoration:none;box-shadow:0 2px 6px rgba(16,36,43,.15)}
.map-controls .map-control-link:hover{background:#f1f8f5}

.map-popup-sensor{align-items:center!important;gap:8px!important;padding:6px 0;border-top:1px solid #edf1ee}
.map-popup-sensor .health-dot{margin-top:0!important;flex:none}
.map-sensor-info{display:flex;flex-direction:column;min-width:0;flex:1;color:inherit;text-decoration:none}
.map-sensor-info b{font-size:12px;line-height:1.25}
.map-sensor-info small{color:#5b6b60;font-size:11px}
.map-sensor-info:hover b{text-decoration:underline}
.map-sensor-value{flex:none;font-size:14px;color:#1f5f3f;white-space:nowrap}
.map-popup-live{margin:6px 0 0;font-size:11px;color:#5b6b60}

.location-card-actions{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none}
.location-card-actions .status-badge{margin:0}
.location-card-actions .map-link{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 12px;border:1px solid #cfd9d1;border-radius:999px;background:#fff;color:#1f5f3f;font-size:.8rem;font-weight:600;text-decoration:none;white-space:nowrap}
.location-card-actions .map-link:hover{background:#eef6f1}
@media(max-width:700px){.location-card-actions{flex-direction:column;align-items:flex-end}}
.location-card-actions .status-badge{display:inline-flex;align-items:center;height:28px;box-sizing:border-box}
.hazard-type-heading .location-card-actions{justify-self:end;align-self:start;margin-left:auto}
.location-card-actions .map-link{font-family:inherit;font-size:.78rem}
.location-card-actions .map-link,.location-card-actions .status-badge{height:26px;line-height:1}
.hazard-type-heading > .location-card-actions{flex:none;align-self:center}
