:root {
  --navy-950: #071a2e;
  --navy-900: #0d2440;
  --navy-800: #143657;
  --navy-700: #1b456d;
  --ink-900: #162435;
  --ink-700: #405267;
  --ink-500: #728196;
  --ink-300: #aeb9c8;
  --line: #e4eaf1;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --teal: #19bfa9;
  --teal-deep: #0b9a89;
  --teal-soft: #e5faf6;
  --gold: #efa93a;
  --gold-soft: #fff4df;
  --orange: #f17d4e;
  --orange-soft: #fff0e9;
  --red: #e25656;
  --blue: #3f7fe8;
  --blue-soft: #edf4ff;
  --shadow-sm: 0 8px 22px rgba(16, 38, 65, 0.055);
  --shadow-md: 0 18px 50px rgba(7, 26, 46, 0.12);
  --radius-xl: 20px;
  --radius-lg: 15px;
  --radius-md: 11px;
  --font: "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink-900);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
}

.login-view {
  position: relative;
  display: grid;
  grid-template-columns: minmax(480px, 1.1fr) minmax(440px, 0.9fr);
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 19% 12%, rgba(39, 210, 184, 0.18), transparent 29%),
    radial-gradient(circle at 72% 86%, rgba(43, 112, 185, 0.2), transparent 32%),
    linear-gradient(135deg, #081b30 0%, #0d2848 58%, #0b223d 100%);
}

.login-atmosphere,
.grid-plane {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid-plane {
  opacity: 0.17;
  background-image:
    linear-gradient(rgba(96, 182, 191, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 182, 191, 0.2) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.82), transparent 76%);
}

.glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(8px);
}

.glow-a {
  top: -16vw;
  left: -6vw;
  width: 42vw;
  height: 42vw;
  border: 1px solid rgba(47, 211, 188, 0.14);
  box-shadow: 0 0 0 11vw rgba(27, 113, 122, 0.035), 0 0 0 22vw rgba(27, 113, 122, 0.02);
}

.glow-b {
  right: 24%;
  bottom: -18vw;
  width: 36vw;
  height: 36vw;
  background: rgba(27, 86, 140, 0.16);
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 5vw, 74px) clamp(38px, 7vw, 110px) 36px;
  color: #fff;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #ecfaf8, #d8ecea);
  box-shadow: inset 0 0 0 1px rgba(15, 56, 76, 0.08);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
  fill: var(--navy-900);
}

.brand-mark .brand-mark-accent {
  fill: var(--teal-deep);
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.brand-copy strong {
  color: var(--ink-900);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.brand-lockup-light .brand-copy strong {
  color: #fff;
}

.brand-lockup-light .brand-copy small {
  color: rgba(220, 239, 244, 0.64);
}

.login-message {
  width: min(580px, 100%);
  margin: auto 0 0;
  padding-top: 9vh;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #6fe6d3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.eyebrow::before {
  width: 22px;
  height: 1px;
  content: "";
  background: currentColor;
}

.login-message h1 {
  max-width: 570px;
  margin: 22px 0 21px;
  font-size: clamp(42px, 4.4vw, 68px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.09;
}

.login-message p {
  max-width: 540px;
  margin: 0;
  color: rgba(219, 234, 244, 0.72);
  font-size: 16px;
  line-height: 1.8;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: auto 0 38px;
  padding-top: 7vh;
}

.login-feature-grid article {
  min-width: 0;
  padding: 18px 16px;
  border: 1px solid rgba(163, 212, 216, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(9px);
}

.login-feature-grid strong,
.login-feature-grid small {
  display: block;
}

.login-feature-grid strong {
  margin-top: 13px;
  font-size: 13px;
  font-weight: 600;
}

.login-feature-grid small {
  margin-top: 6px;
  overflow: hidden;
  color: rgba(208, 229, 237, 0.55);
  font-size: 11px;
  line-height: 1.55;
  text-overflow: ellipsis;
}

.feature-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: rgba(102, 231, 211, 0.12);
}

.feature-icon svg {
  width: 18px;
  fill: none;
  stroke: #62ddcb;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.login-copyright {
  margin: 0;
  color: rgba(201, 222, 231, 0.38);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.login-panel-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 32px clamp(25px, 5vw, 80px);
  background: rgba(247, 250, 253, 0.97);
  box-shadow: -34px 0 80px rgba(3, 18, 34, 0.22);
}

.login-panel {
  width: min(420px, 100%);
}

.login-panel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow-dark {
  color: var(--teal-deep);
  font-size: 10px;
}

.login-panel h2 {
  margin: 17px 0 8px;
  color: var(--ink-900);
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.login-panel-top p {
  margin: 0;
  color: var(--ink-500);
  line-height: 1.65;
}

.compact-toggle {
  min-width: 42px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-700);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  transition: 0.18s ease;
}

.compact-toggle:hover {
  border-color: #b8c7d8;
  color: var(--navy-800);
}

.login-form {
  margin-top: 42px;
}

.field-label {
  display: block;
  margin: 0 0 9px;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 600;
}

.input-shell {
  display: flex;
  height: 51px;
  align-items: center;
  gap: 11px;
  margin-bottom: 22px;
  padding: 0 15px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #fff;
  transition: 0.2s ease;
}

.input-shell:focus-within {
  border-color: var(--teal-deep);
  box-shadow: 0 0 0 3px rgba(25, 191, 169, 0.12);
}

.input-shell > svg {
  width: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: #8c9bad;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  color: var(--ink-900);
  background: transparent;
}

.input-shell input::placeholder {
  color: #aab5c3;
}

.icon-button {
  display: grid;
  padding: 0;
  border: 0;
  place-items: center;
  color: #8796a8;
  background: transparent;
}

.input-action {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.input-action svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.form-error {
  min-height: 19px;
  margin: -8px 0 14px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}

.primary-button {
  display: flex;
  width: 100%;
  height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #0f9e8e, #087f79);
  box-shadow: 0 11px 22px rgba(13, 151, 137, 0.2);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(13, 151, 137, 0.28);
  filter: brightness(1.03);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.primary-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.login-security-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #e7edf3;
  color: #8492a3;
  font-size: 11px;
  line-height: 1.55;
}

.login-security-note svg {
  width: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--teal-deep);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.dashboard-view {
  min-height: 100vh;
  background:
    radial-gradient(circle at 70% -10%, rgba(25, 191, 169, 0.055), transparent 28%),
    var(--canvas);
}

.app-header {
  position: relative;
  z-index: 10;
  color: #fff;
  background:
    linear-gradient(105deg, rgba(8, 29, 50, 0.98), rgba(13, 47, 77, 0.98)),
    var(--navy-900);
  box-shadow: 0 10px 30px rgba(7, 26, 46, 0.12);
}

.app-header::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.17;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(127, 204, 212, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 204, 212, 0.11) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to right, #000, transparent 75%);
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 1680px;
  height: 82px;
  align-items: center;
  gap: 30px;
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 46px);
}

.header-inner .brand-mark {
  width: 40px;
  height: 40px;
  background: rgba(235, 250, 248, 0.94);
}

.header-inner .brand-mark svg {
  width: 27px;
  height: 27px;
}

.header-inner .brand-copy strong {
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.03em;
}

.header-inner .brand-copy small {
  color: rgba(212, 232, 239, 0.55);
  font-size: 8px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding-left: 29px;
  border-left: 1px solid rgba(192, 221, 228, 0.15);
  color: rgba(218, 234, 242, 0.66);
  font-size: 11px;
  white-space: nowrap;
}

.header-status time {
  color: rgba(241, 248, 250, 0.94);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5ce0c9;
  box-shadow: 0 0 0 4px rgba(92, 224, 201, 0.1);
}

.status-separator {
  width: 1px;
  height: 13px;
  margin: 0 3px;
  background: rgba(192, 221, 228, 0.16);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-button {
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(200, 225, 232, 0.14);
  border-radius: 8px;
  color: rgba(234, 244, 247, 0.8);
  background: rgba(255, 255, 255, 0.045);
  font-size: 11px;
  transition: 0.18s ease;
}

.header-button:hover {
  border-color: rgba(200, 225, 232, 0.26);
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
}

.header-button svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.header-button.is-loading svg {
  animation: spin 0.9s linear infinite;
}

.auto-toggle[aria-pressed="true"] {
  border-color: rgba(83, 225, 203, 0.34);
  color: #9ff5e7;
  background: rgba(29, 172, 154, 0.12);
}

.switch-track {
  position: relative;
  width: 24px;
  height: 14px;
  border-radius: 20px;
  background: rgba(202, 222, 230, 0.18);
  transition: 0.2s ease;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease, background 0.2s ease;
}

.auto-toggle[aria-pressed="true"] .switch-track {
  background: #1bbfa9;
}

.auto-toggle[aria-pressed="true"] .switch-thumb {
  transform: translateX(10px);
  background: #fff;
}

.compact-toggle-dark {
  border-color: rgba(200, 225, 232, 0.14);
  color: rgba(234, 244, 247, 0.78);
  background: rgba(255, 255, 255, 0.045);
}

.compact-toggle-dark:hover {
  border-color: rgba(200, 225, 232, 0.26);
  color: #fff;
}

.user-menu {
  position: relative;
  margin-left: 3px;
}

.user-button {
  display: flex;
  height: 37px;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 5px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #eaf4f7;
  background: transparent;
  transition: 0.18s ease;
}

.user-button:hover,
.user-button[aria-expanded="true"] {
  border-color: rgba(200, 225, 232, 0.14);
  background: rgba(255, 255, 255, 0.055);
}

.user-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: #0d3843;
  background: #c8f4eb;
  font-size: 11px;
  font-weight: 700;
}

.user-name {
  max-width: 92px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-button > svg {
  width: 13px;
  fill: none;
  stroke: rgba(230, 243, 246, 0.55);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.user-popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-md);
  color: var(--ink-900);
}

.popover-user {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line);
}

.popover-user strong {
  font-size: 12px;
}

.popover-user small {
  color: var(--ink-500);
  font-size: 10px;
}

.user-popover button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-700);
  background: transparent;
  text-align: left;
  font-size: 11px;
}

.user-popover button:hover {
  color: var(--red);
  background: #fff3f3;
}

.user-popover button svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.dashboard-main {
  width: min(1680px, calc(100% - 44px));
  margin: 0 auto;
  padding: 22px 0 17px;
}

.briefing-row {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(380px, 1.6fr) auto;
  align-items: center;
  gap: 26px;
  margin-bottom: 17px;
}

.briefing-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--teal-deep);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.briefing-row h1 {
  margin: 0;
  color: var(--ink-900);
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.briefing-insight {
  position: relative;
  padding-left: 17px;
  color: var(--ink-700);
  font-size: 12px;
  line-height: 1.6;
}

.briefing-insight::before {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 3px;
  border-radius: 4px;
  content: "";
  background: linear-gradient(var(--teal), #9fe5db);
}

.briefing-meta {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 1px 8px;
  text-align: right;
}

.briefing-meta span {
  color: var(--ink-500);
  font-size: 10px;
}

.briefing-meta strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.briefing-meta small {
  grid-column: 1 / -1;
  color: var(--ink-500);
  font-size: 9px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 13px;
}

.kpi-card {
  position: relative;
  min-width: 0;
  min-height: 132px;
  overflow: hidden;
  padding: 18px 19px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.kpi-card::before {
  position: absolute;
  top: 0;
  left: 18px;
  width: 42px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  content: "";
}

.kpi-primary::before { background: var(--teal); }
.kpi-success::before { background: #43b884; }
.kpi-blue::before { background: var(--blue); }
.kpi-warning::before { background: var(--orange); }

.kpi-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 600;
}

.kpi-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
}

.kpi-primary .kpi-icon { color: var(--teal-deep); background: var(--teal-soft); }
.kpi-success .kpi-icon { color: #229a67; background: #eaf8f1; }
.kpi-blue .kpi-icon { color: var(--blue); background: var(--blue-soft); }
.kpi-warning .kpi-icon { color: var(--orange); background: var(--orange-soft); }

.kpi-icon svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.kpi-value {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
}

.kpi-value strong {
  color: var(--ink-900);
  font-size: 31px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1.25;
}

.kpi-value span {
  color: var(--ink-500);
  font-size: 10px;
}

.kpi-foot {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.45;
}

.kpi-foot em {
  color: var(--teal-deep);
  font-style: normal;
  font-weight: 600;
}

.kpi-foot em.negative {
  color: var(--orange);
}

.sparkline {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 45%;
  height: 47px;
  opacity: 0.7;
}

.mini-track {
  position: absolute;
  right: 17px;
  bottom: 18px;
  left: 19px;
  display: flex;
  height: 4px;
  gap: 2px;
  overflow: hidden;
  border-radius: 6px;
  background: #eef3f8;
}

.mini-track span {
  display: block;
  min-width: 3px;
  border-radius: 6px;
  background: var(--blue);
}

.mini-track span:nth-child(2) { background: #80a9ee; }
.mini-track span:nth-child(3) { background: #b3c9ec; }

.mini-meter {
  position: absolute;
  right: 18px;
  bottom: 19px;
  left: 19px;
  height: 4px;
  overflow: hidden;
  border-radius: 6px;
  background: #f4ede5;
}

.mini-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #f3b871);
  transition: width 0.7s ease;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 13px;
}

.panel {
  min-width: 0;
  padding: 17px 18px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.trend-panel { grid-column: span 8; }
.planning-panel { grid-column: span 4; }
.task-panel { grid-column: span 5; }
.exception-panel { grid-column: span 3; }
.customer-panel { grid-column: span 4; }
.exception-list-panel { grid-column: span 7; }
.activity-panel { grid-column: span 5; }

.panel-header {
  display: flex;
  min-height: 37px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-header h2 {
  margin: 0;
  color: var(--ink-900);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.35;
}

.panel-tag {
  display: inline-flex;
  height: 21px;
  align-items: center;
  padding: 0 8px;
  border-radius: 20px;
  color: var(--teal-deep);
  background: var(--teal-soft);
  font-size: 9px;
  font-weight: 600;
}

.panel-tag-warm {
  color: #b5741e;
  background: var(--gold-soft);
}

.legend {
  display: flex;
  gap: 13px;
  color: var(--ink-500);
  font-size: 9px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-teal { background: var(--teal); }
.legend-gold { background: var(--gold); }

.trend-wrap {
  margin: 4px -3px 0;
}

#trend-chart {
  width: 100%;
  height: 228px;
  overflow: visible;
}

.chart-grid {
  stroke: #e9eef4;
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.chart-axis-label {
  fill: #93a0b0;
  font-size: 9px;
  font-family: var(--font);
}

.chart-value-label {
  fill: #526377;
  font-size: 9px;
  font-family: var(--font);
  font-weight: 600;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.chart-point {
  stroke: #fff;
  stroke-width: 2;
}

.chart-area {
  opacity: 0.95;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf1f5;
  color: var(--ink-500);
  font-size: 9px;
}

.panel-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pulse-mark {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(25, 191, 169, 0.12);
}

.donut-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.5vw, 40px);
  min-height: 164px;
  padding-top: 8px;
}

.donut {
  position: relative;
  display: grid;
  width: 136px;
  height: 136px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#dce5ee 0 100%);
}

.donut::after {
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  content: "";
  background: #fff;
  box-shadow: 0 0 0 1px rgba(227, 234, 241, 0.7);
}

.donut-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-center strong {
  color: var(--ink-900);
  font-size: 24px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.donut-center small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
}

.donut-legend {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

.donut-legend-item {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.donut-legend-item i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.donut-legend-item span {
  overflow: hidden;
  color: var(--ink-700);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend-item strong {
  color: var(--ink-900);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.donut-legend-item small {
  grid-column: 2 / 4;
  margin-top: -5px;
  color: var(--ink-500);
  font-size: 9px;
}

.insight-callout {
  margin-top: 3px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #416172;
  background: #f2f8f8;
  font-size: 9px;
  line-height: 1.55;
}

.task-bars {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 14px;
}

.task-row {
  display: grid;
  grid-template-columns: 105px minmax(75px, 1fr) 44px;
  align-items: center;
  gap: 10px;
}

.task-row-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.task-row-label span {
  overflow: hidden;
  color: var(--ink-700);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-label small {
  color: #a06a24;
  font-size: 8px;
}

.task-track {
  height: 7px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf2f7;
}

.task-track span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #4b89ec, #7fb0f2);
  transition: width 0.6s ease;
}

.task-row:nth-child(1) .task-track span { background: linear-gradient(90deg, #e88145, #f0af65); }
.task-row:nth-child(2) .task-track span { background: linear-gradient(90deg, #3d85df, #7aafea); }
.task-row:nth-child(3) .task-track span { background: linear-gradient(90deg, #13ad9c, #59cdbf); }

.task-row-value {
  color: var(--ink-900);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.task-detail {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid #edf1f5;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.task-detail-grid span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f7f9fc;
  color: var(--ink-500);
  font-size: 9px;
}

.task-detail-grid strong {
  color: var(--ink-700);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.text-button {
  padding: 2px 0;
  border: 0;
  color: var(--teal-deep);
  background: transparent;
  font-size: 9px;
  font-weight: 600;
}

.exception-summary {
  display: flex;
  align-items: center;
  gap: 17px;
  min-height: 112px;
  padding-top: 8px;
}

.progress-ring {
  position: relative;
  display: grid;
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--orange) 0 0%, #f3e7de 0 100%);
}

.progress-ring::after {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  content: "";
  background: #fff;
}

.progress-ring > span {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-ring strong {
  color: var(--ink-900);
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.progress-ring small {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 7px;
}

.exception-stats {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 7px;
}

.exception-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #edf0f4;
  font-size: 9px;
}

.exception-stat:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.exception-stat span {
  overflow: hidden;
  color: var(--ink-500);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exception-stat strong {
  color: var(--ink-900);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.alert-strip {
  margin-top: 5px;
  padding: 8px 9px;
  border-radius: 7px;
  color: #a2671e;
  background: var(--gold-soft);
  font-size: 8px;
  line-height: 1.5;
}

.customer-ranking {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 13px;
}

.customer-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
}

.customer-rank {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 5px;
  color: var(--ink-500);
  background: #f1f4f8;
  font-size: 8px;
  font-weight: 700;
}

.customer-row:nth-child(1) .customer-rank {
  color: #8c6117;
  background: #fff2d8;
}

.customer-row:nth-child(2) .customer-rank {
  color: #62717f;
  background: #edf1f4;
}

.customer-row:nth-child(3) .customer-rank {
  color: #8d5e43;
  background: #faeee6;
}

.customer-name-wrap {
  min-width: 0;
}

.customer-name {
  display: block;
  overflow: hidden;
  margin-bottom: 4px;
  color: var(--ink-700);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 5px;
  background: #edf2f6;
}

.customer-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16b6a2, #7edacd);
}

.customer-value {
  color: var(--ink-900);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.exception-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.exception-item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #edf1f5;
  border-radius: 9px;
  background: #fcfdff;
}

.exception-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.exception-type {
  display: inline-flex;
  height: 20px;
  align-items: center;
  padding: 0 7px;
  border-radius: 5px;
  color: #b66c25;
  background: #fff2e3;
  font-size: 8px;
  font-weight: 600;
}

.exception-age {
  color: var(--ink-500);
  font-size: 8px;
}

.exception-item strong {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  color: var(--ink-900);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exception-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 8px;
}

.exception-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-deep);
  font-size: 9px;
  font-weight: 600;
}

.activity-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(25, 191, 169, 0.1);
  animation: livePulse 2.2s ease-out infinite;
}

.activity-feed {
  position: relative;
  display: flex;
  max-height: 256px;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  margin-top: 11px;
}

.activity-feed::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 1px;
  content: "";
  background: #e8edf3;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 7px 0;
}

.activity-dot {
  position: relative;
  z-index: 1;
  width: 7px;
  height: 7px;
  margin: 6px 0 0 4px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #7fb6db;
  box-shadow: 0 0 0 1px #d7e6ef;
}

.activity-dot.sign { background: var(--teal); box-shadow: 0 0 0 1px #b9e7e0; }
.activity-dot.transit { background: var(--blue); box-shadow: 0 0 0 1px #c9d9f3; }
.activity-dot.warning { background: var(--orange); box-shadow: 0 0 0 1px #f0d2c4; }

.activity-content {
  min-width: 0;
}

.activity-content strong {
  display: block;
  overflow: hidden;
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-content span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-time {
  color: #9aa7b5;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.finance-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr 1fr;
  gap: 13px;
  margin-top: 13px;
}

.finance-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 78px;
  padding: 13px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.finance-label {
  grid-column: 1 / -1;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 600;
}

.finance-card > strong {
  color: var(--ink-900);
  font-size: 20px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.finance-card > small {
  color: var(--ink-500);
  font-size: 8px;
  text-align: right;
}

.resource-values {
  display: flex;
  grid-column: 1 / -1;
  gap: 26px;
  margin-top: 7px;
}

.resource-values span {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.resource-values strong {
  color: var(--ink-900);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.resource-values small {
  color: var(--ink-500);
  font-size: 8px;
}

.data-health {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--teal-deep);
}

.data-health i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.data-health strong {
  font-size: 11px;
}

.data-card > small {
  margin-top: 8px;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 1px 0;
  color: #8c9bad;
  font-size: 8px;
}

.refresh-overlay {
  position: fixed;
  z-index: 40;
  right: 22px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(219, 231, 238, 0.18);
  border-radius: 10px;
  color: rgba(239, 247, 249, 0.9);
  background: rgba(10, 35, 58, 0.94);
  box-shadow: 0 12px 30px rgba(7, 26, 46, 0.22);
  font-size: 10px;
  backdrop-filter: blur(12px);
}

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #63ded0;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.toast {
  position: fixed;
  z-index: 50;
  top: 20px;
  left: 50%;
  min-width: 220px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 11px 15px;
  border-radius: 9px;
  color: #fff;
  background: rgba(13, 36, 64, 0.96);
  box-shadow: var(--shadow-md);
  font-size: 11px;
  text-align: center;
  transform: translateX(-50%);
  animation: toastIn 0.2s ease-out;
}

.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  border-radius: 4px;
  background: #eef2f6;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes livePulse {
  0%, 60% { box-shadow: 0 0 0 3px rgba(25, 191, 169, 0.1); }
  100% { box-shadow: 0 0 0 9px rgba(25, 191, 169, 0); }
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -7px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 1240px) {
  .header-status {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trend-panel,
  .task-panel,
  .exception-list-panel {
    grid-column: span 2;
  }

  .planning-panel,
  .exception-panel,
  .customer-panel,
  .activity-panel {
    grid-column: span 1;
  }

  .finance-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .login-view {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .login-brand {
    min-height: 420px;
    padding-bottom: 48px;
  }

  .login-message {
    padding-top: 52px;
  }

  .login-message h1 {
    max-width: 470px;
    font-size: 46px;
  }

  .login-feature-grid {
    display: none;
  }

  .login-copyright {
    margin-top: auto;
  }

  .login-panel-wrap {
    padding: 58px 24px 72px;
    box-shadow: none;
  }

  .briefing-row {
    grid-template-columns: 1fr auto;
  }

  .briefing-insight {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-inner {
    gap: 16px;
  }

  .user-name {
    display: none;
  }
}

@media (max-width: 720px) {
  .login-brand {
    min-height: 390px;
    padding: 25px 23px 33px;
  }

  .login-message h1 {
    margin-top: 18px;
    font-size: 36px;
  }

  .login-message p {
    font-size: 14px;
  }

  .login-panel-wrap {
    padding: 46px 22px 60px;
  }

  .login-panel h2 {
    font-size: 28px;
  }

  .login-form {
    margin-top: 32px;
  }

  .app-header {
    position: static;
  }

  .header-inner {
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .header-actions {
    width: 100%;
    margin-left: 0;
  }

  .header-button {
    flex: 1;
    justify-content: center;
  }

  .compact-toggle-dark {
    flex: 0 0 42px;
  }

  .dashboard-main {
    width: calc(100% - 26px);
    padding-top: 18px;
  }

  .briefing-row {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .briefing-meta {
    text-align: left;
  }

  .briefing-insight {
    grid-column: auto;
    grid-row: auto;
  }

  .kpi-grid {
    gap: 10px;
  }

  .kpi-card {
    min-height: 126px;
    padding: 16px 15px 13px;
  }

  .kpi-value strong {
    font-size: 27px;
  }

  .dashboard-grid {
    display: flex;
    flex-direction: column;
  }

  .panel {
    padding: 16px 15px 14px;
  }

  .trend-wrap {
    overflow-x: auto;
  }

  #trend-chart {
    min-width: 610px;
    height: 210px;
  }

  .donut-layout {
    min-height: 156px;
  }

  .exception-list {
    grid-template-columns: 1fr;
  }

  .finance-strip {
    grid-template-columns: 1fr;
  }

  .app-footer {
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 430px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .header-inner .brand-copy strong {
    font-size: 14px;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .user-menu {
    margin-left: auto;
  }

  .donut-layout {
    align-items: center;
    flex-direction: column;
  }

  .donut-legend {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
