/* EPM (Enortial Progress Meter) CSS */
/* Strict Minimal Cream & Charcoal Palette */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-base: #FAFAF9;          /* Main warm off-white background */
  --bg-card: #F5F5F3;          /* Extremely subtly darker warm grey/cream for cards/modals */
  --bg-card-hover: #ECECE9;    /* Active/Hover states */
  --border-primary: #1A1A1A;   /* Pure dark charcoal borders */
  --border-muted: #DCDAD5;     /* Lighter beige/grey borders */
  --text-primary: #111111;     /* Contrast charcoal text */
  --text-muted: #4F4F4C;       /* Secondary grey/brown text */
  --accent-lock: #A19F9A;      /* Muted grey for locked elements */
  
  --font-sans: 'Outfit', sans-serif;
  --transition-smooth: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-subtle: 0 4px 20px rgba(26, 26, 26, 0.04);
  --shadow-active: 0 8px 30px rgba(26, 26, 26, 0.08);
}

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

body {
  background-color: var(--bg-base);
  /* Dotted Spreadsheet Background */
  background-image: radial-gradient(var(--border-muted) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
  touch-action: pan-y;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-primary);
}

/* App Container */
#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.screen:not(#screen-login) {
  padding-bottom: 110px; /* Space for floating navbar */
}

/* Utility Layouts */
.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Screen Transitions */
.screen {
  display: none;
  width: 100%;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.screen.active {
  display: block;
}

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

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

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

.screen.active.slide-in-right {
  animation: slideInRight 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.screen.active.slide-in-left {
  animation: slideInLeft 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Login Screen */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 24px;
}

.brand-logo {
  height: 90px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  margin-bottom: -4px;
  display: block;
}

.header-logo {
  height: 24px;
  width: auto;
  filter: invert(1); /* Inverts white logo to black */
  display: inline-block;
  vertical-align: middle;
}

.brand-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 40px;
  text-align: center;
}

.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-primary);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  box-shadow: var(--shadow-subtle);
  position: relative;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  background: var(--bg-base);
  border: 1.5px solid var(--border-primary);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-smooth);
}

.form-input:focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.btn {
  width: 100%;
  background: var(--text-primary);
  color: var(--bg-base);
  border: 1.5px solid var(--border-primary);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.error-message {
  color: #c73e3e;
  font-size: 0.85rem;
  margin-top: 10px;
  text-align: center;
  font-weight: 500;
}

/* Floating Bottom Navbar */
.floating-navbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(245, 245, 243, 0.95);
  backdrop-filter: blur(16px);
  border: 2px solid var(--border-primary);
  border-radius: 30px;
  padding: 6px;
  display: flex;
  gap: 8px;
  box-shadow: var(--shadow-active);
  z-index: 900;
  width: calc(100% - 32px);
  max-width: 360px;
}

.nav-indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px; /* Dynamically updated in JS */
  width: calc(33.333% - 8px); /* Dynamically updated in JS */
  background: var(--text-primary);
  border-radius: 24px;
  transition: left 0.3s cubic-bezier(0.25, 1, 0.5, 1), width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 0;
  pointer-events: none;
}

.nav-item {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 24px;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition-smooth);
  gap: 4px;
  position: relative;
  z-index: 1;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  transition: var(--transition-smooth);
}

.nav-item.active {
  color: var(--bg-base);
}

.nav-item.active svg {
  stroke: var(--bg-base);
}

/* Header UI Component */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1.5px solid var(--border-primary);
  padding-bottom: 16px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.75px;
}

.refresh-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.refresh-btn:hover {
  background: var(--bg-card-hover);
  transform: rotate(45deg);
}

.refresh-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-primary);
  stroke-width: 2.2;
}

/* ROADMAP PAGE - REVERSE SCROLLING SVG path */
.roadmap-outer-container {
  height: calc(100dvh - 130px);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

.roadmap-inner-scroll {
  /* Taller container to enable scroll. Dynamic height depends on path nodes. */
  height: 1000px;
  width: 100%;
  position: relative;
  padding: 80px 0;
}

.roadmap-svg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.roadmap-svg-canvas path {
  fill: none;
  stroke-linecap: round;
}

.roadmap-svg-canvas .path-bg {
  stroke: var(--border-muted);
  stroke-width: 4;
  stroke-dasharray: 8 8;
}

.roadmap-svg-canvas .path-fg {
  stroke: var(--text-primary);
  stroke-width: 4;
  /* transition is controlled by JS for the draw animation */
}

.roadmap-node {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.node-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 3px solid var(--accent-lock);
  transition: var(--transition-smooth);
  position: relative;
  box-shadow: 0 0 0 4px var(--bg-base);
}

.roadmap-node.completed .node-dot {
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.roadmap-node.active .node-dot {
  background: var(--bg-base);
  border-color: var(--text-primary);
  width: 28px;
  height: 28px;
  animation: pulse-ring 2s infinite;
}

.roadmap-node.locked .node-dot {
  background: var(--bg-card);
  border-color: var(--accent-lock);
  cursor: not-allowed;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0px rgba(17, 17, 17, 0.2); }
  70% { box-shadow: 0 0 0 10px rgba(17, 17, 17, 0); }
  100% { box-shadow: 0 0 0 0px rgba(17, 17, 17, 0); }
}

.node-label-card {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1.5px solid var(--border-primary);
  border-radius: 8px;
  padding: 6px 8px;
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-smooth);
  pointer-events: auto;
  overflow: hidden;
}

.node-side-label {
  position: absolute;
  /* left, top, transform are all set via JS */
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.roadmap-node.locked .node-label-card {
  opacity: 0.6;
  border-color: var(--border-muted);
}

.node-badge {
  display: inline-block;
  flex-shrink: 0;
  font-size: 0.48rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 3px;
  border-radius: 3px;
  border: 1px solid var(--border-primary);
  background: var(--bg-base);
}

.node-title {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 1px;
}

.node-date {
  font-size: 0.55rem;
  color: var(--text-muted);
  font-weight: 500;
}

.node-action-btn {
  margin-top: 4px;
  width: 100%;
  padding: 4px 6px;
  font-size: 0.65rem;
  border-radius: 6px;
  background: var(--text-primary);
  color: var(--bg-base);
  border: 1px solid var(--border-primary);
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.node-action-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.tick-btn {
  background: var(--text-primary);
  color: var(--bg-base);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 0 auto;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease;
}

.tick-btn:hover {
  transform: scale(1.1);
  background: #000;
}

@keyframes pop-in {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); background: #4a8a4a; }
  100% { transform: scale(1); background: #4a8a4a; }
}

.tick-btn.popped {
  animation: pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.tick-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--bg-base);
  stroke-width: 3;
}

.project-status-text {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* OTHERS PAGE */
.others-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trainee-tile {
  background: var(--bg-card);
  border: 1.5px solid var(--border-primary);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-smooth);
}

.trainee-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-active);
}

.tile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.trainee-info {
  display: flex;
  flex-direction: column;
}

.trainee-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.trainee-username {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.trainee-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-primary);
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: capitalize;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.missions-count {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--bg-base);
  border: 1.5px solid var(--border-primary);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}

.missions-val {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.missions-lbl {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.progress-bar-outer {
  flex: 1;
  height: 12px;
  background: var(--bg-base);
  border: 1.5px solid var(--border-primary);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.progress-bar-inner {
  height: 100%;
  background: var(--text-primary);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.tile-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  justify-content: space-between;
}

/* SETTINGS PAGE */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.readonly-box {
  background: var(--bg-card-hover);
  border: 1.5px solid var(--border-muted);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 500;
}

/* ADMIN PANEL */
.admin-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 12px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1.5px solid var(--border-primary);
  padding-bottom: 6px;
}

.admin-section-title svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-primary);
  stroke-width: 2.2;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-user-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-primary);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-subtle);
}

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

.admin-user-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.admin-user-actions .btn {
  padding: 8px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Review approval item card */
.review-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border-primary);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.review-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.review-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.review-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.review-actions button {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8rem;
}

/* Modal Overlay & Modal Sheet */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 17, 17, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-sheet {
  background: var(--bg-card);
  border: 2px solid var(--border-primary);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-active);
  position: relative;
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1.5px solid var(--border-primary);
  padding-bottom: 12px;
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
  stroke-width: 2.2;
}

/* Mission Builder Node List styling */
.builder-node-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  border: 1.5px dashed var(--border-muted);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg-card);
  max-height: 280px;
  overflow-y: auto;
}

.builder-node-item {
  background: var(--bg-base);
  border: 1.5px solid var(--border-primary);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
  cursor: grab;
}

.builder-node-item.dragging {
  opacity: 0.5;
  border-style: dashed;
}

.drag-handle {
  cursor: grab;
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.drag-handle svg {
  width: 18px;
  height: 18px;
}

.builder-node-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.builder-node-row1 {
  display: flex;
  gap: 8px;
  align-items: center;
}

.builder-node-title-input {
  flex: 1;
  border: none;
  border-bottom: 1px solid var(--border-muted);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  padding: 2px 0;
}

.builder-node-title-input:focus {
  border-color: var(--border-primary);
}

.builder-node-type-select {
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  background: var(--bg-base);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 4px;
  outline: none;
}

.builder-node-date-input {
  border: 1px solid var(--border-muted);
  border-radius: 4px;
  background: var(--bg-base);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 2px 4px;
  width: 120px;
}

.remove-node-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  color: #c73e3e;
}

.remove-node-btn svg {
  width: 16px;
  height: 16px;
}

.btn-add-node {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border: 1.5px dashed var(--border-primary);
  margin-bottom: 20px;
  font-weight: 600;
}

.btn-add-node:hover {
  background: var(--bg-card);
}

/* Toast/Notification Banner */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--text-primary);
  color: var(--bg-base);
  border: 1.5px solid var(--border-primary);
  border-radius: 12px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.75rem;
  box-shadow: var(--shadow-active);
  z-index: 1100;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Spreadsheet-like lines details styling */
.spreadsheet-grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -10;
}

/* Loading Spinner Simulation Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(250, 248, 245, 0.7);
  backdrop-filter: blur(2px);
  z-index: 950;
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid var(--border-muted);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.6, 0.2, 0.2, 0.8) infinite;
}

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

/* Trainee Missions History Accordion inside Trainee Form */
.trainee-missions-history {
  border-top: 1.5px solid var(--border-primary);
  padding-top: 14px;
  margin-top: 14px;
}

.history-mission-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border-primary);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.history-mission-header {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.history-mission-header:hover {
  background: var(--bg-card-hover);
}

.history-mission-body {
  padding: 10px;
  background: var(--bg-base);
  border-top: 1.5px solid var(--border-primary);
  display: none;
}

.history-mission-body.active {
  display: block;
}

.history-task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-muted);
}

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

/* Bouncing Deadline Speech Bubble */
.deadline-bubble {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-base);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-subtle);
  z-index: 5;
  animation: bounce 2s infinite;
}

.deadline-bubble::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--text-primary);
  border-right: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

