:root {
    --canvas: #f7f9fc;
    --surface: #ffffff;
    --surface-raised: #fbfcfe;
    --surface-muted: #f1f5f9;
    --ink: #141820;
    --ink-soft: #5d6675;
    --ink-faint: #8893a3;
    --line: #dce4ee;
    --line-strong: #c5d1df;
    --blue: #0f9f98;
    --blue-strong: #047b76;
    --blue-soft: #e5f5f3;
    --green: #25a55f;
    --green-soft: #e8f7ee;
    --amber: #e9792d;
    --amber-soft: #fff2e8;
    --red: #d94c4c;
    --red-soft: #fdeeee;
    --violet: #6857c7;
    --shadow-sm: 0 12px 28px rgba(31, 41, 55, .08);
    --shadow-md: 0 20px 48px rgba(31, 41, 55, .10);
}

html[data-theme="dark"] {
    --canvas: #101623;
    --surface: #18212d;
    --surface-raised: #1d2836;
    --surface-muted: #243241;
    --ink: #eff4f7;
    --ink-soft: #b9c4cf;
    --ink-faint: #8e9baa;
    --line: #334354;
    --line-strong: #4a5c70;
    --blue: #5bc8c1;
    --blue-strong: #91e2dc;
    --blue-soft: #173d3a;
    --green: #71d3a1;
    --green-soft: #1a3d2b;
    --amber: #f0ad78;
    --amber-soft: #49321f;
    --red: #f28c8c;
    --red-soft: #48272a;
    --violet: #a99df0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .2);
    --shadow-md: 0 18px 42px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; background: var(--canvas); }
body { margin: 0; color: var(--ink); font-family: Inter, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; font-size: 16px; letter-spacing: 0; line-height: 1.55; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-strong); }
button, a, input, select, textarea { outline-color: var(--blue); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 28%, transparent); outline-offset: 2px; }

/* Top-level workspace */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header { position: sticky; z-index: 1040; top: 0; background: color-mix(in srgb, var(--surface) 94%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.app-header-inner { display: flex; align-items: center; width: min(1560px, 100%); min-height: 68px; margin: 0 auto; padding: 0 32px; gap: 34px; }
.brand-lockup { display: flex; align-items: center; flex: 0 0 auto; gap: 10px; color: var(--ink); }.brand-lockup:hover { color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: #fff; background: var(--blue); border-radius: 7px; font-size: 15px; box-shadow: 0 4px 10px color-mix(in srgb, var(--blue) 25%, transparent); }
.brand-copy { display: grid; gap: 1px; line-height: 1.15; }.brand-copy strong { font-size: 15px; font-weight: 800; }.brand-copy small { color: var(--ink-faint); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.app-nav { display: flex; align-items: stretch; align-self: stretch; gap: 3px; min-width: 0; }
.top-nav-link { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; color: var(--ink-soft)!important; font-size: 14px; font-weight: 700; white-space: nowrap; }.top-nav-link i { color: var(--ink-faint); font-size: 15px; }.top-nav-link:hover { color: var(--ink)!important; background: var(--surface-muted); }.top-nav-link.active { color: var(--blue)!important; }.top-nav-link.active i { color: var(--blue); }.top-nav-link.active:after { position: absolute; right: 12px; bottom: 0; left: 12px; height: 3px; content: ''; background: var(--blue); border-radius: 3px 3px 0 0; }
.header-tools { display: flex; align-items: center; gap: 7px; margin-left: auto; }.icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 35px; height: 35px; padding: 0; color: var(--ink-soft); background: transparent; border: 1px solid transparent; border-radius: 6px; }.icon-button:hover { color: var(--ink); background: var(--surface-muted); border-color: var(--line); }.theme-toggle i { color: var(--blue); }.header-user { display: inline-flex; align-items: center; gap: 7px; max-width: 170px; color: var(--ink-soft); font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.user-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; color: var(--blue); background: var(--blue-soft); border-radius: 50%; font-size: 12px; font-weight: 800; }.logout-btn:hover { color: var(--red); }.mobile-nav-toggle { display: none; }
.mobile-nav-panel, .mobile-nav-backdrop { display: none; }
.content-wrapper { flex: 1; padding: 34px 0 48px; }.container { width: 100%; max-width: 1440px; padding: 0 32px; }
.app-footer { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 32px; color: var(--ink-faint); border-top: 1px solid var(--line); font-size: 11px; }.app-footer i { color: var(--blue); }

/* Page structure */
.page-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }.page-titlebar h1, .page-titlebar h2, .page-titlebar h3, .page-titlebar h4 { margin: 0; color: var(--ink); font-size: 27px; font-weight: 800; }.page-titlebar h4 i { color: var(--blue); }.page-titlebar .text-muted { margin-top: 5px!important; color: var(--ink-soft)!important; font-size: 14px; }.page-titlebar > .d-flex { flex-wrap: wrap; }
.card-custom { overflow: hidden; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow-sm); }.card-custom:hover { box-shadow: var(--shadow-sm); }.card-header-custom { display: flex; align-items: center; min-height: 52px; padding: 0 20px; color: var(--ink)!important; background: var(--surface-raised)!important; border: 0!important; border-bottom: 1px solid var(--line)!important; font-size: 14px; font-weight: 800; }.card-header-custom i { color: var(--blue); }.card-body-custom { padding: 21px; }
.toolbar-card { overflow: visible; background: var(--surface-raised); border-top: 3px solid var(--blue); }.toolbar-card .card-body-custom { padding: 18px 20px; }.toolbar-card .card-header-custom { min-height: 43px; }
.form-section { padding: 18px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 6px; }.form-section + .form-section { margin-top: 14px; }.form-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: var(--ink); font-size: 13px; font-weight: 800; }.form-section-title i { color: var(--blue); }.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Forms and buttons */
.form-label { margin-bottom: 7px; color: var(--ink); font-size: 14px; font-weight: 800; }.form-control, .form-select, .form-control-custom { min-height: 44px; color: var(--ink)!important; background: var(--surface)!important; border-color: var(--line-strong)!important; border-radius: 5px!important; font-size: 15px; }.form-control::placeholder { color: var(--ink-faint); }.form-control:focus, .form-select:focus, .form-control-custom:focus { border-color: var(--blue)!important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent)!important; }.input-group-custom .input-group-text { color: var(--ink-soft); background: var(--surface-muted); border-color: var(--line-strong); }.form-text { color: var(--ink-soft)!important; font-size: 13px; }.form-text code { font-size: 13px; }
.btn { border-radius: 5px; font-size: 14px; font-weight: 800; }.btn-primary-custom, .btn-success-custom, .btn-warning-custom, .btn-danger-custom, .btn-secondary-custom { min-height: 40px; border-radius: 5px; box-shadow: none; }.btn-primary-custom, .btn-success-custom { color: #fff!important; background: var(--blue)!important; border-color: var(--blue)!important; }.btn-warning-custom { color: #fff!important; background: var(--amber)!important; border-color: var(--amber)!important; }.btn-danger-custom { color: #fff!important; background: var(--red)!important; border-color: var(--red)!important; }.btn-secondary-custom { color: var(--ink)!important; background: var(--surface)!important; border-color: var(--line-strong)!important; }.btn-primary-custom:hover, .btn-success-custom:hover, .btn-warning-custom:hover, .btn-danger-custom:hover { filter: brightness(.94); transform: translateY(-1px); }.btn-secondary-custom:hover { color: var(--ink)!important; background: var(--surface-muted)!important; }.btn-sm-custom { min-height: 33px; padding: 4px 8px; font-size: 13px; }
.alert-custom { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding: 11px 13px; border: 1px solid; border-radius: 6px; font-size: 12px; transition: opacity .24s ease; }.alert-success { color: var(--green); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 28%, transparent); }.alert-danger { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 28%, transparent); }.alert-warning { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 28%, transparent); }.alert-info { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 28%, transparent); }

/* Tables, summary cards, and shared legacy component overrides */
.table-responsive { border-radius: 0; }.table-scroll-hint { position: relative; }.table-scroll-hint:after { display: none; content: '左右滑动查看'; position: absolute; z-index: 4; top: 9px; right: 10px; padding: 2px 6px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-size: 12px; pointer-events: none; }.table-custom { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; background: var(--surface); }.table-custom thead { background: var(--surface-muted); }.table-custom th { padding: 13px 14px; color: var(--ink-soft); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; }.table-custom td { padding: 14px; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }.table-custom tbody tr:last-child td { border-bottom: 0; }.table-custom tbody tr:hover { background: color-mix(in srgb, var(--blue-soft) 52%, var(--surface)); }.table-custom code, code { padding: 3px 6px; color: var(--ink); background: var(--surface-muted); border-radius: 3px; font-size: 13px; }.table-custom thead th:first-child, .table-custom tbody td:first-child { position: sticky; left: 0; z-index: 1; background: inherit; }.table-custom thead th:first-child { z-index: 2; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }.kpi-card { position: relative; overflow: hidden; padding: 16px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }.kpi-card:before { position: absolute; inset: 0 auto 0 0; width: 3px; content: ''; background: var(--blue); }.kpi-label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }.kpi-value { margin-top: 6px; color: var(--ink); font-size: 25px; font-weight: 800; line-height: 1; }.badge { border-radius: 4px; font-size: 10px; font-weight: 800; }.pagination-custom .page-link { color: var(--ink-soft); background: var(--surface); border-color: var(--line); border-radius: 4px; }.pagination-custom .page-item.active .page-link { color: #fff; background: var(--blue); border-color: var(--blue); }.pagination-custom .page-link:hover { color: var(--blue-strong); background: var(--blue-soft); border-color: var(--blue); }
.soc-tag, .project-more-btn { color: var(--ink-soft)!important; background: var(--surface-muted)!important; border-color: var(--line)!important; }.project-count { color: var(--ink-soft)!important; }.project-count strong { color: var(--blue)!important; }.project-tag, .project-grid-item, .detail-project-tag, .badge-project { color: var(--blue)!important; background: var(--blue-soft)!important; border-color: color-mix(in srgb, var(--blue) 25%, transparent)!important; }.project-more-btn:hover, .detail-project-tag:hover, .detail-project-tag.active { color: #fff!important; background: var(--blue)!important; }.ownership-self { color: var(--green)!important; background: var(--green-soft)!important; }.ownership-other { color: var(--amber)!important; background: var(--amber-soft)!important; }.info-label, .kv-label { color: var(--ink-soft)!important; }.info-label i { color: var(--blue)!important; }.info-value, .kv-value { color: var(--ink)!important; background: var(--surface-muted)!important; border-color: var(--line)!important; }.info-text { color: var(--ink)!important; }.info-value-remark { color: var(--amber)!important; background: var(--amber-soft)!important; border-color: color-mix(in srgb, var(--amber) 35%, transparent)!important; }.detail-project-section { background: var(--surface-raised)!important; border-color: var(--line)!important; }.detail-project-header { color: var(--ink)!important; border-bottom-color: var(--line)!important; }.log-table thead th { color: var(--ink-soft)!important; background: var(--surface-muted)!important; border-bottom-color: var(--line)!important; }.log-table tbody td { border-bottom-color: var(--line)!important; }.log-table tbody tr:hover { background: var(--blue-soft)!important; }.kv-old { color: var(--red)!important; background: var(--red-soft)!important; }.kv-new { color: var(--green)!important; background: var(--green-soft)!important; }.kv-arrow { color: var(--ink-faint)!important; }.bg-light { background-color: var(--surface-muted)!important; }.bg-success.bg-opacity-10 { background-color: var(--green-soft)!important; }.bg-danger.bg-opacity-10 { background-color: var(--red-soft)!important; }.bg-primary.bg-opacity-10 { background-color: var(--blue-soft)!important; }.text-success { color: var(--green)!important; }.text-danger { color: var(--red)!important; }.text-primary { color: var(--blue)!important; }
.project-modal .modal-content, .modal-content { color: var(--ink)!important; background: var(--surface)!important; border-color: var(--line)!important; border-radius: 7px!important; }.project-modal .modal-header { color: var(--ink)!important; background: var(--surface-raised)!important; border-bottom: 1px solid var(--line)!important; }.project-modal .modal-header .btn-close { filter: none!important; }.project-modal .modal-footer, .modal-header, .modal-footer { border-color: var(--line)!important; }

/* Board registration */
.board-form-workspace { max-width: 1220px; margin: 0 auto; }.board-form-intro { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }.board-form-intro-mark { display: grid; place-items: center; width: 39px; height: 39px; color: var(--blue); background: var(--blue-soft); border-radius: 7px; font-size: 16px; }.board-form-intro h1 { margin: 0; color: var(--ink); font-size: 23px; font-weight: 800; }.board-form-intro p { margin: 3px 0 0; color: var(--ink-soft); font-size: 12px; }.board-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; align-items: start; }.board-form-main { display: grid; gap: 16px; }.board-form-side { position: sticky; top: 92px; }.form-panel { padding: 21px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow-sm); }.form-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }.form-panel-heading h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: 14px; font-weight: 800; }.form-panel-heading i { color: var(--blue); }.form-panel-heading small { color: var(--ink-soft); font-size: 11px; }.board-rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 16px; }.form-field-full { grid-column: 1 / -1; }.board-device-panel { padding: 21px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 7px; box-shadow: var(--shadow-sm); }.board-device-status { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 13px; color: var(--blue); font-size: 11px; font-weight: 800; }.board-device-status i { width: 7px; height: 7px; background: var(--blue); border-radius: 50%; }.board-device-panel .form-control { font-family: Consolas, Monaco, monospace; }.device-rule-preview { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 12px; color: var(--ink-soft); background: var(--surface-muted); border-radius: 5px; font-size: 11px; line-height: 1.65; }.device-rule-preview i { margin-top: 3px; color: var(--blue); }.device-rule-preview code { margin-left: 3px; }.board-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }.form-workspace { max-width: 980px; }.form-workspace .card-body-custom { padding: 24px; }

/* Login and error page */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--canvas); }.login-layout { display: grid; grid-template-columns: minmax(310px, 1fr) minmax(350px, 430px); width: min(100%, 980px); min-height: 570px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); }.login-aside { position: relative; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: 40px; color: #eaf2ff; background: #18355f; }.login-aside:before { position: absolute; inset: 0; content: ''; background: linear-gradient(140deg, rgba(13,28,55,.32), rgba(35,93,184,.22)); pointer-events: none; }.login-aside > * { position: relative; z-index: 1; }.circuit-art { position: absolute; inset: 0; z-index: 0; opacity: .65; background: linear-gradient(115deg, transparent 34%, rgba(175,207,255,.19) 34.3%, transparent 34.6%), repeating-linear-gradient(90deg, transparent 0 58px, rgba(175,207,255,.08) 59px 60px); }.chip-core { position: absolute; top: 76px; right: 73px; width: 130px; height: 130px; background: rgba(82,140,240,.26); border: 2px solid rgba(196,219,255,.5); border-radius: 8px; box-shadow: 0 0 0 18px rgba(128,173,250,.07), 0 0 42px rgba(120,163,240,.24); }.chip-core:after { position: absolute; inset: 33px; content: ''; background: rgba(16,47,94,.8); border-radius: 4px; }.circuit-art i { position: absolute; width: 82px; height: 2px; background: rgba(175,207,255,.4); transform-origin: left; }.circuit-art i:nth-of-type(1){top:142px;right:17px}.circuit-art i:nth-of-type(2){top:225px;right:172px;transform:rotate(90deg)}.circuit-art i:nth-of-type(3){top:275px;right:55px;transform:rotate(-27deg)}.circuit-art i:nth-of-type(4){top:99px;right:219px;transform:rotate(145deg)}.circuit-art i:nth-of-type(5){top:329px;right:8px;transform:rotate(180deg)}.circuit-art i:nth-of-type(6){top:38px;right:34px;transform:rotate(61deg)}.login-aside-mark { display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: auto; color: #d7e7ff; background: rgba(202,221,255,.14); border: 1px solid rgba(214,230,255,.26); border-radius: 7px; font-size: 18px; }.login-theme-toggle { position: absolute; z-index: 2; top: 27px; right: 27px; display: grid; place-items: center; width: 34px; height: 34px; color: #d7e7ff; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 5px; }.login-aside-kicker { margin-bottom: 12px; color: #b8d5ff; font-size: 10px; font-weight: 800; letter-spacing: .14em; }.login-aside h1 { margin: 0 0 11px; color: #fff; font-size: 29px; font-weight: 800; }.login-aside p { max-width: 300px; margin: 0 0 35px; color: #d3e2f8; font-size: 13px; line-height: 1.8; }.login-aside-metrics { display: flex; gap: 28px; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.13); }.login-aside-metrics span { display: grid; gap: 3px; }.login-aside-metrics strong { color: #d5e6ff; font-size: 10px; letter-spacing: .09em; }.login-aside-metrics small { color: #adc7e9; font-size: 10px; }.login-wrapper { display: flex; align-items: center; }.login-card { width: 100%; }.login-header { padding: 34px 34px 23px; border-bottom: 1px solid var(--line); }.login-header .logo { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px; color: var(--blue); background: var(--blue-soft); border-radius: 6px; font-size: 14px; }.login-header h4 { margin: 0 0 5px; color: var(--ink); font-size: 21px; font-weight: 800; }.login-header p { margin: 0; color: var(--ink-soft); font-size: 12px; }.login-body { padding: 29px 34px 31px; }.login-page .form-group { margin-bottom: 19px; }.login-page .form-label { display: block; }.login-page .input-group { position: relative; }.login-page .input-icon { position: absolute; z-index: 3; top: 50%; left: 13px; color: var(--ink-faint); font-size: 12px; transform: translateY(-50%); }.login-page .form-control { padding: 10px 40px 10px 37px; }.password-toggle { position: absolute; z-index: 3; top: 50%; right: 9px; padding: 6px; color: var(--ink-soft); background: transparent; border: 0; transform: translateY(-50%); }.btn-login { width: 100%; min-height: 40px; color: #fff; background: var(--blue); border: 1px solid var(--blue); border-radius: 5px; font-size: 13px; font-weight: 800; }.btn-login:hover { background: var(--blue-strong); }.alert-error { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 11px 12px; color: var(--red); background: var(--red-soft); border: 1px solid color-mix(in srgb, var(--red) 28%, transparent); border-radius: 5px; font-size: 12px; }.login-page .footer { padding: 16px 34px; color: var(--ink-faint); border-top: 1px solid var(--line); font-size: 10px; }
.error-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--canvas); }.error-panel { width: min(100%, 520px); padding: 46px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 7px; box-shadow: var(--shadow-md); }.error-code { color: var(--blue); font-size: 76px; font-weight: 900; line-height: 1; }.error-kicker { margin-top: 13px; color: var(--ink-faint); font-size: 10px; font-weight: 800; letter-spacing: .14em; }.error-panel h1 { margin: 12px 0 8px; color: var(--ink); font-size: 23px; font-weight: 800; }.error-panel p { margin: 0 0 24px; color: var(--ink-soft); font-size: 13px; }

@media (max-width: 1060px) { .app-header-inner { gap: 18px; padding: 0 22px; }.top-nav-link { padding: 0 9px; }.top-nav-link span { font-size: 11px; }.header-user > span:last-child { display: none; }.container { padding: 0 22px; } }
@media (max-width: 820px) { .app-header-inner { min-height: 60px; padding: 0 16px; }.app-nav, .header-user, .logout-btn { display: none; }.mobile-nav-toggle { display: inline-grid; }.mobile-nav-panel { position: fixed; z-index: 1060; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(310px, 86vw); padding: 15px; background: var(--surface); box-shadow: var(--shadow-md); transform: translateX(105%); transition: transform .2s ease; }.mobile-nav-open .mobile-nav-panel { transform: translateX(0); }.mobile-nav-backdrop { position: fixed; z-index: 1050; inset: 0; background: rgba(18, 25, 38, .42); opacity: 0; pointer-events: none; transition: opacity .2s ease; }.mobile-nav-open .mobile-nav-backdrop { opacity: 1; pointer-events: auto; }.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 3px 13px; color: var(--ink); border-bottom: 1px solid var(--line); }.mobile-nav-links { display: grid; gap: 4px; padding-top: 14px; }.mobile-nav-link { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 11px; color: var(--ink-soft)!important; border-radius: 5px; font-size: 13px; font-weight: 700; }.mobile-nav-link i { width: 17px; color: var(--ink-faint); text-align: center; }.mobile-nav-link.active { color: var(--blue)!important; background: var(--blue-soft); }.mobile-nav-link.active i { color: var(--blue); }.content-wrapper { padding: 24px 0 34px; }.container { padding: 0 16px; }.app-footer { padding: 0 16px; }.page-titlebar { align-items: flex-start; flex-direction: column; gap: 13px; }.kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.table-custom { min-width: 760px; }.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }.table-scroll-hint:after { display: block; }.board-form-layout { grid-template-columns: 1fr; }.board-form-side { position: static; }.board-device-panel { margin-bottom: 0; }.login-layout { grid-template-columns: 1fr; min-height: 0; }.login-aside { min-height: 205px; padding: 24px; }.login-aside-mark { margin-bottom: 24px; }.login-aside h1 { font-size: 23px; }.login-aside p, .login-aside-metrics { display: none; }.chip-core { top: 30px; right: 40px; width: 94px; height: 94px; }.login-header, .login-body, .login-page .footer { padding-left: 24px; padding-right: 24px; } }
@media (max-width: 520px) { .brand-copy small { display: none; }.content-wrapper { padding-top: 20px; }.page-titlebar h4, .board-form-intro h1 { font-size: 20px; }.board-rules-grid { grid-template-columns: 1fr; }.form-field-full { grid-column: auto; }.form-panel, .board-device-panel { padding: 16px; }.board-form-actions { flex-wrap: wrap; }.board-form-actions .btn { flex: 1; }.card-body-custom { padding: 15px; }.toolbar-card .card-body-custom { padding: 15px; }.app-footer { font-size: 10px; }.app-footer span:last-child { display: none; } }

/* Final legacy-page normalization: these rules intentionally follow page-local styles. */
.text-muted, .text-secondary { color: var(--ink-soft)!important; }
.text-dark { color: var(--ink)!important; }
.badge.bg-primary { color: #fff!important; background: var(--blue)!important; }
.badge.bg-success { color: #fff!important; background: var(--green)!important; }
.badge.bg-danger { color: #fff!important; background: var(--red)!important; }
.badge.bg-warning { color: #fff!important; background: var(--amber)!important; }
.badge.bg-secondary { color: #fff!important; background: var(--ink-soft)!important; }
.detail-header.success { color: var(--green)!important; }
.detail-header.warning { color: var(--amber)!important; }
.detail-header.danger { color: var(--red)!important; }
.remark-placeholder { color: var(--amber)!important; }
.info-value-empty { color: var(--ink-faint)!important; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }
html[data-theme="dark"] .project-modal .modal-header .btn-close { filter: invert(1) grayscale(1)!important; }
.board-form-actions { grid-column: 1 / -1; }

/* Readability scale for dense operational views. */
.alert-custom { font-size: 13px; }
.kpi-label { font-size: 12px; }
.kpi-value { font-size: 28px; }
.board-form-intro h1 { font-size: 25px; }
.board-form-intro p { font-size: 13px; }
.form-panel-heading h2 { font-size: 15px; }
.form-panel-heading small, .board-device-status, .device-rule-preview { font-size: 12px; }
.mobile-nav-link { font-size: 14px; }
.app-footer { font-size: 12px; }
.form-page-titlebar, .form-workspace { width: 100%; max-width: 980px; margin-right: auto; margin-left: auto; }
.form-workspace .card-body-custom { padding: 26px; }
.form-workspace .form-section { padding: 20px; }
.form-workspace .form-section-title > span { margin-left: auto; color: var(--ink-faint); font-size: 12px; font-weight: 700; }
.form-workspace input[readonly] { color: var(--ink-soft)!important; background: var(--surface-muted)!important; cursor: text; }
.edit-record-context { margin-bottom: 16px; }

/* Visual direction adapted from the supplied reference: quiet surfaces, teal action, compact rounding. */
.app-shell { position: relative; }
html:not([data-theme="dark"]), html:not([data-theme="dark"]) body { background: #f7f9fc; }
html:not([data-theme="dark"]) body:not(.login-page):not(.error-page) { overflow-x: hidden; background: linear-gradient(135deg, rgba(15, 159, 152, .10), transparent 30%), linear-gradient(115deg, #f7f9fc 0%, #f8fbff 42%, #fff7ef 100%); }
html:not([data-theme="dark"]) body:not(.login-page):not(.error-page)::before { position: fixed; inset: 0; z-index: 0; pointer-events: none; content: ''; background-image: linear-gradient(rgba(20, 24, 32, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(20, 24, 32, .04) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000 0%, transparent 80%); }
.app-header { border-bottom-color: rgba(220, 228, 238, .85); background: rgba(247, 249, 252, .86); backdrop-filter: blur(18px); }
.app-header-inner { min-height: 72px; }
.brand-mark { width: 38px; height: 38px; border: 1px solid rgba(15, 159, 152, .28); background: linear-gradient(135deg, #0f9f98, #6857c7); box-shadow: 0 10px 20px rgba(15, 159, 152, .22); }
.app-nav { gap: 8px; }
.top-nav-link { min-height: 34px; padding: 0 12px; border-radius: 8px; }
.top-nav-link:hover { color: #047b76!important; background: rgba(15, 159, 152, .09); }
.top-nav-link.active { color: #047b76!important; background: rgba(15, 159, 152, .11); }
.top-nav-link.active:after { display: none; }
.card-custom, .form-panel, .board-device-panel { border-color: var(--line); border-radius: 8px; background: rgba(255, 255, 255, .90); box-shadow: var(--shadow-sm); }
.form-section { background: rgba(255, 255, 255, .90); box-shadow: var(--shadow-sm); }
.table-custom { background: rgba(255, 255, 255, .90); }
.table-custom thead, .card-header-custom { background: #f3f7fb!important; }
.table-custom tbody tr:hover { background: rgba(15, 159, 152, .06); }
.toolbar-card { border-top-color: var(--blue); }
.btn-primary-custom, .btn-success-custom { background: #047b76!important; border-color: #047b76!important; box-shadow: 0 16px 28px rgba(4, 123, 118, .22); }
.btn-primary-custom:hover, .btn-success-custom:hover { background: #086c68!important; }
.btn-secondary-custom { background: rgba(255, 255, 255, .72)!important; }
.btn-secondary-custom:hover { background: #fff!important; box-shadow: var(--shadow-sm); }
.input-group-custom .input-group-text { min-width: 44px; justify-content: center; }
html[data-theme="dark"] .app-header { border-bottom-color: var(--line); background: color-mix(in srgb, var(--canvas) 86%, transparent); }
html[data-theme="dark"] .brand-mark { border-color: rgba(91, 200, 193, .32); background: linear-gradient(135deg, var(--blue), var(--violet)); }
html[data-theme="dark"] .card-custom, html[data-theme="dark"] .form-panel, html[data-theme="dark"] .board-device-panel, html[data-theme="dark"] .form-section { background: color-mix(in srgb, var(--surface) 92%, transparent); }

@media (max-width: 520px) {
    .board-form-intro h1 { font-size: 22px; }
    .form-panel-heading h2 { font-size: 14px; }
}

/* Reference visual layer: apply the same gradient and grid treatment to every entry state. */
html:not([data-theme="dark"]) body.login-page,
html:not([data-theme="dark"]) body.error-page {
    position: relative;
    overflow-x: hidden;
    background:
        linear-gradient(135deg, rgba(15, 159, 152, .10), transparent 30%),
        linear-gradient(115deg, #f7f9fc 0%, #f8fbff 42%, #fff7ef 100%);
}
html:not([data-theme="dark"]) body.login-page::before,
html:not([data-theme="dark"]) body.error-page::before {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    content: '';
    background-image:
        linear-gradient(rgba(20, 24, 32, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 24, 32, .04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
}
.login-layout,
.error-panel {
    position: relative;
    z-index: 1;
}
.login-layout {
    background: rgba(255, 255, 255, .90);
}
.login-aside {
    color: #d9f7ee;
    background: #101623;
}
.login-aside::before {
    background:
        linear-gradient(135deg, rgba(15, 159, 152, .28), transparent 48%),
        linear-gradient(315deg, rgba(104, 87, 199, .24), transparent 54%);
}
.circuit-art {
    opacity: 1;
    background-image:
        linear-gradient(rgba(217, 247, 238, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(217, 247, 238, .08) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, #000, transparent 88%);
}
.chip-core {
    background: rgba(15, 159, 152, .16);
    border-color: rgba(217, 247, 238, .48);
    box-shadow: 0 0 0 18px rgba(15, 159, 152, .08), 0 0 42px rgba(104, 87, 199, .20);
}
.chip-core::after { background: rgba(16, 22, 35, .82); }
.circuit-art i { background: rgba(217, 247, 238, .30); }
.login-aside-mark {
    color: #fff;
    border-color: rgba(255, 255, 255, .18);
    background: linear-gradient(135deg, #0f9f98, #6857c7);
    box-shadow: 0 10px 20px rgba(15, 159, 152, .22);
}
.login-theme-toggle {
    color: #d9f7ee;
    border-color: rgba(217, 247, 238, .20);
    background: rgba(255, 255, 255, .08);
}
.login-aside-kicker { color: #9fe1d5; }
.login-aside p { color: #c5d1df; }
.login-aside-metrics { border-top-color: rgba(217, 247, 238, .16); }
.login-aside-metrics strong { color: #d9f7ee; }
.login-aside-metrics small { color: #aab7c7; }
.login-header .logo {
    color: #fff;
    background: linear-gradient(135deg, #0f9f98, #6857c7);
    box-shadow: 0 10px 20px rgba(15, 159, 152, .18);
}
.btn-login {
    background: #047b76;
    border-color: #047b76;
    box-shadow: 0 16px 28px rgba(4, 123, 118, .22);
}
.btn-login:hover { background: #086c68; }

/* These pages retain local legacy styles, so the shared visual language must win the cascade. */
.project-modal .modal-header {
    color: var(--ink)!important;
    background: #f3f7fb!important;
    border-bottom: 1px solid var(--line)!important;
}
.project-modal .modal-header .btn-close { filter: none!important; }
.project-tag,
.project-grid-item {
    color: #047b76!important;
    background: rgba(15, 159, 152, .08)!important;
    border-color: rgba(15, 159, 152, .22)!important;
}
.project-more-btn:hover {
    color: #fff!important;
    background: #047b76!important;
    border-color: #047b76!important;
}
.log-table thead th {
    color: #384152!important;
    background: #f3f7fb!important;
    border-bottom-color: var(--line)!important;
}
.log-table tbody td { border-bottom-color: var(--line)!important; }
.log-table tbody tr:hover { background: rgba(15, 159, 152, .06)!important; }
html[data-theme="dark"] .login-page,
html[data-theme="dark"] .error-page { background: var(--canvas); }
html[data-theme="dark"] .login-page::before,
html[data-theme="dark"] .error-page::before { display: none; }
html[data-theme="dark"] .login-layout { background: color-mix(in srgb, var(--surface) 94%, transparent); }
html[data-theme="dark"] .project-modal .modal-header { color: var(--ink)!important; background: var(--surface-raised)!important; }
html[data-theme="dark"] .project-modal .modal-header .btn-close { filter: invert(1) grayscale(1)!important; }
