:root {
  --gov: #1d63a0;
  --gov-dark: #164d80;
  --gov-deep: #103c68;
  --gov-light: #edf5fb;
  --blue: #1d63a0;
  --blue-light: #edf5fb;
  --gold: #d3ad62;
  --red: #c9272c;
  --danger: #bd2b31;
  --warning: #b06a0c;
  --success: #16785a;
  --ink: #1c2935;
  --muted: #687887;
  --line: #d8e0e8;
  --line-strong: #c7d2dd;
  --bg: #f2f5f8;
  --surface: #ffffff;
  --shadow: 0 2px 10px rgba(28, 55, 82, 0.06);
  --shadow-raised: 0 10px 30px rgba(17, 51, 84, 0.16);
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--bg);
}

body { line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button,
input,
select,
textarea { font: inherit; color: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Application shell */
.topbar {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto 0;
  height: 76px;
  display: flex;
  align-items: center;
  padding: 0 30px;
  color: #fff;
  background: linear-gradient(100deg, #123f6d 0%, #174f84 72%, #10385f 100%);
  border-top: 3px solid var(--red);
  border-bottom: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 3px 16px rgba(12, 46, 77, .22);
}

.brand-mark {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: block;
  object-fit: contain;
  margin-right: 14px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.16));
}

.brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  overflow: hidden;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.brand-text span {
  margin-top: 3px;
  color: #c9dbec;
  font-size: 12px;
}

.topbar-context {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0;
  color: #e5efec;
}

.topbar-context > * {
  max-width: 310px;
  overflow: hidden;
  padding: 5px 17px;
  border-left: 1px solid rgba(255,255,255,.16);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar-context svg { width: 17px; height: 17px; flex: 0 0 17px; }
.topbar-context a { display: flex; align-items: center; gap: 7px; }
.topbar-context .organization-name { color: #dce8f3; }
.topbar-context .notification-link { position: relative; width: 48px; justify-content: center; padding-right: 14px; padding-left: 14px; }
.topbar-context .notification-link b { position: absolute; top: -3px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; color: #fff; background: var(--red); border: 2px solid #174f84; border-radius: 9px; font-size: 9px; line-height: 1; }

.topbar-context a { transition: background .16s ease, color .16s ease; }
.topbar-context a:hover { color: #fff; background: rgba(255,255,255,.09); }

.sidebar {
  position: fixed;
  z-index: 20;
  top: 76px;
  bottom: 0;
  left: 0;
  width: 238px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 3px 0 14px rgba(29, 55, 80, .04);
}

.scope {
  min-height: 76px;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background: linear-gradient(135deg, #f0f6fb, #f8fbfd);
  border-bottom: 1px solid #dbe6ef;
  border-left: 4px solid var(--red);
}

.scope span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.scope strong { color: var(--gov-deep); font-size: 15px; font-weight: 600; }

.sidebar-label {
  padding: 19px 24px 7px;
  color: #87938f;
  font-size: 12px;
}

nav { min-height: 0; padding: 6px 12px 14px; flex: 1; overflow-y: auto; }

nav a {
  position: relative;
  height: 45px;
  margin: 2px 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #42534d;
  border-radius: 4px;
  transition: color .16s ease, background .16s ease;
}

nav a span {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  color: #718294;
  font-size: 16px;
}
nav a span svg { width: 19px; height: 19px; }

nav a::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
}

nav a:hover { color: var(--gov-dark); background: #f3f7fb; }
nav a:hover span { color: var(--gov); }
nav a.active { color: var(--gov-dark); background: var(--gov-light); font-weight: 600; }
nav a.active span { color: var(--gov); }
nav a.active::before { background: var(--gov); }
.nav-count { min-width: 23px; height: 20px; margin-left: auto; padding: 0 6px; display: grid; place-items: center; color: #fff; background: var(--red); border-radius: 10px; font-size: 11px; font-weight: 600; }

.sidebar-foot {
  margin-top: auto;
  padding: 17px 21px;
  color: #7b8984;
  font-size: 12px;
  line-height: 1.8;
  background: #f7f9fb;
  border-top: 1px solid var(--line);
}

.main {
  width: calc(100% - 238px);
  min-height: 100vh;
  margin-left: 238px;
  padding: 104px 30px 42px;
}

.main > * { max-width: 1560px; margin-left: auto; margin-right: auto; }

.page-head {
  min-height: 62px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.breadcrumb { margin-bottom: 5px; color: #7b8984; font-size: 12px; }
.page-head h1 { margin: 0; padding-left: 13px; position: relative; font-size: 23px; line-height: 1.35; font-weight: 700; color: #1b2c3c; }
.page-head h1::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 0; width: 4px; background: var(--red); border-radius: 1px; }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }

/* Commands and status */
.btn {
  min-height: 38px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  background: var(--gov);
  border: 1px solid var(--gov);
  border-radius: 4px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(18, 73, 121, .15);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.btn:hover { background: var(--gov-dark); border-color: var(--gov-dark); box-shadow: 0 3px 9px rgba(18,73,121,.18); }
.btn:focus-visible { outline: 3px solid rgba(29,99,160,.2); outline-offset: 2px; }
.btn:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }
.btn-secondary { color: var(--gov-dark); background: #fff; border-color: #aebdcb; box-shadow: none; }
.btn-secondary:hover { color: var(--gov-dark); background: var(--gov-light); border-color: var(--gov); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #8f1f17; border-color: #8f1f17; }
.btn-sm { min-height: 31px; padding: 0 11px; font-size: 13px; }

.badge {
  min-height: 23px;
  padding: 2px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #53625d;
  background: #edf1f0;
  border: 1px solid #dce4e1;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

.badge-success { color: #08653c; background: #e7f4ec; border-color: #c6e4d2; }
.badge-danger { color: #9c241c; background: #fbeceb; border-color: #efcac6; }
.badge-warning { color: #8b5708; background: #fff3dd; border-color: #ecd7ab; }
.badge-info { color: #24577e; background: var(--blue-light); border-color: #cadceb; }

.alert {
  position: relative;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 3px;
  box-shadow: var(--shadow);
}

.alert-success { color: #155f3c; background: #edf8f1; border-left-color: var(--success); }
.alert-error { color: #8f261f; background: #fff1ef; border-left-color: var(--danger); }
.alert-info { color: #285678; background: #eef5fa; border-left-color: var(--blue); }

/* Dashboard and panels */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 15px;
  margin-bottom: 18px;
}

.stat {
  position: relative;
  min-height: 132px;
  padding: 18px 20px 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--success);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.stat::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 9px;
  height: 9px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(22,120,90,.10);
}

.stat.warning { border-top-color: var(--warning); }
.stat.warning::after { background: var(--warning); box-shadow: 0 0 0 5px rgba(168,101,8,.10); }
.stat.danger { border-top-color: var(--danger); }
.stat.danger::after { background: var(--danger); box-shadow: 0 0 0 5px rgba(180,35,24,.10); }
.stat.blue { border-top-color: var(--blue); }
.stat.blue::after { background: var(--blue); box-shadow: 0 0 0 5px rgba(36,91,134,.10); }
.stat-label { color: #5d6e7d; font-size: 13px; font-weight: 600; }
.stat-value { margin: 8px 0 3px; color: #192b3c; font-size: 31px; line-height: 1.15; font-weight: 700; }
.stat-note { color: #82909e; font-size: 12px; }

.service-license {
  margin-bottom: 18px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--success);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.service-license-warning { border-left-color: var(--warning); }
.service-license-danger { border-left-color: var(--danger); }
.service-license-status { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.service-license-status span { color: var(--muted); font-size: 12px; font-weight: 600; }
.service-license-status strong { color: #17364c; font-size: 23px; }
.service-license-status small { color: #6c7c89; }
.service-license dl { margin: 0; display: grid; grid-template-columns: repeat(4,minmax(120px,1fr)); }
.service-license dl > div { min-width: 0; padding: 3px 16px; border-left: 1px solid var(--line); }
.service-license dt { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.service-license dd { margin: 0; color: #263c50; font-weight: 600; overflow-wrap: anywhere; }
.service-license.compact { grid-template-columns: 145px minmax(0,1fr) auto; }
.authorization-region { margin-bottom: 16px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); }
.authorization-region summary { min-height: 58px; padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #5d6f7f; cursor: pointer; list-style: none; border-bottom: 1px solid transparent; }
.authorization-region[open] summary { border-bottom-color: var(--line); }
.authorization-region summary::-webkit-details-marker { display: none; }
.authorization-region summary > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.authorization-region summary strong { color: #26394b; font-size: 16px; }
.authorization-region summary small { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, 1fr); gap: 18px; }

.panel {
  margin-bottom: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.panel-head {
  min-height: 55px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(90deg, #fff, #fbfcfe);
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  min-width: 0;
  margin: 0;
  padding-left: 11px;
  overflow-wrap: anywhere;
  color: #26394b;
  border-left: 4px solid var(--gov);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
}

.panel-head > a:not(.btn) { color: var(--blue); font-size: 13px; }
.panel-head > a:not(.btn):hover { text-decoration: underline; }
.panel-body { padding: 20px; }

.status-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.status-overview > div {
  min-height: 84px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e1e7ed;
  border-radius: 3px;
}
.status-overview span { display: flex; align-items: center; color: var(--muted); }
.status-overview strong { color: #203448; font-size: 25px; font-weight: 700; }
.status-dot { width: 9px; height: 9px; margin-right: 9px; display: inline-block; background: #87938f; border-radius: 50%; }
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }
.status-dot.maintenance { background: var(--warning); }
.status-dot.disabled { background: #7c8985; }

.trend-chart { height: 230px; display: grid; grid-template-columns: repeat(14,minmax(34px,1fr)); align-items: end; gap: 10px; overflow-x: auto; }
.trend-item { height: 205px; min-width: 34px; display: grid; grid-template-rows: 24px 1fr 25px; align-items: end; text-align: center; }
.trend-value { color: #526575; font-size: 12px; }
.trend-column { width: min(30px,70%); min-height: 5px; margin: 0 auto; position: relative; overflow: hidden; background: #b8d0e3; border-radius: 3px 3px 0 0; }
.trend-column i { position: absolute; right: 0; bottom: 0; left: 0; display: block; background: var(--gov); }
.trend-label { padding-top: 7px; color: var(--muted); font-size: 11px; }
.device-map { width: 100%; height: min(68vh,680px); min-height: 430px; border: 1px solid var(--line-strong); border-radius: 3px; background: #eef3f5; }
.device-map .leaflet-popup-content { min-width: 180px; line-height: 1.65; }

/* Tables and search */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; }
.table th {
  padding: 11px 13px;
  color: #4f6070;
  background: #f1f5f8;
  border-bottom: 1px solid var(--line-strong);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.table td { padding: 12px 13px; border-bottom: 1px solid #e7edf2; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f6f9fc; }
.table a.link { color: var(--blue); font-weight: 600; }
.table a.link:hover { text-decoration: underline; }

.filter {
  margin-bottom: 16px;
  padding: 15px 17px;
  display: flex;
  align-items: flex-end;
  gap: 11px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

/* Forms */
.field { min-width: 150px; display: flex; flex-direction: column; gap: 7px; }
.field.grow { flex: 1; }
.field.full { grid-column: 1 / -1; }
.field label { color: #4e6070; font-size: 13px; font-weight: 600; }
.required::after { content: " *"; color: var(--danger); }
.input,
.select,
.textarea {
  width: 100%;
  min-height: 39px;
  padding: 8px 11px;
  color: #263746;
  background: #fff;
  border: 1px solid #b8c5d0;
  border-radius: 3px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input:hover,
.select:hover,
.textarea:hover { border-color: #8fa6ba; }
.input:focus,
.select:focus,
.textarea:focus { border-color: var(--gov); box-shadow: 0 0 0 3px rgba(29,99,160,.12); }
.input:disabled,
.select:disabled,
.textarea:disabled { color: #7b8984; background: #f0f3f2; cursor: not-allowed; }
.textarea { min-height: 106px; resize: vertical; line-height: 1.65; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-actions { margin-top: 22px; padding-top: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.hint { color: #788782; font-size: 12px; line-height: 1.6; }

/* Work-order details */
.progress {
  margin-bottom: 18px;
  padding: 19px 20px 16px;
  display: flex;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.progress-step { position: relative; min-width: 118px; flex: 1; color: #87938f; font-size: 12px; text-align: center; }
.progress-step::before { content: ""; position: relative; z-index: 2; width: 14px; height: 14px; margin: 0 auto 8px; display: block; background: #d4ddda; border: 3px solid #eef2f1; border-radius: 50%; }
.progress-step::after { content: ""; position: absolute; top: 6px; left: 50%; right: -50%; height: 2px; background: #d9e1df; }
.progress-step:last-child::after { display: none; }
.progress-step.done { color: var(--gov-dark); font-weight: 600; }
.progress-step.done::before { background: var(--gov); border-color: #cddfed; }
.progress-step.done::after { background: var(--gov); }

.detail-section-title { margin: 24px 0 7px; padding: 2px 0 2px 10px; color: var(--gov-dark); border-left: 3px solid var(--gold); font-size: 15px; font-weight: 600; }
.detail-section-title:first-child { margin-top: 0; }
.detail-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-list > div { min-width: 0; padding: 11px 8px 11px 0; display: grid; grid-template-columns: 116px minmax(0, 1fr); border-bottom: 1px dashed var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: #2b3834; font-weight: 500; }
.detail-text { margin: 10px 0 0; padding: 13px 15px; color: #344657; background: #f6f9fc; border: 1px solid #e1e8ef; border-left: 3px solid #9db9d1; border-radius: 2px; line-height: 1.8; white-space: normal; overflow-wrap: anywhere; }

.timeline { position: relative; margin-left: 3px; }
.timeline::before { content: ""; position: absolute; top: 7px; bottom: 7px; left: 8px; width: 2px; background: #d8e3ed; }
.timeline-item { position: relative; padding: 0 0 23px 35px; overflow-wrap: anywhere; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; z-index: 2; top: 3px; left: 1px; width: 16px; height: 16px; background: var(--gov); border: 4px solid #cddfed; border-radius: 50%; }
.timeline-meta { margin: 4px 0 7px; color: var(--muted); font-size: 12px; }
.empty-state { padding: 48px 20px; color: var(--muted); text-align: center; }
.empty-state h2 { margin: 0 0 8px; color: #31403b; font-size: 34px; font-weight: 500; }

/* Login and TOTP */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(540px, 1.45fr) minmax(400px, .75fr); background: #fff; }
.login-scene {
  position: relative;
  padding: clamp(44px, 6vw, 92px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #fff;
  background-color: var(--gov-deep);
  background-image: linear-gradient(105deg, rgba(8,47,83,.96) 0%, rgba(15,68,108,.84) 48%, rgba(19,92,111,.56) 100%), url('/assets/login-bg.jpg?v=2');
  background-position: center;
  background-size: cover;
}
.login-scene::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 42%, rgba(5,35,62,.26)); pointer-events: none; }
.login-scene::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 5px; background: var(--red); }
.login-scene > * { position: relative; z-index: 1; }
.login-agency { display: flex; align-items: center; gap: 14px; color: #e5eef6; font-size: 15px; font-weight: 600; }
.login-title { margin: auto 0; padding: 70px 0; }
.login-title > span { display: inline-block; margin-bottom: 15px; padding-left: 12px; color: #f2dba9; border-left: 3px solid var(--gold); font-size: 14px; font-weight: 600; }
.login-scene h1 { max-width: 760px; margin: 0 0 18px; font-size: 36px; line-height: 1.5; font-weight: 700; text-shadow: 0 2px 8px rgba(4,29,52,.2); }
.login-scene p { margin: 0; color: #dbe8f3; font-size: 16px; }
.login-record { color: rgba(231,240,248,.72); font-size: 12px; }
.seal {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
}
.seal img { width: 48px; height: 48px; display: block; object-fit: contain; }
.login-side { position: relative; padding: 52px; display: grid; place-items: center; background: #f7f9fb; }
.login-side::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 4px; background: linear-gradient(90deg, var(--red) 0 34%, var(--gold) 34% 44%, var(--gov) 44%); }
.login-box { width: min(390px, 100%); }
.login-box::before { content: "政务业务系统"; margin-bottom: 13px; display: block; color: var(--gov); font-size: 13px; font-weight: 600; }
.login-box h2 { margin: 0 0 7px; color: #192d40; font-size: 27px; line-height: 1.35; font-weight: 700; }
.login-box > .hint { margin: 0 0 27px; display: block; }
.login-box .field { margin-bottom: 17px; }
.login-box .btn { width: 100%; min-height: 45px; margin-top: 7px; }
.security-note { margin-top: 24px; padding: 13px 14px; color: #647586; background: #edf3f8; border-left: 3px solid var(--gov); font-size: 12px; line-height: 1.7; }

.nav-toggle { width: 38px; height: 38px; margin-right: 8px; padding: 0; display: none; place-items: center; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.24); border-radius: 3px; }
.nav-toggle svg { width: 21px; height: 21px; }
.nav-backdrop { position: fixed; z-index: 15; inset: 76px 0 0; padding: 0; display: none; background: rgba(13,35,57,.38); border: 0; }
.screen-watermark { position: fixed; z-index: 1000; inset: 0; display: block; pointer-events: none; user-select: none; }
.notification-list { display: flex; flex-direction: column; }
.notification-item { min-height: 88px; padding: 16px 20px; display: grid; grid-template-columns: 10px minmax(0,1fr) 20px; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); transition: background .15s ease; }
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { background: #f7fafd; }
.notification-item.unread { background: #f2f7fc; }
.notification-mark { width: 7px; height: 7px; background: #bdc8d2; border-radius: 50%; }
.notification-item.unread .notification-mark { background: var(--red); box-shadow: 0 0 0 4px rgba(201,39,44,.09); }
.notification-content { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.notification-content strong { color: #21374b; font-size: 14px; }
.notification-content > span { color: #526577; overflow-wrap: anywhere; }
.notification-content small { color: #82909d; font-size: 12px; }
.notification-arrow { color: #8b99a6; font-size: 22px; }
.wrap-cell { min-width: 240px; max-width: 440px; white-space: normal; overflow-wrap: anywhere; }
.stat-value small { margin-left: 2px; font-size: 16px; font-weight: 600; }

@media print {
  .screen-watermark { display: block !important; }
}

@media (max-width: 1100px) {
  .topbar-context > span { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .service-license, .service-license.compact { grid-template-columns: 145px minmax(0,1fr); }
  .service-license > .btn { grid-column: 2; justify-self: start; }
  .service-license dl { grid-template-columns: repeat(2,minmax(140px,1fr)); row-gap: 12px; }
}

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-raised); }
  .nav-open .sidebar { transform: translateX(0); }
  .nav-open .nav-backdrop { display: block; }
  .nav-toggle { display: grid; }
  .main { width: 100%; margin-left: 0; padding: 101px 18px 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .login-page { position: relative; grid-template-columns: 1fr; background: #f4f7fa; }
  .login-scene { min-height: 210px; padding: 27px 28px 54px; display: block; background-position: center 52%; }
  .login-agency { font-size: 14px; }
  .login-title { margin-top: 28px; padding: 0; }
  .login-title > span, .login-scene p, .login-record { display: none; }
  .login-scene h1 { margin: 0; font-size: 24px; line-height: 1.5; }
  .seal { width: 48px; height: 48px; }
  .seal img { width: 38px; height: 38px; }
  .login-side { min-height: calc(100vh - 210px); margin-top: -28px; padding-top: 42px; align-items: start; border-radius: 18px 18px 0 0; z-index: 2; }
}

@media (max-width: 640px) {
  .topbar { height: 66px; padding: 0 12px; border-top-width: 2px; }
  .brand-mark { width: 42px; height: 42px; flex-basis: 42px; margin-right: 9px; }
  .brand-text strong { font-size: 16px; }
  .brand-text span { display: none; }
  .topbar-context > * { max-width: 82px; padding: 4px 9px; }
  .sidebar { top: 66px; }
  .nav-backdrop { top: 66px; }
  .main { padding: 86px 12px 26px; }
  .page-head { min-height: 56px; align-items: flex-start; flex-direction: column; gap: 11px; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-head h1 { font-size: 21px; }
  .panel-head { min-height: 52px; padding: 10px 14px; }
  .panel-body { padding: 16px; }
  .filter { align-items: stretch; }
  .filter .field { width: 100%; }
  .filter .btn { flex: 1; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list > div { grid-template-columns: 106px minmax(0, 1fr); }
  .service-license, .service-license.compact { padding: 16px; grid-template-columns: 1fr; gap: 14px; }
  .service-license dl { grid-template-columns: 1fr; gap: 0; }
  .service-license dl > div { padding: 9px 0; border-left: 0; border-top: 1px solid var(--line); }
  .service-license > .btn { grid-column: 1; }
  .login-side { padding: 38px 22px 30px; }
}

@media (max-width: 430px) {
  .brand-mark { display: none; }
  .topbar-context .user-link { display: none; }
  .topbar-context .logout-link span { display: none; }
  .topbar-context .logout-link { width: 40px; justify-content: center; padding: 4px 8px; }
  .stats { gap: 10px; }
  .stat { min-height: 116px; padding: 15px; }
  .stat-value { font-size: 26px; }
  .status-overview { grid-template-columns: 1fr; }
  .btn { padding: 0 13px; }
}
