@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap");

:root {
  color-scheme: light;
  --primary: #2c5ead;
  --accent: #1591dc;
  --info: #4bb8fa;
  --soft: #c4e2f5;
  --bg: #f8fafc;
  --surface: #ffffff;
  --card: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);

  /* ── Design Tokens ── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 40px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --card-padding: 20px;
  --content-max: 1440px;
  --content-pad: 40px;

  /* Health & Intelligence variables */
  --health-primary: #6366f1;
  --health-success: #10b981;
  --health-warning: #f59e0b;
  --health-danger: #ef4444;
  --health-info: #3b82f6;
  --phi-surface: rgba(15, 23, 42, 0.55);
  --phi-surface-2: rgba(30, 41, 59, 0.6);
  --phi-border: rgba(148, 163, 184, 0.16);
  --phi-text: #e2e8f0;
  --phi-text-dim: #94a3b8;
  --phi-text-strong: #f1f5f9;
  --phi-radius: 18px;
  --phi-radius-sm: 10px;
  --phi-shadow: 0 18px 48px -24px rgba(2, 6, 23, 0.7);
}

.dark {
  color-scheme: dark;
  --bg: #081225;
  --surface: #0f172a;
  --card: #172033;
  --surface-2: #102034;
  --border: rgba(255, 255, 255, 0.06);
  --text: #f1f5f9;
  --muted: #64748b;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

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

::-webkit-scrollbar-track {
  background: var(--surface-2);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.page {
  min-height: 100vh;
}

/* ── Auth Page: Redesigned Premium (Enterprise SaaS) ── */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ===== Left: Showcase Panel ===== */

.auth-showcase {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 48px;
  background: #0a0e1a;
}

.auth-showcase-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 60% at 20% 20%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 60%
    ),
    radial-gradient(
    ellipse 60% 50% at 80% 30%,
    rgba(52, 211, 153, 0.1) 0%,
    transparent 50%
  ),
    radial-gradient(
    ellipse 50% 60% at 40% 80%,
    rgba(139, 92, 246, 0.12) 0%,
    transparent 50%
  );
  pointer-events: none;
}

/* ── Floating Orbs ── */

.auth-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
}

.auth-orb-1 {
  width: 400px;
  height: 400px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4), transparent 70%);
  animation: auth-float 20s ease-in-out infinite;
}

.auth-orb-2 {
  width: 300px;
  height: 300px;
  bottom: -60px;
  right: -40px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.3), transparent 70%);
  animation: auth-float 25s ease-in-out infinite reverse;
}

.auth-orb-3 {
  width: 250px;
  height: 250px;
  top: 50%;
  left: 60%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3), transparent 70%);
  animation: auth-float 18s ease-in-out infinite 2s;
}

@keyframes auth-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(40px, -50px) scale(1.05);
  }

  50% {
    transform: translate(-30px, -20px) scale(0.95);
  }

  75% {
    transform: translate(20px, -40px) scale(1.02);
  }
}

/* ── Showcase Content ── */

.auth-showcase-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.auth-showcase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.brand-mark-lg {
  width: 48px !important;
  height: 48px !important;
  font-size: 24px !important;
}

/* ── Floating Stats Cards ── */

.auth-showcase-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-floating-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  animation: auth-card-float 4s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.auth-floating-card:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@keyframes auth-card-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.auth-stat-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.auth-stat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-stat-value {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.auth-stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.auth-stat-trend {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.auth-stat-trend.up {
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
}

/* ── Analytics Widget ── */

.auth-analytics {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  backdrop-filter: blur(12px);
}

.auth-analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.auth-analytics-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.auth-analytics-badge {
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  padding: 2px 8px;
  border-radius: 999px;
}

.auth-analytics-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 64px;
}

.auth-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.6),
    rgba(99, 102, 241, 0.2)
  );
  min-height: 6px;
  transition: height 0.6s ease;
  animation: auth-bar-grow 0.8s ease-out backwards;
}

.auth-bar:nth-child(1) {
  animation-delay: 0.1s;
}

.auth-bar:nth-child(2) {
  animation-delay: 0.2s;
}

.auth-bar:nth-child(3) {
  animation-delay: 0.3s;
}

.auth-bar:nth-child(4) {
  animation-delay: 0.4s;
}

.auth-bar:nth-child(5) {
  animation-delay: 0.5s;
}

.auth-bar:nth-child(6) {
  animation-delay: 0.6s;
}

.auth-bar:nth-child(7) {
  animation-delay: 0.7s;
}

@keyframes auth-bar-grow {
  from {
    height: 0;
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ── Activity Feed ── */

.auth-activity {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  backdrop-filter: blur(12px);
}

.auth-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-top: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.auth-activity-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.auth-activity-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

.auth-activity-text strong {
  color: #fff;
  font-weight: 600;
}

.auth-activity-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}

/* ── Testimonial ── */

.auth-testimonial-modern {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  backdrop-filter: blur(12px);
}

.auth-testimonial-avatars {
  display: flex;
  flex-shrink: 0;
}

.auth-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.auth-testimonial-text-modern {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  font-style: italic;
}

.auth-testimonial-author-modern {
  margin: 4px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

/* ===== Right: Auth Panel ===== */

.auth-panel {
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--bg);
  position: relative;
}

.auth-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(99, 102, 241, 0.3),
    transparent
  );
}

.auth-panel-inner {
  width: 100%;
  max-width: 440px;
  animation: auth-fade-in 0.6s ease-out;
}

@keyframes auth-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Glassmorphism Card ── */

.auth-glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px 32px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.02),
    0 12px 24px rgba(0, 0, 0, 0.06),
    0 24px 48px rgba(0, 0, 0, 0.04);
}

/* ── Auth Header ── */

.auth-header {
  margin-bottom: 28px;
}

.auth-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Form Body ── */

.auth-form-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-input::placeholder {
  color: color-mix(in srgb, var(--muted), transparent 30%);
}

.auth-password-wrap {
  position: relative;
}

.auth-password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-password-toggle:hover {
  background: color-mix(in srgb, var(--border), transparent 60%);
  color: var(--text);
}

/* ── Options Row ── */

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.auth-checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-checkbox-mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  background: var(--surface);
}

.auth-checkbox input:checked + .auth-checkbox-mark {
  background: #6366f1;
  border-color: #6366f1;
}

.auth-checkbox input:checked + .auth-checkbox-mark::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.auth-checkbox input:focus-visible + .auth-checkbox-mark {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.auth-checkbox-label {
  font-size: 13px;
  color: var(--muted);
}

.auth-forgot {
  font-size: 13px;
  font-weight: 600;
  color: #6366f1;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.auth-forgot:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ── Error ── */

.auth-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

/* ── Role notice (informational) ── */

.auth-role-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--info), transparent 90%);
  border: 1px solid color-mix(in srgb, var(--info), transparent 75%);
  border-radius: 10px;
  color: var(--info);
  font-size: 12px;
  line-height: 1.5;
}

.auth-role-notice strong {
  font-weight: 700;
  color: var(--info);
}

/* ── Submit Button ── */

.auth-submit {
  width: 100% !important;
  height: 46px !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  border: 0 !important;
  transition:
    opacity 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3) !important;
}

.auth-submit:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4) !important;
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.6;
}

.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 999px;
  animation: auth-spin 0.6s linear infinite;
  display: inline-block;
}

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

/* ── Divider ── */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Social Buttons ── */

.auth-social-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.auth-social-btn:hover {
  background: color-mix(in srgb, var(--surface), var(--border) 15%);
  border-color: color-mix(in srgb, var(--border), transparent 20%);
  transform: translateY(-1px);
}

.auth-social-btn:active {
  transform: translateY(0);
}

/* ── Demo Access ── */

.auth-demo {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.auth-demo summary {
  cursor: pointer;
}

.auth-demo-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  transition: color 0.15s ease;
}

.auth-demo-summary::-webkit-details-marker {
  display: none;
}

.auth-demo-summary:hover {
  color: var(--text);
}

.auth-demo[open] .auth-demo-summary {
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.auth-demo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 10px;
}

.auth-demo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2), transparent 20%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-demo-btn:hover:not(:disabled) {
  border-color: #6366f1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
}

/* ── Auth Footer ── */

.auth-footer {
  text-align: center;
  color: var(--muted);
  margin-top: 20px;
  font-size: 14px;
}

.auth-link {
  color: #6366f1 !important;
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline !important;
}

/* ── Error Pages (404, Offline) ── */
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.error-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 50% at 50% 20%,
      rgba(99, 102, 241, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
    ellipse 50% 40% at 80% 80%,
    rgba(52, 211, 153, 0.05) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.error-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  text-align: center;
  animation: error-fade-in 0.5s ease-out;
}

@keyframes error-fade-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.error-icon-wrap {
  margin-bottom: 16px;
}

.error-icon {
  font-size: 64px;
  line-height: 1;
  display: inline-block;
  animation: error-float 3s ease-in-out infinite;
}

@keyframes error-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.error-code {
  display: block;
  font-size: 80px;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -2px;
  margin-bottom: 8px;
}

.error-title {
  margin: 0 0 12px;
  font-size: 24px;
  color: var(--text);
}

.error-desc {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.error-path {
  margin-bottom: 24px;
}

.error-path code {
  display: inline-block;
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Online Status Banner ── */
.online-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  animation: banner-slide-down 0.3s ease-out;
}

@keyframes banner-slide-down {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.online-banner.offline {
  background: #7c2d12;
  color: #fed7aa;
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.online-banner.reconnected {
  background: #064e3b;
  color: #a7f3d0;
  border-bottom: 1px solid rgba(52, 211, 153, 0.2);
}

.online-banner-dismiss {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.15s;
  margin-left: 8px;
}

.online-banner-dismiss:hover {
  opacity: 1;
}

/* ── Responsive ── */

@media (max-width: 820px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    display: none;
  }

  .auth-panel {
    padding: 24px 16px;
  }

  .auth-glass {
    padding: 28px 20px 24px;
    border-radius: 12px;
  }

  .auth-title {
    font-size: 26px;
  }
}

.brand-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary);
  color: white;
}

.headline {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  letter-spacing: 0;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.02em;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-inner::-webkit-scrollbar {
  width: 3px;
}

.sidebar-inner::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.sidebar-inner:hover::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--border), transparent 40%);
}

/* ── Header ── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 10px;
  min-height: 52px;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.sb-brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.sb-brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.sb-brand-name {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.sb-brand-tier {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sb-collapse-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.sb-collapse-btn:hover {
  background: color-mix(in srgb, var(--border), transparent 50%);
  opacity: 1;
  color: var(--text);
}

/* ── Navigation ── */
.sb-nav {
  flex: 1;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

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

.sb-section-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 8px 4px;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  color: color-mix(in srgb, var(--text), var(--muted) 40%);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  transition: all 0.15s ease;
  min-height: 32px;
}

.sb-link:hover {
  background: color-mix(in srgb, var(--border), transparent 70%);
  color: var(--text);
}

.sb-link:hover .sb-link-icon {
  color: var(--text);
}

.sb-link.active {
  background: color-mix(in srgb, var(--primary), transparent 90%);
  color: var(--primary);
  font-weight: 600;
}

.sb-link.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
  box-shadow: 0 0 8px color-mix(in srgb, var(--primary), transparent 40%);
}

.sb-link.active .sb-link-icon {
  color: var(--primary);
}

.sb-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: color-mix(in srgb, var(--text), var(--muted) 55%);
  transition: color 0.15s ease;
}

.sb-link-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Footer ── */
.sb-footer {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid color-mix(in srgb, var(--border), transparent 50%);
  background: var(--surface);
}

.sidebar-inner .sb-footer {
  position: sticky;
  bottom: 0;
}

.sb-api-row {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface), var(--border) 8%);
  transition: background 0.15s ease;
  cursor: default;
}

.sb-api-row:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 20%);
}

.sb-api-row button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.sb-api-dot-collapsed {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.sb-cta {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sb-cta:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary), transparent 55%);
}

.sb-cta:active {
  transform: translateY(0);
  box-shadow: none;
}

.sb-fab {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sb-fab:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.sb-fab:active {
  transform: translateY(0);
}

.sidebar-collapsed .sidebar-header {
  padding: 14px 6px 10px;
  justify-content: space-between;
}

.sidebar-collapsed .sb-brand-icon {
  width: 36px;
  height: 36px;
  font-size: 20px;
}

.sidebar-collapsed .sb-nav {
  padding: 4px 6px;
}

.sidebar-collapsed .sb-link {
  justify-content: center;
  padding: 7px 0;
  position: relative;
}

.sidebar-collapsed .sb-link:hover::after {
  content: attr(data-label);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 100;
  pointer-events: none;
}

.sidebar-collapsed .sb-section-label {
  display: none;
}

.sidebar-collapsed .sb-link.active::before {
  left: -6px;
  top: 4px;
  bottom: 4px;
}

.sidebar-collapsed .sb-footer {
  align-items: center;
  padding: 8px 6px 10px;
  gap: 10px;
}

.sidebar-collapsed .sb-fab {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

/* Sidebar toggle visibility overrides */
.sidebar-collapsed .sb-brand-text,
.sidebar-collapsed .sb-link-text,
.sidebar-collapsed .sb-footer-expanded {
  display: none;
}

.sb-footer-collapsed {
  display: none;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.sidebar-collapsed .sb-footer-collapsed {
  display: flex;
}

.sidebar-collapsed .sb-collapse-icon {
  transform: rotate(180deg);
}

.main-region {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 12px var(--content-pad);
  background: color-mix(in srgb, var(--surface), transparent 16%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 30%);
}

.content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--content-pad);
}

.content-full {
  width: 100%;
  margin: 0;
  padding: var(--space-xl) var(--content-pad);
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex: 1;
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Global Search (Enterprise) ── */
.search-command {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-command-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  background: color-mix(in srgb, var(--surface-2), var(--surface) 35%);
  border: 1px solid color-mix(in srgb, var(--border), transparent 35%);
  border-radius: var(--radius-lg);
  transition: border 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-command-input-wrap:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: color-mix(in srgb, var(--surface-2), var(--surface) 20%);
}

.search-command-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
  line-height: 0;
}

.search-command-input {
  width: 100%;
  height: 100%;
  padding: 0 72px 0 40px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 450;
  outline: none;
}

.search-command-input::placeholder {
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
}

.search-command-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--border), transparent 70%);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  line-height: 1;
  white-space: nowrap;
}

.search-kbd-mac {
  display: flex;
  align-items: center;
  line-height: 0;
}

.search-kbd-text {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Dropdown ── */
.search-command-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 450px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--border), transparent 20%);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 100;
  animation: search-dropdown-in 0.12s ease-out;
}

@keyframes search-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-section {
  padding: 6px 0;
}

.search-section + .search-section {
  border-top: 1px solid color-mix(in srgb, var(--border), transparent 50%);
}

.search-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Result Items ── */
.search-group-list,
.search-recent-list {
  display: flex;
  flex-direction: column;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  margin: 0 6px;
  width: calc(100% - 12px);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 14px;
  transition: background 0.1s ease;
}

.search-item:hover,
.search-item.active {
  background: color-mix(in srgb, var(--primary), transparent 90%);
}

.search-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-2), transparent 40%);
  flex-shrink: 0;
  line-height: 0;
}

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

.search-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
  padding: 0;
  line-height: 0;
}

.search-item:hover .search-item-action {
  opacity: 1;
}

.search-item-action:hover {
  background: color-mix(in srgb, var(--border), transparent 40%);
  color: var(--text);
}

/* ── Loading Skeleton ── */
.search-loading-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px;
}

.search-skeleton-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
}

.search-skeleton-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--surface-2),
    color-mix(in srgb, var(--border), transparent 50%),
    var(--surface-2)
  );
  background-size: 200% 100%;
  animation: search-shimmer 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

.search-skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--surface-2),
    color-mix(in srgb, var(--border), transparent 50%),
    var(--surface-2)
  );
  background-size: 200% 100%;
  animation: search-shimmer 1.2s ease-in-out infinite;
}

.search-skeleton-line:last-child {
  width: 35%;
}

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

  100% {
    background-position: -200% 0;
  }
}

/* ── Empty State ── */
.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 16px;
  text-align: center;
}

.search-empty-title {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.search-empty-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ── Footer Hint ── */
.search-footer-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-top: 1px solid color-mix(in srgb, var(--border), transparent 50%);
  font-size: 11px;
  color: var(--muted);
}

.search-footer-hint span {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ── Mobile search ── */
@media (max-width: 980px) {
  .search-command {
    max-width: 100%;
  }

  .search-command-dropdown {
    position: fixed;
    top: 72px;
    left: 12px;
    right: 12px;
    max-height: calc(100vh - 96px);
    border-radius: var(--radius-md);
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: color-mix(in srgb, var(--border), transparent 10%);
}

.shell-user {
  position: relative;
  display: flex;
  align-items: center;
}

.shell-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.shell-user-trigger:hover,
.shell-user-trigger[aria-expanded="true"] {
  background: color-mix(in srgb, var(--surface), var(--border) 20%);
  border-color: color-mix(in srgb, var(--border), transparent 24%);
}

.shell-user-meta {
  display: grid;
  gap: 2px;
  text-align: right;
}

.shell-user-name,
.shell-user-role {
  margin: 0;
}

.shell-user-name {
  font-size: 13px;
  font-weight: 700;
}

.shell-user-role {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.shell-user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 240px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  z-index: 80;
}

.shell-user-menu-header {
  padding: 8px 10px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 18%);
  margin-bottom: 4px;
}

.shell-user-menu-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.shell-user-menu-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

.shell-user-menu-link:hover {
  background: color-mix(in srgb, var(--surface), var(--border) 24%);
}

.shell-user-menu-logout {
  color: var(--danger);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--card-padding);
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.04),
    0 1px 2px rgba(15, 23, 42, 0.03);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ── 12-Column Enterprise Dashboard Grid ── */
.dg {
  display: grid;
  gap: var(--space-lg);
}

.dg-12 {
  grid-template-columns: repeat(12, 1fr);
}

.dg-span-3 {
  grid-column: span 3;
}

.dg-span-4 {
  grid-column: span 4;
}

.dg-span-5 {
  grid-column: span 5;
}

.dg-span-6 {
  grid-column: span 6;
}

.dg-span-7 {
  grid-column: span 7;
}

.dg-span-8 {
  grid-column: span 8;
}

.dg-span-9 {
  grid-column: span 9;
}

.dg-span-12 {
  grid-column: span 12;
}

/* ── KPI / Stat Cards ── */
.kpi-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.kpi-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.kpi-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  margin: 2px 0 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.kpi-trend {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
}

.kpi-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ── Section / Panel ── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.headline-lg {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.headline-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ── Responsive grid overrides ── */
@media (max-width: 1200px) {
  .dg-span-3,
  .dg-span-4 {
    grid-column: span 6;
  }

  .dg-span-5,
  .dg-span-7 {
    grid-column: span 12;
  }

  .dg-span-8,
  .dg-span-9 {
    grid-column: span 12;
  }
}

@media (max-width: 768px) {
  .dg-span-3,
  .dg-span-4,
  .dg-span-5,
  .dg-span-6,
  .dg-span-7,
  .dg-span-8,
  .dg-span-9 {
    grid-column: span 12;
  }

  .dg {
    gap: var(--space-md);
  }
}

/* ── Card height equalization ── */
.card-equal {
  display: flex;
  flex-direction: column;
}

.card-equal .card-body {
  flex: 1;
}

.card-full-height {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-full-height .card-body {
  flex: 1;
  overflow: auto;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  transition: transform 0.15s ease, background 0.15s ease, border 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-secondary {
  border-color: var(--border);
  background: var(--surface);
}

.btn-danger {
  background: color-mix(in srgb, var(--danger), transparent 88%);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 72%);
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 78%);
}

.label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.field-error::before {
  content: "⚠";
  font-size: 11px;
  flex-shrink: 0;
  line-height: 1.4;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-success {
  color: var(--success);
  background: color-mix(in srgb, var(--success), transparent 90%);
  border-color: color-mix(in srgb, var(--success), transparent 72%);
}

.badge-warning {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning), transparent 90%);
  border-color: color-mix(in srgb, var(--warning), transparent 72%);
}

.badge-danger {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 90%);
  border-color: color-mix(in srgb, var(--danger), transparent 72%);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary), white 18%);
  color: white;
  font-weight: 800;
  border: 2px solid var(--surface);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(320px, 1fr));
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.kanban-column {
  min-height: 620px;
  background: color-mix(in srgb, var(--surface-2), transparent 8%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  position: sticky;
  top: 0;
  padding-bottom: 8px;
  background: inherit;
  z-index: 1;
}

.kanban-column-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted), transparent 80%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.task-card {
  position: relative;
  padding: 0;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 6px 18px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.task-card:hover {
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.task-card-inner {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.task-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
  background: var(--accent);
}

.task-card.priority-HIGH::before,
.task-card.priority-URGENT::before {
  background: var(--danger);
}

.task-card.priority-MEDIUM::before {
  background: var(--warning);
}

.task-card.priority-LOW::before {
  background: var(--muted);
}

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

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-comment-count {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.kanban-column.drag-over {
  background: color-mix(in srgb, var(--primary), transparent 90%);
  border-color: var(--primary);
}

.kanban-column.drag-over .kanban-dropzone {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 92%);
}

.task-card:hover .drag-handle {
  opacity: 1;
}

.drag-handle {
  opacity: 0;
  transition: opacity 0.15s ease;
  cursor: grab;
  color: var(--muted);
  display: flex;
}

.task-card:active {
  cursor: grabbing;
}

.task-done {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.task-done .task-card-inner {
  text-decoration: line-through;
  color: var(--muted);
}

.task-label {
  background: var(--surface-2);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.overdue {
  color: var(--danger) !important;
  font-weight: 600;
}

.kanban-add-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.kanban-add-btn:hover {
  background: color-mix(in srgb, var(--primary), transparent 85%);
  color: var(--primary);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 60px;
}

.kanban-dropzone {
  padding: 20px;
  color: var(--muted);
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: transparent;
  min-height: 80px;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.kanban-add-task {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px;
  color: var(--muted);
  border-radius: 8px;
  background: transparent;
  border: 1px dashed var(--border);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.kanban-add-task:hover {
  background: color-mix(in srgb, var(--surface), var(--border) 15%);
  border-color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.62);
}

.modal {
  width: min(100%, 1180px);
  max-height: min(92vh, 920px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.page-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  font-size: 20px;
}

.workspace-page {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 1360px;
}

/* ── Project Detail — Premium Redesign ── */

.pd-header {
  margin-bottom: 24px;
}

.pd-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pd-header-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pd-header-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.pd-status-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 26px 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pd-status-select:hover {
  opacity: 0.85;
}

.pd-status-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pd-status-select option {
  background: var(--surface, #1a1d24);
  color: var(--text, #e8eaf0);
}

.pd-header-dates {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.pd-header-date {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.pd-header-date-label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.pd-header-date-sep {
  color: var(--muted);
  opacity: 0.6;
}

.pd-title {
  margin: 0;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.pd-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 640px;
}

.pd-header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Health Indicator ── */

.pd-health {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pd-health.on-track {
  background: color-mix(in srgb, var(--success), transparent 85%);
  color: var(--success);
}

.pd-health.at-risk {
  background: color-mix(in srgb, var(--warning), transparent 85%);
  color: var(--warning);
}

.pd-health.delayed {
  background: color-mix(in srgb, var(--danger), transparent 85%);
  color: var(--danger);
}

.pd-health-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

/* ── KPI Grid ── */

.pd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.pd-kpi {
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: grid;
  gap: 2px;
}

.pd-kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pd-kpi-value {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.pd-kpi-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.pd-kpi-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
  margin-bottom: 6px;
}

/* ── Main 2-Column Layout ── */

.pd-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}

.pd-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.pd-card-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Progress Section ── */

.pd-progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.pd-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s ease;
}

.pd-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.pd-progress-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.pd-progress-stat {
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2), transparent 30%);
}

.pd-progress-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.pd-progress-stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Task Updates ── */

.pd-task-list {
  display: grid;
  gap: 6px;
}

.pd-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2), transparent 40%);
  transition: background 0.15s ease;
  cursor: pointer;
}

.pd-task-item:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 10%);
}

.pd-task-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.pd-task-info {
  flex: 1;
  min-width: 0;
}

.pd-task-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-task-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.pd-task-assignee {
  flex-shrink: 0;
}

/* ── Team Avatars ── */

.pd-team {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pd-team-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: 2px solid var(--card);
  margin-left: -6px;
}

.pd-team-avatar:first-child {
  margin-left: 0;
}

.pd-team-count {
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
}

/* ── Activity Timeline ── */

.pd-timeline {
  display: grid;
  gap: 0;
}

.pd-tl-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}

.pd-tl-line {
  width: 2px;
  background: var(--border);
  flex-shrink: 0;
  margin-left: 7px;
  align-self: stretch;
}

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

.pd-tl-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  margin-top: 2px;
}

.pd-tl-dot.created {
  background: var(--info);
}

.pd-tl-dot.updated {
  background: var(--warning);
}

.pd-tl-dot.completed {
  background: var(--success);
}

.pd-tl-dot.commented {
  background: var(--muted);
}

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

.pd-tl-text {
  margin: 0;
  font-size: 13px;
  color: var(--text);
}

.pd-tl-text strong {
  font-weight: 600;
}

.pd-tl-time {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* ── Health Detail Card ── */

.pd-health-card {
  display: grid;
  gap: 12px;
}

.pd-hc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.pd-hc-label {
  color: var(--muted);
}

.pd-hc-value {
  font-weight: 600;
  color: var(--text);
}

.pd-hc-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ── Tabs ── */

.pd-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  margin-bottom: 20px;
}

.pd-tab {
  padding: 0 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.pd-tab.active {
  border-bottom-color: var(--text);
  color: var(--text);
}

/* ── Members table ── */

.pd-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
}

.pd-member-row:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 30%);
}

.pd-member-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pd-member-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.priority-dot.urgent,
.priority-dot.high {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger), transparent 75%);
}

.priority-dot.medium {
  background: var(--warning);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning), transparent 75%);
}

.priority-dot.low {
  background: var(--muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted), transparent 75%);
}

.progress-ring-svg {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--surface-2);
}

.progress-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
}

.task-table th {
  padding: 12px 16px;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.task-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.task-table tr:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 40%);
}

.task-table tr:last-child td {
  border-bottom: 0;
}

.workload-bar {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border), transparent 40%);
  overflow: hidden;
}

.workload-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
}

.glow-blue {
  box-shadow: 0 0 20px color-mix(in srgb, var(--primary), transparent 75%);
}

.mobile-column-indicator {
  display: none;
  gap: 8px;
  padding: 12px 0;
  overflow-x: auto;
}

.mobile-column-indicator button {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.mobile-column-indicator button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.mobile-nav {
  display: none;
}

/* ── Large Screens: 1440p+ ── */
@media (min-width: 1920px) {
  :root {
    --content-max: 88vw;
    --content-pad: 48px;
  }

  .topbar {
    padding: 12px 48px;
  }

  .headline-lg {
    font-size: 36px;
  }
}

@media (min-width: 2560px) {
  :root {
    --content-max: 85vw;
    --content-pad: 56px;
  }

  .topbar {
    padding: 14px 56px;
  }
}

@media (min-width: 3840px) {
  :root {
    --content-max: 80vw;
    --content-pad: 64px;
  }
}

/* ── Tablet / Mobile ── */
@media (max-width: 1200px) {
  .search-command {
    max-width: 280px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
    padding-bottom: 72px;
  }

  .sidebar {
    display: none;
  }

  :root {
    --content-pad: 16px;
  }

  .content {
    padding: var(--space-md) var(--content-pad);
    width: 100%;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    padding: 12px 16px;
    display: grid;
    grid-template-areas:
      "title actions"
      "search search";
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .topbar-main {
    display: contents;
  }

  .topbar-title {
    grid-area: title;
    align-self: center;
  }

  .search-command {
    grid-area: search;
    max-width: 100%;
  }

  .topbar-actions {
    grid-area: actions;
    width: auto;
    justify-content: flex-end;
    gap: 12px;
  }

  .shell-user-meta {
    display: none;
  }

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

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

  .panel[style*="grid-template-columns: 2fr"] {
    grid-template-columns: 1fr !important;
  }

  .modal > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-nav a.active {
    color: var(--primary);
  }

  .mobile-column-indicator {
    display: flex;
  }

  .kanban-board {
    grid-template-columns: repeat(4, minmax(280px, 85vw));
    gap: 14px;
    scroll-snap-type: x mandatory;
  }

  .kanban-column {
    scroll-snap-align: start;
    min-height: 400px;
  }

  .task-table {
    font-size: 13px;
  }

  .task-table th,
  .task-table td {
    padding: 10px 12px;
  }

  .stat-card-enhanced-icon {
    width: 36px;
    height: 36px;
  }

  .stat-card-enhanced-value {
    font-size: 24px;
  }

  .project-hero {
    padding: 16px;
  }
}

@media (max-width: 820px) {
  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    display: none;
  }

  .auth-form-section {
    padding: 32px 20px;
  }

  .auth-form-title {
    font-size: 24px;
  }
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 64px 24px;
  color: var(--muted);
}

.error-boundary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
}

.error-boundary-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  max-width: 400px;
}

/* ── Enterprise Project Cards ── */

.pc-page {
  display: grid;
  gap: var(--space-lg);
}

.pc-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.pc-page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.pc-page-counts {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.pc-count-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), transparent 85%);
  color: var(--primary);
  letter-spacing: 0.02em;
}

.pc-count-badge--done {
  background: color-mix(in srgb, var(--success), transparent 85%);
  color: var(--success);
}

.pc-count-badge--hold {
  background: color-mix(in srgb, var(--warning), transparent 85%);
  color: var(--warning);
}

.pc-count-badge--archived {
  background: color-mix(in srgb, var(--muted), transparent 80%);
  color: var(--muted);
}

.pc-count-badge--total {
  background: color-mix(in srgb, var(--text), transparent 88%);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text), transparent 78%);
}

.pc-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 1200px) {
  .pc-skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pc-skeleton-grid {
    grid-template-columns: 1fr;
  }
}

.pc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 1200px) {
  .pc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ── Card ── */
.pc {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  cursor: default;
}

.pc:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: color-mix(in srgb, var(--primary), transparent 60%);
}

.pc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
}

.pc-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pc-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary), transparent 85%);
  color: var(--primary);
  flex-shrink: 0;
}

.pc-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.pc-title:hover {
  color: var(--primary);
}

.pc-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pc-badge--success {
  background: color-mix(in srgb, var(--success), transparent 85%);
  color: var(--success);
}

.pc-badge--warning {
  background: color-mix(in srgb, var(--warning), transparent 85%);
  color: var(--warning);
}

.pc-badge--danger {
  background: color-mix(in srgb, var(--danger), transparent 85%);
  color: var(--danger);
}

.pc-badge--neutral {
  background: var(--surface-2);
  color: var(--muted);
}

.pc-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Meta row ── */
.pc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}

.pc-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pc-meta-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.pc-avatars {
  display: flex;
  align-items: center;
}

.pc-avatars .avatar {
  margin-left: -6px;
  border: 2px solid var(--card);
  transition: transform 0.15s ease;
}

.pc-avatars .avatar:first-child {
  margin-left: 0;
}

.pc:hover .pc-avatars .avatar {
  border-color: color-mix(in srgb, var(--primary), transparent 60%);
}

.pc-extra-count {
  margin-left: -6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 2px solid var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
}

.pc-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Progress area ── */
.pc-progress-area {
  display: grid;
  gap: 8px;
}

.pc-progress-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pc-task-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pc-progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  transition: box-shadow 0.3s ease;
}

.pc:hover .pc-progress-track {
  box-shadow: 0 0 12px color-mix(in srgb, var(--primary), transparent 70%);
}

.pc-progress-seg {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pc-progress-seg:first-child {
  border-radius: 999px 0 0 999px;
}

.pc-progress-seg:last-child {
  border-radius: 0 999px 999px 0;
}

.pc-progress-seg:only-child {
  border-radius: 999px;
}

/* ── Context menu ── */
.pc-ctx {
  position: relative;
}

.pc-ctx-trigger {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pc-ctx-trigger:hover {
  background: color-mix(in srgb, var(--primary), transparent 85%);
  color: var(--text);
}

.pc-ctx-backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
}

.pc-ctx-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 50;
  padding: 4px;
  display: grid;
  gap: 2px;
}

.pc-ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.pc-ctx-item:hover {
  background: var(--surface-2);
}

.pc-ctx-item--danger {
  color: var(--danger);
}

.pc-ctx-item--danger:hover {
  background: color-mix(in srgb, var(--danger), transparent 88%);
}

/* ── Empty state ── */
.pc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
}

/* ── Avatar Upload ── */
.avatar-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  text-align: center;
}

.avatar-upload:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 92%);
}

.avatar-upload-input {
  display: none;
}

.avatar-upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.avatar-upload-img {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid var(--border);
}

.avatar-upload-preview p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.avatar-upload-hint {
  font-size: 12px !important;
  color: var(--muted) !important;
}

/* ══════════════════════════════════════════════════════
   Enterprise Dashboard Redesign
   ══════════════════════════════════════════════════════ */
:root {
  --dash-gap: 16px;
  --dash-card-radius: 16px;
  --dash-card-pad: 18px;
  --dash-max: 1600px;
}

.dash-content {
  width: 100%;
  max-width: var(--dash-max);
  margin: 0 auto;
  padding: 24px 40px;
}

/* ── Header Section ── */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.dash-header-left {
  display: grid;
  gap: 12px;
}

.dash-greeting {
  margin: 0;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.dash-greeting-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.dash-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-summary-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2), transparent 20%);
  border: 1px solid color-mix(in srgb, var(--border), transparent 30%);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.dash-summary-chip strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dash-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.dash-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.dash-btn:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 20%);
  border-color: color-mix(in srgb, var(--border), transparent 10%);
}

.dash-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.dash-btn-primary:hover {
  background: color-mix(in srgb, var(--primary), #000 12%);
  border-color: transparent;
}

/* ── Dashboard Grid ── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--dash-gap);
}

.dash-col-3 {
  grid-column: span 3;
}

.dash-col-4 {
  grid-column: span 4;
}

.dash-col-5 {
  grid-column: span 5;
}

.dash-col-6 {
  grid-column: span 6;
}

.dash-col-7 {
  grid-column: span 7;
}

.dash-col-8 {
  grid-column: span 8;
}

.dash-col-12 {
  grid-column: span 12;
}

/* ── Cards ── */
.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--dash-card-radius);
  padding: var(--dash-card-pad);
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.04),
    0 1px 2px rgba(15, 23, 42, 0.03);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dash-card:hover {
  box-shadow:
    0 4px 16px rgba(15, 23, 42, 0.06),
    0 2px 8px rgba(15, 23, 42, 0.04);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.dash-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.dash-card-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary), transparent 85%);
  color: var(--primary);
}

.dash-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-card-full {
  display: flex;
  flex-direction: column;
}

.dash-card-full .dash-card-body {
  flex: 1;
}

/* ── Enhanced KPI Cards ── */
.kpi-enhanced {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.kpi-enhanced-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kpi-enhanced-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.kpi-enhanced-trend {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.kpi-enhanced-trend.up {
  color: var(--success);
  background: color-mix(in srgb, var(--success), transparent 88%);
}

.kpi-enhanced-trend.down {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 88%);
}

.kpi-enhanced-metric {
  margin: 0;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi-enhanced-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-enhanced-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ── CSS Sparkline ── */
.kpi-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
}

.kpi-sparkline span {
  width: 5px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
  opacity: 0.35;
  transition: opacity 0.2s ease;
}

.dash-card:hover .kpi-sparkline span {
  opacity: 0.55;
}

.kpi-sparkline span:nth-child(1) {
  height: 40%;
}

.kpi-sparkline span:nth-child(2) {
  height: 65%;
}

.kpi-sparkline span:nth-child(3) {
  height: 30%;
}

.kpi-sparkline span:nth-child(4) {
  height: 80%;
}

.kpi-sparkline span:nth-child(5) {
  height: 50%;
}

.kpi-sparkline span:nth-child(6) {
  height: 72%;
}

.kpi-sparkline span:nth-child(7) {
  height: 58%;
}

.kpi-sparkline.success span {
  background: var(--success);
}

.kpi-sparkline.warning span {
  background: var(--warning);
}

.kpi-sparkline.danger span {
  background: var(--danger);
}

.kpi-sparkline.accent span {
  background: var(--accent);
}

/* ── Project Progress Items ── */
.dash-projects {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-project-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 60%);
  transition: background 0.12s ease;
  border-radius: 6px;
  margin: 0 -6px;
  padding: 10px 6px;
}

.dash-project-item:last-child {
  border-bottom: none;
}

.dash-project-item:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 50%);
}

.dash-project-ring-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.dash-project-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dash-project-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-project-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.dash-project-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dash-risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dash-risk-badge.on-track {
  color: var(--success);
  background: color-mix(in srgb, var(--success), transparent 88%);
}

.dash-risk-badge.at-risk {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning), transparent 88%);
}

.dash-risk-badge.delayed {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 88%);
}

.dash-risk-badge.completed {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 88%);
}

.dash-risk-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

/* ── Enhanced Task Table ── */
.dash-task-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-task-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.dash-task-table th:hover {
  color: var(--text);
}

.dash-task-table th.sorted {
  color: var(--primary);
}

.dash-task-table td {
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 50%);
  font-size: 13px;
  vertical-align: middle;
}

.dash-task-table tr {
  transition: background 0.1s ease;
}

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

.dash-task-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 55%);
}

.dash-task-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-task-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ── Status Badge (compact) ── */
.dash-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.dash-status-badge.todo {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted), transparent 85%);
}

.dash-status-badge.in_progress {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent), transparent 85%);
}

.dash-status-badge.review {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning), transparent 85%);
}

.dash-status-badge.done {
  color: var(--success);
  background: color-mix(in srgb, var(--success), transparent 85%);
}

.dash-priority-badge {
  font-size: 10px;
  font-weight: 700;
}

/* ── Pagination ── */
.dash-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--border), transparent 50%);
}

.dash-page-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.dash-page-btn:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 20%);
  color: var(--text);
}

.dash-page-btn.active {
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary), transparent 70%);
}

.dash-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Reusable Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--border), transparent 50%);
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-summary {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.pagination-size.select {
  width: auto;
  min-width: 100px;
  min-height: 32px;
  padding: 0 28px 0 10px;
  font-size: 12px;
  font-weight: 600;
  background-position: right 6px center;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.page-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  padding: 0;
}

.page-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--surface-2), transparent 20%);
  color: var(--text);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.page-ellipsis {
  width: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
  user-select: none;
}

/* ── Team Workload ── */
.dash-workload {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-workload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 60%);
}

.dash-workload-item:last-child {
  border-bottom: none;
}

.dash-workload-avatar {
  flex-shrink: 0;
}

.dash-workload-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

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

.dash-workload-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-workload-role {
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-2), transparent 30%);
  flex-shrink: 0;
}

.dash-workload-capacity {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.dash-workload-track {
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border), transparent 40%);
  overflow: hidden;
}

.dash-workload-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.5s ease;
}

/* ── Activity Timeline ── */
.dash-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
}

.dash-tl-line {
  position: absolute;
  left: 10px;
  top: 12px;
  bottom: 8px;
  width: 2px;
  background: color-mix(in srgb, var(--border), transparent 40%);
  z-index: 0;
}

.dash-tl-item {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 8px 0 8px 0;
  z-index: 1;
}

.dash-tl-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 22px;
}

.dash-tl-dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--card);
  position: relative;
  z-index: 2;
}

.dash-tl-dot.create {
  background: var(--accent);
}

.dash-tl-dot.update {
  background: var(--warning);
}

.dash-tl-dot.complete {
  background: var(--success);
}

.dash-tl-dot.comment {
  background: var(--muted);
}

.dash-tl-dot.default {
  background: var(--primary);
}

.dash-tl-dot-inner {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #fff;
}

.dash-tl-content {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.dash-tl-text {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.dash-tl-text strong {
  font-weight: 600;
}

.dash-tl-project-ref {
  color: var(--primary);
  font-weight: 500;
}

.dash-tl-time {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dash-tl-actor-avatar {
  flex-shrink: 0;
}

/* ── Empty State ── */
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.dash-empty-icon {
  margin-bottom: 4px;
  opacity: 0.4;
}

/* ── Responsive ── */
@media (max-width: 1400px) {
  .dash-content {
    padding: 20px 24px;
  }
}

@media (max-width: 1200px) {
  .dash-col-3 {
    grid-column: span 6;
  }

  .dash-col-4 {
    grid-column: span 6;
  }

  .dash-col-5,
  .dash-col-7 {
    grid-column: span 12;
  }

  .dash-col-6 {
    grid-column: span 12;
  }

  .dash-col-8,
  .dash-col-9 {
    grid-column: span 12;
  }

  .dash-header {
    flex-direction: column;
  }

  .dash-header-actions {
    width: 100%;
  }

  .dash-summary {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .dash-content {
    padding: 16px;
  }

  .dash-grid {
    gap: 12px;
  }

  .dash-col-3,
  .dash-col-4,
  .dash-col-5,
  .dash-col-6,
  .dash-col-7,
  .dash-col-8,
  .dash-col-9 {
    grid-column: span 12;
  }

  .dash-greeting {
    font-size: 22px;
  }

  .kpi-enhanced-metric {
    font-size: 26px;
  }

  .dash-summary-chip {
    font-size: 11px;
    padding: 4px 10px;
  }

  .dash-task-table th,
  .dash-task-table td {
    padding: 8px 8px;
    font-size: 12px;
  }

  .dash-project-ring-wrap {
    width: 36px;
    height: 36px;
  }
}

/* ── Confirm Dialog ── */

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: confirm-fade-in 0.15s ease-out;
}

@keyframes confirm-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.confirm-modal {
  width: min(100%, 400px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.15);
  animation: confirm-slide-up 0.2s ease-out;
}

@keyframes confirm-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirm-icon-wrap {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  margin: 0 auto 16px;
}

.confirm-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.confirm-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 24px;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.confirm-actions .btn {
  min-width: 100px;
  justify-content: center;
}

/* ── API Metrics Table ── */

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

.api-metrics-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.api-metrics-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.api-metrics-table tbody tr:hover {
  background: color-mix(in srgb, var(--primary), transparent 95%);
}

.method-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  padding: 1px 7px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.method-get {
  background: color-mix(in srgb, var(--success), transparent 85%);
  color: var(--success);
}

.method-post {
  background: color-mix(in srgb, var(--primary), transparent 85%);
  color: var(--primary);
}

.method-patch {
  background: color-mix(in srgb, var(--warning), transparent 85%);
  color: var(--warning);
}

.method-delete {
  background: color-mix(in srgb, var(--danger), transparent 85%);
  color: var(--danger);
}

.status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  padding: 1px 7px;
  border-radius: 4px;
}

.status-2 {
  background: color-mix(in srgb, var(--success), transparent 85%);
  color: var(--success);
}

.status-4 {
  background: color-mix(in srgb, var(--warning), transparent 85%);
  color: var(--warning);
}

.status-5 {
  background: color-mix(in srgb, var(--danger), transparent 85%);
  color: var(--danger);
}

.dur-fast {
  color: var(--success);
  font-weight: 600;
}

.dur-warn {
  color: var(--warning);
  font-weight: 600;
}

.dur-slow {
  color: var(--danger);
  font-weight: 700;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: 6px 0 0 6px;
}

.btn-group .btn:last-child {
  border-radius: 0 6px 6px 0;
}

/* ═══════════════════════════════════════════════════════════
   Analytics Module - Charts, KPIs, and Recharts Tooltips
   ═══════════════════════════════════════════════════════════ */

.analytics-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 4px 0 40px;
}

.analytics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.analytics-head-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.analytics-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

.analytics-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.analytics-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.analytics-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 4px 4px 12px;
}

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

.analytics-select {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  min-width: 140px;
}

.analytics-select:hover {
  background: var(--surface-2);
}

.analytics-range {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.analytics-range-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.analytics-range-btn:hover {
  color: var(--text);
}

.analytics-range-btn.is-active {
  background: var(--primary);
  color: #fff;
}

.analytics-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--danger), transparent 88%);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger), transparent 75%);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

/* ── KPI Grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
  min-height: 116px;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 100% 0%,
    color-mix(in srgb, var(--primary), transparent 94%),
    transparent 60%
  );
  pointer-events: none;
  opacity: 0.7;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary), transparent 90%);
  border-color: color-mix(in srgb, var(--primary), transparent 70%);
}

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

.kpi-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
}

.kpi-card-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 1;
}

.kpi-card-value {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}

.kpi-card-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  position: relative;
  z-index: 1;
}

.kpi-card-trend-label {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  position: relative;
  z-index: 1;
}

.kpi-card-skel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.kpi-skel-line {
  display: block;
  height: 12px;
  width: 100%;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--surface-2),
    color-mix(in srgb, var(--surface-2), transparent 50%),
    var(--surface-2)
  );
  background-size: 220% 100%;
  animation: kpi-skel-pulse 1.4s ease-in-out infinite;
}

.kpi-skel-line.short {
  width: 50%;
}

@keyframes kpi-skel-pulse {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* ── Chart Card ── */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--text), transparent 96%);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.chart-card:hover {
  box-shadow: 0 6px 18px color-mix(in srgb, var(--text), transparent 94%);
  border-color: color-mix(in srgb, var(--primary), transparent 80%);
}

.chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chart-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chart-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chart-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  letter-spacing: -0.01em;
}

.chart-card-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}

.chart-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-card-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}

.chart-card-loading,
.chart-card-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.chart-card-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted), transparent 90%);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.chart-card-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.chart-card-empty-body {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  max-width: 220px;
}

.chart-card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

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

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

.chart-foot-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.chart-foot-value {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ── Donut Chart ── */
.donut-chart-wrap {
  position: relative;
  width: 100%;
}

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

.donut-center-value {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.donut-center-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  font-weight: 500;
}

/* ── Recharts Tooltip ── */
.chart-tooltip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--text), transparent 88%);
  font-size: 12px;
  min-width: 160px;
  backdrop-filter: blur(8px);
}

.chart-tooltip-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin: 0 0 6px;
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.chart-tooltip-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.chart-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

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

.chart-tooltip-value {
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

.chart-tooltip-muted {
  color: var(--muted);
  font-weight: 500;
}

.chart-tooltip-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0 4px;
}

.chart-tooltip-total {
  font-weight: 700;
}

/* ── Dashboard Analytics Snapshot ── */
.dash-analytics-snapshot {
  background: linear-gradient(
    135deg,
    var(--card) 0%,
    color-mix(in srgb, var(--primary), transparent 96%) 100%
  );
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dash-analytics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-analytics-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-analytics-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

.dash-analytics-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 80%);
  transition: background 0.15s ease;
}

.dash-analytics-link:hover {
  background: color-mix(in srgb, var(--primary), transparent 92%);
}

.dash-analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dash-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dash-analytics-grid > .chart-card {
  min-height: 280px;
}

/* ── Project Analytics Tab ── */
.pd-analytics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pd-analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pd-analytics-title {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-analytics-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 80%);
  transition: background 0.15s ease;
}

.pd-analytics-link:hover {
  background: color-mix(in srgb, var(--primary), transparent 92%);
}

.pd-analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pd-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pd-analytics-grid > .chart-card {
  min-height: 280px;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

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

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

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

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

  .pd-analytics-grid {
    grid-template-columns: 1fr;
  }
}

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

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

  .pd-analytics-kpis {
    grid-template-columns: 1fr;
  }

  .analytics-head {
    flex-direction: column;
    align-items: stretch;
  }

  .analytics-head-right {
    width: 100%;
  }

  .analytics-title {
    font-size: 22px;
  }

  .kpi-card-value {
    font-size: 26px;
  }
}

/* ── Dark mode refinements for analytics ── */
.dark .chart-card {
  background: var(--card);
}

.dark .chart-tooltip {
  background: var(--surface);
}

.dark .kpi-card {
  background: var(--card);
}

.dark .dash-analytics-snapshot {
  background: linear-gradient(
    135deg,
    var(--card) 0%,
    color-mix(in srgb, var(--primary), transparent 96%) 100%
  );
}

.dark .chart-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.dark .recharts-cartesian-axis-tick-value {
  fill: var(--muted);
}

.dark .recharts-legend-item-text {
  color: var(--muted) !important;
}

/* ═══════════════════════════════════════════════════════════
   Task Attachments - Drag/Drop Uploader + Attachment List
   ═══════════════════════════════════════════════════════════ */

.att-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.att-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.att-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.att-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-family: "Hanken Grotesk", Inter, sans-serif;
  letter-spacing: -0.01em;
}

.att-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}

.att-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ── Dropzone ── */
.att-dropzone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2), transparent 30%);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
  user-select: none;
}

.att-dropzone:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 50%);
  background: color-mix(in srgb, var(--primary), transparent 94%);
}

.att-dropzone.is-dragging {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 90%);
  transform: scale(1.005);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary), transparent 88%);
}

.att-dropzone-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
  flex-shrink: 0;
}

.att-dropzone-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.att-dropzone-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.att-dropzone-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.att-dropzone-browse {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.att-dropzone-formats {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}

/* ── Uploading state ── */
.att-uploading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 70%);
  background: color-mix(in srgb, var(--primary), transparent 94%);
  border-radius: 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
}

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

.att-uploading-track {
  width: 120px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), transparent 80%);
  overflow: hidden;
  flex-shrink: 0;
}

.att-uploading-fill {
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  animation: att-up-progress 1.4s ease-in-out infinite;
}

@keyframes att-up-progress {
  0% {
    width: 10%;
    margin-left: 0;
  }

  50% {
    width: 60%;
    margin-left: 20%;
  }

  100% {
    width: 10%;
    margin-left: 90%;
  }
}

/* ── Error banner ── */
.att-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger), transparent 75%);
  background: color-mix(in srgb, var(--danger), transparent 92%);
  color: var(--danger);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Attachment list ── */
.att-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.att-list-skel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.att-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.att-empty p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.att-empty span {
  font-size: 12px;
  color: var(--muted);
}

.att-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.att-item:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 70%);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--text), transparent 94%);
  transform: translateY(-1px);
}

.att-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.att-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.att-item-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.att-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.att-item-size {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  color: var(--text);
}

.att-item-date {
  white-space: nowrap;
}

.att-item-dot {
  color: var(--muted);
  opacity: 0.5;
}

.att-item-uploader {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.att-item-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), transparent 80%);
  color: var(--primary);
  font-size: 9px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

.att-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.att-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.att-icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.att-icon-btn--download:hover {
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary), transparent 75%);
}

.att-icon-btn--delete:hover {
  background: color-mix(in srgb, var(--danger), transparent 88%);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 75%);
}

.att-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.att-icon-btn:disabled:hover {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .att-dropzone {
    padding: 14px;
    gap: 10px;
  }

  .att-dropzone-icon {
    width: 40px;
    height: 40px;
  }

  .att-item {
    padding: 10px;
    gap: 10px;
  }

  .att-item-icon {
    width: 36px;
    height: 36px;
  }

  .att-item-meta {
    font-size: 11px;
  }
}

/* ── Dark mode refinements ── */
.dark .att-dropzone {
  background: color-mix(in srgb, var(--surface-2), transparent 30%);
}

.dark .att-item:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* -- File Picker (reusable) -- */
.fp-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fp-wrap.is-compact .fp-dropzone {
  padding: 12px 14px;
}

.fp-wrap.is-compact .fp-dropzone-icon {
  width: 36px;
  height: 36px;
}

.fp-wrap.is-compact .fp-dropzone-title {
  font-size: 13px;
}

.fp-wrap.is-compact .fp-dropzone-hint {
  font-size: 11px;
}

.fp-wrap.is-compact .fp-item {
  padding: 8px 10px;
}

.fp-dropzone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.fp-dropzone:hover,
.fp-dropzone:focus-visible {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 95%);
}

.fp-dropzone.is-dragging {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 90%);
  transform: scale(1.01);
}

.fp-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
  flex-shrink: 0;
}

.fp-dropzone-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fp-dropzone-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.fp-dropzone-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.fp-errors {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fp-error-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--danger);
  padding: 6px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger), transparent 92%);
  border: 1px solid color-mix(in srgb, var(--danger), transparent 80%);
}

.fp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

.fp-item:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 70%);
}

.fp-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
}

.fp-item-body {
  flex: 1 1 auto;
  min-width: 0;
}

.fp-item-name {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fp-item-meta {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}

.fp-remove {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.fp-remove:hover {
  background: color-mix(in srgb, var(--danger), transparent 88%);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 75%);
}

@media (max-width: 640px) {
  .fp-dropzone {
    padding: 12px 14px;
    gap: 10px;
  }

  .fp-dropzone-icon {
    width: 36px;
    height: 36px;
  }

  .fp-item {
    padding: 8px 10px;
    gap: 8px;
  }
}

/* ── Full Page Loader ── */

.full-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: full-loader-fade 0.18s ease-out;
}

.full-loader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.full-loader-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(420px, 100%);
  padding: 32px 28px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: full-loader-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

.full-loader-spinner {
  --loader-accent: var(--primary);
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.full-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 3px solid transparent;
  border-top-color: var(--loader-accent);
  border-right-color: color-mix(in srgb, var(--loader-accent), transparent 60%);
  animation: full-loader-spin 1.1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.full-loader-ring-1 {
  inset: 0;
  border-width: 3px;
}

.full-loader-ring-2 {
  inset: 10px;
  border-width: 2px;
  border-top-color: color-mix(in srgb, var(--loader-accent), white 25%);
  border-right-color: transparent;
  animation-direction: reverse;
  animation-duration: 1.4s;
  opacity: 0.75;
}

.full-loader-ring-3 {
  inset: 20px;
  border-width: 2px;
  border-top-color: color-mix(in srgb, var(--loader-accent), transparent 30%);
  border-right-color: transparent;
  border-bottom-color: color-mix(
    in srgb,
    var(--loader-accent),
    transparent 50%
  );
  animation-duration: 0.9s;
  opacity: 0.5;
}

.full-loader-icon {
  position: relative;
  z-index: 1;
  color: var(--loader-accent);
  animation: full-loader-pulse 1.6s ease-in-out infinite;
}

.full-loader-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--loader-accent);
}

.full-loader-message {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  line-height: 1.3;
  max-width: 360px;
}

.full-loader-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 6px;
  margin-top: 2px;
}

.full-loader-progress span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--loader-accent);
  opacity: 0.5;
  animation: full-loader-bounce 1.2s ease-in-out infinite;
}

.full-loader-progress span:nth-child(1) {
  animation-delay: 0s;
}

.full-loader-progress span:nth-child(2) {
  animation-delay: 0.12s;
}

.full-loader-progress span:nth-child(3) {
  animation-delay: 0.24s;
}

.full-loader-progress span:nth-child(4) {
  animation-delay: 0.36s;
}

.full-loader-progress span:nth-child(5) {
  animation-delay: 0.48s;
}

.full-loader-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
  margin-top: 2px;
}

.full-loader-count {
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--loader-accent), transparent 85%);
  color: var(--loader-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

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

@keyframes full-loader-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.92);
    opacity: 0.7;
  }
}

@keyframes full-loader-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

@keyframes full-loader-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes full-loader-pop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

body.has-full-loader {
  overflow: hidden;
}

.task-card.task-assigned-to-me {
  border-color: color-mix(in srgb, var(--primary), transparent 55%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary), transparent 70%);
}

.task-card.task-assigned-to-me::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 75%);
  z-index: 2;
}

@media (max-width: 640px) {
  .full-loader-card {
    padding: 24px 20px;
    border-radius: 14px;
  }

  .full-loader-spinner {
    width: 72px;
    height: 72px;
  }

  .full-loader-message {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .full-loader-ring,
  .full-loader-progress span,
  .full-loader-icon {
    animation-duration: 0s;
  }

  .full-loader-card {
    animation: none;
  }
}

/* ============================================================
   Project Health Intelligence Engine
   Premium enterprise analytics card + workspace overview
   ============================================================ */

/* ----------------------------------------------------------
   ProjectHealthCard (enterprise intelligence widget — v2)
   ---------------------------------------------------------- */

.phc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(
    145deg,
    rgba(99, 102, 241, 0.06) 0%,
    rgba(15, 23, 42, 0.7) 50%,
    rgba(15, 23, 42, 0.9) 100%
  );
  border: 1px solid var(--phi-border);
  box-shadow: 0 20px 52px -20px rgba(2, 6, 23, 0.8);
  color: var(--phi-text);
  overflow: hidden;
}

.phc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  border: 1px solid var(--phc-accent, var(--health-primary));
  opacity: 0.18;
}

.phc-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--phc-accent, var(--health-primary)) 0%,
    transparent 100%
  );
  opacity: 0.5;
}

/* Top row */
.phc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.phc-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--phi-text-strong);
}

.phc-top-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.phc-score-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-feature-settings: "tnum";
  background: color-mix(
    in srgb,
    var(--phc-chip-color, var(--health-primary)),
    transparent 88%
  );
  color: var(--phc-chip-color, var(--health-primary));
}

.phc-risk-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.phc-risk-on_track {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.phc-risk-at_risk {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.phc-risk-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.phc-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--phi-text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--phi-border);
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.phc-refresh:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--phi-text);
}

.phc-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.phc-refresh svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Center: gauge area */
.phc-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
}

.phc-gauge-wrap {
  position: relative;
  width: 180px;
  max-width: 220px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phc-gauge-svg {
  width: 100%;
  height: 100%;
}

.phc-gauge-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}

.phc-gauge-score {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}

.phc-gauge-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--phi-text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.phc-trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.phc-trend-up {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.phc-trend-down {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.phc-trend-flat {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

/* KPI grid (3 cols for enterprise density) */
.phc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

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

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

.phc-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--phi-surface);
  border: 1px solid var(--phi-border);
  transition: border-color 150ms ease, transform 100ms ease;
}

.phc-kpi:hover {
  border-color: rgba(148, 163, 184, 0.3);
  transform: translateY(-1px);
}

.phc-kpi-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--phi-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.phc-kpi-value {
  font-size: 20px;
  font-weight: 700;
  font-feature-settings: "tnum";
  line-height: 1.1;
  color: var(--phi-text-strong);
}

.phc-kpi-danger .phc-kpi-value {
  color: var(--health-danger);
}

/* Section cards (risk, actions, breakdown) */
.phc-section-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 12px;
  background: var(--phi-surface);
  border: 1px solid var(--phi-border);
}

.phc-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--phi-text-strong);
  letter-spacing: 0.01em;
}

.phc-section-icon {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.phc-empty {
  margin: 0;
  font-size: 12px;
  color: var(--phi-text-dim);
  font-style: italic;
}

/* Risk factors list */
.phc-risk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phc-risk-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--phi-border);
  transition: background 150ms ease;
}

.phc-risk-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.phc-risk-icon {
  font-size: 14px;
  line-height: 1.3;
  flex-shrink: 0;
  margin-top: 1px;
}

.phc-risk-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--phi-text-strong);
  margin-bottom: 2px;
}

.phc-risk-item-desc {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--phi-text-dim);
}

/* Action pills */
.phc-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phc-action-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--phi-text);
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.14),
    rgba(99, 102, 241, 0.05)
  );
  border: 1px solid rgba(99, 102, 241, 0.2);
  transition: background 150ms ease, border-color 150ms ease;
  white-space: nowrap;
  cursor: default;
}

.phc-action-pill:hover {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2),
    rgba(99, 102, 241, 0.08)
  );
  border-color: rgba(99, 102, 241, 0.35);
}

/* Health breakdown bars */
.phc-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phc-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.phc-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--phi-text);
}

.phc-bar-label {
  font-weight: 500;
}

.phc-bar-score {
  font-weight: 700;
  font-feature-settings: "tnum";
  color: var(--phi-text-strong);
}

.phc-bar-max {
  font-weight: 500;
  font-size: 11px;
  color: var(--phi-text-dim);
}

.phc-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.phc-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 700ms ease;
}

/* Loading + error states */
.phc-loading,
.phc-error {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  justify-content: center;
}

.phc-error {
  color: #fca5a5;
  font-size: 13px;
  align-items: center;
}

.phc-skel-row {
  height: 20px;
  width: 60%;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.04)
  );
  background-size: 200% 100%;
  animation: phc-shimmer 1.5s infinite;
}

.phc-skel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.phc-skel-tile {
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.04)
  );
  background-size: 200% 100%;
  animation: phc-shimmer 1.5s infinite;
}

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

  100% {
    background-position: -200% 0;
  }
}

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

  100% {
    background-position: -200% 0;
  }
}

/* ----------------------------------------------------------
   Workspace Health Overview (dashboard widget)
   ---------------------------------------------------------- */

.who-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px;
  border-radius: var(--phi-radius);
  background: linear-gradient(
    150deg,
    rgba(99, 102, 241, 0.07) 0%,
    rgba(15, 23, 42, 0.6) 50%,
    rgba(15, 23, 42, 0.85) 100%
  );
  border: 1px solid var(--phi-border);
  color: var(--phi-text);
}

.who-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.who-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--phi-text-strong);
}

.who-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--phi-text-dim);
  letter-spacing: 0.02em;
}

.who-link {
  font-size: 12px;
  color: var(--phi-text-dim);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--phi-border);
  transition: color 150ms ease, background 150ms ease;
}

.who-link:hover {
  color: var(--phi-text-strong);
  background: rgba(255, 255, 255, 0.08);
}

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

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

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

.who-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--phi-surface);
  border: 1px solid var(--phi-border);
  border-radius: var(--phi-radius-sm);
  transition: border-color 150ms ease;
}

.who-kpi:hover {
  border-color: rgba(148, 163, 184, 0.32);
}

.who-kpi-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--phi-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.who-kpi-value {
  font-size: 24px;
  font-weight: 800;
  font-feature-settings: "tnum";
  color: var(--phi-text-strong);
  line-height: 1.1;
}

.who-kpi-suffix {
  font-size: 12px;
  color: var(--phi-text-dim);
  font-weight: 500;
}

.who-kpi-band {
  font-size: 11px;
  color: var(--phi-text-dim);
  font-weight: 500;
}

.who-kpi-success {
  color: var(--health-success);
}

.who-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.who-list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--phi-surface);
  border: 1px solid var(--phi-border);
  border-radius: var(--phi-radius-sm);
}

.who-list-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--phi-text-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.who-list-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.who-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.who-row {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: background 150ms ease;
}

.who-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.who-row-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--phi-text);
  font-size: 13px;
}

.who-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.who-row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who-row-meta {
  font-size: 12px;
  color: var(--phi-text-dim);
  flex-shrink: 0;
}

.who-row-meta-suffix {
  color: var(--phi-text-dim);
  font-weight: 400;
}

.who-empty {
  margin: 0;
  padding: 10px;
  font-size: 12px;
  color: var(--phi-text-dim);
  font-style: italic;
  text-align: center;
}

.who-loading,
.who-error {
  min-height: 100px;
  align-items: center;
  justify-content: center;
}

.who-error {
  color: #fca5a5;
  font-size: 13px;
}

.who-skel-header {
  height: 24px;
  width: 40%;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.04)
  );
  background-size: 200% 100%;
  animation: phi-shimmer 1.5s infinite;
}

.who-skel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

.who-skel-tile {
  height: 60px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.04)
  );
  background-size: 200% 100%;
  animation: phi-shimmer 1.5s infinite;
}

/* ============================================================
   Executive Dashboard — Overview, Risk Matrix, Team Intel
   ============================================================ */

.eo-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-radius: 18px;
  width: 100%;
  min-width: 0;
  margin-top: 4px;
  background: linear-gradient(
    140deg,
    rgba(99, 102, 241, 0.06),
    rgba(15, 23, 42, 0.55) 45%,
    rgba(15, 23, 42, 0.75) 100%
  );
  border: 1px solid var(--phi-border, rgba(148, 163, 184, 0.16));
  color: var(--phi-text, #e2e8f0);
  box-sizing: border-box;
}

.eo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eo-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--phi-text-strong);
}

.eo-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--phi-text-dim);
  letter-spacing: 0.03em;
}

.eo-link {
  font-size: 12px;
  color: var(--phi-text-dim);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--phi-border);
  transition: color 150ms, background 150ms;
}

.eo-link:hover {
  color: var(--phi-text-strong);
  background: rgba(255, 255, 255, 0.08);
}

/* KPI row — responsive 5-col */
.eo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  min-width: 0;
}

@media (max-width: 1200px) {
  .eo-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .eo-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

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

.eo-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  min-width: 0;
  overflow: hidden;
  background: var(--phi-surface);
  border: 1px solid var(--phi-border);
  border-radius: 10px;
  transition: border-color 150ms;
}

.eo-kpi:hover {
  border-color: rgba(148, 163, 184, 0.32);
}

.eo-kpi-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--phi-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.eo-kpi-value {
  font-size: 22px;
  font-weight: 800;
  font-feature-settings: "tnum";
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eo-kpi-desc {
  font-size: 11px;
  color: var(--phi-text-dim);
  font-weight: 500;
}

/* Trend arrow inside KPI tile */
.eo-trend {
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.eo-trend-up {
  color: #10b981;
}

.eo-trend-down {
  color: #ef4444;
}

.eo-trend-flat {
  color: #94a3b8;
}

/* Narrative block — premium insight quote */
.eo-narrative {
  position: relative;
  padding: 14px 16px 14px 20px;
  background: var(--phi-surface);
  border: 1px solid var(--phi-border);
  border-radius: 10px;
  border-left: 3px solid var(--phi-accent, #6366f1);
  font-size: 13px;
  line-height: 1.6;
  color: var(--phi-text);
}

.eo-narrative strong {
  color: var(--phi-text-strong);
}

/* Two-col layout: Forecast + Insights */
.eo-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-width: 0;
}

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

.eo-card {
  padding: 16px;
  background: var(--phi-surface);
  border: 1px solid var(--phi-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.eo-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--phi-text-strong);
  letter-spacing: 0.02em;
}

/* Delivery Forecast Card */
.eo-dfc {
  gap: 12px;
}

.eo-dfc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.eo-dfc-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.eo-dfc-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--phi-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.eo-dfc-value {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eo-dfc-meta {
  font-size: 11px;
  color: var(--phi-text-dim);
  border-top: 1px solid var(--phi-border);
  padding-top: 10px;
  margin-top: 4px;
}

.eo-dfc-up {
  color: #10b981;
}

.eo-dfc-down {
  color: #ef4444;
}

.eo-dfc-flat {
  color: #94a3b8;
}

/*Project Insights */
.eo-insight-card {
  gap: 10px;
}

.eo-insight-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eo-insight-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border-left: 3px solid var(--eo-insight-border, #6366f1);
  font-size: 12px;
  line-height: 1.5;
}

.eo-insight-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.eo-insight-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--phi-text);
}

/* Risk Matrix Card */
.eo-rm-card {
  overflow: hidden;
}

.eo-rm-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.eo-rm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 500px;
}

.eo-rm-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--phi-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--phi-border);
  white-space: nowrap;
}

.eo-rm-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.eo-rm-row:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.eo-rm-name a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.eo-rm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.eo-rm-project-name {
  font-weight: 600;
  color: var(--phi-text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  display: inline-block;
  vertical-align: middle;
}

.eo-rm-score {
  font-weight: 700;
  font-feature-settings: "tnum";
}

.eo-rm-risk {
  font-weight: 600;
}

.eo-rm-bar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eo-rm-bar-bg {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  max-width: 100px;
  min-width: 40px;
}

.eo-rm-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 600ms ease;
}

.eo-rm-bar-label {
  font-weight: 600;
  font-feature-settings: "tnum";
  color: var(--phi-text);
  min-width: 32px;
}

.eo-rm-due {
  font-weight: 600;
}

.eo-rm-overdue {
  font-feature-settings: "tnum";
  text-align: center;
}

/* Team Intelligence */
.eo-ti-card {
  gap: 14px;
}

.eo-ti-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.eo-ti-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.eo-ti-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--phi-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.eo-ti-stat-value {
  font-size: 20px;
  font-weight: 700;
  font-feature-settings: "tnum";
  overflow: hidden;
  text-overflow: ellipsis;
}

.eo-ti-contributors {
  border-top: 1px solid var(--phi-border);
  padding-top: 12px;
  margin-top: 6px;
}

.eo-ti-contrib-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--phi-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.eo-ti-avatars {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.eo-ti-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--phi-border);
  border-radius: 999px;
  transition: background 150ms ease, border-color 150ms ease;
}

.eo-ti-person:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(148, 163, 184, 0.3);
}

.eo-ti-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.eo-ti-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eo-ti-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.eo-ti-person-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--phi-text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
  white-space: nowrap;
}

.eo-ti-person-stat {
  font-size: 10px;
  color: var(--phi-text-dim);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  font-feature-settings: "tnum";
}

/* Empty state */
.eo-empty {
  text-align: center;
  padding: 40px 20px;
}

.eo-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.eo-empty h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--phi-text-strong);
}

.eo-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--phi-text-dim);
  line-height: 1.5;
  max-width: 380px;
  margin-inline: auto;
}

/* Loading skeleton */
.eo-skel-header {
  height: 22px;
  width: 35%;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.04)
  );
  background-size: 200% 100%;
  animation: phi-shimmer 1.5s infinite;
}

.eo-skel-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
}

.eo-skel-tile {
  height: 60px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.04)
  );
  background-size: 200% 100%;
  animation: phi-shimmer 1.5s infinite;
}

.eo-error {
  align-items: center;
  justify-content: center;
  color: #fca5a5;
  font-size: 13px;
  min-height: 80px;
}

/* Analytics Trends Charts */
.atc-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.atc-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--phi-text-strong, #f1f5f9);
}

.atc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 1100px) {
  .atc-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .atc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.atc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--phi-surface, rgba(15, 23, 42, 0.55));
  border: 1px solid var(--phi-border);
  border-radius: 10px;
}

.atc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.atc-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--phi-text-dim, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.atc-card-avg {
  font-size: 13px;
  font-weight: 700;
  color: var(--phi-text-strong, #f1f5f9);
  font-feature-settings: "tnum";
}

.atc-spark-svg {
  width: 100%;
  height: 56px;
  display: block;
}

.atc-empty {
  font-size: 11px;
  color: var(--phi-text-dim);
  text-align: center;
  padding: 20px 0;
}

.atc-loading {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--phi-text-dim);
}

/* ═══════════════════════════════════════════════════════════
   Executive Command Center — Workspace Health Hero
   ═══════════════════════════════════════════════════════════ */
.ecc-hero {
  position: relative;
  margin-bottom: 20px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.85),
    rgba(30, 27, 75, 0.9)
  );
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.ecc-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 60% at 0% 20%,
      rgba(99, 102, 241, 0.08),
      transparent 60%
    ),
    radial-gradient(
    ellipse 60% 40% at 100% 80%,
    rgba(16, 185, 129, 0.06),
    transparent 50%
  );
  pointer-events: none;
}

.ecc-hero-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 24px 28px;
  flex-wrap: wrap;
}

.ecc-hero-primary {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.ecc-score-ring {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.ecc-score-ring svg {
  display: block;
}

.ecc-score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ecc-hero-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ecc-hero-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ecc-hero-status {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.ecc-hero-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
}

.ecc-hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.ecc-stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ecc-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ecc-stat-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ecc-stat-value {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ecc-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 768px) {
  .ecc-hero-content {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 20px;
  }
  .ecc-hero-primary {
    justify-content: center;
  }
  .ecc-hero-stats {
    justify-content: space-around;
  }
  .ecc-stat {
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Project Timeline (Gantt)
   ═══════════════════════════════════════════════════════════ */
.pt-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.pt-empty h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.pt-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.pt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pt-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pt-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pt-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2), transparent 30%);
}

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

.pt-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.pt-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.pt-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-x: auto;
}

.pt-week-labels {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 0;
}

.pt-week-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 0;
  white-space: nowrap;
}

.pt-timeline-track {
  display: flex;
  position: relative;
  height: 8px;
  margin: 4px 0 12px;
}

.pt-week-segment {
  border-right: 1px solid color-mix(in srgb, var(--border), transparent 60%);
  height: 100%;
}

.pt-week-segment:last-child {
  border-right: none;
}

.pt-today-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #ef4444;
  z-index: 5;
  pointer-events: none;
}

.pt-today-label {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: #ef4444;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pt-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 60%);
}

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

.pt-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  max-width: 220px;
  flex-shrink: 0;
}

.pt-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pt-row-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.pt-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-overdue-badge {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  margin-left: auto;
}

.pt-row-dates {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pt-bar-track {
  flex: 1;
  position: relative;
  height: 24px;
  min-width: 200px;
}

.pt-bar {
  position: absolute;
  top: 6px;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  transition: left 0.3s ease, width 0.3s ease;
}

.pt-bar-inner {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
}

.pt-bar-overdue {
  position: absolute;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
}

/* ═══════════════════════════════════════════════════════════
   Activity Heatmap
   ═══════════════════════════════════════════════════════════ */
.heatmap-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.heatmap-loading {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 13px;
}

.heatmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.heatmap-title-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 3px;
}

.heatmap-legend-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 4px;
}

.heatmap-body {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.heatmap-days {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 20px;
  flex-shrink: 0;
}

.heatmap-days span {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  height: 12px;
  line-height: 12px;
}

.heatmap-grid {
  display: flex;
  gap: 0;
  flex-direction: column;
  flex: 1;
}

.heatmap-months {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
}

.heatmap-month-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  width: 12px;
}

.heatmap-weeks {
  display: flex;
  gap: 3px;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  transition: all 0.1s ease;
  cursor: default;
}

.heatmap-cell:hover {
  transform: scale(1.4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.heatmap-empty {
  background: transparent;
}
.heatmap-0 {
  background: var(--surface-2);
}
.heatmap-1 {
  background: color-mix(in srgb, var(--success), transparent 80%);
}
.heatmap-2 {
  background: color-mix(in srgb, var(--success), transparent 55%);
}
.heatmap-3 {
  background: color-mix(in srgb, var(--success), transparent 30%);
}
.heatmap-4 {
  background: color-mix(in srgb, var(--success), transparent 5%);
}

/* ═══════════════════════════════════════════════════════════
   Workload Balancer
   ═══════════════════════════════════════════════════════════ */
.wlb-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wlb-header {
  display: flex;
  align-items: center;
}

.wlb-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wlb-summary {
  display: flex;
  gap: 16px;
}

.wlb-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  text-align: center;
}

.wlb-stat-value {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.wlb-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wlb-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wlb-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wlb-bar-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 100px;
  flex-shrink: 0;
}

.wlb-bar-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wlb-bar-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.wlb-bar-track {
  flex: 1;
  height: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border), transparent 50%);
  overflow: hidden;
}

.wlb-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.wlb-recs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.wlb-recs-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wlb-rec {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--surface-2), transparent 40%);
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════
   Insights Assistant
   ═══════════════════════════════════════════════════════════ */
.ia-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ia-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ia-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ia-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 85%);
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.ia-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ia-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2), transparent 30%);
  border-left: 3px solid var(--ia-border, #6366f1);
  transition: background 0.15s ease;
}

.ia-item:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 10%);
}

.ia-item-icon {
  font-size: 16px;
  line-height: 1.4;
  flex-shrink: 0;
}

.ia-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.ia-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.ia-item-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.ia-item-action {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2px;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════
   Portfolio Page
   ═══════════════════════════════════════════════════════════ */
.pf-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 4px 0 40px;
}

.pf-hero-skel {
  border-radius: 16px;
  overflow: hidden;
}

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

@media (max-width: 1200px) {
  .pf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.pf-card-skel {
  border-radius: 12px;
  overflow: hidden;
}

/* Hero */
.pf-hero {
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.9),
    rgba(30, 27, 75, 0.95)
  );
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.pf-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 70% 50% at 0% 30%,
      rgba(99, 102, 241, 0.06),
      transparent 60%
    ),
    radial-gradient(
    ellipse 50% 40% at 100% 70%,
    rgba(16, 185, 129, 0.04),
    transparent 50%
  );
  pointer-events: none;
}

.pf-hero-main {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.pf-hero-score {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pf-hero-ring {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.pf-hero-ring svg {
  display: block;
}

.pf-hero-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pf-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pf-hero-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pf-hero-status {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pf-hero-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.pf-hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.pf-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  min-width: 60px;
}

.pf-hero-stat-value {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.pf-hero-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Forecast bar */
.pf-hero-forecast {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pf-hero-forecast-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pf-hero-forecast-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pf-hero-forecast-value {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}

/* Sections */
.pf-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pf-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pf-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pf-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pf-close-btn:hover {
  background: color-mix(in srgb, var(--danger), transparent 85%);
  color: var(--danger);
}

/* Risk Matrix table */
.pf-rm-scroll {
  overflow-x: auto;
}

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

.pf-rm-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.pf-rm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 50%);
  vertical-align: middle;
}

.pf-rm-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

.pf-rm-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 50%);
}

.pf-rm-name a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.pf-rm-name a:hover {
  color: var(--primary);
}

.pf-rm-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.pf-rm-score {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pf-rm-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-rm-bar-fill {
  height: 6px;
  border-radius: 999px;
  transition: width 0.4s ease;
  min-width: 4px;
}

.pf-rm-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pf-rm-overdue {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Portfolio Insights cards */
.pf-insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 1200px) {
  .pf-insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pf-insights-grid {
    grid-template-columns: 1fr;
  }
}

.pf-insight-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--pf-insight-border, #6366f1);
  background: color-mix(in srgb, var(--surface-2), transparent 40%);
}

.pf-insight-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.pf-insight-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════
   PDF Export — Print Styles
   ═══════════════════════════════════════════════════════════ */
.pd-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.pd-export-btn:hover {
  background: color-mix(in srgb, var(--surface-2), transparent 20%);
  border-color: color-mix(in srgb, var(--border), transparent 10%);
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }
  .app-sidebar,
  .app-topbar,
  .pd-header-actions,
  .pd-export-btn,
  .pd-tabs,
  .dash-header-actions,
  .dash-btn,
  .btn,
  .tab-bar,
  .pc-ctx,
  .pf-close-btn,
  .modal-backdrop,
  .modal,
  .toast-container {
    display: none !important;
  }
  .pd-content,
  .dash-content,
  .app-main {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .pd-card,
  .dash-card,
  .chart-card,
  .pc,
  .pf-hero {
    border: 1px solid #ddd !important;
    background: #fff !important;
    break-inside: avoid;
  }
  .pd-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .pf-hero {
    background: #fff !important;
  }
  .pf-hero-stat-value,
  .ecc-stat-value,
  .pf-hero-ring-value,
  .kpi-enhanced-metric {
    color: #000 !important;
  }
  .pf-hero-label,
  .pf-hero-forecast-label,
  .ecc-stat-label,
  .ecc-hero-title {
    color: #666 !important;
  }
  @page {
    margin: 16mm 20mm;
  }
}

/* ═══════════════════════════════════════════════════════════
   Responsive Tweaks for New Features
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .pf-hero-main {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  .pf-hero-score {
    justify-content: center;
  }
  .pf-hero-stats {
    justify-content: space-around;
  }
  .pf-hero-forecast {
    flex-direction: column;
    gap: 12px;
  }
  .pt-row-info {
    min-width: 120px;
    max-width: 140px;
  }
  .pt-bar-track {
    min-width: 100px;
  }
  .pt-week-label {
    font-size: 8px;
  }
  .wlb-bar-label {
    min-width: 70px;
  }
  .wlb-summary {
    flex-wrap: wrap;
  }
  .heatmap-body {
    flex-direction: column;
  }
  .heatmap-days {
    flex-direction: row;
    padding-top: 0;
    gap: 3px;
  }
  .heatmap-days span {
    height: auto;
    width: 12px;
    text-align: center;
  }
  .heatmap-weeks {
    flex-wrap: wrap;
  }
  .pf-rm-table th,
  .pf-rm-table td {
    padding: 6px 8px;
    font-size: 11px;
  }
}

/* ── PD Skeleton Loading ── */
.pd-skeleton {
  display: grid;
  gap: 12px;
}

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

@media (max-width: 768px) {
  .pd-skeleton-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Settings Page ── */
.settings-page {
  display: grid;
  gap: 18px;
  max-width: 100%;
  width: 100%;
}

.settings-page section {
  width: 100%;
}

.section-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.settings-heading {
  margin: 4px 0 0;
  font-size: 32px;
}

.settings-subheading {
  margin: 4px 0 16px;
  font-size: 24px;
}

.settings-card {
  padding: 20px;
  display: grid;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.settings-user-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.settings-user-row > div {
  min-width: 0;
  flex: 1;
}

.settings-muted-text {
  margin: 0;
  color: var(--muted);
}

.settings-field {
  display: grid;
  gap: 6px;
  width: 100%;
}

.settings-error {
  margin-top: 8px;
}

.settings-theme-row {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.settings-theme-row > div p {
  margin: 2px 0 0;
  color: var(--muted);
}

.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.settings-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
  width: 100%;
}

.settings-debug-card {
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 980px) {
  .settings-card {
    padding: 16px;
    gap: 14px;
  }
  .settings-card > * {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
  }
  .settings-actions {
    flex-direction: column;
  }
  .settings-actions .btn,
  .settings-actions a.btn,
  .settings-actions button {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
  .settings-theme-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .settings-theme-row > div:first-child {
    width: 100%;
  }
  .settings-user-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .settings-user-row strong {
    word-break: break-all;
    overflow-wrap: break-word;
  }
  .avatar-upload {
    padding: 12px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .avatar-upload-img {
    width: 60px;
    height: 60px;
  }
  .settings-heading {
    font-size: 26px;
  }
}

@media (max-width: 640px) {
  .settings-heading {
    font-size: 24px;
  }
  .settings-subheading {
    font-size: 20px;
  }
  .settings-card {
    padding: 14px;
    gap: 12px;
  }
  .settings-debug-card {
    padding: 14px;
  }
  .settings-theme-row {
    padding: 12px;
    gap: 12px;
  }
  .avatar-upload {
    padding: 10px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .avatar-upload-img {
    width: 56px;
    height: 56px;
  }
  .avatar-upload-preview {
    max-width: 100%;
    overflow: hidden;
  }
  .avatar-upload-preview p {
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  .settings-heading {
    font-size: 20px;
  }
  .settings-subheading {
    font-size: 18px;
  }
  .settings-card {
    padding: 10px;
    gap: 10px;
  }
  .settings-debug-card {
    padding: 10px;
  }
  .settings-theme-row {
    padding: 10px;
    gap: 10px;
  }
  .avatar-upload {
    padding: 8px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .avatar-upload-img {
    width: 48px;
    height: 48px;
  }
  .settings-page {
    gap: 12px;
  }
}

@media (max-width: 360px) {
  .settings-heading {
    font-size: 18px;
  }
  .settings-card {
    padding: 8px;
    gap: 8px;
  }
  .settings-debug-card {
    padding: 8px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Mobile Responsive Enhancements (768px and below)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .pd-header-top {
    flex-direction: column;
  }
  .pd-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .pd-header-actions .btn,
  .pd-header-actions button {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }
  .pd-title {
    font-size: 22px;
  }
  .pd-desc {
    max-width: 100%;
  }
  .pd-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .pd-kpi {
    padding: 12px 14px;
  }
  .pd-kpi-value {
    font-size: 20px;
  }
  .pd-kpi-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
  }
  .pd-tabs {
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 4px;
  }
  .pd-tab {
    font-size: 12px;
    padding: 0 0 8px;
  }
  .pd-progress-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .pd-progress-stat {
    padding: 8px 6px;
  }
  .pd-progress-stat-value {
    font-size: 16px;
  }
  .pd-member-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .pd-member-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .pd-member-actions select {
    width: 100% !important;
  }
  .pd-member-actions .btn {
    flex: 0;
  }
  .pc-page-header {
    flex-direction: column;
  }
  .pc-page-actions {
    width: 100%;
  }
  .pc-page-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .pc-count-badge {
    font-size: 11px;
    padding: 3px 8px;
  }
  .pc-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .pc-header-left {
    min-width: 0;
    flex: 1;
  }
  .pc-title {
    font-size: 14px;
    max-width: 160px;
  }
  .pc-desc {
    -webkit-line-clamp: 1;
  }
  .pc-meta {
    flex-wrap: wrap;
  }
  .avatar-upload {
    padding: var(--space-md);
  }
  .avatar-upload-img {
    width: 64px;
    height: 64px;
  }
  .avatar-upload-preview p {
    font-size: 13px;
  }
  .pd-header-badges {
    gap: 4px;
  }
  .pd-health {
    font-size: 11px;
    padding: 3px 8px;
  }
  .pd-status-select {
    font-size: 11px;
    padding: 3px 22px 3px 10px;
  }
  .pd-header-dates {
    font-size: 12px;
    gap: 6px;
  }
  .pd-card {
    padding: 14px;
  }
  .pd-card-title {
    font-size: 13px;
    margin-bottom: 10px;
  }
  .pd-tl-text {
    font-size: 12px;
  }
  .pd-tl-time {
    font-size: 10px;
  }
  .pd-task-name {
    font-size: 12px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .pd-task-meta {
    font-size: 10px;
  }
  .pd-task-item {
    padding: 8px 10px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Small Mobile (480px and below)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .pd-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pd-kpi-value {
    font-size: 18px;
  }
  .pd-kpi-sub {
    font-size: 11px;
  }
  .pd-title {
    font-size: 20px;
  }
  .pd-header-actions .btn,
  .pd-header-actions a {
    font-size: 12px;
    padding: 8px 12px;
  }
  .pd-header-actions .btn .material-symbols-outlined,
  .pd-header-actions a .material-symbols-outlined {
    font-size: 16px;
  }
  .pd-tabs {
    gap: 8px;
  }
  .pd-tab {
    font-size: 11px;
  }
  .pd-progress-stat-value {
    font-size: 14px;
  }
  .pd-progress-stat-label {
    font-size: 10px;
  }
  .pd-header-dates {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .pd-header-date-sep {
    display: none;
  }
  .pd-member-actions {
    flex-wrap: wrap;
    gap: 4px;
  }
  .pc-page-actions {
    flex-direction: column;
  }
  .pc-page-actions .btn {
    width: 100%;
  }
  .pc-count-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
  .pc-title {
    font-size: 13px;
    max-width: 120px;
  }
  .pc {
    padding: var(--space-md);
    gap: 10px;
  }
  .pd-header-actions {
    flex-direction: column;
  }
  .pd-header-actions .btn,
  .pd-header-actions button,
  .pd-header-actions a {
    width: 100%;
    justify-content: center;
  }
  .pd-desc {
    font-size: 13px;
  }
  .pd-card {
    padding: 12px;
  }
  .pd-progress-bar {
    height: 6px;
  }
  .pd-progress-meta {
    font-size: 11px;
    flex-direction: column;
    gap: 2px;
  }
  .pd-team-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }
  .avatar-upload {
    padding: var(--space-sm);
  }
  .avatar-upload-img {
    width: 56px;
    height: 56px;
  }
  .avatar-upload-preview p {
    font-size: 12px;
  }
}



/* ═══════════════════════════════════════════════════════════
   Global overflow safety
   ═══════════════════════════════════════════════════════════ */
.app-shell {
  overflow-x: hidden;
}

.settings-page {
  overflow-wrap: break-word;
  word-wrap: break-word;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════
   Task Table Mobile (all pages)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .task-table {
    font-size: 12px;
  }
  .task-table th,
  .task-table td {
    padding: 8px 10px;
  }
  .task-table td:first-child,
  .task-table th:first-child {
    padding-left: 10px;
  }
  .task-table td:last-child,
  .task-table th:last-child {
    padding-right: 10px;
  }
  .task-table .badge {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Page-level responsive fixes
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .task-table th:nth-child(3),
  .task-table td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 480px) {
  .task-table th:nth-child(4),
  .task-table td:nth-child(4) {
    display: none;
  }
}
