/* ═══════════════════════════════════════════════
   ماس الإنجاز - تصميم احترافي مع أيقونات 3D
   ═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

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

:root {
  --sidebar-w: 290px;
  --bg-deep:    #07090f;
  --bg-base:    #0d1117;
  --bg-card:    #111827;
  --bg-glass:   rgba(255,255,255,0.04);
  --bg-glass2:  rgba(255,255,255,0.07);
  --border:     rgba(255,255,255,0.08);
  --border2:    rgba(255,255,255,0.12);
  --text1:      #f1f5f9;
  --text2:      #94a3b8;
  --text3:      #4b5563;
  --accent:     #6366f1;
  --accent2:    #8b5cf6;
  --accent3:    #06b6d4;
  --gold:       #f59e0b;
  --green:      #10b981;
  --red:        #ef4444;

  /* 3D Icon gradient palettes */
  --g-blue:   linear-gradient(135deg, #1e40af 0%, #3b82f6 40%, #60a5fa 70%, #93c5fd 100%);
  --g-purple: linear-gradient(135deg, #581c87 0%, #7c3aed 40%, #a78bfa 70%, #c4b5fd 100%);
  --g-cyan:   linear-gradient(135deg, #164e63 0%, #0891b2 40%, #22d3ee 70%, #67e8f9 100%);
  --g-gold:   linear-gradient(135deg, #78350f 0%, #d97706 40%, #fbbf24 70%, #fde68a 100%);
  --g-green:  linear-gradient(135deg, #064e3b 0%, #059669 40%, #34d399 70%, #6ee7b7 100%);
  --g-rose:   linear-gradient(135deg, #881337 0%, #e11d48 40%, #fb7185 70%, #fda4af 100%);
  --g-indigo: linear-gradient(135deg, #1e1b4b 0%, #4338ca 40%, #818cf8 70%, #a5b4fc 100%);
  --g-orange: linear-gradient(135deg, #7c2d12 0%, #ea580c 40%, #fb923c 70%, #fed7aa 100%);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Body ── */
body {
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text1);
  display: flex;
  height: 100vh;
  overflow: hidden;
  direction: rtl;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(99,102,241,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139,92,246,0.05) 0%, transparent 60%);
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(17,24,39,0.98) 0%, rgba(13,17,23,0.98) 100%);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 10;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}

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

/* ── Sidebar Header ── */
.sidebar-header {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.logo { display: flex; align-items: center; gap: 13px; }

.logo-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  /* 3D effect */
  background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 -2px 0 rgba(0,0,0,0.3) inset,
    0 8px 24px rgba(99,102,241,0.4),
    0 2px 4px rgba(0,0,0,0.5),
    0 0 0 1px rgba(99,102,241,0.3);
  transform: perspective(200px) rotateX(5deg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

.logo-icon:hover {
  transform: perspective(200px) rotateX(0deg) translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.2) inset,
    0 -2px 0 rgba(0,0,0,0.3) inset,
    0 16px 40px rgba(99,102,241,0.5),
    0 4px 8px rgba(0,0,0,0.4),
    0 0 0 1px rgba(99,102,241,0.4);
}

.logo-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text1);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.logo-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
  font-weight: 400;
}

/* ── Sidebar Nav ── */
.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 14px 0 8px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Agent Nav Item ── */
.agent-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  position: relative;
}

.agent-nav-item:hover {
  background: var(--bg-glass2);
  border-color: var(--border);
}

.agent-nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.1) inset;
}

.agent-nav-item.active::before {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 3px 0 0 3px;
}

/* 3D Agent Nav Icon */
.agent-nav-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.2s ease;
}

.agent-nav-item:hover .agent-nav-icon {
  transform: scale(1.05) translateY(-1px);
}

.agent-nav-info .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text1);
  line-height: 1.3;
}

.agent-nav-info .role {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
  line-height: 1.2;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text2);
  background: rgba(255,255,255,0.02);
}

.status-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2.5s infinite;
  box-shadow: 0 0 6px rgba(16,185,129,0.6);
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.85); }
}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.hidden { display: none !important; }

/* ══════════════════════════════════════
   WELCOME SCREEN
══════════════════════════════════════ */
.welcome-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 20%, rgba(99,102,241,0.08) 0%, transparent 70%);
}

.welcome-content {
  text-align: center;
  max-width: 860px;
  width: 100%;
}

/* 3D Welcome Icon */
.welcome-icon {
  width: 88px; height: 88px;
  margin: 0 auto 28px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  background: linear-gradient(145deg, #4338ca 0%, #6366f1 45%, #818cf8 80%, #a5b4fc 100%);
  box-shadow:
    0 2px 0 rgba(255,255,255,0.2) inset,
    0 -3px 0 rgba(0,0,0,0.4) inset,
    0 0 0 1px rgba(99,102,241,0.5),
    0 20px 60px rgba(99,102,241,0.4),
    0 8px 20px rgba(0,0,0,0.5),
    4px 4px 12px rgba(0,0,0,0.3),
    -2px -2px 8px rgba(255,255,255,0.05);
  transform: perspective(300px) rotateX(8deg) rotateY(-3deg);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: float3d 4s ease-in-out infinite;
}

@keyframes float3d {
  0%, 100% { transform: perspective(300px) rotateX(8deg) rotateY(-3deg) translateY(0); }
  50% { transform: perspective(300px) rotateX(5deg) rotateY(2deg) translateY(-8px); }
}

.welcome-content h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text1) 0%, var(--text2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.welcome-content p {
  color: var(--text2);
  font-size: 15px;
  margin-bottom: 44px;
  line-height: 1.6;
}

/* ── Agent Cards ── */
.agents-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.agent-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.agent-card:hover {
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px rgba(0,0,0,0.3),
    0 0 0 1px rgba(99,102,241,0.15),
    0 0 30px rgba(99,102,241,0.08);
}

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

/* 3D Card Icon */
.agent-card .card-icon {
  width: 68px; height: 68px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 30px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.agent-card:hover .card-icon {
  transform: perspective(200px) rotateX(-5deg) scale(1.05) translateY(-3px);
}

.agent-card .card-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text1);
  letter-spacing: -0.01em;
}

.agent-card .card-desc {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.6;
}

/* ══════════════════════════════════════
   CHAT SCREEN
══════════════════════════════════════ */
.chat-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Chat Header ── */
.chat-header {
  padding: 14px 24px;
  background: rgba(17,24,39,0.95);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  position: relative;
  z-index: 5;
}

.agent-info { display: flex; align-items: center; gap: 13px; }

.agent-avatar {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.agent-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.agent-desc { font-size: 11px; color: var(--text3); margin-top: 2px; }

.clear-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.clear-btn:hover {
  background: var(--bg-glass2);
  border-color: var(--border2);
  color: var(--text1);
  transform: translateY(-1px);
}

/* ── Messages ── */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 82%;
  animation: msgIn 0.3s ease;
}

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

.message.user { align-self: flex-start; flex-direction: row-reverse; }
.message.assistant { align-self: flex-end; }

.message-avatar {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 4px;
}

.user .message-avatar {
  background: linear-gradient(145deg, #1e3a8a, #1d4ed8);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.1) inset,
    0 4px 12px rgba(29,78,216,0.4);
}

.message-bubble {
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.75;
  max-width: 100%;
}

.user .message-bubble {
  background: linear-gradient(135deg, rgba(30,58,138,0.9), rgba(29,78,216,0.7));
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 12px 4px 12px 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.assistant .message-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.message-bubble strong { font-weight: 700; color: var(--text1); }
.message-bubble code {
  background: rgba(255,255,255,0.08);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #93c5fd;
  border: 1px solid rgba(255,255,255,0.1);
}

.message-bubble pre {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0;
}

.message-bubble pre code { background: none; padding: 0; border: none; }
.message-bubble ul, .message-bubble ol { padding-right: 20px; margin: 8px 0; }
.message-bubble li { margin-bottom: 5px; }
.message-bubble h2 { font-size: 16px; margin: 16px 0 8px; color: var(--text1); }
.message-bubble h3 { font-size: 14px; margin: 12px 0 6px; color: var(--text1); }

.message-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 13px;
}

.message-bubble th, .message-bubble td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: right;
}

.message-bubble th {
  background: rgba(255,255,255,0.05);
  font-weight: 600;
}

.message-bubble tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}

/* ── Thinking Block ── */
.thinking-block {
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(99,102,241,0.05));
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #a78bfa;
}

.thinking-block summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.thinking-block summary::before { content: "💭"; font-size: 13px; }
.thinking-content {
  margin-top: 8px;
  color: #7c8db5;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ── Typing Indicator ── */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 8px 4px;
  align-items: center;
}

.typing-indicator span {
  width: 7px; height: 7px;
  background: var(--text3);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Examples Bar ── */
.examples-bar {
  padding: 10px 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  background: rgba(17,24,39,0.8);
  backdrop-filter: blur(8px);
}

.example-chip {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.example-chip:hover {
  border-color: rgba(99,102,241,0.4);
  color: var(--text1);
  background: rgba(99,102,241,0.1);
}

/* ── Input Area ── */
.input-area {
  padding: 14px 20px 16px;
  background: rgba(17,24,39,0.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 10px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.input-wrapper:focus-within {
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1), 0 4px 20px rgba(0,0,0,0.3);
}

textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text1);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  max-height: 140px;
  direction: rtl;
}

textarea::placeholder { color: var(--text3); }

/* 3D Send Button */
.send-btn {
  background: linear-gradient(145deg, #4338ca 0%, #6366f1 50%, #818cf8 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.2) inset,
    0 -2px 0 rgba(0,0,0,0.3) inset,
    0 6px 20px rgba(99,102,241,0.4),
    0 2px 4px rgba(0,0,0,0.3);
  letter-spacing: -0.01em;
}

.send-btn svg { width: 15px; height: 15px; }

.send-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 -2px 0 rgba(0,0,0,0.3) inset,
    0 10px 28px rgba(99,102,241,0.5),
    0 4px 8px rgba(0,0,0,0.3);
}

.send-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.1) inset,
    0 -1px 0 rgba(0,0,0,0.3) inset,
    0 3px 10px rgba(99,102,241,0.3);
}

.send-btn:disabled {
  background: var(--text3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── History Item ── */
.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.2s;
  border: 1px solid transparent;
  font-size: 12px;
  color: var(--text2);
}

.history-item:hover {
  background: var(--bg-glass);
  border-color: var(--border);
  color: var(--text1);
}

/* ══════════════════════════════════════
   TASKS SCREEN
══════════════════════════════════════ */
.tasks-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(124,58,237,0.05) 0%, transparent 60%);
}

.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.tasks-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text1);
  letter-spacing: -0.02em;
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Task Card */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.2s;
}

.task-card:hover {
  border-color: rgba(124,58,237,0.35);
  transform: translateY(-3px);
  box-shadow:
    0 16px 32px rgba(0,0,0,0.25),
    0 0 0 1px rgba(124,58,237,0.1);
}

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

.task-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.task-card-title { font-weight: 600; color: var(--text1); font-size: 14px; flex: 1; line-height: 1.4; }
.task-card-desc { font-size: 12px; color: var(--text3); margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.task-card-footer { display: flex; justify-content: space-between; align-items: center; }
.task-card-agent { font-size: 11px; color: var(--text3); }

/* Status Badges */
.badge {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-pending { background: rgba(30,41,59,0.8); color: #94a3b8; border: 1px solid rgba(148,163,184,0.15); }
.badge-running { background: rgba(30,58,138,0.5); color: #60a5fa; border: 1px solid rgba(96,165,250,0.2); }
.badge-completed { background: rgba(5,46,22,0.6); color: #4ade80; border: 1px solid rgba(74,222,128,0.2); }
.badge-failed { background: rgba(69,10,10,0.6); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }
.badge-draft { background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(165,180,252,0.2); }

/* Priority */
.priority-low { color: #6b7280; }
.priority-medium { color: #f59e0b; }
.priority-high { color: #ef4444; }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn-primary {
  background: linear-gradient(145deg, #6d28d9 0%, #7c3aed 50%, #8b5cf6 100%);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 -2px 0 rgba(0,0,0,0.25) inset,
    0 6px 18px rgba(124,58,237,0.35);
  letter-spacing: -0.01em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.2) inset,
    0 -2px 0 rgba(0,0,0,0.25) inset,
    0 10px 25px rgba(124,58,237,0.45);
}

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

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text2);
  border: 1px solid var(--border);
  padding: 9px 20px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-glass2);
  border-color: var(--border2);
  color: var(--text1);
}

/* ══════════════════════════════════════
   MODALS
══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlayIn 0.2s ease;
}

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

.modal-box {
  background: linear-gradient(145deg, #111827, #0d1117);
  border: 1px solid var(--border2);
  border-radius: 20px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 40px 80px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.05);
  position: relative;
}

.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-box-lg { width: 720px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 26px 0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text1);
  letter-spacing: -0.01em;
}

.modal-close {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  transition: all 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background: var(--bg-glass2);
  color: var(--text1);
  border-color: var(--border2);
}

.modal-body {
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-body label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.modal-body input,
.modal-body textarea,
.modal-body select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text1);
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
  outline: none;
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.modal-body select option { background: var(--bg-card); }

.modal-footer {
  padding: 16px 26px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}

/* Task Detail */
.detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.detail-meta span { font-size: 12px; }

.task-progress-area {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.progress-label { font-size: 13px; color: #60a5fa; margin-bottom: 10px; font-weight: 600; }
.thinking-block-task { margin-bottom: 10px; }
.thinking-block-task details { font-size: 12px; color: var(--text3); }
.thinking-block-task summary { cursor: pointer; color: #a78bfa; }
.progress-text { font-size: 13px; color: var(--text2); line-height: 1.7; white-space: pre-wrap; max-height: 280px; overflow-y: auto; }

.task-report {
  margin-top: 16px;
  background: rgba(5,46,22,0.2);
  border: 1px solid rgba(74,222,128,0.15);
  border-radius: 12px;
  padding: 16px;
}

.task-report h4 { color: #4ade80; margin: 0 0 12px; font-size: 14px; font-weight: 700; }
#report-content { font-size: 13px; color: var(--text2); line-height: 1.7; white-space: pre-wrap; max-height: 380px; overflow-y: auto; }

/* ══════════════════════════════════════
   3D ICON UTILITY CLASSES
══════════════════════════════════════ */
.icon-3d {
  position: relative;
  border-radius: 14px;
  box-shadow:
    0 2px 0 rgba(255,255,255,0.18) inset,
    0 -3px 0 rgba(0,0,0,0.35) inset,
    0 8px 24px rgba(0,0,0,0.35),
    0 2px 4px rgba(0,0,0,0.4),
    0 0 0 1px rgba(255,255,255,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-3d-blue   { background: var(--g-blue); box-shadow: 0 2px 0 rgba(255,255,255,0.18) inset, 0 -3px 0 rgba(0,0,0,0.35) inset, 0 8px 24px rgba(59,130,246,0.35), 0 2px 4px rgba(0,0,0,0.4), 0 0 0 1px rgba(59,130,246,0.25); }
.icon-3d-purple { background: var(--g-purple); box-shadow: 0 2px 0 rgba(255,255,255,0.18) inset, 0 -3px 0 rgba(0,0,0,0.35) inset, 0 8px 24px rgba(124,58,237,0.35), 0 2px 4px rgba(0,0,0,0.4), 0 0 0 1px rgba(124,58,237,0.25); }
.icon-3d-cyan   { background: var(--g-cyan); box-shadow: 0 2px 0 rgba(255,255,255,0.18) inset, 0 -3px 0 rgba(0,0,0,0.35) inset, 0 8px 24px rgba(6,182,212,0.35), 0 2px 4px rgba(0,0,0,0.4), 0 0 0 1px rgba(6,182,212,0.25); }
.icon-3d-gold   { background: var(--g-gold); box-shadow: 0 2px 0 rgba(255,255,255,0.18) inset, 0 -3px 0 rgba(0,0,0,0.35) inset, 0 8px 24px rgba(217,119,6,0.35), 0 2px 4px rgba(0,0,0,0.4), 0 0 0 1px rgba(217,119,6,0.25); }
.icon-3d-green  { background: var(--g-green); box-shadow: 0 2px 0 rgba(255,255,255,0.18) inset, 0 -3px 0 rgba(0,0,0,0.35) inset, 0 8px 24px rgba(5,150,105,0.35), 0 2px 4px rgba(0,0,0,0.4), 0 0 0 1px rgba(5,150,105,0.25); }
.icon-3d-rose   { background: var(--g-rose); box-shadow: 0 2px 0 rgba(255,255,255,0.18) inset, 0 -3px 0 rgba(0,0,0,0.35) inset, 0 8px 24px rgba(225,29,72,0.35), 0 2px 4px rgba(0,0,0,0.4), 0 0 0 1px rgba(225,29,72,0.25); }
.icon-3d-indigo { background: var(--g-indigo); box-shadow: 0 2px 0 rgba(255,255,255,0.18) inset, 0 -3px 0 rgba(0,0,0,0.35) inset, 0 8px 24px rgba(67,56,202,0.35), 0 2px 4px rgba(0,0,0,0.4), 0 0 0 1px rgba(67,56,202,0.25); }
.icon-3d-orange { background: var(--g-orange); box-shadow: 0 2px 0 rgba(255,255,255,0.18) inset, 0 -3px 0 rgba(0,0,0,0.35) inset, 0 8px 24px rgba(234,88,12,0.35), 0 2px 4px rgba(0,0,0,0.4), 0 0 0 1px rgba(234,88,12,0.25); }

/* Sidebar tasks */
.sidebar-section-title { cursor: pointer; }
.sidebar-section-title:hover { color: var(--text1); }

#sidebar-tasks-list .task-sidebar-item {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  border-radius: 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  border: 1px solid transparent;
}

#sidebar-tasks-list .task-sidebar-item:hover {
  background: var(--bg-glass);
  border-color: var(--border);
  color: var(--text1);
}

/* File preview */
#filePreview {
  padding: 6px 16px;
  background: rgba(17,24,39,0.9);
  border-top: 1px solid var(--border);
}
