
/* === IRACEMA CRM v5 DESIGN SYSTEM === */
:root { --primary: #6366f1; --primary-hover: #4f46e5; --accent: #8b5cf6; --success: #10b981; --warning: #f59e0b; --danger: #ef4444; --info: #3b82f6; --bg-dark: #0f0e1a; --bg-card: #1a1833; --bg-surface: #1e1b4b; --text-primary: #f1f5f9; --text-secondary: #94a3b8; --text-muted: #64748b; --border: rgba(255,255,255,0.08); --radius: 12px; --shadow: 0 4px 24px rgba(0,0,0,0.3); }

/* Header Enhancement */
.top-bar, header { background: var(--bg-dark) !important; border-bottom: 1px solid var(--border) !important; }

/* Sign Out Button */
.crm-signout-btn { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); border-radius: 8px; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer; margin-left: 8px; transition: all 0.2s; }
.crm-signout-btn:hover { background: rgba(239,68,68,0.25); }

/* Card Styles */
.crm-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: all 0.2s; }
.crm-card:hover { border-color: rgba(99,102,241,0.3); box-shadow: 0 0 20px rgba(99,102,241,0.1); }

/* Button Styles */
.crm-btn { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; }
.crm-btn-primary { background: var(--primary); color: white; }
.crm-btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.crm-btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.crm-btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.crm-btn-success { background: var(--success); color: white; }
.crm-btn-danger { background: var(--danger); color: white; }

/* Stat Cards */
.crm-stat { text-align: center; padding: 20px; }
.crm-stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.crm-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-top: 4px; }

/* Modal */
.crm-modal-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.6); z-index:9000; display:flex; align-items:center; justify-content:center; }
.crm-modal { background:var(--bg-surface); border:1px solid var(--border); border-radius:16px; padding:24px; width:90%; max-width:600px; max-height:85vh; overflow-y:auto; box-shadow:var(--shadow); }
.crm-modal h2 { margin:0 0 16px; font-size:18px; color:var(--text-primary); }

/* Table Enhancements */
.data-table { width: 100%; }
.data-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }

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

/* AI Chat Widget */
.crm-ai-widget { position:fixed; bottom:20px; right:20px; z-index:8000; }
.crm-ai-toggle { width:56px; height:56px; border-radius:50%; background:linear-gradient(135deg,#6366f1,#8b5cf6); color:white; border:none; font-size:24px; cursor:pointer; box-shadow:0 4px 20px rgba(99,102,241,0.4); transition:all 0.3s; display:flex; align-items:center; justify-content:center; }
.crm-ai-toggle:hover { transform:scale(1.1); box-shadow:0 6px 30px rgba(99,102,241,0.6); }
.crm-ai-panel { position:fixed; bottom:90px; right:20px; width:380px; height:500px; background:var(--bg-surface); border:1px solid var(--border); border-radius:16px; box-shadow:0 20px 60px rgba(0,0,0,0.5); display:none; flex-direction:column; z-index:8001; overflow:hidden; }
.crm-ai-panel.open { display:flex; }
.crm-ai-header { padding:16px; background:linear-gradient(135deg,#6366f1,#8b5cf6); color:white; display:flex; justify-content:space-between; align-items:center; }
.crm-ai-header h3 { margin:0; font-size:15px; }
.crm-ai-messages { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:10px; }
.crm-ai-msg { padding:10px 14px; border-radius:12px; font-size:13px; line-height:1.5; max-width:85%; word-wrap:break-word; }
.crm-ai-msg.bot { background:rgba(99,102,241,0.15); color:var(--text-primary); align-self:flex-start; border-bottom-left-radius:4px; }
.crm-ai-msg.user { background:var(--primary); color:white; align-self:flex-end; border-bottom-right-radius:4px; }
.crm-ai-input-row { padding:12px; border-top:1px solid var(--border); display:flex; gap:8px; }
.crm-ai-input { flex:1; background:rgba(255,255,255,0.05); border:1px solid var(--border); border-radius:8px; padding:10px; color:var(--text-primary); font-size:13px; outline:none; }
.crm-ai-input:focus { border-color:var(--primary); }
.crm-ai-send { background:var(--primary); color:white; border:none; border-radius:8px; padding:10px 14px; cursor:pointer; font-size:13px; }


/* === ANIMATIONS === */
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: calc(200px + 100%) 0; } }

/* === ENHANCED CARDS === */
.view-container .stat-card, .view-container [style*="background:#1a1f35"] {
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.view-container .stat-card:hover, .view-container [style*="background:#1a1f35"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.15) !important;
}

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4a5568; }

/* === SIDEBAR ENHANCEMENTS === */
.sidebar { transition: width 0.3s ease !important; }
.sidebar .nav-item { transition: all 0.15s ease !important; border-radius: 8px !important; margin: 1px 8px !important; }
.sidebar .nav-item:hover { background: rgba(124, 58, 237, 0.08) !important; }
.sidebar .nav-item.active { background: rgba(124, 58, 237, 0.15) !important; border-left: 3px solid #7c3aed !important; }

/* === TABLE ENHANCEMENTS === */
.table tbody tr { transition: background 0.15s ease !important; }
.table tbody tr:hover { background: rgba(124, 58, 237, 0.05) !important; }

/* === BUTTON ENHANCEMENTS === */
.btn, button { transition: all 0.2s ease !important; }
.btn:hover, button:hover { transform: translateY(-1px) !important; }
.btn:active, button:active { transform: translateY(0) !important; }

/* === BADGE ANIMATIONS === */
.badge { animation: fadeIn 0.3s ease; }

/* === INPUT FOCUS EFFECTS === */
input:focus, textarea:focus, select:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
  outline: none !important;
}

/* === MOBILE RESPONSIVENESS ===
   2026-05-14: removed the legacy "collapse to 60px / hide on <480px" rules.
   The hamburger drawer in style.css handles mobile properly now. */
@media (max-width: 768px) {
  .top-bar { padding: 8px 12px !important; }
}

/* === LOADING SKELETON === */
.crm-skeleton {
  background: linear-gradient(90deg, #1a1f35 0%, #242b45 50%, #1a1f35 100%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 6px;
}

/* === TOOLTIP === */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1f35;
  color: #e2e8f0;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 1000;
  border: 1px solid #2d3748;
}

/* === CUSTOM SELECT === */
.crm-select {
  background: #1a1f35 !important;
  color: #e2e8f0 !important;
  border: 1px solid #2d3748 !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  cursor: pointer !important;
}

/* === SIGN OUT BUTTON GLOW === */
.crm-signout-btn, [style*="border: 2px solid #ef4444"] {
  animation: none;
  transition: all 0.3s ease !important;
}
.crm-signout-btn:hover, [style*="border: 2px solid #ef4444"]:hover {
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3) !important;
}

/* === NOTIFICATION BADGE PULSE === */
.badge-danger, .badge[style*="background:#ef4444"], .badge[style*="background: #ef4444"] {
  animation: pulse 2s infinite;
}

/* === PAGE TRANSITIONS === */
.view-container > div {
  animation: fadeIn 0.3s ease;
}
