/* Agent Teamwork Hub Styling */
:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-glass: rgba(31, 41, 55, 0.6);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
}

/* Top Navbar */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 1.5rem;
  color: var(--accent-cyan);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Navigation Tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-glass);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Main Container */
main {
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.kanban-col {
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 650px;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid var(--border-glass);
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.badge-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--text-primary);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.task-card {
  padding: 0.95rem 1rem;
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s, box-shadow 0.18s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  position: relative;
}

.task-card:hover {
  transform: translateY(-3px);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
}

.task-card.compact {
  padding: 0.65rem 0.85rem;
  gap: 0.25rem;
}

.task-card.compact .task-title {
  font-size: 0.86rem;
  margin-bottom: 0.25rem;
}

.task-card.compact .task-meta {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}

.task-card-completed {
  border-left: 3px solid #10b981 !important;
  background: rgba(16, 185, 129, 0.04);
}

.task-priority {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.priority-urgent { background: rgba(244, 63, 94, 0.2); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.priority-high { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.priority-normal { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.3); }
.priority-low { background: rgba(107, 114, 128, 0.2); color: var(--text-secondary); border: 1px solid rgba(107, 114, 128, 0.3); }

.task-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
  line-height: 1.35;
}

.task-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Status Pills */
.status-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.status-completed { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.status-assigned { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }
.status-in_progress { background: rgba(6, 182, 212, 0.2); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.35); }
.status-backlog { background: rgba(148, 163, 184, 0.2); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.35); }
.status-prerequisites { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.status-review { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }

/* Idea Foundry animation */
.foundry-fade-in {
  animation: foundryGridFade 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes foundryGridFade {
  from { opacity: 0.3; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cal-day-has-props {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Live Comms Chat View */
.chat-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 210px);
}

.channel-list {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.channel-item {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.15s;
}

.channel-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.channel-item.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border-left: 3px solid var(--accent-cyan);
}

.chat-container {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.msg-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.msg-content-wrapper {
  flex: 1;
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.msg-sender {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.msg-role-tag {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  font-weight: 600;
}

.msg-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.msg-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
  background: rgba(31, 41, 55, 0.4);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-input-bar {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 0.75rem;
}

.chat-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.chat-input:focus {
  border-color: var(--accent-cyan);
}

.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #fff;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* Fleet Cards */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.agent-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.agent-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.agent-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.agent-role {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.caps-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cap-tag {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  width: 90%;
  max-width: 600px;
  background: #111827;
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.5rem;
}

/* ============================================================
   Smart Calendar & Dropdown Selector Component
   ============================================================ */
.smart-date-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.date-dropdown {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  min-width: 260px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.date-dropdown:hover, .date-dropdown:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.date-dropdown option {
  background: #111827;
  color: #f3f4f6;
  padding: 0.6rem;
}

.cal-popover-btn {
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  white-space: nowrap;
}

.calendar-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 330px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85), 0 0 15px rgba(6, 182, 212, 0.15);
  border-radius: 12px;
  padding: 1rem;
  z-index: 9999;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: calFadeIn 0.18s ease-out;
}

@keyframes calFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.cal-month-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.cal-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--accent-cyan);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
}

/* Dates with Compiles -> Glowing highlighted! */
.cal-day-compiled {
  background: rgba(16, 185, 129, 0.22) !important;
  border: 1.5px solid #10b981 !important;
  color: #34d399 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.cal-day-compiled::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 5px;
  height: 5px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
}

.cal-day-compiled:hover {
  background: rgba(16, 185, 129, 0.38) !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.75);
  transform: scale(1.08);
}

/* Dates without compiles -> NOT highlighted */
.cal-day-empty {
  color: var(--text-muted);
  opacity: 0.4;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
}

.cal-day-empty:hover {
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Selected Day ring */
.cal-day-selected {
  outline: 2px solid #38bdf8 !important;
  outline-offset: 1px;
}

/* Other month days */
.cal-day-other-month {
  visibility: hidden;
  pointer-events: none;
}

/* Popover Legend */
.cal-legend {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

