:root {
  color-scheme: light;
  --ink: #172723;
  --muted: #72817c;
  --line: #e5ece8;
  --canvas: #f5f8f6;
  --surface: #ffffff;
  --green: #176c52;
  --green-soft: #e7f3ee;
  --amber: #a86813;
  --amber-soft: #fff4df;
  --red: #b34646;
  --red-soft: #fff0ef;
  --shadow: 0 14px 36px rgba(23, 52, 42, .07);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.55 Inter, "Microsoft YaHei", system-ui, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted, .section-heading p, .panel-heading p, .fine-print { color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, #d6eee3, transparent 52%), var(--canvas); }
.login-card { width: min(100%, 420px); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 15px; color: #fff; background: var(--green); font-size: 15px; font-weight: 800; letter-spacing: -.07em; }
.brand-mark.small { width: 36px; height: 36px; margin: 0; border-radius: 12px; font-size: 12px; }
.login-card h1 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.login-card form { display: grid; gap: 13px; margin-top: 24px; }
label { display: grid; gap: 6px; color: #54645e; font-size: 12px; font-weight: 650; }
input, select { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #dce5e0; border-radius: 9px; outline: 0; color: var(--ink); background: #fff; }
input:focus, select:focus { border-color: #72aa92; box-shadow: 0 0 0 3px #176c5215; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px; color: #42534c; background: #fff; font-weight: 650; white-space: nowrap; }
.button:hover { border-color: #b9d1c4; background: #f8fbf9; }
.button.primary { border-color: var(--green); color: white; background: var(--green); }
.button.primary:hover { background: #105c44; }
.button.full { width: 100%; }
.button.quiet { border-color: transparent; color: var(--muted); }
.button.danger { color: var(--red); border-color: #f0cfcc; background: #fff; }
.feedback { min-height: 20px; margin: 14px 0 0; color: var(--red); font-size: 13px; }
.fine-print { margin: 18px 0 0; font-size: 11px; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 2; display: flex; width: 230px; flex-direction: column; padding: 22px 14px 17px; color: #dce9e3; background: #10231f; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 28px; }
.side-brand b, .side-brand small { display: block; }
.side-brand b { font-size: 13px; }
.side-brand small { margin-top: 2px; color: #91a79c; font-size: 11px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 9px; color: #a9bbb2; background: transparent; text-align: left; }
.nav-item span { width: 18px; font-size: 16px; text-align: center; }
.nav-item:hover, .nav-item.active { color: #fff; background: #1c3a31; }
.side-bottom { margin-top: auto; padding: 13px 9px 0; border-top: 1px solid #294138; color: #b2c3ba; font-size: 11px; }
.side-bottom p { margin: 4px 0 0 15px; color: #7f978a; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 0; border-radius: 50%; background: #71d6a5; box-shadow: 0 0 9px #71d6a599; }
.workspace { max-width: 1700px; margin-left: 230px; padding: 28px clamp(20px, 4vw, 62px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.account { display: flex; align-items: center; gap: 13px; }
.role-badge { padding: 5px 9px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 750; }
.section-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading { margin-bottom: 17px; }
.section-heading h2, .panel-heading h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.section-heading p, .panel-heading p { margin: 4px 0 0; font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(155px, 1fr)); gap: 12px; }
.metric-card { position: relative; overflow: hidden; padding: 17px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 5px 17px rgba(28, 59, 46, .03); }
.metric-card::after { position: absolute; top: -20px; right: -20px; width: 75px; height: 75px; border-radius: 50%; background: var(--green-soft); content: ""; opacity: .65; }
.metric-label { position: relative; z-index: 1; color: var(--muted); font-size: 12px; }
.metric-value { position: relative; z-index: 1; margin-top: 9px; font-size: 27px; font-weight: 750; letter-spacing: -.05em; }
.metric-card.alert .metric-value { color: var(--red); }
.metric-card.warning .metric-value { color: var(--amber); }
.panel { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 5px 17px rgba(28, 59, 46, .03); }
.overview-lower { margin-top: 17px; padding: 19px; }
.text-button { border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 700; }
.event-list { display: grid; margin-top: 16px; }
.event-row { display: grid; grid-template-columns: 12px minmax(145px, .8fr) minmax(180px, 1fr) minmax(140px, .8fr) minmax(125px, .65fr); align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid #eef2ef; font-size: 12px; }
.event-dot { width: 8px; height: 8px; border-radius: 50%; background: #86a097; }
.event-dot.POSSIBLE_FALL, .event-dot.SENSOR_ERROR { background: var(--red); }
.event-name { font-weight: 700; }
.event-meta { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-panel { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.filter-panel label { min-width: 135px; flex: 1 1 150px; }
.filter-panel label:nth-child(1), .filter-panel label:nth-child(2) { flex-basis: 175px; }
.filter-panel input, .filter-panel select { min-height: 36px; padding: 7px 9px; font-size: 12px; }
.table-panel { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 12px 14px; color: #718078; background: #f8faf9; font-size: 10px; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; }
td { padding: 12px 14px; border-top: 1px solid #edf1ee; color: #384840; font-size: 12px; }
tbody tr:hover { background: #fbfdfb; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.link-button { padding: 0; border: 0; color: var(--green); background: transparent; font-weight: 700; }
.state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 99px; font-size: 10px; font-weight: 750; }
.state::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.state.ok { color: var(--green); background: var(--green-soft); }
.state.warn { color: var(--amber); background: var(--amber-soft); }
.state.bad { color: var(--red); background: var(--red-soft); }
.state.neutral { color: #687a72; background: #edf1ef; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 2px; color: var(--muted); font-size: 12px; }
.pager .button { min-height: 31px; padding: 4px 10px; }
.empty { padding: 30px; color: var(--muted); text-align: center; }
.operator-form { display: flex; align-items: end; gap: 12px; margin-bottom: 14px; padding: 15px; }
.operator-form label { flex: 1; }
.detail-dialog { width: min(1040px, calc(100vw - 32px)); max-height: 88vh; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 24px 90px #0f211c55; }
.detail-dialog::backdrop { background: #10231f88; backdrop-filter: blur(3px); }
.detail-content { padding: 22px; }
.detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-top h2 { margin: 0; font-size: 21px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 9px; margin: 18px 0; }
.detail-field { padding: 11px; border-radius: 9px; background: #f6f9f7; }
.detail-field small { display: block; margin-bottom: 4px; color: var(--muted); }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 10px; font-size: 14px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(420px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 10px; color: white; background: #16382c; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: .18s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1050px) { .sidebar { width: 190px; } .workspace { margin-left: 190px; padding-inline: 22px; } .metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .sidebar { position: static; width: 100%; padding: 12px; } .side-brand { padding-bottom: 11px; } .sidebar nav { display: flex; overflow: auto; } .nav-item { width: auto; flex: 0 0 auto; padding: 9px 11px; } .side-bottom { display: none; } .workspace { margin: 0; padding: 19px 13px 45px; } .topbar { align-items: flex-start; flex-direction: column; margin-bottom: 20px; } .account { width: 100%; } .metric-grid { gap: 8px; } .metric-card { padding: 13px; } .metric-value { font-size: 23px; } .event-row { grid-template-columns: 10px 1fr 1fr; gap: 7px; padding: 8px 0; } .event-row .event-hide-mobile { display: none; } .operator-form { align-items: stretch; flex-direction: column; } .detail-grid { grid-template-columns: repeat(2, 1fr); } }
