:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #172b3c;
  background: #f3f7f8;
  font-synthesis: none;
  --navy: #09283a;
  --navy-deep: #071f30;
  --teal: #0aa98f;
  --teal-dark: #087d70;
  --line: #e1e9ed;
  --muted: #7f919e;
  --content-pad: clamp(1.1rem, 2vw, 2.25rem);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f3f7f8; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #6dd1bd; outline-offset: 2px; }
button:not(:disabled) { transition: background .18s, color .18s, border-color .18s, box-shadow .18s, transform .18s; }
button:not(:disabled):active { transform: translateY(1px); }
button:not(.nav-scrim, .nav-toggle) { border-radius: 10px; padding: .68rem 1rem; color: #fff; background: #087f75; font-weight: 750; }
button:not(.nav-scrim, .nav-toggle, .secondary, [data-view], .hero-primary, .hero-secondary):hover { background: #056c63; }
button.secondary { color: #126b68; background: #e8f4f1; }
button.secondary:hover { background: #d9eeea; }
input, select { width: 100%; min-height: 44px; padding: .72rem .84rem; border: 1px solid #d5e0e8; border-radius: 10px; background: #fff; color: #17273b; }
label { display: grid; gap: .45rem; font-weight: 700; font-size: .88rem; color: #344558; }
.muted { color: #82909e; }
.error { color: #bc3041 !important; }
.eyebrow { color: #188878; font-size: .62rem; font-weight: 900; letter-spacing: .17em; }
.brand-mark { width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none; border-radius: 12px; background: linear-gradient(145deg, #14c2aa, #08766d); color: white; box-shadow: 0 9px 25px #09a38d31; font-size: 1rem; font-weight: 850; letter-spacing: -.04em; }

/* Login */
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 12% 15%, #c9eee8 0, transparent 36%), radial-gradient(circle at 90% 85%, #d6e6f4 0, transparent 34%), #f4f7f9; }
.login-card { width: min(100%, 430px); display: grid; gap: 1.05rem; padding: 2.4rem; border: 1px solid #e3ebee; border-radius: 24px; background: #fff; box-shadow: 0 32px 80px #182b3c1a, 0 8px 20px #182b3c0a; }
.login-card h1 { margin: -.35rem 0 0; font-size: 1.8rem; letter-spacing: -.04em; }
.login-card p { margin: 0; }
.login-card .muted { margin: -.8rem 0 .45rem; line-height: 1.7; }
.login-card button { min-height: 48px; margin-top: .25rem; }
.login-card .error:empty { display: none; }

/* Frame and navigation */
.app-shell { display: grid; grid-template-columns: 276px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 30; height: 100vh; display: flex; flex-direction: column; padding: 1.15rem .85rem .85rem; color: #d7e5e9; background: linear-gradient(165deg, #0b2e42 0%, #09283a 54%, #071f30 100%); box-shadow: 10px 0 32px #112d3811; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #375466 transparent; }
.brand { display: flex; gap: .75rem; align-items: center; padding: .12rem .5rem .9rem; }
.brand strong { display: block; color: #f9ffff; font-size: .96rem; font-weight: 850; letter-spacing: .01em; }
.brand small { display: block; margin-top: .18rem; color: #8ba9b5; font-size: .58rem; font-weight: 850; letter-spacing: .14em; }
.workspace-label { display: flex; gap: .55rem; align-items: center; justify-content: space-between; margin: .1rem .35rem 1rem; padding: .68rem .78rem; border: 1px solid #62d6c04d; border-radius: 10px; background: #43b1a313; color: #d7f5ee; font-size: .71rem; font-weight: 750; }
.workspace-label::after { content: '⌄'; color: #86b8b5; }
.workspace-dot, .pulse-dot { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; background: #21d4b3; box-shadow: 0 0 0 4px #55d5b829; }
.sidebar nav { display: grid; gap: .8rem; padding-bottom: 1.25rem; }
.nav-group { display: grid; gap: .13rem; }
.nav-group > span { padding: .22rem .72rem .35rem; color: #7697a5; font-size: .64rem; font-weight: 850; letter-spacing: .05em; }
.sidebar nav button[data-view] { width: 100%; display: flex; align-items: center; gap: .72rem; min-height: 38px; padding: .44rem .62rem; border: 1px solid transparent; border-radius: 9px; color: #bfd0d6; background: transparent; text-align: left; font-size: .79rem; font-weight: 650; }
.sidebar nav button[data-view]:hover { color: #fff; background: #ffffff12; }
.sidebar nav button[data-view].active { border-color: #43b69c31; color: #f2fffc; background: linear-gradient(90deg, #087f708f, #176a6660); box-shadow: inset 3px 0 #3ee1bd; }
.nav-icon { width: 27px; height: 27px; flex: none; display: grid; place-items: center; border: 1px solid #6a94a530; border-radius: 7px; color: #9fbdc8; background: #ffffff0a; font-style: normal; font-size: .59rem; font-weight: 850; }
.sidebar nav button.active .nav-icon { border-color: #5fd3b64a; color: #cbfff3; background: #66d4b729; }
.sidebar-footer { display: flex; align-items: center; gap: .62rem; margin-top: auto; padding: .75rem .45rem .08rem; border-top: 1px solid #ffffff17; }
.profile-avatar { width: 35px; height: 35px; flex: none; display: grid; place-items: center; border-radius: 10px; color: #c9fff2; background: #2f89796b; font-size: .68rem; font-weight: 850; }
.profile-copy { flex: 1; min-width: 0; }
.profile-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f2fcfb; font-size: .76rem; }
.profile-copy small { display: block; color: #7f9da9; font-size: .65rem; }
.sidebar-footer button#logout { padding: .4rem .5rem; border: 1px solid #ffffff1c; border-radius: 8px; color: #a9c5ca; background: #ffffff0b; font-size: .67rem; white-space: nowrap; }
.sidebar-footer button#logout:hover { color: #fff; background: #ffffff20; }
.nav-toggle, .nav-scrim { display: none; }

/* Main surface and top command bar */
.content { width: 100%; min-width: 0; max-width: 1920px; margin: 0 auto; padding: 0 var(--content-pad) 3rem; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; display: grid; grid-template-columns: minmax(180px, .72fr) minmax(300px, 1.35fr) minmax(320px, .95fr); align-items: center; gap: 1.1rem; margin: 0 calc(-1 * var(--content-pad)); padding: .6rem var(--content-pad); border-bottom: 1px solid #e4eaed; background: #ffffffeb; backdrop-filter: blur(16px); box-shadow: 0 3px 16px #152d3a08; }
.topbar-main { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.topbar-divider { width: 1px; height: 26px; background: #e1e8eb; }
.breadcrumb { display: flex; align-items: center; gap: .5rem; min-width: 0; color: #9aa9b2; font-size: .71rem; white-space: nowrap; }
.breadcrumb strong { overflow: hidden; text-overflow: ellipsis; color: #526979; }
.breadcrumb b { color: #c1ccd1; }
.workspace-search { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .58rem; padding: 0 .72rem; border: 1px solid #e6ecef; border-radius: 10px; background: #f5f8fa; color: #90a1ac; }
.workspace-search input { min-height: 38px; padding: 0; border: 0; outline: 0; background: transparent; font-size: .72rem; }
.workspace-search kbd { padding: .18rem .36rem; border: 1px solid #dce5e9; border-radius: 5px; background: #fff; color: #8698a4; font-size: .57rem; box-shadow: 0 1px 2px #1b33420a; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: .62rem; min-width: 0; }
.online-status { display: inline-flex; align-items: center; gap: .46rem; padding-right: .75rem; border-right: 1px solid #e5ebee; color: #334f60; font-size: .69rem; font-weight: 750; white-space: nowrap; }
.online-status i { width: 7px; height: 7px; border-radius: 50%; background: #11ba99; box-shadow: 0 0 0 5px #12b99916; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0 !important; border: 1px solid #e2e9ec; background: #fff !important; color: #4c6472 !important; font-size: 1rem; }
.account-button { max-width: 190px; display: flex; align-items: center; gap: .55rem; padding: .25rem .35rem !important; background: transparent !important; color: #283f50 !important; text-align: left; }
.account-button > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 50%; background: #123a5d; color: #fff; }
.account-button > span:nth-child(2) { min-width: 0; flex: 1; }
.account-button strong, .account-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button strong { font-size: .72rem; }
.account-button small { margin-top: .12rem; color: #91a1aa; font-size: .59rem; }
.account-button i { color: #78909c; font-style: normal; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 1.55rem 0 1.15rem; }
.page-head h1 { margin: 0; color: #102a3d; font-size: clamp(1.55rem, 2.1vw, 2rem); font-weight: 900; letter-spacing: -.055em; }
.page-head p { margin: .32rem 0 0; color: #82939e; font-size: .76rem; }
.page-controls { display: flex; align-items: center; gap: .55rem; }
.expiry-badge, .updated-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .58rem .78rem; border: 1px solid #dde8e8; border-radius: 999px; background: #fff; color: #526e78; box-shadow: 0 5px 18px #133a3f07; font-size: .66rem; font-weight: 750; white-space: nowrap; }
.expiry-badge::before, .updated-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #18b698; }
.updated-badge::before { background: #3aa5e8; }
.message { margin: 0; color: #087f75; font-size: .78rem; }
.message:not(:empty) { margin: 0 0 .9rem; padding: .65rem .82rem; border: 1px solid #d6efe9; border-radius: 10px; background: #f0faf7; }
.message.error { border-color: #f0c7ce; background: #fff3f4; }
.view { min-width: 0; }

/* Reference-style overview */
.welcome-banner { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(340px, 1.25fr) minmax(390px, 1fr) 178px; align-items: center; min-height: 188px; overflow: hidden; padding: 1.65rem 1.9rem; border-radius: 18px; background: radial-gradient(circle at 74% -30%, #28a58a7a, transparent 38%), linear-gradient(112deg, #0a3449 0%, #0b5d5a 57%, #049071 100%); box-shadow: 0 18px 34px #123b481a; color: #fff; }
.welcome-banner::after { content: ''; position: absolute; right: -90px; top: -125px; width: 410px; height: 410px; border: 1px solid #ffffff1f; border-radius: 50%; box-shadow: 0 0 0 56px #ffffff08, 0 0 0 112px #ffffff05; z-index: -1; }
.welcome-content { position: relative; z-index: 1; min-width: 0; padding-right: 1.2rem; }
.welcome-eyebrow { display: inline-flex; align-items: center; gap: .65rem; color: #b4f1e3; font-size: .63rem; font-weight: 900; letter-spacing: .17em; }
.welcome-banner h2 { margin: .62rem 0 .32rem; font-size: clamp(1.42rem, 2vw, 2rem); font-weight: 900; letter-spacing: -.045em; }
.welcome-banner p { max-width: 540px; margin: 0; color: #b8d8d8; font-size: .76rem; line-height: 1.65; }
.welcome-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.05rem; }
.welcome-meta span { padding: .38rem .64rem; border: 1px solid #b7f4e02b; border-radius: 999px; color: #d9f4ef; background: #ffffff12; font-size: .65rem; font-weight: 750; }
.welcome-meta .healthy-chip { background: #22c5a12b; color: #bffff0; }
.healthy-chip i { display: inline-block; width: 6px; height: 6px; margin-right: .32rem; border-radius: 50%; background: #46ebbd; }
.hero-metrics { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; border-left: 1px solid #ffffff1e; }
.hero-metrics > div { position: relative; min-width: 0; padding: .35rem .82rem; border-right: 1px solid #ffffff1e; }
.hero-metric-icon { float: left; width: 31px; height: 31px; display: grid; place-items: center; margin-right: .55rem; border: 1px solid #ffffff21; border-radius: 9px; color: #cffff5; background: #ffffff12; font-size: .58rem; font-weight: 900; }
.hero-metrics p { margin: .08rem 0 .2rem; color: #a9cfcd; font-size: .62rem; white-space: nowrap; }
.hero-metrics strong { display: block; color: #fff; font-size: 1.48rem; line-height: 1.05; letter-spacing: -.04em; }
.hero-metrics small { display: block; margin: .32rem 0 0 2.72rem; color: #8fd0c7; font-size: .56rem; }
.hero-actions { position: relative; z-index: 2; display: grid; gap: .62rem; padding-left: 1rem; }
.hero-actions button { width: 100%; padding: .72rem .8rem; border: 1px solid #ffffff31; border-radius: 9px; font-size: .69rem; }
.hero-primary { background: #fff !important; color: #087c6e !important; box-shadow: 0 8px 18px #003b3326; }
.hero-secondary { background: #083f4380 !important; color: #e9fffa !important; }
.welcome-art { position: absolute; right: 7%; top: 30%; width: 125px; height: 88px; transform: rotate(-13deg); opacity: .2; }
.welcome-art span { position: absolute; width: 104px; height: 65px; border: 1px solid #b1e9d9; border-radius: 11px; background: linear-gradient(125deg, #eaffff35, #7df1c30b); }
.welcome-art span:nth-child(2) { top: 12px; left: 17px; }
.welcome-art span:nth-child(3) { top: 24px; left: 34px; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .72rem; margin: 1rem 0; }
.kpi-card { min-width: 0; display: flex; align-items: flex-start; gap: .62rem; min-height: 104px; padding: .85rem .78rem; border: 1px solid #e0e8eb; border-radius: 13px; background: #fff; box-shadow: 0 6px 18px #183b4a09; }
.kpi-icon, .summary-icon { width: 29px; height: 29px; display: grid; place-items: center; flex: none; border-radius: 8px; color: #079b83; background: #dcf6ef; font-size: .55rem; font-weight: 900; }
.kpi-icon.blue, .summary-icon.blue { color: #338bd4; background: #e7f2fc; }
.kpi-icon.orange, .summary-icon.warn { color: #dd8435; background: #fff1e4; }
.kpi-icon.purple { color: #745bd2; background: #eeeafd; }
.kpi-card > div { min-width: 0; display: grid; gap: .17rem; }
.kpi-card span:not(.kpi-icon) { color: #607784; font-size: .62rem; font-weight: 750; }
.kpi-card strong { color: #142e42; font-size: 1.17rem; letter-spacing: -.035em; }
.kpi-card small { color: #99a8b1; font-size: .55rem; line-height: 1.35; }
.stat-empty { grid-column: 1 / -1; padding: 1.4rem; border: 1px dashed #cee0e3; border-radius: 14px; color: #8197a0; background: #fff; }
.dashboard-grid { display: grid; gap: .85rem; }
.dashboard-grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(270px, .95fr) minmax(270px, .95fr); }
.dashboard-grid-bottom { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .85rem; }
.dashboard-panel { min-width: 0; margin: 0; padding: 1rem 1.08rem; border: 1px solid #e0e8eb; border-radius: 14px; background: #fff; box-shadow: 0 7px 20px #183b4a08; }
.dashboard-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .7rem; }
.dashboard-panel h2 { margin: .2rem 0 0; color: #173146; font-size: .93rem; }
.panel-chip { padding: .3rem .5rem; border: 1px solid #dfe9ec; border-radius: 7px; color: #6d828e; background: #f8fafb; font-size: .59rem; white-space: nowrap; }
.business-chart { min-height: 220px; }
.business-chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-grid line { stroke: #e9eff2; stroke-width: 1; }
.chart-area { fill: url(#agent-chart-fill); }
.chart-line { fill: none; stroke: #08a58b; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-point circle { fill: #fff; stroke: #08a58b; stroke-width: 3; }
.chart-point text { fill: #4d6674; font-size: 10px; font-weight: 800; text-anchor: middle; }
.chart-point .chart-label { fill: #83949e; font-size: 9px; font-weight: 650; }
.chart-empty { display: grid; place-items: center; min-height: 220px; color: #91a1aa; font-size: .72rem; }
.distribution-body { min-height: 220px; display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: .75rem; }
.resource-donut { position: relative; width: 126px; height: 126px; display: grid; place-content: center; border-radius: 50%; text-align: center; }
.resource-donut::after { content: ''; position: absolute; inset: 18px; border-radius: 50%; background: #fff; }
.resource-donut strong, .resource-donut span { position: relative; z-index: 1; }
.resource-donut strong { color: #1a3548; font-size: 1.05rem; }
.resource-donut span { margin-top: .15rem; color: #8a9aa3; font-size: .56rem; }
.resource-legend { display: grid; gap: .48rem; }
.resource-legend > div { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; align-items: center; gap: .38rem; font-size: .6rem; }
.resource-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--legend-color); }
.resource-legend span { overflow: hidden; color: #617984; text-overflow: ellipsis; white-space: nowrap; }
.resource-legend strong { color: #2f4959; }
.resource-legend small { width: 34px; color: #9aa8b0; text-align: right; }
.resource-bars { min-height: 220px; display: flex; align-items: flex-end; justify-content: space-around; gap: .58rem; padding-top: 1.1rem; }
.resource-bars > div { height: 188px; flex: 1; min-width: 0; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: .38rem; color: #718691; font-size: .58rem; }
.resource-bars i { width: min(34px, 72%); display: flex; align-items: flex-end; border-radius: 6px 6px 2px 2px; background: #edf3f5; overflow: hidden; }
.resource-bars b { width: 100% !important; height: var(--bar-height, 50%); min-height: 4%; display: block; align-self: flex-end; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #0fc1a0, #078a7c); }
.resource-bars > div:nth-child(3n+2) b { background: linear-gradient(180deg, #38a9ed, #4d79e7); }
.resource-bars > div:nth-child(3n) b { background: linear-gradient(180deg, #48d1b0, #0da38a); }
.resource-bars strong { color: #314c5c; font-size: .65rem; }
.summary-list { display: grid; }
.summary-list > div { min-width: 0; display: flex; align-items: center; gap: .62rem; padding: .62rem 0; border-top: 1px solid #edf1f3; }
.summary-list > div:first-child { border-top: 0; }
.summary-icon { width: 27px; height: 27px; font-size: .52rem; }
.summary-icon.ok { color: #0c9a7f; background: #dff7ef; }
.summary-list p { min-width: 0; flex: 1; margin: 0; }
.summary-list strong, .summary-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-list strong { color: #304958; font-size: .68rem; }
.summary-list small { margin-top: .15rem; color: #91a0a9; font-size: .57rem; }
.summary-list time, .status-text { color: #94a4ac; font-size: .57rem; white-space: nowrap; }
.status-text { padding: .25rem .38rem; border-radius: 999px; background: #f0f4f5; }
.status-text.ok { color: #0e967e; background: #e6f8f2; }
.status-text.warn { color: #c27630; background: #fff1e2; }
/* Panels, lists and forms */
.panel { margin: 1rem 0; padding: clamp(1.1rem, 2.2vw, 1.75rem); border: 1px solid #e0e9ed; border-radius: 18px; background: #fff; box-shadow: 0 8px 28px #14354a09; }
.panel h2 { margin: 0 0 .28rem; color: #1a3448; font-size: 1.05rem; font-weight: 800; }
.panel .muted { margin: .2rem 0 1.25rem; font-size: .78rem; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.data-sync-tools { display: flex; align-items: center; gap: .7rem; color: #879aa4; font-size: .69rem; white-space: nowrap; }
.data-sync-tools button { min-width: 88px; padding: .55rem .78rem !important; font-size: .72rem; }
.data-query-tools { display: flex; justify-content: flex-end; margin: -.2rem 0 1rem; }
.data-query-tools label { width: min(100%, 390px); grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.data-query-tools label span { color: #708791; font-size: .7rem; }
.data-query-tools input { min-height: 40px; }
.table-wrap code, .scan-records code { color: #2e6f89; overflow-wrap: anywhere; white-space: normal; }
.content-copy, .scan-result-copy { width: 100%; display: grid; gap: .42rem; padding: .75rem !important; border: 1px solid #cfe9e1; border-radius: 11px !important; color: #203d4b !important; background: #f1fbf7 !important; text-align: left; }
.content-copy:hover, .scan-result-copy:hover { border-color: #8fd2bf; background: #e8f8f2 !important; }
.content-copy code, .scan-result-copy code { color: #1d3544; font-family: ui-monospace, Consolas, monospace; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.content-copy span, .scan-result-copy span { color: #16816f; font-size: .63rem; font-weight: 800; }
.content-error { color: #b74250; font-size: .72rem; }
.scan-upload-status { margin-bottom: 1rem; padding: .95rem; border: 1px solid #deeaed; border-radius: 14px; background: #f7fbfb; }
.status-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.status-chip { padding: .38rem .64rem; border: 1px solid #d9e3e6; border-radius: 999px; color: #566f7a; background: #fff; font-size: .68rem; font-weight: 800; }
.status-chip.pending { border-color: #ecdcae; color: #a27420; background: #fffaf0; }
.status-chip.ok { border-color: #bfe9dc; color: #16816f; background: #f0fbf7; }
.status-chip.failed { border-color: #efcbd0; color: #b4424f; background: #fff4f5; }
.scan-attention { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-top: .75rem; }
.scan-attention article { display: grid; gap: .2rem; padding: .75rem; border: 1px solid #e2e9eb; border-radius: 10px; background: #fff; font-size: .7rem; }
.scan-attention span, .scan-attention small { color: #7a8e98; }
.scan-records { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.scan-card { min-width: 0; padding: 1rem; border: 1px solid #dde8eb; border-radius: 16px; background: #fff; box-shadow: 0 6px 20px #163e4d0a; }
.scan-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: .82rem; border-bottom: 1px solid #edf2f3; }
.scan-card-head > div { display: grid; gap: .25rem; }
.scan-card-head strong { color: #1d3548; font-size: .92rem; }
.scan-card-head span:not(.latest-chip) { color: #82949e; font-size: .7rem; }
.latest-chip { padding: .33rem .55rem; border-radius: 999px; color: #16816f; background: #e8f8f2; font-size: .63rem; font-weight: 800; white-space: nowrap; }
.scan-device { display: grid; gap: .25rem; margin: .9rem 0 .75rem; }
.scan-device span { color: #82949e; font-size: .65rem; }
.scan-device strong { color: #243d4f; font-size: .85rem; }
.scan-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: 0; }
.scan-facts > div { min-width: 0; padding: .68rem; border-radius: 10px; background: #f6f9fa; }
.scan-facts .wide { grid-column: 1 / -1; }
.scan-facts dt { color: #8799a2; font-size: .63rem; }
.scan-facts dd { margin: .23rem 0 0; color: #344d5c; font-size: .72rem; overflow-wrap: anywhere; }
.scan-group { margin-top: .75rem; padding: .7rem; border: 1px solid #e1e9eb; border-radius: 10px; color: #58717c; font-size: .7rem; }
.scan-group summary { cursor: pointer; font-weight: 800; }
.scan-group > div { display: grid; gap: .2rem; padding: .6rem 0; border-top: 1px solid #edf1f2; }
.scan-empty { grid-column: 1 / -1; margin: 0; padding: 2rem; border: 1px dashed #cedeE2; border-radius: 14px; color: #82949e; text-align: center; }
.usage-panel { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 2fr); align-items: center; gap: 1.5rem; margin-top: 1.6rem; }
.usage-panel .muted { margin-bottom: 0; }
.usage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.usage-grid > div { display: grid; gap: .35rem; min-width: 0; padding: 1rem; border: 1px solid #e7eeef; border-radius: 13px; background: #f8fbfb; }
.usage-grid span { color: #899ca5; font-size: .67rem; }
.usage-grid strong { color: #244254; font-size: .78rem; overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #e8eef0; border-radius: 13px; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
thead { background: #f5f9f9; }
th { padding: .83rem .9rem; color: #68818d; font-size: .68rem; font-weight: 800; text-align: left; white-space: nowrap; }
td { padding: .95rem .9rem; border-top: 1px solid #edf1f2; color: #334b5a; white-space: normal; overflow-wrap: anywhere; }
tbody tr:hover { background: #fafdfc; }
td small { display: block; max-width: 220px; color: #ad7044; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 165px; }
.actions button { padding: .43rem .66rem !important; font-size: .69rem; }
.pager { display: flex; justify-content: end; align-items: center; gap: .5rem; margin-top: 1rem; }
.pager span { margin-right: auto; color: #7b909c; font-size: .74rem; }
.account-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-top: 1rem; }
.account-info > div { display: grid; gap: .34rem; min-width: 0; padding: .95rem; border: 1px solid #e7eef0; border-radius: 11px; background: #f8fbfb; overflow-wrap: anywhere; font-size: .79rem; }
.account-info strong { color: #81949e; font-size: .7rem; }
.password-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 1rem; margin-top: 1.2rem; }
.password-form button { min-height: 44px; }

@media (max-width: 1260px) { .cards-primary, .cards-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .usage-panel { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(290px, 84vw); height: 100dvh; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 15px 0 40px #071a2a35; }
  .sidebar.is-open { transform: translateX(0); }
  .nav-scrim:not([hidden]) { position: fixed; inset: 0; z-index: 25; display: block; width: 100%; height: 100%; border: 0; background: #10283880; }
  .nav-toggle { width: 37px; height: 37px; flex: none; display: grid; place-items: center; border: 1px solid #dce9e8; border-radius: 10px; color: #2b6570; background: #fff; font-size: 1.05rem; }
  .content { padding: 1.35rem 1.2rem 3rem; }
  .welcome-art { right: 5%; opacity: .22; }
  .scan-records { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .content { padding: 1.05rem .85rem 2.5rem; }
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 1.48rem; }
  .expiry-badge { display: none; }
  .welcome-banner { min-height: 220px; padding: 1.35rem; border-radius: 17px; }
  .welcome-banner p { font-size: .77rem; }
  .welcome-meta { gap: .35rem; margin-top: 1.1rem; }
  .welcome-meta span { font-size: .62rem; }
  .welcome-art { display: none; }
  .cards-primary, .cards-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .stat-card-primary { min-height: 155px; padding: .9rem; }
  .stat-card-primary strong { font-size: 1.65rem; }
  .stat-card-secondary { min-height: 75px; gap: .45rem; padding: .65rem; }
  .stat-mini-icon { width: 27px; height: 27px; }
  .usage-grid { grid-template-columns: 1fr; }
  .account-info, .password-form { grid-template-columns: 1fr; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .data-sync-tools { width: 100%; justify-content: space-between; }
  .data-query-tools { justify-content: stretch; }
  .data-query-tools label { width: 100%; grid-template-columns: 1fr; }
  .scan-attention, .scan-facts { grid-template-columns: 1fr; }
  .scan-facts .wide { grid-column: auto; }
  .pager { flex-wrap: wrap; }
  .pager span { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }


/* Dashboard responsive overrides */
@media (max-width: 1500px) {
  .dashboard-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid-main { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); }
  .comparison-panel { grid-column: 1 / -1; }
  .resource-bars { min-height: 180px; }
  .resource-bars > div { height: 150px; }
}
@media (max-width: 1180px) {
  .topbar { grid-template-columns: minmax(170px, .8fr) minmax(280px, 1.2fr); }
  .topbar-actions { display: none; }
  .welcome-banner { grid-template-columns: 1fr; gap: 1.1rem; }
  .hero-metrics { border-left: 0; }
  .hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 0; }
  .dashboard-grid-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(290px, 84vw); height: 100dvh; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 15px 0 40px #071a2a35; }
  .sidebar.is-open { transform: translateX(0); }
  .nav-scrim:not([hidden]) { position: fixed; inset: 0; z-index: 25; display: block; width: 100%; height: 100%; border: 0; background: #10283880; }
  .nav-toggle { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid #dce9e8; border-radius: 9px; color: #2b6570; background: #fff; font-size: 1rem; }
  .topbar { grid-template-columns: auto minmax(220px, 1fr); }
  .topbar-main .topbar-divider, .breadcrumb { display: none; }
  .dashboard-grid-main { grid-template-columns: 1fr; }
  .comparison-panel { grid-column: auto; }
  .scan-records { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --content-pad: .82rem; }
  .topbar { min-height: 58px; gap: .55rem; }
  .workspace-search kbd { display: none; }
  .workspace-search input { font-size: .66rem; }
  .page-head { align-items: flex-start; padding-top: 1.15rem; }
  .page-head h1 { font-size: 1.48rem; }
  .page-head p { font-size: .68rem; }
  .page-controls { display: none; }
  .welcome-banner { min-height: 0; padding: 1.3rem; border-radius: 15px; }
  .welcome-banner p { font-size: .7rem; }
  .hero-metrics { grid-template-columns: 1fr; gap: .3rem; }
  .hero-metrics > div { padding: .5rem; border: 1px solid #ffffff16; border-radius: 9px; }
  .hero-metrics small { margin-left: 2.72rem; }
  .hero-actions { grid-template-columns: 1fr; }
  .welcome-art { display: none; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .58rem; }
  .kpi-card { min-height: 96px; padding: .72rem .65rem; }
  .distribution-body { grid-template-columns: 1fr; justify-items: center; }
  .resource-legend { width: 100%; }
  .resource-bars { overflow-x: auto; justify-content: flex-start; }
  .resource-bars > div { min-width: 46px; }
  .account-info, .password-form { grid-template-columns: 1fr; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .data-sync-tools { width: 100%; justify-content: space-between; }
  .data-query-tools { justify-content: stretch; }
  .data-query-tools label { width: 100%; grid-template-columns: 1fr; }
  .scan-attention, .scan-facts { grid-template-columns: 1fr; }
  .scan-facts .wide { grid-column: auto; }
  .pager { flex-wrap: wrap; }
  .pager span { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
