.civil-command-header,
.civil-command-nav,
.civil-project-card,
.civil-today-card,
.civil-command-workcell {
  --civil-ink: #102a43;
  --civil-blue: #1769e0;
  --civil-cyan: #11a8c5;
  --civil-line: #c8d6e6;
  --civil-paper: #ffffff;
  --civil-muted: #64778c;
  font-family: "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif;
}

.civil-command-header {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 86px;
  margin-bottom: 10px;
  padding: 16px 18px;
  overflow: hidden;
  border: 1px solid #9fb6ce;
  border-left: 5px solid var(--civil-blue);
  background:
    linear-gradient(90deg, rgba(23, 105, 224, .08) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(rgba(23, 105, 224, .06) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(120deg, #fff 0%, #f8fbff 64%, #edf5ff 100%);
  box-shadow: 0 8px 24px rgba(31, 69, 110, .08);
}

.civil-command-header::after {
  content: "CIVIL";
  position: absolute;
  right: 22px;
  bottom: -18px;
  color: rgba(18, 75, 136, .045);
  font: 900 76px/1 Bahnschrift, "Arial Narrow", sans-serif;
  letter-spacing: .14em;
  pointer-events: none;
}

.civil-command-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff;
  background: linear-gradient(145deg, #0e4e9b, #1e7be8);
  clip-path: polygon(14% 0, 86% 0, 100% 14%, 100% 86%, 86% 100%, 14% 100%, 0 86%, 0 14%);
  box-shadow: 0 8px 18px rgba(23, 105, 224, .24);
}

.civil-command-mark .civil-icon {
  width: 31px;
  height: 31px;
}

.civil-command-copy {
  min-width: 0;
}

.civil-command-kicker,
.civil-section-heading span,
.civil-file-feature-head span {
  color: #3976b9;
  font: 800 10px/1.2 Bahnschrift, "Microsoft YaHei UI", sans-serif;
  letter-spacing: .15em;
}

.civil-command-copy h1 {
  margin: 3px 0 2px;
  color: var(--civil-ink);
  font: 800 27px/1.15 Bahnschrift, "Microsoft YaHei UI", sans-serif;
  letter-spacing: .02em;
}

.civil-command-copy p {
  max-width: 920px;
  margin: 0;
  color: var(--civil-muted);
  font-size: 13px;
  line-height: 1.55;
}

.civil-command-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.civil-module.civil-cockpit {
  background:
    radial-gradient(circle at 88% 6%, rgba(35, 126, 226, .09), transparent 23%),
    #edf3f8;
}

.civil-command-nav {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #adc1d6;
  background: #fff;
}

.civil-command-tabrail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 1px 6px;
  scrollbar-color: #9db8d5 transparent;
  scrollbar-width: thin;
}

.civil-command-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #bfd0e1;
  border-radius: 6px;
  color: #29445f;
  background: linear-gradient(180deg, #fff, #f3f7fb);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.civil-command-tab:hover {
  transform: translateY(-1px);
  border-color: #69a1dc;
  background: #edf6ff;
}

.civil-command-tab.primary {
  border-color: #1769e0;
  color: #fff;
  background: linear-gradient(135deg, #115bbb, #267ef0);
  box-shadow: 0 6px 14px rgba(23, 105, 224, .22);
}

.civil-command-tab:focus-visible {
  outline: 3px solid rgba(17, 168, 197, .28);
  outline-offset: 2px;
}

.civil-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.civil-command-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.civil-command-tools .desktop-search-input {
  flex: 1 1 260px;
  max-width: none;
  min-height: 36px;
}

.civil-command-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 9px;
}

.civil-metric {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 76px;
  padding: 11px 12px;
  border: 1px solid var(--civil-line);
  border-top: 3px solid var(--metric-accent, #3178c6);
  background: var(--civil-paper);
  box-shadow: 0 5px 15px rgba(38, 70, 104, .06);
  animation: civil-rise .34s both;
  animation-delay: calc(var(--civil-order) * 35ms);
}

.civil-metric-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--metric-accent, #3178c6);
  background: var(--metric-soft, #eef6ff);
  clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%, 0 10%);
}

.civil-metric span {
  display: block;
  color: #5e7185;
  font-size: 11px;
  font-weight: 800;
}

.civil-metric strong {
  display: block;
  margin-top: 3px;
  color: #102a43;
  font: 800 25px/1 Bahnschrift, "Microsoft YaHei UI", sans-serif;
}

.civil-metric-blue { --metric-accent: #1769e0; --metric-soft: #eaf3ff; }
.civil-metric-indigo { --metric-accent: #5945c6; --metric-soft: #f0eeff; }
.civil-metric-green { --metric-accent: #17825c; --metric-soft: #e9f8f1; }
.civil-metric-amber { --metric-accent: #be7600; --metric-soft: #fff4d8; }
.civil-metric-cyan { --metric-accent: #0783a0; --metric-soft: #e7f7fb; }
.civil-metric-red { --metric-accent: #c13f4b; --metric-soft: #fff0f1; }

.civil-command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr);
  gap: 10px;
}

.civil-project-card,
.civil-today-card,
.civil-command-workcell {
  min-width: 0;
  border: 1px solid var(--civil-line);
  background: #fff;
  box-shadow: 0 6px 18px rgba(38, 70, 104, .06);
}

.civil-project-card,
.civil-today-card {
  padding: 13px;
}

.civil-section-heading,
.civil-file-feature-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.civil-section-heading h2,
.civil-file-feature-head h3 {
  margin: 2px 0 0;
  color: #17324e;
  font: 800 16px/1.2 Bahnschrift, "Microsoft YaHei UI", sans-serif;
}

.civil-scope-chip,
.civil-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #b9cee2;
  color: #315878;
  background: #f4f9fe;
  font-size: 11px;
  font-weight: 800;
}

.civil-scope-chip .civil-icon {
  width: 15px;
  height: 15px;
}

.civil-live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #18a56b;
  box-shadow: 0 0 0 4px rgba(24, 165, 107, .12);
}

.civil-project-layout {
  display: grid;
  grid-template-columns: minmax(220px, 34%) minmax(240px, 1fr) 128px;
  gap: 14px;
  align-items: stretch;
}

.civil-project-blueprint,
.civil-project-photo {
  width: 100%;
  min-height: 170px;
  max-height: 190px;
  border: 1px solid #a9c0d7;
  background: #0c355c;
  object-fit: cover;
}

.civil-project-blueprint {
  display: grid;
  place-items: center;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 10px;
  color: #a8d8ff;
  background:
    linear-gradient(rgba(129, 190, 240, .1) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(90deg, rgba(129, 190, 240, .1) 1px, transparent 1px) 0 0 / 18px 18px,
    #0c355c;
}

.civil-project-blueprint svg {
  width: 100%;
  height: 128px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.civil-project-blueprint .civil-blueprint-accent {
  stroke: #48bfe3;
  stroke-dasharray: 5 5;
}

.civil-project-blueprint span {
  color: #d6ebff;
  font-size: 10px;
  letter-spacing: .08em;
}

.civil-project-facts h3 {
  margin: 4px 0;
  color: #102a43;
  font-size: 18px;
}

.civil-project-facts > p {
  margin: 0 0 10px;
  color: #61768a;
  font-size: 12px;
}

.civil-project-facts dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.civil-project-facts dl div {
  padding: 7px 8px;
  border-left: 2px solid #9abce0;
  background: #f5f8fc;
}

.civil-project-facts dt {
  color: #718398;
  font-size: 10px;
}

.civil-project-facts dd {
  margin: 2px 0 0;
  color: #263f58;
  font-size: 12px;
  font-weight: 800;
}

.civil-project-progress {
  display: grid;
  place-items: center;
}

.civil-progress-ring {
  display: grid;
  place-items: center;
  align-content: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 58%, transparent 60%),
    conic-gradient(#1c74dc calc(var(--civil-progress, 0) * 1%), #dfe9f3 0);
  box-shadow: inset 0 0 0 1px #d3dfeb;
}

.civil-progress-ring strong {
  color: #123b66;
  font: 800 22px/1 Bahnschrift, sans-serif;
}

.civil-progress-ring span {
  margin-top: 5px;
  color: #6d7e90;
  font-size: 10px;
}

.civil-today-list {
  display: grid;
  gap: 7px;
}

.civil-today-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 32px;
  padding: 6px 8px;
  border-bottom: 1px solid #e3ebf3;
}

.civil-today-row i {
  width: 7px;
  height: 21px;
  background: var(--today-accent, #718398);
}

.civil-today-row span {
  color: #38516a;
  font-size: 12px;
  font-weight: 800;
}

.civil-today-row strong {
  color: var(--today-accent, #38516a);
  font: 800 18px/1 Bahnschrift, sans-serif;
}

.civil-today-row small {
  grid-column: 2 / -1;
  color: #7a8999;
  font-size: 10px;
}

.civil-today-blue { --today-accent: #1769e0; }
.civil-today-amber { --today-accent: #b97300; }
.civil-today-red { --today-accent: #bf3c48; }
.civil-today-slate { --today-accent: #718398; }

.civil-command-workgrid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 10px;
  align-items: stretch;
}

.civil-command-workcell {
  display: grid;
  min-height: 320px;
}

.civil-command-workcell > .desktop-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100%;
  padding: 12px;
  border: 0;
  border-radius: 0;
}

.civil-command-workcell .civil-xaml-table-wrap {
  min-height: 250px;
}

.civil-workcell-files {
  display: block;
  padding: 12px;
}

.civil-workcell-files > .desktop-panel {
  min-height: 250px;
  padding: 10px 0 0;
}

.civil-file-feature-head > .civil-icon {
  width: 26px;
  height: 26px;
  color: #2a6bb0;
}

.civil-file-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.civil-file-tile {
  min-width: 0;
  border: 1px solid #d0deeb;
  background: #f8fbfe;
}

.civil-file-thumb {
  display: grid;
  place-items: center;
  height: 66px;
  overflow: hidden;
  color: #3379bd;
  background:
    linear-gradient(135deg, rgba(32, 111, 190, .08), transparent),
    #eef5fb;
}

.civil-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.civil-file-thumb .civil-icon {
  width: 30px;
  height: 30px;
}

.civil-file-tile > div:last-child {
  padding: 6px;
}

.civil-file-tile strong,
.civil-file-tile span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.civil-file-tile strong {
  color: #29435d;
  font-size: 10px;
}

.civil-file-tile span {
  margin-top: 3px;
  color: #74869a;
  font-size: 9px;
}

.civil-file-empty {
  display: grid;
  place-items: center;
  min-height: 82px;
  border: 1px dashed #b8cadd;
  color: #708297;
  background: #f8fbfe;
  font-size: 12px;
}

.civil-error-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid #e4a6aa;
  border-left: 4px solid #c13f4b;
  color: #7d2730;
  background: #fff3f3;
}

.civil-loading-banner {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #9ec2e7;
  border-left: 4px solid #1769e0;
  color: #24527e;
  background: #eef7ff;
  font-size: 12px;
  font-weight: 800;
}

.civil-loading-banner .civil-icon {
  animation: civil-pulse 1s ease-in-out infinite alternate;
}

.civil-error-banner .civil-icon {
  margin-top: 1px;
}

.civil-error-banner strong,
.civil-error-banner span {
  display: block;
}

.civil-error-banner span {
  margin-top: 3px;
  font-size: 11px;
}

@keyframes civil-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes civil-pulse {
  from { opacity: .45; transform: translateX(-2px); }
  to { opacity: 1; transform: translateX(2px); }
}

@media (max-width: 1440px) {
  .civil-command-metrics {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }

  .civil-project-layout {
    grid-template-columns: minmax(200px, 36%) minmax(220px, 1fr) 118px;
  }
}

@media (max-width: 1180px) {
  .civil-command-header {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .civil-command-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .civil-command-hero,
  .civil-command-workgrid {
    grid-template-columns: 1fr;
  }

  .civil-project-layout {
    grid-template-columns: minmax(210px, 34%) minmax(220px, 1fr) 118px;
  }
}

@media (max-width: 760px) {
  .civil-command-header {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 12px;
  }

  .civil-command-mark {
    width: 42px;
    height: 42px;
  }

  .civil-command-copy h1 {
    font-size: 22px;
  }

  .civil-command-copy p {
    font-size: 11px;
  }

  .civil-command-metrics {
    grid-template-columns: repeat(2, minmax(128px, 1fr));
  }

  .civil-project-layout {
    grid-template-columns: 1fr;
  }

  .civil-project-progress {
    justify-content: start;
  }

  .civil-file-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .civil-metric,
  .civil-command-tab,
  .civil-loading-banner .civil-icon {
    animation: none;
    transition: none;
  }
}
