/* =============================================================
   DevFlow · 软件交付工单中心
   Design tokens & UI system
   ============================================================= */

:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --bg: #f3f5fa;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #66708a;
  --line: #e6eaf2;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 12px 30px -24px rgba(15, 23, 42, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

::selection {
  background: #c7d2fe;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #ccd4e3;
  border-radius: 99px;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* =============================================================
   Layout
   ============================================================= */

.app {
  min-height: 100vh;
}

body:not(.ready) .app {
  display: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 256px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 18px 20px;
  color: #8d9cb8;
  background:
    radial-gradient(560px 320px at -10% -6%, rgba(99, 102, 241, 0.32), transparent 62%),
    radial-gradient(420px 300px at 120% 104%, rgba(14, 165, 233, 0.12), transparent 60%),
    linear-gradient(180deg, #0a1222, #0d1527 55%, #0a1222);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #7c83ff, #4f46e5);
  box-shadow: 0 12px 26px -10px rgba(99, 102, 241, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

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

.brand-text strong {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f1f5fd;
}

.brand-text span {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: #7f8db0;
  margin-top: 1px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: #93a1bd;
  transition: all 0.16s ease;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #e2e8f5;
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.28), rgba(99, 102, 241, 0.08));
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.24);
}

.nav-item.active svg {
  color: #c7d2fe;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  right: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a5b4fc;
  box-shadow: 0 0 9px #a5b4fc;
}

.sidebar-tip {
  margin-top: auto;
  padding: 14px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.65;
  color: #a9b6d2;
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.17), rgba(99, 102, 241, 0.035));
  border: 1px solid rgba(129, 140, 248, 0.18);
}

.tip-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #c7d2fe;
  background: rgba(129, 140, 248, 0.16);
}

.sidebar-tip p {
  margin: 0 0 8px;
}

.sidebar-tip a {
  font-size: 12px;
  font-weight: 600;
  color: #c7d2fe;
}

.sidebar-tip a:hover {
  color: #e0e7ff;
}

.sidebar-foot {
  display: flex;
}

.user-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #818cf8, #6366f1);
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}

.user-info strong {
  font-size: 13px;
  color: #e8edf9;
}

.user-info span {
  font-size: 11.5px;
  color: #7f8db0;
}

.user-logout {
  width: 28px;
  height: 28px;
  flex: none;
  margin-left: auto;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #7f8db0;
  cursor: pointer;
  transition: 0.15s;
}

.user-logout:hover {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
}

.user-logout svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main {
  margin-left: 256px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 34px;
  background: rgba(243, 245, 250, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(230, 234, 242, 0.9);
}

.topbar-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62vw;
}

.topbar-title p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62vw;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.today-chip {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  white-space: nowrap;
}

.view {
  flex: 1;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 34px 56px;
}

/* =============================================================
   Buttons / pills / cards
   ============================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: #cdd6e4;
  box-shadow: 0 8px 18px -12px rgba(15, 23, 42, 0.28);
}

.btn:active {
  transform: none;
}

.btn-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 10px 22px -10px rgba(79, 70, 229, 0.7);
}

.btn-primary:hover {
  border-color: transparent;
  filter: saturate(1.08);
  box-shadow: 0 14px 26px -10px rgba(79, 70, 229, 0.72);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #64748b;
}

.btn-ghost:hover {
  background: #eef1f7;
  box-shadow: none;
}

.btn-danger {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.btn-sm {
  padding: 7px 11px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  transition: 0.15s;
}

.icon-btn:hover {
  background: #f1f4fa;
  color: #475569;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--tag, #64748b);
  background: color-mix(in srgb, var(--tag, #64748b) 11%, #fff);
  border: 1px solid color-mix(in srgb, var(--tag, #64748b) 20%, #fff);
}

.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.pill-plain::before {
  display: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* =============================================================
   Dashboard
   ============================================================= */

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

.kpi {
  position: relative;
  padding: 19px 20px;
  overflow: hidden;
  animation: rise 0.45s both;
}

.kpi:nth-child(2) {
  animation-delay: 0.04s;
}

.kpi:nth-child(3) {
  animation-delay: 0.08s;
}

.kpi:nth-child(4) {
  animation-delay: 0.12s;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c), transparent 72%);
  opacity: 0.55;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.kpi-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #fff);
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.kpi-value .unit {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.kpi-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 12px;
  color: #8a94ab;
}

.kpi-sub .danger-text {
  color: #dc2626;
  font-weight: 600;
}

.kpi-sub .ok-text {
  color: #0f9f6e;
  font-weight: 600;
}

.dash-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 372px;
  gap: 16px;
  margin-top: 16px;
}

.dash-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 20px;
  animation: rise 0.5s both;
}

.dash-bottom .panel {
  animation-delay: 0.1s;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-head p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted);
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: 0;
}

/* Donut chart */

.donut-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1;
}

.donut-box {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
}

.donut-box svg {
  display: block;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  pointer-events: none;
}

.donut-center strong {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.donut-center span {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
}

.donut-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  width: 100%;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11.5px;
  color: #4b5568;
}

.legend-row .dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 3px;
}

.legend-row .name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-row b {
  font-weight: 650;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

/* Bar chart */

.chart-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 190px;
  padding-top: 6px;
}

.chart-bars {
  display: flex;
  justify-content: space-around;
  gap: 14px;
  height: 196px;
  align-items: flex-end;
}

.bar-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
  height: 100%;
  min-width: 0;
}

.bar-pair {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding-top: 14px;
  border-bottom: 1px dashed #edf0f7;
}

.bar-pair::before {
  content: "";
  position: absolute;
  inset: 33% 0 auto 0;
  border-top: 1px dashed #f1f4fa;
  pointer-events: none;
}

.chart-bar {
  display: block;
  width: 15px;
  min-height: 3px;
  border-radius: 6px 6px 3px 3px;
  transition: height 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 10px -6px rgba(79, 70, 229, 0.4);
}

.chart-bar-new {
  background: linear-gradient(180deg, #818cf8, #6366f1);
}

.chart-bar-done {
  background: linear-gradient(180deg, #34d399, #10b981);
  box-shadow: 0 4px 10px -6px rgba(16, 185, 129, 0.4);
}

.chart-bar:hover {
  filter: brightness(1.07);
}

.bar-label {
  text-align: center;
  font-size: 11px;
  color: #8a94ab;
  font-variant-numeric: tabular-nums;
}

/* Attention list */

.attention-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.attention-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 8px;
  border-radius: 12px;
  transition: 0.15s;
}

.attention-item:hover {
  background: #f8fafd;
}

.attention-line {
  width: 3px;
  height: 30px;
  flex: none;
  border-radius: 3px;
  background: #cbd5e1;
}

.attention-main {
  flex: 1;
  min-width: 0;
}

.attention-main strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attention-main span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #98a2b6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attention-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
}

.mini-progress {
  display: block;
  width: 64px;
  height: 4px;
  border-radius: 99px;
  background: #eef1f8;
  overflow: hidden;
}

.mini-progress i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #818cf8, #6366f1);
}

.due-badge {
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.due-badge.danger {
  color: #dc2626;
  background: #fef2f2;
}

.due-badge.warn {
  color: #d97706;
  background: #fffbeb;
}

.due-badge.ok {
  color: #0f9f6e;
  background: #ecfdf5;
}

/* Mini project table */

.mini-table {
  display: flex;
  flex-direction: column;
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 88px minmax(110px, 1fr) 92px;
  align-items: center;
  gap: 14px;
  padding: 11px 8px;
  border-radius: 10px;
  border-bottom: 1px solid #f2f5fa;
  transition: 0.15s;
}

.mini-row:last-child {
  border-bottom: none;
}

.mini-row:hover {
  background: #f8fafd;
}

.mini-project {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mini-project strong {
  font-size: 12.8px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-project span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-deadline {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.mini-deadline.danger {
  color: #dc2626;
  font-weight: 600;
}

.mini-deadline.warn {
  color: #d97706;
  font-weight: 600;
}

/* Activity feed */

.feed {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.feed-item {
  display: flex;
  gap: 11px;
  padding: 9px 6px;
  border-radius: 10px;
  transition: 0.15s;
}

.feed-item:hover {
  background: #f8fafd;
}

.feed-ico {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #fff);
}

.feed-ico svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feed-body {
  flex: 1;
  min-width: 0;
}

.feed-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.45;
  color: #334155;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11px;
  color: #98a2b6;
}

.feed-meta b {
  font-weight: 600;
  color: #64748b;
}

/* =============================================================
   Projects list
   ============================================================= */

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.chips {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #5b6577;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.15s;
}

.chip b {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  color: #94a3b8;
  background: #f1f4fa;
  font-variant-numeric: tabular-nums;
}

.chip:hover {
  border-color: #cbd5e1;
  background: #fafbff;
}

.chip.active {
  color: #fff;
  background: #0f172a;
  border-color: #0f172a;
  box-shadow: 0 8px 16px -10px rgba(15, 23, 42, 0.5);
}

.chip.active b {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.chip .cdot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--tag);
}

.filter-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  stroke: #94a3b8;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search-box input {
  width: 230px;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ink);
  transition: 0.15s;
}

.search-box input:focus {
  outline: none;
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
  transition: 0.15s;
}

.select:focus {
  outline: none;
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(318px, 1fr));
  gap: 16px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 19px 20px 17px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  animation: rise 0.4s both;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--pri, #e2e8f0);
  opacity: 0.85;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: #c7d2fe;
  box-shadow: 0 18px 44px -24px rgba(79, 70, 229, 0.32);
}

.pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pc-code {
  font-size: 10.8px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.045em;
  font-variant-numeric: tabular-nums;
}

.pc-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.38;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-customer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: -4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-customer .dot-sep {
  color: #cbd5e1;
}

.pc-progress {
  margin-top: 2px;
}

.pc-progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.pc-progress-head strong {
  color: #334155;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.bar {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: #eef1f8;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #818cf8, #6366f1);
  transition: width 0.6s ease;
}

.bar > i.complete {
  background: linear-gradient(90deg, #34d399, #10b981);
}

.pc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1px;
  padding-top: 12px;
  border-top: 1px dashed #eef1f8;
}

.pc-foot .due {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.pc-foot .due.danger {
  color: #dc2626;
  font-weight: 600;
}

.pc-foot .due.warn {
  color: #d97706;
  font-weight: 600;
}

.pc-money {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* =============================================================
   Project detail
   ============================================================= */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition: 0.15s;
}

.back-link:hover {
  color: var(--primary);
}

.back-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 17px;
}

.dh-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dh-title h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.dh-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.dot-sep {
  color: #cbd5e1;
}

.dh-actions {
  display: flex;
  gap: 10px;
  flex: none;
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  padding: 22px 24px;
  margin-bottom: 16px;
  animation: rise 0.45s both;
}

.hero-left {
  flex: 1;
  min-width: 0;
}

.hero-right {
  flex: none;
  display: flex;
  align-items: center;
  gap: 18px;
}

.stepper {
  display: flex;
  align-items: flex-start;
  margin: 0 0 20px;
  padding: 0 0 6px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.stepper::-webkit-scrollbar {
  display: none;
}

.step {
  position: relative;
  flex: 1;
  min-width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.step::before {
  content: "";
  position: absolute;
  top: 12px;
  left: calc(-50% + 15px);
  right: calc(50% + 15px);
  height: 2px;
  border-radius: 2px;
  background: #e8ecf6;
}

.step:first-child::before {
  display: none;
}

.step.done::before,
.step.current::before {
  background: linear-gradient(90deg, #a5b4fc, #6366f1);
}

.step-dot {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #e8ecf6;
  background: #f1f4fa;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.step-dot svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.step-label {
  font-size: 10.8px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
}

.step.done .step-dot {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4f46e5;
}

.step.done .step-label {
  color: #64748b;
}

.step.current .step-dot {
  width: 28px;
  height: 28px;
  border-color: #4f46e5;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}

.step.current .step-label {
  color: #312e81;
  font-weight: 700;
}

.cancel-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.cancel-banner svg {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #f0f3f9;
}

.hstat {
  min-width: 0;
}

.hstat > span {
  display: block;
  margin-bottom: 4px;
  font-size: 10.8px;
  font-weight: 550;
  color: #94a3b8;
}

.hstat > strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.hstat > small {
  display: block;
  margin-top: 3px;
  font-size: 10.8px;
  color: #9aa4b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hstat strong.danger {
  color: #dc2626;
}

.hstat strong.warn {
  color: #d97706;
}

.ring {
  --p: 0;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#6366f1 calc(var(--p) * 1%), #edf0f8 0);
  transition: background 0.35s ease;
}

.ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 1px 5px rgba(15, 23, 42, 0.05);
}

.ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.ring-inner strong {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.ring-inner strong small {
  margin-left: 1px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.ring-inner span {
  margin-top: 5px;
  font-size: 10.5px;
  color: #94a3b8;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

.detail-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.ms-list {
  display: flex;
  flex-direction: column;
}

.ms-row {
  padding: 11px 8px;
  border-radius: 12px;
  border-bottom: 1px solid #f4f6fb;
  transition: background 0.15s;
}

.ms-row:last-child {
  border-bottom: none;
}

.ms-row:hover {
  background: #f9fbfe;
}

.ms-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.ms-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.ms-name .check {
  width: 17px;
  height: 17px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid #d8dfec;
  color: transparent;
}

.ms-name .check svg {
  width: 9px;
  height: 9px;
  stroke: currentColor;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ms-row.done .check {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}

.ms-row.done .ms-name {
  color: #64748b;
}

.ms-due {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 10.8px;
  color: #9aa4b8;
  white-space: nowrap;
}

.ms-due .danger {
  color: #dc2626;
  font-weight: 600;
}

.ms-edit {
  padding: 2px 5px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #a8b1c2;
  font-size: 10.5px;
  cursor: pointer;
  opacity: 0;
  transition: 0.15s;
}

.ms-row:hover .ms-edit,
.ms-edit:focus-visible {
  opacity: 1;
}

.ms-edit:hover {
  color: #4f46e5;
  background: #eef2ff;
}

@media (hover: none) {
  .ms-edit {
    opacity: 1;
  }
}

.ms-slider {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ms-range {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #6366f1 var(--fill, 0%), #edf0f8 var(--fill, 0%));
  outline: none;
  cursor: pointer;
}

.ms-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 3px solid #6366f1;
  background: #fff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.28);
  cursor: grab;
}

.ms-range::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.08);
}

.ms-range::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 3px solid #6366f1;
  background: #fff;
}

.ms-val {
  width: 38px;
  flex: none;
  text-align: right;
  font-size: 11.5px;
  font-weight: 650;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.ticket-list {
  display: flex;
  flex-direction: column;
}

.ticket-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-radius: 11px;
  border-bottom: 1px solid #f4f6fb;
  cursor: pointer;
  transition: background 0.15s;
}

.ticket-row:last-child {
  border-bottom: none;
}

.ticket-row:hover {
  background: #f8fafd;
}

.ttype {
  width: 27px;
  height: 27px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #fff);
}

.ticket-main {
  flex: 1;
  min-width: 0;
}

.ticket-main strong {
  display: block;
  font-size: 12.8px;
  font-weight: 550;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-row.is-done .ticket-main strong {
  color: #94a3b8;
  text-decoration: line-through;
  text-decoration-color: #cbd5e1;
}

.ticket-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
  font-size: 10.8px;
  color: #9aa4b8;
}

.ticket-sub .danger {
  color: #dc2626;
  font-weight: 600;
}

.ticket-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.avatar-xs {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.note-form {
  margin-bottom: 14px;
}

.note-form textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafbfe;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
  transition: 0.15s;
}

.note-form textarea:focus {
  outline: none;
  border-color: #a5b4fc;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.note-hint {
  font-size: 10.5px;
  color: #b0b8c8;
}

.timeline {
  display: flex;
  flex-direction: column;
  max-height: 580px;
  margin-right: -6px;
  padding-right: 6px;
  overflow-y: auto;
}

.tl-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
}

.tl-item::before {
  content: "";
  position: absolute;
  top: 27px;
  bottom: 0;
  left: 12px;
  width: 1.5px;
  background: #eef1f8;
}

.tl-item:last-child::before {
  display: none;
}

.tl-dot {
  position: relative;
  z-index: 1;
  width: 25px;
  height: 25px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 22%, #fff);
}

.tl-dot svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl-body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.tl-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: #334155;
}

.tl-detail {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.55;
  color: #7c8698;
  word-break: break-word;
}

.tl-time {
  margin-top: 4px;
  font-size: 10.5px;
  color: #a8b1c2;
}

/* =============================================================
   Kanban board
   ============================================================= */

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.board-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.board-summary b {
  color: #1e293b;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 14px;
  align-items: start;
}

.kanban-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  padding: 12px;
  border: 1px solid #e6eaf2;
  border-radius: 16px;
  background: #eef1f8;
  transition: 0.15s;
}

.kanban-col.over {
  background: #e8ecff;
  border-color: #c7d2fe;
  box-shadow: inset 0 0 0 1px #c7d2fe;
}

.kc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 6px;
}

.kc-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--c);
}

.kc-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.kc-count {
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid #e3e8f2;
  background: #fff;
  font-size: 11px;
  font-weight: 650;
  color: #8a94ab;
  font-variant-numeric: tabular-nums;
}

.kc-add {
  width: 24px;
  height: 24px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  transition: 0.15s;
}

.kc-add:hover {
  color: #4f46e5;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.kc-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 80px;
}

.kanban-card {
  padding: 12px 13px;
  border: 1px solid #e6eaf2;
  border-radius: 13px;
  background: #fff;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}

.kanban-card:hover {
  transform: translateY(-1px);
  border-color: #cfd8e8;
  box-shadow: 0 10px 22px -14px rgba(15, 23, 42, 0.3);
}

.kanban-card.dragging {
  opacity: 0.45;
  transform: rotate(2deg) scale(0.98);
}

.kc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.kc-prio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 10%, #fff);
  white-space: nowrap;
}

.kc-prio::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.kc-proj {
  max-width: 62%;
  padding: 2.5px 7px;
  border-radius: 6px;
  background: #f4f6fb;
  font-size: 10.5px;
  color: #8a94ab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kc-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.42;
  color: #26334a;
}

.kc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.kc-due {
  font-size: 10.5px;
  color: #98a2b6;
  white-space: nowrap;
}

.kc-due.danger {
  color: #dc2626;
  font-weight: 600;
}

.kc-empty {
  padding: 16px 10px;
  border: 1.5px dashed #dbe2ee;
  border-radius: 11px;
  text-align: center;
  font-size: 11.5px;
  color: #a8b1c2;
}

/* =============================================================
   Customers
   ============================================================= */

.cust-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.cust-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  animation: rise 0.4s both;
}

.cs-ico {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #fff);
}

.cs-ico svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cs-body span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.cs-body strong {
  display: block;
  margin-top: 2px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

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

.table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 13px 20px;
  text-align: left;
  font-size: 10.8px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
  background: #fafbfe;
  border-bottom: 1px solid #eef1f8;
  white-space: nowrap;
}

.table td {
  padding: 14px 20px;
  border-bottom: 1px solid #f4f6fb;
  vertical-align: middle;
}

.table tbody tr {
  transition: background 0.15s;
}

.table tbody tr:hover {
  background: #fafbfe;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.cust-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.cust-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.cust-name strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #26334a;
}

.cust-name span {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: #94a3b8;
}

.contact-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #5b6577;
}

.contact-lines span:last-child {
  font-size: 11.5px;
  color: #98a2b6;
}

.money-cell {
  font-weight: 650;
  color: #334155;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #f1f4fa;
  color: #475569;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* =============================================================
   Modal & forms
   ============================================================= */

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(10, 18, 34, 0.46);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn 0.16s ease;
}

.modal {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 40px 90px -30px rgba(10, 18, 34, 0.55);
  animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.35, 1.1);
}

.modal-wide {
  width: min(680px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0f3f9;
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-head p {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.modal-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 18px 24px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 24px;
  border-top: 1px solid #f0f3f9;
  background: #fafbfe;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field.span-2 {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: #4b5568;
}

.field label em {
  font-style: normal;
  color: #ef4444;
}

.input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #dfe5ef;
  border-radius: 10px;
  background: #fbfcfe;
  font-size: 13px;
  color: var(--ink);
  transition: 0.15s;
}

.field textarea {
  min-height: 70px;
  line-height: 1.55;
  resize: vertical;
}

.input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #a5b4fc;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.field-hint {
  font-size: 11px;
  color: #a0a9bb;
}

.confirm-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #475569;
}

.status-options {
  display: grid;
  gap: 8px;
}

.status-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid #e6eaf2;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.15s;
}

.status-option:hover {
  border-color: #c7d2fe;
  background: #fafbff;
}

.status-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-option:has(input:checked) {
  border-color: #a5b4fc;
  background: #f5f7ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.so-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--tag);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag) 16%, #fff);
}

.status-option div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.status-option strong {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.status-option small {
  font-size: 11px;
  color: #98a2b6;
}

/* =============================================================
   Login
   ============================================================= */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(800px 520px at 8% -12%, rgba(99, 102, 241, 0.5), transparent 60%),
    radial-gradient(700px 500px at 108% 112%, rgba(14, 165, 233, 0.3), transparent 62%),
    linear-gradient(135deg, #070d18, #0b1424 52%, #0a1222);
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black, transparent 76%);
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 76%);
  pointer-events: none;
}

.login-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: min(940px, 100%);
  min-height: 566px;
  overflow: hidden;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 50px 120px -35px rgba(0, 0, 0, 0.75);
  animation: popIn 0.35s ease;
}

.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 42px 40px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(420px 320px at 10% 0%, rgba(99, 102, 241, 0.5), transparent 62%),
    radial-gradient(360px 300px at 110% 100%, rgba(14, 165, 233, 0.24), transparent 60%),
    linear-gradient(165deg, #111c33, #0b1222 62%, #0a1120);
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.03), 0 0 0 120px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand .brand-mark {
  width: 42px;
  height: 42px;
}

.login-brand strong {
  display: block;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.login-brand span {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #8f9dbd;
}

.login-pitch {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.login-pitch h1 {
  margin: 0 0 14px;
  font-size: 34px;
  font-weight: 750;
  line-height: 1.28;
  letter-spacing: -0.03em;
}

.login-pitch h1 em {
  font-style: normal;
  color: #a5b4fc;
}

.login-pitch p {
  max-width: 32ch;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: #a7b3cd;
}

.login-features {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #c3cde2;
}

.login-features .dot {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #c7d2fe;
  background: rgba(129, 140, 248, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.24);
}

.login-features .dot svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-panel-foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #6f7e9f;
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 44px;
}

.login-heading h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.login-heading p {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 15px;
  margin-top: 28px;
}

.login-form .field label {
  font-size: 12.5px;
}

.login-form .input {
  padding: 11px 13px;
  font-size: 14px;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.login-error {
  min-height: 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #dc2626;
}

.login-demo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding: 11px 13px;
  border: 1px solid #e6e9fb;
  border-radius: 11px;
  background: #f5f7ff;
  font-size: 11.5px;
  color: #8a94ab;
}

.login-demo button {
  padding: 2px 0;
  border: none;
  background: transparent;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.login-demo button:hover {
  color: #3730a3;
  text-decoration: underline;
}

@media (max-width: 860px) {
  .login-card {
    grid-template-columns: 1fr;
    width: min(520px, 100%);
    min-height: 0;
  }

  .login-brand-panel {
    gap: 16px;
    padding: 26px 28px 22px;
  }

  .login-pitch {
    margin-top: 6px;
  }

  .login-pitch h1 {
    margin-bottom: 8px;
    font-size: 24px;
  }

  .login-pitch p {
    font-size: 12.5px;
  }

  .login-features,
  .login-panel-foot {
    display: none;
  }

  .login-form-panel {
    padding: 30px 28px 34px;
  }
}

@media (max-width: 480px) {
  .login-screen {
    padding: 14px;
  }

  .login-card {
    border-radius: 20px;
  }

  .login-form-panel {
    padding: 26px 22px 30px;
  }
}

/* =============================================================
   Toast / empty / skeleton
   ============================================================= */

.toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 380px;
  padding: 10px 12px 10px 13px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #0f172a;
  color: #f1f5f9;
  font-size: 12.5px;
  box-shadow: 0 16px 40px -16px rgba(15, 23, 42, 0.6);
  animation: toastIn 0.22s ease;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

.toast.out {
  opacity: 0;
  transform: translateY(6px);
}

.toast-ico {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: none;
  color: #34d399;
}

.toast-ico svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast-msg {
  flex: 1;
  line-height: 1.5;
}

.toast.error .toast-ico,
.toast.warn .toast-ico {
  color: #f87171;
}

.toast.warn .toast-ico {
  color: #fbbf24;
}

.toast.info .toast-ico {
  color: #93c5fd;
}

.toast.loading .toast-ico {
  color: #a5b4fc;
}

.toast-ico .spin {
  animation: spin 0.8s linear infinite;
  transform-origin: 12px 12px;
}

.toast-act {
  flex: none;
  padding: 4px 10px;
  border: 1px solid rgba(165, 180, 252, 0.5);
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  transition: 0.15s;
}

.toast-act:hover {
  background: rgba(99, 102, 241, 0.34);
  color: #fff;
}

.toast-x {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: 0.15s;
}

.toast:hover .toast-x,
.toast-x:focus-visible {
  opacity: 1;
}

.toast-x:hover {
  background: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-ico {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 16px;
  background: #f1f4fa;
  color: #94a3b8;
}

.empty-ico svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state h4 {
  margin: 0 0 5px;
  font-size: 14px;
  color: #475569;
}

.empty-state p {
  margin: 0 0 16px;
  font-size: 12px;
  color: #98a2b6;
}

.muted-empty {
  padding: 18px 8px;
  font-size: 12px;
  color: #98a2b6;
  text-align: center;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #eef1f8;
}

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

.skeleton-hero {
  height: 146px;
  margin-bottom: 16px;
  border-radius: 18px;
}

.skeleton-row {
  height: 82px;
  margin-bottom: 12px;
  border-radius: 16px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.skeleton-kpi {
  height: 118px;
  border-radius: 18px;
}

/* =============================================================
   Animations
   ============================================================= */

@keyframes rise {
  from {
    transform: translateY(8px);
  }
  to {
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* =============================================================
   Responsive
   ============================================================= */

@media (max-width: 1380px) {
  .dash-grid {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .panel-attention {
    grid-column: 1 / -1;
  }

  .attention-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 16px;
  }
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-bottom {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    max-height: 420px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 78px;
    padding: 24px 12px;
    gap: 20px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand-text,
  .nav-item span,
  .sidebar-tip,
  .user-info {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
  }

  .nav-item.active::after {
    display: none;
  }

  .user-card {
    flex-direction: column;
    gap: 7px;
    justify-content: center;
    padding: 8px;
  }

  .user-logout {
    margin-left: 0;
  }

  .sidebar-foot {
    margin-top: auto;
  }

  .main {
    margin-left: 78px;
  }

  .topbar {
    padding: 17px 24px;
  }

  .view {
    padding: 24px 24px 48px;
  }
}

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

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

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

  .project-grid {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  }

  .kanban {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .kanban-col {
    flex: 0 0 272px;
    scroll-snap-align: start;
  }
}

@media (max-width: 720px) {
  .sidebar {
    width: 68px;
    padding: 20px 9px;
  }

  .main {
    margin-left: 68px;
  }

  .topbar {
    padding: 15px 16px;
  }

  .topbar-title p {
    display: none;
  }

  .topbar-title h1 {
    font-size: 18px;
    max-width: 48vw;
  }

  .today-chip {
    display: none;
  }

  .view {
    padding: 20px 16px 44px;
  }

  .detail-head {
    align-items: flex-start;
  }

  .dh-title h2 {
    font-size: 20px;
  }

  .detail-hero {
    padding: 18px;
  }

  .hero-right {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .cust-stats {
    grid-template-columns: 1fr;
  }

  .filter-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-tools .search-box {
    flex: 1 1 100%;
    order: -1;
  }

  .filter-tools .search-box input {
    width: 100%;
  }

  .filter-tools .select {
    flex: 1 1 130px;
  }

  .filter-tools .btn {
    flex: 0 0 auto;
  }

  .modal-backdrop {
    padding: 14px;
  }

  .modal {
    max-height: 94vh;
  }

  .kpi-grid {
    gap: 12px;
  }

  .kpi {
    padding: 16px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .mini-row {
    grid-template-columns: minmax(0, 1fr) 84px;
    row-gap: 6px;
  }

  .mini-row > .mini-bar-col,
  .mini-row > .mini-deadline {
    display: none;
  }
}

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

  .project-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions .btn {
    padding: 9px 11px;
  }

  .dh-actions {
    width: 100%;
  }

  .dh-actions .btn {
    flex: 1;
  }
}

/* =============================================================
   交互反馈层：全局进度 / 焦点 / 乐观更新 / 快捷键
   ============================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#global-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  height: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

#global-progress.on {
  opacity: 1;
}

#global-progress > i {
  display: block;
  width: 36%;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  animation: slideBar 1.15s ease-in-out infinite;
}

#global-progress.done > i {
  animation: none;
  width: 100%;
  transform: none;
}

#global-progress > span {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  font-size: 11.5px;
  white-space: nowrap;
}

@keyframes slideBar {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(300%); }
}

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

/* ---- 按钮的忙/禁用态 ---- */

.is-busy {
  opacity: 0.58;
  pointer-events: none;
}

.btn.is-loading {
  cursor: progress;
}

.btn.is-loading::before {
  content: "";
  width: 11px;
  height: 11px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn-ghost.is-loading::before,
.btn:not(.btn-primary):not(.btn-danger).is-loading::before {
  border-color: rgba(79, 70, 229, 0.28);
  border-top-color: #4f46e5;
}

/* ---- 弹窗：底部提示、脏值守卫、校验反馈 ---- */

.modal-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.foot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.foot-actions > div {
  display: flex;
  gap: 10px;
}

.foot-hint {
  font-size: 11px;
  color: #a8b1c2;
}

.discard-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid #fed7aa;
  border-radius: 11px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
}

.discard-bar > div {
  display: flex;
  gap: 8px;
  flex: none;
}

.discard-bar[hidden] {
  display: none;
}

.form-error {
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid #fecaca;
  border-radius: 11px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.5;
}

.field.is-invalid .input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: #f87171;
  background: #fff8f8;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.11);
}

.field.is-invalid label {
  color: #b91c1c;
}

.field-err {
  font-size: 11px;
  color: #dc2626;
}

.modal.shake {
  animation: modalShake 0.3s ease;
}

@keyframes modalShake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-6px); }
  55% { transform: translateX(5px); }
  78% { transform: translateX(-2px); }
}

/* ---- 看板：拖放目标提示 + 乐观更新 ---- */

.kanban-card {
  position: relative;
}

.kanban-card:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  box-shadow: 0 10px 22px -14px rgba(15, 23, 42, 0.3);
}

.kc-sync {
  position: absolute;
  inset: 0;
  display: none;
  border-radius: 13px;
  background: rgba(238, 242, 255, 0.72);
}

.kanban-card.syncing {
  cursor: progress;
  border-color: #c7d2fe;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.16);
}

.kanban-card.syncing .kc-sync {
  display: block;
  animation: syncPulse 1s ease-in-out infinite;
}

.kanban-card.syncing::after {
  content: "保存中";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 3px 9px;
  border-radius: 999px;
  background: #4f46e5;
  color: #fff;
  font-size: 10.5px;
  font-weight: 650;
}

.kanban-card.sync-failed {
  border-color: #fca5a5;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.14);
}

@keyframes syncPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

.kc-drop {
  display: none;
  padding: 10px;
  border: 1px dashed #a5b4fc;
  border-radius: 11px;
  background: rgba(99, 102, 241, 0.07);
  color: #4f46e5;
  font-size: 11.5px;
  text-align: center;
}

.kanban-col.over .kc-drop {
  display: block;
}

.kanban-col.over .kc-empty {
  display: none;
}

/* ---- 阶段进度条保存态 ---- */

.ms-range:disabled {
  cursor: progress;
}

.ms-row.saving {
  background: #f6f8ff;
}

.ms-row {
  position: relative;
}

.ms-state {
  flex: none;
  width: 56px;
  border-radius: 999px;
  font-size: 10.5px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.ms-row.saving .ms-state,
.ms-row.saved .ms-state,
.ms-row.save-failed .ms-state {
  padding: 2.5px 0;
  animation: stateIn 0.22s ease;
}

@keyframes stateIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.ms-row.saving .ms-state {
  color: #4f46e5;
  background: #eef2ff;
}

.ms-row.saving .ms-state::before {
  content: "保存中";
}

.ms-row.saved .ms-state {
  color: #047857;
  background: #dcfce7;
}

.ms-row.saved .ms-state::before {
  content: "已保存";
}

.ms-row.save-failed .ms-state {
  color: #b91c1c;
  background: #fee2e2;
}

.ms-row.save-failed .ms-state::before {
  content: "未保存";
}

.ms-row.saved {
  animation: msFlash 1s ease;
}

@keyframes msFlash {
  0% { background: #dcfce7; }
  100% { background: transparent; }
}

/* ---- 快捷键入口与说明 ---- */

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 2px 6px;
  border: 1px solid #dfe5ef;
  border-bottom-width: 2px;
  border-radius: 7px;
  background: #f8fafc;
  color: #475569;
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
}

.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid #e6eaf2;
  border-radius: 999px;
  background: #fff;
  color: #7b8598;
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.15s;
}

.kbd-hint:hover {
  border-color: #c7d2fe;
  background: #f7f8ff;
  color: #4f46e5;
}

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  color: #475569;
}

.shortcut-row:nth-child(odd) {
  background: #f8fafc;
}

.shortcut-row kbd {
  flex: none;
  min-width: 66px;
}

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

.login-card.shake {
  animation: modalShake 0.3s ease;
}

@media (max-width: 860px) {
  .kbd-hint {
    display: none;
  }
}

@media (max-width: 720px) {
  .foot-hint {
    display: none;
  }

  .foot-actions {
    justify-content: flex-end;
  }

  .discard-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .toast {
    max-width: calc(100vw - 32px);
  }

  .toast-root {
    right: 16px;
    bottom: 16px;
    left: 16px;
    align-items: stretch;
  }

  #global-progress > span {
    font-size: 11px;
  }
}
