:root {
  --bg-dark: #03060f;
  --bg-sidebar: #060a17;
  --bg-card: rgba(10, 16, 32, 0.88);
  --bg-card-hover: rgba(18, 28, 54, 0.95);
  
  --border-color: rgba(0, 240, 255, 0.18);
  --border-glow: rgba(0, 240, 255, 0.5);
  --border-pink: rgba(234, 76, 137, 0.5);
  
  --neon-cyan: #00f0ff;
  --neon-pink: #ea4c89;
  --neon-purple: #9d4edd;
  --neon-green: #00ff9d;
  --neon-gold: #fbbf24;

  --cyber-gradient: linear-gradient(135deg, #00f0ff 0%, #ea4c89 50%, #9d4edd 100%);
  --cyber-gradient-btn: linear-gradient(135deg, #ea4c89 0%, #9d4edd 100%);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --shadow-cyber: 0 12px 40px rgba(0, 0, 0, 0.85);
  --shadow-glow-cyan: 0 0 30px rgba(0, 240, 255, 0.35);
  --shadow-glow-pink: 0 0 30px rgba(234, 76, 137, 0.35);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 240, 255, 0.15) 0px, transparent 55%),
    radial-gradient(at 100% 100%, rgba(234, 76, 137, 0.15) 0px, transparent 55%),
    radial-gradient(at 50% 50%, rgba(157, 78, 221, 0.1) 0px, transparent 65%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Cairo', 'Inter', sans-serif;
  height: 100vh;
  overflow: hidden;
}

.app-shell {
  display: flex;
  height: 100vh;
}

/* Sidebar Sci-Fi */
.sidebar {
  width: 300px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  box-shadow: 6px 0 30px rgba(0, 0, 0, 0.6);
  position: relative;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  background: var(--cyber-gradient);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: white;
  box-shadow: var(--shadow-glow-cyan);
  animation: hudPulse 3s infinite alternate;
}

@keyframes hudPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5)); }
  100% { transform: scale(1.06); filter: drop-shadow(0 0 20px rgba(234, 76, 137, 0.7)); }
}

.brand-info h2 {
  font-size: 1.2rem;
  font-weight: 900;
  background: linear-gradient(90deg, #00f0ff, #ea4c89, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info span {
  font-size: 0.75rem;
  color: var(--neon-cyan);
}

.billing-badge-card {
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid var(--border-glow);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.badge-status {
  font-size: 0.78rem;
  color: var(--neon-cyan);
  font-weight: 700;
}

.project-selector-wrapper {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.2rem;
}

.project-selector-wrapper label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.project-dropdown {
  background: #02040a;
  border: 1px solid var(--border-color);
  color: var(--neon-cyan);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  width: 100%;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: right;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.25);
  color: var(--neon-cyan);
}

.nav-item.active {
  background: var(--cyber-gradient-btn);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  box-shadow: var(--shadow-glow-pink);
}

.badge-count {
  position: absolute;
  left: 0.8rem;
  background: rgba(0, 240, 255, 0.2);
  color: var(--neon-cyan);
  padding: 0.15rem 0.55rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: bold;
}

.sidebar-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.green-dot {
  color: var(--neon-green);
  font-size: 0.6rem;
  margin-left: 0.3rem;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  gap: 1.5rem;
}

/* Top Bar Sci-Fi */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  padding: 1.1rem 1.6rem;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-cyber);
}

.header-project-details h1 {
  font-size: 1.45rem;
  font-weight: 900;
  background: linear-gradient(90deg, #ffffff, #00f0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.category-tag {
  font-size: 0.8rem;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 0.2rem 0.75rem;
  border-radius: 50px;
  display: inline-block;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary { background: var(--cyber-gradient-btn); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow-pink); }

.btn-cyber { background: linear-gradient(135deg, #00f0ff 0%, #0088ff 100%); color: #03060f; }
.btn-cyber:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow-cyan); }

.btn-secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-main); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

.btn-accent { background: rgba(157, 78, 221, 0.2); color: #c084fc; border: 1px solid rgba(157, 78, 221, 0.4); }
.btn-success { background: #10b981; color: white; }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-xs { padding: 0.25rem 0.7rem; font-size: 0.75rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.w-100 { width: 100%; }

/* Tab Pages */
.tab-page {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.tab-page.active {
  display: flex;
}

/* Glassmorphic Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.25rem;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-cyber);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
}

.card-header h3 {
  font-size: 1.15rem;
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.info-group {
  margin-bottom: 1rem;
}

.info-group label {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.35rem;
}

.slogan-box {
  background: rgba(0, 240, 255, 0.08);
  border-right: 3px solid var(--neon-cyan);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-style: italic;
  color: #e0f2fe;
}

.milestone-list {
  padding-right: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.mini-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mini-stat.gold-stat {
  border-color: rgba(251, 191, 36, 0.4);
}

.mini-stat i {
  font-size: 1.9rem;
  color: var(--neon-cyan);
}

.mini-stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mini-stat h3 {
  font-size: 1.45rem;
}

/* Agents Grid Cyber */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: var(--transition);
}

.agent-card:hover {
  transform: translateY(-4px);
  border-color: var(--neon-cyan);
  box-shadow: var(--shadow-glow-cyan);
}

.agent-top {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.agent-avatar {
  font-size: 2.3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.65rem;
  border-radius: 16px;
}

.agent-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.agent-role {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.prompt-preview {
  background: #010308;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.78rem;
  color: var(--neon-green);
  max-height: 85px;
  overflow: hidden;
}

.agent-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

/* WhatsApp Cyber Simulation */
.grid-whatsapp {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 580px;
}

.chat-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
}

.wa-group-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.wa-icon {
  font-size: 2.2rem;
  color: #25d366;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.5rem;
}

.msg {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}

.system-msg {
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  align-self: center;
  text-align: center;
  font-size: 0.82rem;
}

.user-msg {
  background: #0a241a;
  align-self: flex-start;
  border-radius: 14px 14px 14px 0;
  border: 1px solid rgba(37, 211, 102, 0.3);
}

.agent-msg {
  background: #141038;
  align-self: flex-end;
  border-radius: 14px 14px 0 14px;
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.chat-input-area {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.chat-input-area input {
  flex: 1;
  background: #010308;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(1, 3, 8, 0.88);
  backdrop-filter: blur(12px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
  background: #060a17;
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  padding: 1.7rem;
  box-shadow: var(--shadow-glow-cyan);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-control {
  background: #010308;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
}

.form-control:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

/* Data Table Cyber */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.88rem;
}

.data-table th {
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.landing-iframe {
  width: 100%;
  height: 380px;
  background: #010308;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 3000;
}

.toast {
  background: #060a17;
  border: 1px solid var(--neon-cyan);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  box-shadow: var(--shadow-glow-cyan);
}
