/* ============================================
   工程项目过程数据管理平台
   Architectural Luxury Theme
   ============================================ */

:root {
  /* Base palette - deep charcoal/slate */
  --bg-primary: #0b0f14;
  --bg-secondary: #111820;
  --bg-card: #171e28;
  --bg-card-hover: #1c2432;
  --bg-elevated: #1f2838;

  /* Surface overlays */
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.05);

  /* Text hierarchy */
  --text-primary: #e8ecf1;
  --text-secondary: #8b95a5;
  --text-muted: #5a6478;
  --text-inverse: #0b0f14;

  /* Accent - warm copper/bronze */
  --copper: #c8956c;
  --copper-light: #e8b88a;
  --copper-dark: #a67c52;
  --copper-glow: rgba(200, 149, 108, 0.15);

  /* Status colors */
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.12);

  /* Borders and lines */
  --border: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.03);
  --border-active: rgba(200, 149, 108, 0.3);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(200, 149, 108, 0.1);

  /* Radii */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  /* Typography */
  --font-heading: 'Noto Serif SC', 'Songti SC', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(200, 149, 108, 0.04), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(96, 165, 250, 0.03), transparent 40%),
    var(--bg-primary);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color var(--duration-fast) var(--ease-out);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-glow);
}

::selection {
  background: var(--copper);
  color: var(--bg-primary);
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ============================================
   Animations & Keyframes
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--copper-glow); }
  50% { box-shadow: 0 0 15px var(--copper-glow); }
}

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

.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
  animation: fadeIn var(--duration-slow) var(--ease-out);
}

.app-shell.dashboard-active {
  grid-template-columns: 1fr;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  animation: slideInRight var(--duration-slow) var(--ease-out);
}

/* Brand Block */
.brand-block {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  transition: all var(--duration-normal) var(--ease-out);
}

.brand-block:hover {
  background: var(--glass-hover);
  border-color: var(--border-active);
}

.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--copper-dark), var(--copper));
  box-shadow: var(--shadow-glow);
}

.brand-mark span {
  position: absolute;
  display: block;
  background: var(--bg-primary);
}

.brand-mark span:nth-child(1) {
  width: 18px;
  height: 6px;
  left: 7px;
  top: 11px;
  border-radius: 1px;
}

.brand-mark span:nth-child(2) {
  width: 6px;
  height: 18px;
  left: 7px;
  top: 11px;
  border-radius: 1px;
}

.brand-mark span:nth-child(3) {
  width: 16px;
  height: 6px;
  right: 7px;
  bottom: 9px;
  background: var(--bg-primary);
  border-radius: 1px;
}

.brand-block h1 {
  margin-top: 2px;
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-primary);
}

/* Eyebrow label */
.eyebrow {
  margin: 0 0 3px;
  font-size: 10px;
  color: var(--copper);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.brand-block .eyebrow {
  color: var(--copper-light);
}

/* Side sections */
.side-section {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  transition: all var(--duration-normal) var(--ease-out);
}

.side-section:hover {
  background: var(--glass-hover);
}

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

.section-head.compact {
  align-items: center;
  margin-bottom: 10px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-primary);
}

.text-action {
  padding: 0;
  color: var(--copper);
  font-size: 12px;
  font-weight: 500;
  transition: color var(--duration-fast) var(--ease-out);
}

.text-action:hover {
  color: var(--copper-light);
}

/* Filter grid */
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.filter-button {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: left;
  padding: 6px 10px;
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-button:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.filter-button.active {
  color: var(--bg-primary);
  background: var(--copper);
  border-color: var(--copper);
}

/* Project panel */
.project-panel {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  padding: 12px;
  text-align: left;
  transition: all var(--duration-normal) var(--ease-out);
  animation: fadeInUp var(--duration-slow) var(--ease-out) backwards;
}

.project-card:nth-child(1) { animation-delay: 50ms; }
.project-card:nth-child(2) { animation-delay: 100ms; }
.project-card:nth-child(3) { animation-delay: 150ms; }
.project-card:nth-child(4) { animation-delay: 200ms; }
.project-card:nth-child(5) { animation-delay: 250ms; }
.project-card:nth-child(6) { animation-delay: 300ms; }

.project-card:hover {
  background: var(--glass-hover);
  border-color: var(--border-active);
  transform: translateX(2px);
}

.project-card.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--copper);
  box-shadow: var(--shadow-glow);
}

.project-card.hidden {
  display: none;
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.project-card h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

.project-card p {
  margin: 4px 0 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.project-card.active p {
  color: var(--text-secondary);
}

.mini-status {
  flex: none;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--bg-primary);
  background: var(--green);
  font-weight: 600;
}

.mini-status.warning {
  background: var(--amber);
}

.mini-progress {
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--border);
}

.mini-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--copper-dark), var(--copper));
  border-radius: 2px;
  transition: width var(--duration-slow) var(--ease-out);
}

.project-card.warning .mini-progress span {
  background: linear-gradient(90deg, var(--amber), #fcd34d);
}

.project-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.project-card.active .project-foot {
  color: var(--text-secondary);
}

/* Source card */
.source-card {
  padding: 12px;
}

.source-title {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
}

.source-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
}

.source-row strong {
  color: var(--copper);
  font-weight: 500;
}

.muted {
  color: var(--text-muted);
  font-size: 12px;
}

/* ============================================
   Workspace
   ============================================ */

.workspace {
  height: 100vh;
  overflow: auto;
  padding: 24px 28px 40px;
  background: var(--bg-primary);
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  animation: fadeInUp var(--duration-slow) var(--ease-out);
}

.topbar-left {
  flex: 1;
}

.chart-legend {
  display: flex;
  gap: 12px;
}

.chart-panel {
  /* Inherits from .panel */
}

.matrix-panel {
  /* Inherits from .panel */
}

.topbar h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* Role switch */
.role-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.role-button,
.tab-button,
.outline-button,
.primary-button,
.icon-button {
  border-radius: var(--radius-sm);
  min-height: 34px;
}

.role-button {
  padding: 0 14px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
}

.role-button:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.role-button.active {
  background: var(--copper);
  color: var(--bg-primary);
  font-weight: 600;
}

/* Date pill */
.date-pill {
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 11px;
  color: var(--text-muted);
}

.date-pill strong {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
}

/* ============================================
   Summary Strip
   ============================================ */

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  animation: fadeInUp var(--duration-slow) var(--ease-out) 100ms backwards;
}

.summary-card,
.metric-card,
.panel,
.hero-main,
.risk-card,
.workbench {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
}

.summary-card:hover,
.metric-card:hover,
.panel:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.summary-card {
  padding: 16px;
  min-height: 110px;
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--copper), transparent);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.summary-card:hover::before {
  opacity: 1;
}

.summary-card span,
.metric-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.summary-card strong {
  display: block;
  margin: 8px 0 4px;
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 1;
  color: var(--text-primary);
  font-weight: 600;
}

.summary-card small,
.metric-card small {
  color: var(--text-muted);
  line-height: 1.45;
  font-size: 11px;
}

/* ============================================
   Project Hero
   ============================================ */

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  margin-bottom: 16px;
  animation: fadeInUp var(--duration-slow) var(--ease-out) 200ms backwards;
}

.hero-main {
  padding: 20px;
}

.hero-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-main h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  line-height: 1.15;
  font-weight: 600;
  color: var(--text-primary);
}

.hero-subtitle {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.status-badge {
  flex: none;
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.status-badge.warning {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.2);
}

/* Metric grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 120px;
  padding: 16px;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--copper-glow), transparent);
}

.metric-card strong {
  display: block;
  margin: 8px 0 10px;
  font-family: var(--font-heading);
  font-size: 26px;
  line-height: 1;
  color: var(--text-primary);
  font-weight: 600;
}

/* Progress track */
.progress-track {
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--border);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--copper-dark), var(--copper), var(--copper-light));
  border-radius: 3px;
  transition: width 800ms var(--ease-out);
  position: relative;
}

.progress-track span::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

/* Risk card */
.risk-card {
  padding: 16px;
}

.icon-button {
  width: 32px;
  min-height: 32px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(248, 113, 113, 0.2);
  font-weight: 700;
  font-size: 14px;
  transition: all var(--duration-fast) var(--ease-out);
}

.icon-button:hover {
  background: rgba(248, 113, 113, 0.2);
  transform: scale(1.05);
}

.risk-list {
  display: grid;
  gap: 8px;
}

.risk-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  transition: all var(--duration-fast) var(--ease-out);
}

.risk-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.risk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.3);
}

.risk-dot.warning {
  background: var(--amber);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.3);
}

.risk-dot.danger {
  background: var(--red);
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.3);
  animation: pulse 2s infinite;
}

.risk-item strong {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.risk-item span:last-child {
  color: var(--text-secondary);
  font-size: 11px;
}

/* ============================================
   Insight Grid
   ============================================ */

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 14px;
  margin-bottom: 16px;
  animation: fadeInUp var(--duration-slow) var(--ease-out) 300ms backwards;
}

.panel {
  padding: 18px;
}

.chart {
  height: 220px;
  position: relative;
}

.chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-body);
}

/* Source matrix */
.source-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.source-matrix div {
  min-height: 80px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  transition: all var(--duration-fast) var(--ease-out);
}

.source-matrix div:hover {
  border-color: var(--border-active);
  transform: translateY(-1px);
}

.source-matrix span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.source-matrix strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
}

/* Buttons */
.outline-button,
.primary-button {
  padding: 0 16px;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--duration-fast) var(--ease-out);
}

.outline-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.outline-button:hover {
  background: var(--glass-hover);
  border-color: var(--border-active);
  color: var(--text-primary);
}

.primary-button {
  background: var(--copper);
  color: var(--bg-primary);
  border: 1px solid var(--copper);
}

.primary-button:hover {
  background: var(--copper-light);
  border-color: var(--copper-light);
  box-shadow: var(--shadow-glow);
}

/* ============================================
   Workbench
   ============================================ */

.workbench {
  overflow: hidden;
  margin-bottom: 24px;
  animation: fadeInUp var(--duration-slow) var(--ease-out) 400ms backwards;
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.tab-button {
  flex: 1;
  min-height: 44px;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  font-weight: 500;
  font-size: 13px;
  transition: all var(--duration-fast) var(--ease-out);
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.tab-button.active {
  background: var(--bg-card);
  color: var(--copper);
  box-shadow: inset 0 -2px 0 var(--copper);
}

.tab-content {
  padding: 20px;
}

/* Content grid */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.form-card,
.table-card,
.note-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.form-card,
.note-card {
  padding: 18px;
}

.form-card h3,
.table-card h3,
.note-card h3 {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Field grid */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  transition: all var(--duration-fast) var(--ease-out);
}

.field input:hover,
.field textarea:hover {
  border-color: var(--border-active);
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

/* Fake upload */
.fake-upload {
  display: grid;
  gap: 8px;
  min-height: 160px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg-elevated);
  align-content: center;
  text-align: center;
  color: var(--text-muted);
  transition: all var(--duration-normal) var(--ease-out);
}

.fake-upload:hover {
  border-color: var(--copper);
  background: var(--copper-glow);
}

.fake-upload strong {
  color: var(--text-secondary);
  font-size: 14px;
}

.fake-upload span {
  font-size: 12px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.photo-tile {
  height: 68px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, var(--copper-glow), var(--blue-soft)),
    var(--bg-elevated);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 11px;
  transition: all var(--duration-fast) var(--ease-out);
}

.photo-tile:hover {
  border-color: var(--border-active);
  transform: scale(1.02);
}

/* Table card */
.table-card {
  overflow-x: auto;
  overflow-y: hidden;
}

.table-card h3 {
  padding: 18px 18px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  color: var(--text-secondary);
}

.data-table td.numeric,
.data-table th.numeric {
  text-align: right;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--blue-soft);
  color: var(--blue);
}

.tag.green {
  background: var(--green-soft);
  color: var(--green);
}

.tag.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.red {
  background: var(--red-soft);
  color: var(--red);
}

/* Timeline */
.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  transition: all var(--duration-fast) var(--ease-out);
}

.timeline-item:hover {
  border-color: var(--border-active);
}

.timeline-item time {
  color: var(--copper);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}

.timeline-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

/* Doc tree */
.doc-tree {
  display: grid;
  gap: 10px;
}

.doc-node {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--bg-elevated);
  transition: all var(--duration-fast) var(--ease-out);
}

.doc-node:hover {
  border-color: var(--border-active);
}

.doc-node header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.doc-node strong {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}

.doc-node p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

/* Letter preview */
.letter-preview {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(200, 149, 108, 0.3);
  border-radius: var(--radius);
  background: var(--copper-glow);
  color: var(--copper-light);
  display: none;
  animation: scaleIn var(--duration-normal) var(--ease-out);
}

.letter-preview.visible {
  display: block;
}

.letter-preview h4 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--copper);
}

.letter-preview p {
  margin: 0;
  line-height: 1.7;
  font-size: 13px;
}

/* Empty state */
.empty-state {
  padding: 32px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--bg-elevated);
  text-align: center;
  font-size: 13px;
}

/* Toast */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 340px;
  padding: 14px 18px;
  border-radius: var(--radius);
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-out);
  z-index: 100;
  font-size: 13px;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Page Navigation
   ============================================ */

.page-nav {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.nav-button {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.nav-button:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.nav-button.active {
  background: var(--copper);
  color: var(--bg-primary);
  font-weight: 600;
}

/* Page content visibility */
.page-content {
  display: none;
}

.page-content.active {
  display: block;
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

/* ============================================
   Executive Dashboard - KPI Cards
   ============================================ */

.dashboard-kpi {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
  animation: fadeInUp var(--duration-slow) var(--ease-out) 100ms backwards;
}

.kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

.kpi-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--copper-glow);
  color: var(--copper);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 22px;
  height: 22px;
}

.kpi-icon.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.kpi-content {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
}

.kpi-trend.up {
  color: var(--green);
  background: var(--green-soft);
}

.kpi-trend.down {
  color: var(--red);
  background: var(--red-soft);
}

.kpi-trend.neutral {
  color: var(--text-muted);
  background: var(--glass);
}

.kpi-trend svg {
  width: 10px;
  height: 10px;
}

/* ============================================
   Executive Dashboard - Charts
   ============================================ */

.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 14px;
  margin-bottom: 20px;
  animation: fadeInUp var(--duration-slow) var(--ease-out) 200ms backwards;
}

.chart-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 20px;
  transition: all var(--duration-normal) var(--ease-out);
}

.chart-card:hover {
  border-color: var(--border-active);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-body {
  position: relative;
}

/* Donut chart */
.donut-chart {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  position: relative;
}

.donut-chart svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-chart circle {
  fill: none;
  stroke-width: 24;
  transition: stroke-dasharray 1s var(--ease-out);
}

.donut-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.donut-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.donut-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Bar chart */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-item {
  display: grid;
  grid-template-columns: 80px 1fr 60px;
  align-items: center;
  gap: 12px;
}

.bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
}

.bar-track {
  height: 24px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--copper-dark), var(--copper));
  transition: width 1s var(--ease-out);
  position: relative;
}

.bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shimmer 2s infinite;
}

.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Line chart */
.line-chart {
  height: 280px;
  position: relative;
}

.line-chart svg {
  width: 100%;
  height: 100%;
}

.trend-legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 3px;
  border-radius: 1px;
}

.legend-dot.contract {
  background: var(--copper);
}

.legend-dot.output {
  background: var(--green);
}

.legend-dot.cost {
  background: var(--blue);
}

/* ============================================
   Executive Dashboard - Trend Section
   ============================================ */

.dashboard-trend {
  margin-bottom: 20px;
  animation: fadeInUp var(--duration-slow) var(--ease-out) 300ms backwards;
}

/* ============================================
   Executive Dashboard - Bottom Section
   ============================================ */

.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
  animation: fadeInUp var(--duration-slow) var(--ease-out) 400ms backwards;
}

/* Risk alert list */
.risk-alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.risk-alert-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
}

.risk-alert-item:hover {
  border-color: var(--border-active);
  transform: translateX(2px);
}

.risk-alert-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.risk-alert-icon.safety {
  background: var(--red-soft);
  color: var(--red);
}

.risk-alert-icon.quality {
  background: var(--amber-soft);
  color: var(--amber);
}

.risk-alert-icon.progress {
  background: var(--blue-soft);
  color: var(--blue);
}

.risk-alert-icon.cost {
  background: var(--copper-glow);
  color: var(--copper);
}

.risk-alert-info h4 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.risk-alert-info p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.risk-alert-count {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Ranking tabs */
.ranking-tabs {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.ranking-tab {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border-radius: 4px;
  transition: all var(--duration-fast) var(--ease-out);
}

.ranking-tab:hover {
  color: var(--text-primary);
}

.ranking-tab.active {
  background: var(--copper);
  color: var(--bg-primary);
}

/* Ranking list */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
}

.ranking-item:hover {
  border-color: var(--border-active);
}

.ranking-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--glass);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.ranking-item:nth-child(1) .ranking-number {
  background: var(--copper);
  color: var(--bg-primary);
}

.ranking-item:nth-child(2) .ranking-number {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

.ranking-item:nth-child(3) .ranking-number {
  background: var(--copper-dark);
  color: var(--bg-primary);
}

.ranking-info h4 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ranking-info p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.ranking-value {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================
   Executive Dashboard - Project Grid
   ============================================ */

.dashboard-projects {
  animation: fadeInUp var(--duration-slow) var(--ease-out) 500ms backwards;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.project-grid-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

.project-grid-card:hover {
  border-color: var(--copper);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.project-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.project-grid-header h4 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.project-grid-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.project-grid-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.project-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-stat span {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-stat strong {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.project-grid-progress {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.project-progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.project-progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.project-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--copper-dark), var(--copper));
  transition: width 1s var(--ease-out);
}
