/* ==========================================================================
   Hengxin Cloud · Operations control panel
   A sharper cockpit-style home: command console, instrument cards, modules.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Command console
   -------------------------------------------------------------------------- */
.control-console {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: block;
  margin-bottom: 18px;
  padding: 0;
  border: 1px solid rgba(96, 165, 250, .24);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 84% -18%, rgba(59, 130, 246, .30), transparent 44%),
    radial-gradient(ellipse at 8% 120%, rgba(29, 78, 216, .18), transparent 42%),
    linear-gradient(116deg, #03050a 0%, #061224 50%, #09275a 100%);
  box-shadow:
    0 24px 52px rgba(2, 8, 23, .18),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}
.control-console::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(147, 197, 253, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 197, 253, .055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .55) 62%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .55) 62%, transparent 100%);
  pointer-events: none;
}
.control-console > * { position: relative; z-index: 1; }
.console-body {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 28px;
  padding: 20px 28px 24px;
}
.console-attendance {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(96, 165, 250, .16);
  background: rgba(2, 8, 18, .28);
}
.attendance-now { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.attendance-eyebrow {
  color: #7190b2;
  font-family: var(--font-num);
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: .15em;
  white-space: nowrap;
}
.attendance-eyebrow i { color: rgba(147, 197, 253, .4); font-style: normal; }
.attendance-clock {
  color: #f8fbff;
  font-family: var(--font-num);
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .015em;
  font-variant-numeric: tabular-nums;
}
.attendance-state {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid rgba(147, 197, 253, .16);
}
.attendance-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #64748b;
}
.attendance-dot.working {
  background: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .13);
  animation: attendancePulse 2.2s ease-in-out infinite;
}
.attendance-dot.done { background: #93c5fd; }
@keyframes attendancePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(96, 165, 250, .13); }
  50% { box-shadow: 0 0 0 5px rgba(96, 165, 250, .04); }
}
.attendance-state strong {
  color: #f1f7ff;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}
.attendance-state > span:last-child {
  color: #8ba6c2;
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attendance-state > span:last-child::before {
  content: "·";
  margin-right: 5px;
  color: rgba(147, 197, 253, .55);
}
.attendance-records {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-left: 18px;
  border-left: 1px solid rgba(147, 197, 253, .16);
}
.attendance-records > div { display: flex; flex-direction: column; gap: 2px; min-width: 34px; }
.attendance-records span {
  color: #7190b2;
  font-size: 7.5px;
  letter-spacing: .06em;
}
.attendance-records strong {
  color: #f1f7ff;
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.attendance-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.attendance-btn {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid rgba(147, 197, 253, .22);
  border-radius: 6px;
  background: rgba(255, 255, 255, .055);
  color: #dbeafe;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, border-color .16s, opacity .16s;
}
.attendance-btn .icon { width: 10px; height: 10px; }
.attendance-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .12); border-color: rgba(147, 197, 253, .4); }
.attendance-btn.primary {
  border-color: rgba(147, 197, 253, .5);
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .26);
}
.attendance-btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  border-color: rgba(191, 219, 254, .6);
}
.attendance-btn:disabled { opacity: .42; cursor: not-allowed; }
.console-main { min-width: 0; flex: 1; }
.console-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #93c5fd;
  font-family: var(--font-num);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.console-live {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .13);
  animation: consolePulse 2.4s ease-in-out infinite;
}
.console-sep { color: rgba(147, 197, 253, .38); }
@keyframes consolePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(96, 165, 250, .13); }
  50% { box-shadow: 0 0 0 5px rgba(96, 165, 250, .04); }
}
.console-main h1 {
  margin-top: 8px;
  color: #f8fbff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -.045em;
}
.console-main p {
  margin-top: 7px;
  color: #9db5d1;
  font-size: 10.5px;
  line-height: 1.7;
}
.console-main p strong { color: #dbeafe; font-weight: 600; }
.console-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 17px;
  min-width: 390px;
}
.console-meta { display: flex; align-items: flex-start; gap: 0; }
.console-meta > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 82px;
  padding: 0 15px;
  border-left: 1px solid rgba(147, 197, 253, .14);
}
.console-meta > div:first-child { border-left: 0; padding-left: 0; }
.console-meta > div:last-child { padding-right: 0; }
.console-meta span {
  font-size: 7.5px;
  letter-spacing: .12em;
  color: #7190b2;
  text-transform: uppercase;
}
.console-meta strong {
  color: #f1f7ff;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.console-meta strong.console-ok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #93c5fd;
}
.console-meta strong.console-ok i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #60a5fa;
}
.console-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.console-actions .btn { height: 34px; font-size: 10.5px; }
.control-console .btn-primary {
  color: #fff;
  border-color: rgba(147, 197, 253, .44);
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  box-shadow: 0 7px 20px rgba(37, 99, 235, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.control-console .btn-primary:hover {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  border-color: rgba(191, 219, 254, .6);
}
.control-console .btn-secondary {
  color: #f8fbff;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .18);
  box-shadow: none;
}
.control-console .btn-secondary:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .28);
}

/* --------------------------------------------------------------------------
   Instrument-style KPI cards
   -------------------------------------------------------------------------- */
.stat-grid { gap: 14px; margin-bottom: 18px; }
.stat-card {
  overflow: hidden;
  min-height: 132px;
  padding: 17px 18px 15px;
  border-color: #e2e8f1;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .025), 0 10px 24px rgba(15, 23, 42, .025);
  transition: border-color .18s, box-shadow .18s, transform .18s;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.stat-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.stat-card:hover {
  border-color: #c9d8ea;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .03), 0 14px 32px rgba(37, 99, 235, .06);
  transform: translateY(-1px);
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  width: 34px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--stat-color, var(--brand));
  opacity: .9;
}
.stat-card::after { display: none; }
.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #000;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
}
.stat-index {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 16px;
  padding: 0 4px;
  border: 1px solid #dbe6f4;
  border-radius: 3px;
  background: #f6faff;
  color: #2563eb;
  font-family: var(--font-num);
  font-size: 7.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .06em;
}
.stat-icon {
  width: 30px;
  height: 30px;
  border: 1px solid #e3ebf5;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--stat-color, var(--brand));
  box-shadow: none;
}
.stat-icon .icon { width: 14px; height: 14px; }
.stat-value {
  margin-top: 15px;
  color: #000;
  font-size: 29px;
  font-weight: 650;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.stat-value .unit {
  margin-left: 4px;
  color: #5e7188;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0;
}
.stat-foot {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid #eef3f9;
}
.stat-trend,
.stat-note { font-size: 9px; }
.stat-note { color: #5f7187; }

/* --------------------------------------------------------------------------
   Operations modules
   -------------------------------------------------------------------------- */
.ops-radar { gap: 14px; margin-bottom: 18px; }
.ops-card {
  padding: 16px 17px;
  border-color: #e3eaf3;
  border-radius: 13px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .02);
}
.ops-card:hover {
  border-color: #c6d9f0;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .06);
}
.ops-card::before { top: 17px; bottom: 17px; width: 2px; }
.ops-icon {
  width: 32px;
  height: 32px;
  border: 1px solid #e3ebf5;
  border-radius: 9px;
  background: #f8fbff;
  box-shadow: none;
}
.ops-head {
  color: #000;
  font-size: 9px;
  letter-spacing: .035em;
}
.ops-badge {
  border: 1px solid #f0e2c9;
  background: #fffaf0;
  color: #8b5e18;
  font-size: 7.5px;
  padding: 2px 5px;
}
.ops-badge.danger { border-color: #f1d8d4; background: #fff5f3; color: #a33f36; }
.ops-badge.ok { border-color: #d7e6fa; background: #f1f7ff; color: #1d4ed8; }
.ops-value {
  margin-top: 4px;
  color: #000;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
.ops-value small { color: #5f7187; font-size: 8px; }
.ops-note { margin-top: 3px; color: #5f7187; font-size: 8.5px; }
.ops-arrow { color: #7d91a9; }

/* --------------------------------------------------------------------------
   Chart and cards: quieter, sharper, more editorial
   -------------------------------------------------------------------------- */
.card {
  border-color: #e2e9f2;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .02), 0 8px 24px rgba(15, 23, 42, .022);
}
.card-head { padding: 18px 20px 0; }
.card-kicker {
  margin-bottom: 5px;
  color: #2563eb;
  font-family: var(--font-num);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.card-title { font-size: 13px; letter-spacing: -.012em; }
.card-title .icon { color: #6b7f99; }
.card-sub { color: #000; opacity: .62; }
.chart-card { border-top: 2px solid #2563eb; }
.chart-top { margin-bottom: 12px; }
.chart-total { font-size: 25px; font-variant-numeric: tabular-nums; }
.chart-total span { color: #5e7188; font-size: 9px; }
.chart-grid-line { stroke: #e8eef7; stroke-dasharray: 2 5; }
.chart-axis-label { fill: #5e7188; font-size: 8px; }
.chart-line { stroke: #2563eb; stroke-width: 2.2; }
.chart-dot { stroke: #2563eb; stroke-width: 2; }
.chart-dot-label { fill: #000; font-size: 8.5px; font-weight: 600; }
.chart-note { color: #5e7188; font-size: 9px; }
.chart-note strong { color: #1d4ed8; }
.chart-period { background: #f3f7fd; border: 1px solid #e6edf7; }
.chart-period span { color: #5e7188; font-size: 8px; }
.chart-period span.active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .08);
}
.card-link { color: #5e7188; }
.card-link:hover { color: #1d4ed8; }
.card-footer { border-top-color: #eef3f9; color: #5e7188; }

/* --------------------------------------------------------------------------
   Responsive control deck
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .console-body { flex-direction: column; gap: 20px; }
  .console-side {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }
  .console-meta > div:first-child { padding-left: 0; }
}
@media (max-width: 980px) {
  .console-attendance { flex-wrap: wrap; gap: 10px 18px; }
  .attendance-actions { margin-left: 0; }
  .console-side {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .console-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .control-console {
    padding: 0;
    border-radius: 16px;
  }
  .console-attendance { flex-wrap: wrap; gap: 10px 16px; padding: 12px 20px; }
  .console-body { padding: 18px 20px 22px; }
  .attendance-now { width: 100%; justify-content: space-between; }
  .attendance-state { flex: 1; padding-left: 0; border-left: 0; }
  .attendance-records { order: 3; width: 100%; justify-content: space-between; padding-left: 0; border-left: 0; }
  .attendance-actions { order: 4; width: 100%; margin-left: 0; }
  .attendance-btn { flex: 1; justify-content: center; }
  .console-main h1 { font-size: 25px; }
  .console-main p { font-size: 10px; }
  .console-side { flex-direction: column; align-items: stretch; gap: 14px; }
  .console-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 0;
  }
  .console-meta > div {
    min-width: 0;
    padding: 0 10px;
  }
  .console-meta > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .console-actions .btn { flex: 1; }
  .stat-card { min-height: 120px; padding: 14px; }
  .stat-value { font-size: 25px; }
  .stat-index { min-width: 17px; height: 15px; padding: 0 3px; }
  .stat-label { font-size: 9px; gap: 5px; }
}

