@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Orbitron:wght@500;700;900&display=swap');

/* ─── Camaro Redline Theme Variables ───────────────────────────────────────── */

:root {
  --rm-bg:          #030305; /* Pitch Black */
  --rm-surface:     rgba(13, 14, 18, 0.85); /* Dark cockpit panel */
  --rm-card:        rgba(16, 18, 22, 0.9); /* Carbon metal card */
  --rm-card-hover:  rgba(25, 27, 35, 0.95);
  --rm-border:      rgba(230, 0, 0, 0.2); /* Crimson edge highlight */
  --rm-border-mid:  rgba(255, 255, 255, 0.06);
  --rm-ink:         #f8fafc; /* Speedometer readout white */
  --rm-ink-2:       #cbd5e1; /* Carbon silver */
  --rm-mute:        #64748b; /* Muted gauge gray */
  --rm-accent:      #ff1a1a; /* Camaro Redline Red */
  --rm-accent-dim:  rgba(255, 26, 26, 0.12); /* Tail-light halo */
  --rm-accent-text: #ffffff;
  --rm-danger:      #ef4444; /* Warning indicator */
  --rm-success:     #10b981; /* Shift light green */
  --rm-warning:     #f59e0b; /* Check engine yellow */
  --rm-high:        #ff1a1a; /* Redline */
  --rm-medium:      #f97316; /* Mid range */
  --rm-low:         #3b82f6; /* Low gear */
  --rm-shadow:      0 12px 36px rgba(0,0,0,0.8), 0 0 0 1px rgba(255, 26, 26, 0.08);
  --rm-shadow-sm:   0 6px 16px rgba(0,0,0,0.6);
  --rm-glow:        0 0 15px rgba(255, 26, 26, 0.5);
  --rm-nav-bg:      rgba(3, 3, 5, 0.9);
}

/* ─── Reset / Global ──────────────────────────────────────────────────────── */

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

html {
  background-color: var(--rm-bg);
}

body {
  background-color: #040406;
  color: var(--rm-ink);
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

body::before { display: none; }

::selection {
  background: var(--rm-accent);
  color: var(--rm-accent-text);
}

::-webkit-scrollbar        { width: 8px; height: 8px; }
::-webkit-scrollbar-track  { background: rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar-thumb  { background: #1c1d24; border-radius: 99px; border: 2px solid var(--rm-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--rm-accent); }

/* ─── Navigation ──────────────────────────────────────────────────────────── */

.rm-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 65px;
  display: flex;
  align-items: center;
  background: var(--rm-nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 2px solid rgba(230, 0, 0, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.rm-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── Nav Dropdown ────────────────────────────────────────────────────────── */

.rm-dropdown { position: relative; }

.rm-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #0f1015;
  border: 1px solid var(--rm-accent);
  border-radius: 6px;
  box-shadow: var(--rm-shadow);
  min-width: 180px;
  z-index: 150;
  overflow: hidden;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.rm-dropdown-menu.is-open { display: block; }

.rm-dropdown-item {
  display: block;
  width: 100%;
  padding: 11px 16px;
  font-size: 13px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rm-ink-2);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.rm-dropdown-item:last-child { border-bottom: none; }
.rm-dropdown-item:hover { 
  background: var(--rm-accent); 
  color: #ffffff; 
  text-shadow: 0 0 4px #ffffff;
  padding-left: 20px;
}

/* ─── Nav Logo ────────────────────────────────────────────────────────────── */

.rm-nav-logo {
  height: 48px;
  width: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rm-nav-logo:hover {}

@media (max-width: 768px) {
  .rm-nav-logo {
    height: 38px;
  }
}

/* ─── Wordmark ────────────────────────────────────────────────────────────── */

.rm-wordmark {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  user-select: none;
  text-shadow: 0 0 8px rgba(255, 26, 26, 0.6);
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

.rm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  height: 36px;
  padding: 0 16px;
  border-radius: 4px;
  border: 1px solid rgba(230, 0, 0, 0.35);
  background: rgba(10, 10, 15, 0.7);
  color: var(--rm-ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.rm-btn:hover {
  background: rgba(230, 0, 0, 0.15);
  color: #ffffff;
  border-color: var(--rm-accent);
  box-shadow: 0 0 12px rgba(255, 26, 26, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.rm-btn:active { transform: scale(0.97); }

.rm-btn--primary {
  background: linear-gradient(180deg, #d60000 0%, #990000 100%);
  color: #ffffff;
  border-color: #ff3333;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  box-shadow: 0 4px 12px rgba(230, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.rm-btn--primary:hover {
  background: linear-gradient(180deg, #ff1a1a 0%, #c20000 100%);
  box-shadow: 0 0 18px rgba(255, 26, 26, 0.65), inset 0 1px 0 rgba(255,255,255,0.3);
  border-color: #ffffff;
  color: #ffffff;
}

.rm-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--rm-mute);
}

.rm-btn--ghost:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.rm-btn--danger {
  background: linear-gradient(180deg, #b91c1c 0%, #7f1d1d 100%);
  color: #ffffff;
  border-color: #ef4444;
}

.rm-btn--danger:hover {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
  color: #ffffff;
}

.rm-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.rm-btn--sm   { height: 30px; padding: 0 12px; font-size: 10px; }
.rm-btn--icon { width: 30px; height: 30px; padding: 0; border-radius: 4px; }

/* ─── Cards ───────────────────────────────────────────────────────────────── */

.rm-card {
  background: var(--rm-card);
  border: 1px solid var(--rm-border);
  border-radius: 6px;
  padding: 1.5rem;
  box-shadow: var(--rm-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

/* Subtle carbon diagonal stripes on card headers */
.rm-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #ff1a1a;
  box-shadow: 0 1px 6px rgba(255, 26, 26, 0.4);
  opacity: 0.8;
}

.rm-card:hover {
  border-color: var(--rm-accent);
  background: var(--rm-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 20px rgba(255, 26, 26, 0.15);
}

/* ─── Search ──────────────────────────────────────────────────────────────── */

.rm-search-wrap {
  position: relative;
  margin-bottom: 1.75rem;
}

.rm-search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rm-mute);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.rm-search {
  width: 100%;
  height: 46px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  padding: 0 16px 0 46px;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

.rm-search::placeholder { color: var(--rm-mute); }

.rm-search:focus {
  outline: none;
  border-color: var(--rm-accent);
  box-shadow: 0 0 15px rgba(255, 26, 26, 0.25), inset 0 2px 4px rgba(0,0,0,0.6);
}

/* ─── Stage Components ────────────────────────────────────────────────────── */

.stage-number {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--rm-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 3px rgba(255, 26, 26, 0.2);
}

.stage-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: default;
}

/* ─── Progress Bar (Cockpit Gauge Style) ─────────────────────────────────── */

.rm-progress-wrap {
  height: 6px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.rm-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tachometer Redlining Concept */
.rm-progress-fill.prog-empty  { background: rgba(255, 255, 255, 0.03); }
.rm-progress-fill.prog-red    { background: linear-gradient(90deg, #500000 0%, #990000 100%); }
.rm-progress-fill.prog-yellow { background: linear-gradient(90deg, #990000 0%, #d60000 100%); }
.rm-progress-fill.prog-green  { 
  background: linear-gradient(90deg, #d60000 0%, #ff1a1a 100%); 
  box-shadow: 0 0 10px rgba(255, 26, 26, 0.8);
  filter: drop-shadow(0 0 4px #ff1a1a);
}

/* ─── Item Components ─────────────────────────────────────────────────────── */

.rm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  background: rgba(0,0,0,0.12);
  margin-bottom: 2px;
}

.rm-item:hover { 
  background: rgba(230, 0, 0, 0.05); 
  border-color: rgba(230, 0, 0, 0.15);
}

.rm-item.is-completed {
  border-color: rgba(255, 255, 255, 0.02);
  background: rgba(0,0,0,0.2);
}

.rm-item.is-completed .rm-item-text {
  text-decoration: line-through;
  color: var(--rm-mute);
  opacity: 0.6;
}

.rm-sub-item { padding-left: 32px; }

.rm-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.rm-priority-dot.dot-high   { 
  background: #ff1a1a; 
  box-shadow: 0 0 8px #ff1a1a; 
  animation: pulseGlow 1.5s infinite alternate; 
}
.rm-priority-dot.dot-medium { 
  background: #f97316; 
  box-shadow: 0 0 6px #f97316; 
}
.rm-priority-dot.dot-low    { 
  background: #3b82f6; 
}
.rm-priority-dot.dot-none   { 
  background: rgba(255, 255, 255, 0.15); 
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 4px #ff1a1a; }
  100% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 12px #ff1a1a; }
}

.rm-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  overflow: hidden;
}

.rm-item-body::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, transparent, var(--rm-card));
  pointer-events: none;
}

.rm-item:hover .rm-item-body::after {
  background: linear-gradient(to right, transparent, var(--rm-card-hover));
}

.rm-item-text {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--rm-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}

.rm-completed-at {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--rm-mute);
  white-space: nowrap;
  display: block;
}

.rm-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ─── Checkered Flag Completion Button ────────────────────────────────────── */

.flag-item-btn { 
  color: var(--rm-mute); 
  border-color: transparent; 
  background: transparent; 
  transition: all 0.2s ease;
}
.flag-item-btn:hover { 
  color: #ff1a1a; 
  background: transparent; 
  border-color: transparent; 
  transform: scale(1.15);
  filter: drop-shadow(0 0 4px #ff1a1a);
}
.flag-item-btn.is-flagged { 
  color: #ff1a1a; 
  filter: drop-shadow(0 0 6px #ff1a1a);
}
.flag-item-btn.is-flagged:hover { 
  color: var(--rm-mute); 
  background: transparent; 
  border-color: transparent; 
  filter: none;
}

/* ─── Completed Section ───────────────────────────────────────────────────── */

.rm-completed-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin-top: 8px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255,255,255,0.05);
}

.rm-completed-header:hover { 
  background: rgba(230, 0, 0, 0.05); 
  border-color: rgba(230, 0, 0, 0.15);
}

.rm-completed-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rm-mute);
}

.rm-completed-count { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--rm-accent); }

.rm-chevron { width: 14px; height: 14px; transition: transform 0.2s ease; flex-shrink: 0; color: var(--rm-mute); }
.rm-completed-header.is-open .rm-chevron { transform: rotate(90deg); color: var(--rm-accent); }

/* ─── Modal ───────────────────────────────────────────────────────────────── */

.rm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.rm-modal {
  background: linear-gradient(135deg, #0a0b0e 0%, #12131a 100%);
  border: 2px solid var(--rm-border);
  border-radius: 8px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(255, 26, 26, 0.1);
  padding: 1.75rem;
  max-width: 480px;
  width: calc(100% - 2rem);
  margin: auto;
  position: relative;
}

.rm-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #ff1a1a;
  box-shadow: 0 1px 8px rgba(255,26,26,0.5);
}

.rm-modal-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 5px rgba(255, 26, 26, 0.3);
}

.rm-modal-error {
  color: var(--rm-danger);
  font-size: 12px;
  margin-top: 8px;
  font-family: 'Orbitron', sans-serif;
}

.rm-label {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--rm-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.rm-input,
.rm-select,
.rm-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #ffffff;
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.rm-input::placeholder,
.rm-textarea::placeholder { color: var(--rm-mute); }

.rm-input:focus,
.rm-select:focus,
.rm-textarea:focus {
  outline: none;
  border-color: var(--rm-accent);
  box-shadow: 0 0 12px rgba(255, 26, 26, 0.3), inset 0 2px 4px rgba(0,0,0,0.5);
}

.rm-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

.rm-select { appearance: none; -webkit-appearance: none; cursor: pointer; }

.rm-notes-log {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--rm-ink-2);
  line-height: 1.7;
  max-height: 160px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── Toolbar + Layout ────────────────────────────────────────────────────── */

.rm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.rm-toggle-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rm-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.rm-divider { height: 1px; background: rgba(255, 255, 255, 0.05); margin: 16px 0; }

/* ─── Main Container ──────────────────────────────────────────────────────── */

.rm-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ─── Project Cards (Race Panels) ─────────────────────────────────────────── */

.projects-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); 
  gap: 1.5rem; 
}

.project-card { 
  cursor: pointer; 
  display: flex; 
  flex-direction: column; 
}

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

.project-card-footer {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--rm-border);
}

.project-card-name { 
  font-family: 'Orbitron', sans-serif; 
  font-size: 18px; 
  font-weight: 900; 
  color: #ffffff; 
  letter-spacing: 0.02em; 
  line-height: 1.2; 
  cursor: default;
}

.project-card-name:hover { color: var(--rm-accent); text-shadow: 0 0 5px rgba(255,26,26,0.3); }

.project-card-rename { 
  display: none; 
  font-family: 'Orbitron', sans-serif; 
  font-size: 18px; 
  font-weight: 900; 
  letter-spacing: 0.02em; 
  line-height: 1.2; 
  background: transparent; 
  border: none; 
  border-bottom: 2px solid var(--rm-accent); 
  outline: none; 
  color: #ffffff; 
  width: 100%; 
  padding: 0; 
}

.project-name-wrap.is-renaming .project-card-name { display: none; }
.project-name-wrap.is-renaming .project-card-rename { display: block; }

.project-card-date { 
  font-family: 'JetBrains Mono', monospace; 
  font-size: 10px; 
  color: var(--rm-mute); 
  margin-top: 4px; 
}

.project-stats { 
  display: flex; 
  margin-top: 18px; 
  border: 1px solid rgba(230, 0, 0, 0.15); 
  border-radius: 4px; 
  overflow: hidden; 
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.project-stat { 
  flex: 1; 
  padding: 10px 8px; 
  text-align: center; 
  border-right: 1px solid rgba(230, 0, 0, 0.15); 
  background: rgba(0, 0, 0, 0.25);
}

.project-stat:last-child { border-right: none; }

.project-stat-value { 
  font-family: 'Orbitron', monospace; 
  font-size: 18px; 
  font-weight: 900; 
  color: var(--rm-accent); 
  line-height: 1.2; 
  text-shadow: 0 0 5px rgba(255, 26, 26, 0.4);
}

.project-stat-unit { font-size: 11px; color: var(--rm-mute); }
.project-stat-label { 
  font-family: 'Orbitron', sans-serif;
  font-size: 8px; 
  font-weight: 700; 
  color: var(--rm-mute); 
  text-transform: uppercase; 
  letter-spacing: 0.08em; 
  margin-top: 3.5px; 
  min-height: 2.4em;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ─── Roadmap View ───────────────────────────────────────────────────── */

.stage-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.stage-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.stage-header-left { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.stage-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.item-list { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; }
.stage-completed { display: none; }
.stage-completed.visible { display: block; }
.modal-footer-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 1.5rem; }
.search-hidden { display: none !important; }

.drag-handle { 
  cursor: grab; 
  color: var(--rm-mute); 
  display: flex; 
  align-items: center; 
  padding: 0 8px 0 0; 
  flex-shrink: 0; 
}
.drag-handle:hover { color: var(--rm-accent); }
.drag-handle:active { cursor: grabbing; }

.sortable-ghost { 
  opacity: 0.3; 
  background: var(--rm-accent-dim); 
  border: 1px dashed var(--rm-accent); 
  border-radius: 4px; 
}
.stage-card-hidden { display: none !important; }

mark.rm-search-highlight { 
  background: var(--rm-accent-dim); 
  color: #ffffff; 
  border-radius: 2px; 
  padding: 0 2px; 
  border-bottom: 1px solid var(--rm-accent);
}

/* Priority Selector Flags */
.priority-flags { display: flex; gap: 8px; align-items: center; }
.priority-flag-btn { 
  background: rgba(0,0,0,0.3); 
  border: 1px solid rgba(255,255,255,0.05); 
  border-radius: 4px; 
  padding: 6px 8px; 
  cursor: pointer; 
  opacity: 0.45; 
  transition: all 0.15s; 
  line-height: 0; 
}
.priority-flag-btn:hover { 
  opacity: 0.8; 
  border-color: rgba(255,255,255,0.2);
}
.priority-flag-btn.is-active { 
  opacity: 1; 
  border-color: var(--rm-accent); 
  background: var(--rm-accent-dim); 
  box-shadow: 0 0 8px rgba(255, 26, 26, 0.2);
}

/* Breadcrumb HUD */
.rm-breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 1.75rem; }
.rm-breadcrumb-back { 
  font-family: 'Orbitron', sans-serif;
  font-size: 11px; 
  font-weight: 900;
  text-transform: uppercase;
  color: var(--rm-mute); 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  background: none; 
  border: none; 
  padding: 0; 
}
.rm-breadcrumb-back:hover { color: var(--rm-accent); text-shadow: 0 0 4px var(--rm-accent); }
.rm-breadcrumb-sep { color: rgba(230, 0, 0, 0.3); font-family: 'Orbitron', sans-serif; font-size: 14px; }
.rm-breadcrumb-current { 
  font-family: 'Orbitron', sans-serif;
  font-size: 12px; 
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff; 
  text-shadow: 0 0 5px rgba(255,26,26,0.3);
}

/* ─── Login Cockpit Page ──────────────────────────────────────────────────── */

body.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
}

body.login-body::before { display: none; }

body.login-body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.7) 0px,
    rgba(255, 255, 255, 0.7) 60px,
    transparent 60px,
    transparent 90px
  );
  z-index: 0;
  pointer-events: none;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
  z-index: 5;
  position: relative;
}

.login-logo {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 24px;
  filter: drop-shadow(-2px 0 0 black) drop-shadow(2px 0 0 black) drop-shadow(0 -2px 0 black) drop-shadow(0 2px 0 black);
}

.login-wrap .rm-card {
  margin-top: 0;
  background: linear-gradient(135deg, rgba(8, 9, 12, 0.95) 0%, rgba(18, 19, 25, 0.95) 100%);
  border: 2px solid var(--rm-accent);
  box-shadow: 0 25px 60px rgba(0,0,0,0.9), 0 0 30px rgba(255, 26, 26, 0.2);
  border-radius: 8px;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 1.5rem;
}

/* Engine Start Style Login Button */
.login-submit {
  width: 100%;
  height: 48px;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  justify-content: center;
  background: linear-gradient(180deg, #d60000 0%, #800000 100%);
  border-color: #ff3333;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(230, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-submit:hover {
  background: linear-gradient(180deg, #ff1a1a 0%, #b80000 100%);
  box-shadow: 0 0 25px rgba(255, 26, 26, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: #ffffff;
}

.login-error {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--rm-danger);
  margin-top: 14px;
  text-align: center;
  text-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
}

.stage-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.stage-action-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {

  .rm-nav-inner { padding: 0 1rem; }
  .rm-main { padding: 1.5rem 1rem; }
  .rm-modal { padding: 1.5rem 1.25rem; border-radius: 6px; width: 100%; max-width: 100%; }
  .rm-card { padding: 1.25rem 1rem; }
  .reorder-stage-btn,
  .reorder-item-btn { display: none; }
  .login-logo { width: 100%; margin-left: 0; margin-top: 0; }
  .login-wrap .rm-card { margin-top: 0; }
  .rm-modal .rm-textarea { min-height: 70px; max-height: 140px; }
  .stage-date-label { display: none; }
  .rm-modal-backdrop { align-items: flex-start; padding-top: 2rem; }
  .rm-modal { margin: 0; }
}

/* ─── Dashboard Card Mini Gantt Timelines ────────────────────────────────── */

.mini-gantt-card-wrap {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  position: relative;
}

.mini-gantt-rail-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 99px;
  position: relative;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.mini-gantt-rail-bg {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(255, 26, 26, 0.03) 4px,
    rgba(255, 26, 26, 0.03) 8px
  );
}

.mini-gantt-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 99px;
  transition: all 0.25s ease;
  min-width: 4px;
}

.mini-gantt-segment.segment-active {
  background: linear-gradient(90deg, #990000 0%, #ff1a1a 100%);
  box-shadow: 0 0 6px rgba(255, 26, 26, 0.4);
}

.mini-gantt-segment.segment-completed {
  background: linear-gradient(90deg, #0f766e 0%, var(--rm-success) 100%);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.mini-gantt-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  font-weight: 700;
  color: var(--rm-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mini-gantt-dates-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mini-gantt-date-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--rm-mute);
}

/* ─── Direct Date Labels in Gantt Chart ──────────────────────────────────── */

.gantt-bar-label-text {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--rm-mute);
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

.gantt-bar-label-text--item {
  font-size: 9px;
  opacity: 0.85;
}

/* ─── Timeline Tabs ──────────────────────────────────────────────────────── */

.rm-view-tabs {
  display: flex;
  align-items: center;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--rm-border-mid);
  padding-bottom: 0px;
}

.rm-tab-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--rm-mute);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.rm-tab-btn:hover {
  color: #ffffff;
}

.rm-tab-btn.is-active {
  color: #ffffff;
  border-bottom-color: var(--rm-accent);
  text-shadow: 0 0 6px rgba(255, 26, 26, 0.4);
}

.rm-subtab-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
  color: var(--rm-mute);
  cursor: pointer;
  transition: all 0.15s ease;
}

.rm-subtab-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

.rm-subtab-btn.is-active {
  color: #ffffff;
  border-color: var(--rm-accent);
  background: var(--rm-accent-dim);
  box-shadow: 0 0 8px rgba(255, 26, 26, 0.15);
}

/* ─── Gantt Chart ────────────────────────────────────────────────────────── */

.gantt-chart-wrap {
  background: var(--rm-card);
  border: 1px solid var(--rm-border);
  border-radius: 6px;
  box-shadow: var(--rm-shadow);
  overflow-x: auto;
  position: relative;
}

.gantt-grid-header {
  display: flex;
  border-bottom: 1px solid var(--rm-border-mid);
  background: rgba(0, 0, 0, 0.2);
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--rm-mute);
}

.gantt-cell-label-header {
  width: 250px;
  min-width: 250px;
  padding: 12px 16px;
  border-right: 1px solid var(--rm-border-mid);
  display: flex;
  align-items: center;
}

.gantt-cell-track-header {
  flex: 1;
  position: relative;
  height: 38px;
}

.gantt-grid-label {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--rm-mute);
}

.gantt-chart-body {
  position: relative;
}

.gantt-grid-lines {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 250px;
  right: 0;
  pointer-events: none;
}

.gantt-grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 1px dashed rgba(255, 255, 255, 0.04);
}

.gantt-grid-line.line-today {
  border-left: 1.5px solid var(--rm-accent);
  filter: drop-shadow(0 0 3px var(--rm-accent));
  opacity: 0.8;
  z-index: 10;
}

.gantt-grid-line.line-today .today-tag {
  position: absolute;
  top: 2px;
  left: 4px;
  background: var(--rm-accent);
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  box-shadow: 0 0 6px rgba(255, 26, 26, 0.5);
}

.gantt-rows-container {
  position: relative;
  z-index: 1;
}

.gantt-row {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: background 0.15s ease;
  min-height: 40px;
}

.gantt-row:hover {
  background: rgba(255, 255, 255, 0.01);
}

.gantt-cell-label {
  width: 250px;
  min-width: 250px;
  padding: 8px 16px;
  border-right: 1px solid var(--rm-border-mid);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  overflow: hidden;
}

.stage-row .gantt-cell-label {
  cursor: pointer;
}

.stage-row .gantt-cell-label:hover {
  background: rgba(230, 0, 0, 0.03);
}

.gantt-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.gantt-chevron svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
  color: var(--rm-mute);
}

.gantt-chevron.is-open svg {
  transform: rotate(90deg);
  color: var(--rm-accent);
}

.gantt-stage-num {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 900;
  color: var(--rm-accent);
  text-transform: uppercase;
  flex-shrink: 0;
}

.gantt-title-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-item-text {
  font-size: 12px;
  color: var(--rm-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-cell-track {
  flex: 1;
  padding: 8px 0;
  position: relative;
  display: flex;
  align-items: center;
}

.gantt-bar-container {
  position: relative;
  width: 100%;
  height: 20px;
}

.gantt-bar {
  position: absolute;
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  min-width: 8px;
  transition: all 0.3s ease;
}

.gantt-bar.bar-active {
  background: linear-gradient(90deg, #990000 0%, #d60000 100%);
  border: 1px solid #ff3333;
  box-shadow: 0 0 10px rgba(230, 0, 0, 0.2);
}

.gantt-bar.bar-completed {
  background: linear-gradient(90deg, #0f766e 0%, var(--rm-success) 100%);
  border: 1px solid #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.gantt-bar-progress {
  font-size: 8px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  white-space: nowrap;
  overflow: hidden;
}

.gantt-bar--item {
  height: 10px;
  margin-top: 5px;
  border-radius: 2px;
  padding: 0;
  box-shadow: none;
}

.gantt-bar.bar-item-active {
  background: linear-gradient(90deg, rgba(230, 0, 0, 0.3) 0%, rgba(255, 26, 26, 0.6) 100%);
  border: 1px solid rgba(255, 26, 26, 0.4);
}

.gantt-bar.bar-item-completed {
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.3) 0%, rgba(16, 185, 129, 0.6) 100%);
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.gantt-sub-row .gantt-cell-label {
  border-left: 3px solid rgba(255, 255, 255, 0.02);
}

/* ─── Activity Feed ──────────────────────────────────────────────────────── */

.feed-timeline {
  position: relative;
  padding: 1rem 0;
  margin-left: 20px;
}

.feed-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 2px;
  background: var(--rm-border-mid);
}

.feed-item {
  position: relative;
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.feed-item:last-child {
  margin-bottom: 0;
}

.feed-item-time {
  width: 150px;
  min-width: 150px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--rm-mute);
  padding-top: 6px;
}

.feed-item-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1015;
  border: 1px solid var(--rm-border);
  z-index: 2;
  font-size: 12px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.badge-project {
  border-color: #cbd5e1;
  color: #cbd5e1;
  box-shadow: 0 0 8px rgba(203, 213, 225, 0.15);
}

.badge-stage-add {
  border-color: var(--rm-warning);
  color: var(--rm-warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}

.badge-stage-done {
  border-color: var(--rm-success);
  color: var(--rm-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.badge-item-add {
  border-color: var(--rm-low);
  color: var(--rm-low);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}

.badge-item-done {
  border-color: var(--rm-success);
  color: var(--rm-success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.feed-item-card {
  flex: 1;
  background: var(--rm-card);
  border: 1px solid var(--rm-border);
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: var(--rm-shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.feed-item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--rm-border-mid);
}

.feed-item-card:hover {
  border-color: var(--rm-accent);
  background: var(--rm-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--rm-shadow);
}

.feed-item-card.view-item-btn:hover::before {
  background: var(--rm-accent);
}

.feed-item-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.feed-item-desc {
  font-size: 11px;
  color: var(--rm-mute);
}

@media (max-width: 768px) {
  .feed-timeline::before {
    left: 10px;
  }
  .feed-item {
    flex-direction: column;
    gap: 8px;
    padding-left: 28px;
  }
  .feed-item-time {
    width: auto;
    text-align: left;
    padding-top: 0;
  }
  .feed-item-badge {
    position: absolute;
    left: -6px;
    top: 18px;
    width: 24px;
    height: 24px;
    font-size: 9px;
  }
}

/* ─── Project Archiving & Dashboard Sections ─────────────────────────────── */

.project-section {
  margin-bottom: 2.5rem;
}

.project-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: var(--rm-accent);
  text-shadow: 0 0 10px rgba(255, 26, 26, 0.6);
  margin-bottom: 2.2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  user-select: none;
}

.project-section-header span {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 15px var(--rm-accent);
}

.header-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(230, 0, 0, 0.35) 0%, rgba(230, 0, 0, 0.02) 100%);
  box-shadow: 0 1px 2px rgba(230, 0, 0, 0.1);
}

.project-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 1rem;
}

.complete-project-btn {
  border-color: rgba(255, 26, 26, 0.45) !important;
  color: var(--rm-ink) !important;
}

.complete-project-btn:hover {
  background: var(--rm-accent) !important;
  color: #ffffff !important;
  box-shadow: var(--rm-glow);
}

.unarchive-project-btn {
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--rm-mute) !important;
}

.unarchive-project-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--rm-ink) !important;
}
