.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  min-height: 420px;
}

.hero-visual {
  background:
    linear-gradient(160deg, rgba(15, 20, 25, 0.15), rgba(15, 20, 25, 0.72)),
    radial-gradient(circle at 30% 40%, rgba(61, 155, 143, 0.45), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(232, 165, 75, 0.28), transparent 40%),
    repeating-linear-gradient(
      -35deg,
      rgba(255, 255, 255, 0.03) 0 1px,
      transparent 1px 14px
    ),
    #1b2733;
  position: relative;
}
.hero-visual::after {
  content: "AVAILABILITY";
  position: absolute;
  left: 28px;
  bottom: 28px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.12em;
  color: rgba(238, 242, 246, 0.55);
}

.auth-copy {
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-copy .brand { font-size: 1.8rem; margin-bottom: 10px; }
.lead { margin: 0 0 8px; font-size: 1.05rem; }
.hint { margin: 0 0 28px; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.bind-title { margin: 0 0 14px; font-weight: 600; }

.client-shell { min-height:100vh; display:grid; grid-template-columns:220px minmax(0,1fr); }
.client-side { min-width:0; padding:22px 14px; background:#111920; border-right:1px solid var(--line); }
.client-side .brand { padding:8px 10px 20px; font-size:1.05rem; }
.client-side .brand span { color:var(--text); }
.client-main { min-width:0; }
.client-head { min-height:70px; padding:14px 24px; display:flex; align-items:center; justify-content:space-between; gap:16px; border-bottom:1px solid var(--line); background:rgba(15,20,25,.88); position:sticky; top:0; z-index:5; }
.client-head h1 { margin:0; font-size:1.2rem; }
.client-head-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; min-width:0; }
.client-head .sub { color:var(--muted); white-space:nowrap; }
.client-body { padding:20px 24px 30px; }
.client-nav { display:grid; gap:6px; }
.client-nav a { color:var(--muted); text-decoration:none; padding:11px 12px; border-radius:8px; font-size:1rem; white-space:nowrap; }
.client-nav a:hover,.client-nav a.active { color:var(--text); background:rgba(61,155,143,.18); }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-row-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-row-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { padding: 18px 20px; }
.kpi-label { color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }
.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.kpi-value small { font-size: 1rem; margin-left: 2px; color: var(--muted); }
.kpi-value.ok { color: var(--ok); }
.kpi-value.muted { color: var(--stop); }

.chart-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.chart-card, .device-list { padding: 18px 20px 22px; }
.brand-with-logo { display:flex; align-items:center; gap:10px; }
.brand-with-logo img { width:34px; height:34px; object-fit:contain; flex:0 0 auto; }
.auth-copy .brand-with-logo img { width:52px; height:52px; }
.admin-view-actions { display:flex; align-items:center; gap:8px; }
.admin-view-actions .input { width:180px; }
.shift-chart-grid .chart-card { min-width: 0; }
.shift-chart-grid canvas { max-height: 320px; }
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.chart-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.chart-head p { margin: 0; color: var(--muted); font-size: 0.86rem; }

.util-bar {
  width: 90px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
.util-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

@media (max-width: 900px) {
  .auth-panel { grid-template-columns: 1fr; }
  .hero-visual { min-height: 160px; }
  .kpi-row, .kpi-row-5, .kpi-row-6, .chart-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .kpi-row, .kpi-row-5, .chart-grid { grid-template-columns: 1fr; }
  .kpi-row-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap:10px; }
  .kpi-row-6 .kpi { min-width:0; padding:16px 12px; }
  .kpi-row-6 .kpi-label { overflow-wrap:anywhere; }
  .kpi-row-6 .kpi-value { font-size:clamp(1.35rem, 6vw, 2rem); }
  .chart-head { flex-wrap:wrap; }
  .shift-chart-grid canvas { max-height: 250px; }
}

.client-head .sub { white-space:normal; overflow-wrap:anywhere; }
.client-head-actions { flex-wrap:wrap; }
.password-dialog { width:min(420px, calc(100% - 24px)); max-height:calc(100dvh - 32px); overflow-y:auto; padding:24px; color:var(--text); }
.password-dialog::backdrop { background:rgba(0,0,0,.65); }
.password-dialog h2 { margin:0 0 12px; font-size:1.2rem; }
.password-dialog .hint { margin-bottom:16px; }
.password-dialog input { font-size:16px; }
.password-error { color:var(--danger); line-height:1.5; margin:12px 0; }
.password-actions { display:flex; gap:12px; justify-content:flex-end; }
/* 历史查询保持紧凑，便于后续增加生产数据筛选条件。 */
.history-head { align-items:flex-end; gap:16px; }
.history-filters { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.history-filters .input { width:145px; min-width:120px; }
@media (max-width: 760px) {
  .client-shell { grid-template-columns:minmax(0,1fr); }
  .client-side { position:static; padding:12px; }
  .client-side .brand { padding:4px 6px 10px; }
  .client-nav { display:flex; width:100%; overflow-x:auto; }
  .client-head { position:static; padding:12px; align-items:flex-start; flex-direction:column; }
  .client-head-actions { width:100%; flex-wrap:wrap; justify-content:flex-start; }
  .client-body { padding:12px; }
  .admin-view-actions { margin-left:0; }
  .admin-view-actions .label { display:none; }
  .admin-view-actions .input { width:min(180px,44vw); }
  .history-head { align-items:stretch; flex-direction:column; }
  .history-filters { justify-content:flex-start; }
  .history-filters .input { flex:1 1 140px; }
}

.overview-filter { display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; margin-bottom:18px; }
.overview-filter label { flex-shrink:0; }
.overview-filter .input { width:240px; max-width:100%; min-width:0; }
.overview-filter .hint { flex:1; min-width:220px; margin:0; }
@media(max-width:600px) { .overview-filter .input { flex:1; width:auto; } .overview-filter .hint { flex-basis:100%; min-width:0; } }
