/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Cairo:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f3f4f6;
  --bg-tertiary: #e5e7eb;
  --bg-surface: #ffffff;
  --bg-hover: #f1f5f9;
  --text-primary: #475569;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #1e293b;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-hover: #1d4ed8;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warn: #d97706;
  --warn-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --info: #0891b2;
  --info-light: #ecfeff;
  --sidebar-w: 250px;
  --topbar-h: 60px;
  --radius: 4px;
  --radius-sm: 2px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  font-family: 'Inter', 'Cairo', sans-serif;
  font-size: 13.5px;
  color: var(--text-primary);
}

html, body { height: 100%; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
body { background: var(--bg-secondary); overflow: hidden; color: var(--text-primary); }

/* Global Subtle Scrollbar (Perfex Style) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== LOGIN (Perfex Style) ===== */
.login-screen {
  position: fixed; inset: 0; background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.login-wrapper {
  width: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeUp 0.4s ease;
}

.login-header-area {
  margin-bottom: 25px;
  text-align: center;
}

.login-logo-text {
  font-size: 32px;
  font-weight: 800;
  color: #1e293b;
  text-align: center;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.login-logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; font-size: 22px; font-weight: 700;
}

.login-title-main { font-size: 24px; font-weight: 700; color: #334155; text-align: center; margin-bottom: 8px; }
.login-sub-text { font-size: 14px; color: #64748b; text-align: center; margin-bottom: 10px; }

.login-card {
  background: #fff; border-radius: 4px; padding: 40px;
  width: 100%; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.form-label-perfex { font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 8px; display: block; }
.form-input-perfex {
  width: 100%; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 4px;
  font-size: 14px; margin-bottom: 20px; transition: all 0.2s; outline: none;
  font-family: inherit;
}
.form-input-perfex:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

.btn-login-perfex {
  background: #1e293b; color: #fff; width: 100%; padding: 12px; border: none;
  border-radius: 4px; font-weight: 700; cursor: pointer; font-size: 15px; transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.btn-login-perfex:hover { background: #0f172a; }

.forgot-link { color: #64748b; font-size: 13px; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

.login-error { background: #fef2f2; color: #dc2626; padding: 12px; border-radius: 4px; font-size: 13px; margin-bottom: 20px; text-align: center; border: 1px solid #fee2e2; }

/* Perfex Style Alerts */
.alert-danger-perfex {
  background-color: #fcf2f2;
  color: #d33d3d;
  border: 1px solid #f9dbdb;
  border-left: 5px solid #d33d3d;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
}
.login-hint { font-size: 11px; color: var(--text-tertiary); text-align: center; margin-top: 16px; line-height: 1.8; }

/* ===== LAYOUT ===== */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ===== SIDEBAR (Flex Flow Push) ===== */
.sidebar {
  width: var(--sidebar-w) !important;
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; 
  position: relative !important; 
  height: calc(100% - var(--topbar-h)) !important;
  margin-top: var(--topbar-h) !important;
  z-index: 10001 !important; 
  margin-right: calc(-1 * var(--sidebar-w)) !important;
  visibility: hidden !important;
  border-left: 1px solid #e2e8f0 !important;
  overflow: visible !important; /* Allow dropdown to be seen */
}
.sidebar.open { 
  margin-right: 0 !important; 
  visibility: visible !important;
  box-shadow: -2px 0 15px rgba(0,0,0,0.05) !important; 
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 20px; border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}
.brand-logo {
  width: 40px; height: 40px; border-radius: 6px; background: #2563eb;
  color: #fff; font-weight: 800; font-size: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.topbar-brand { display: flex; align-items: center; gap: 0; }
.brand-name { font-size: 19px; font-weight: 800; color: #1e293b; letter-spacing: -0.5px; white-space: nowrap; }
.brand-sub { font-size: 10px; color: #64748b; margin-top: 1px; text-transform: uppercase; letter-spacing: 0.05em; display: none; }

.sidebar-nav { 
  flex: 1 !important; 
  padding: 5px 0 !important; 
  overflow-y: auto !important; 
  direction: ltr !important; /* Force scrollbar to left */
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}
.sidebar-nav > * { direction: rtl !important; } /* Restore content direction */

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

.nav-section { margin-bottom: 0px !important; }
#sidebar .nav-label {
  font-size: 11px !important; text-transform: uppercase !important; letter-spacing: 0.05em !important;
  color: #94a3b8 !important; padding: 10px 20px 4px !important; display: block !important; 
  font-weight: 700 !important; opacity: 0.8 !important; background: #ffffff !important;
  line-height: 1 !important;
}
#sidebar .nav-item {
  display: flex !important; align-items: center !important; gap: 12px !important;
  padding: 7px 20px !important;
  color: #4b5563 !important; text-decoration: none !important;
  font-size: 13px !important; font-weight: 500 !important;
  transition: all 0.1s ease !important; cursor: pointer !important;
  position: relative !important;
  background: #ffffff !important;
  border-right: 3px solid transparent !important;
  line-height: 1.1 !important;
}

#sidebar .nav-item:hover, #sidebar .nav-item.active { 
  background: #f3f4f6 !important; 
  color: #1e293b !important; 
}

#sidebar .nav-item.active { 
  border-right: 3px solid #2563eb !important;
  font-weight: 700 !important;
}

#sidebar .nav-icon { 
  font-size: 16px !important; width: 22px !important; text-align: center !important; 
  flex-shrink: 0 !important; color: #6b7280 !important; 
}

#sidebar .nav-item:hover .nav-icon, #sidebar .nav-item.active .nav-icon { color: #2563eb !important; opacity: 1 !important; }
#sidebar .nav-text { color: inherit !important; }

/* Submenu Styling */
.submenu { background: #ffffff !important; display: none; }
.submenu.show { display: block !important; }
.submenu-item {
  padding: 8px 45px 8px 20px !important;
  font-size: 13px !important;
  color: #64748b !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  background: #ffffff !important;
}
.submenu-item:hover {
  background: #f3f4f6 !important;
  color: #1e293b !important;
  padding-right: 50px !important;
}
.nav-badge {
  margin-right: auto; background: var(--danger); color: #fff;
  font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600;
}

/* ===== SIDEBAR PROFILE CARD (Perfex Style - Premium) ===== */
.perfex-profile-card {
  margin: 15px 12px 25px 12px;
  padding: 10px 12px;
  background: #f0f2f5; /* Perfex Light Grey Background */
  border: 1px solid #dce1e7;
  border-radius: 4px; /* Perfex uses smaller radius */
  position: relative;
  z-index: 10; /* Ensure it's above nav items */
  transition: all 0.2s ease;
}
.perfex-profile-card:hover {
  background: #e4e7ed;
  border-color: #cbd5e1;
}
.pp-inner {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.pp-avatar {
  width: 34px; height: 34px; border-radius: 50%; /* Typical Perfex is circular */
  background: #475569;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.pp-info { flex: 1; min-width: 0; }
.pp-name { 
  font-size: 13px; font-weight: 700; color: #334155; 
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
  margin-bottom: 0px; line-height: 1.2;
}
.pp-role { 
  font-size: 11px; color: #64748b; 
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.pp-chevron { color: #94a3b8; font-size: 10px; margin-right: auto; }

/* Dropdown */
.pp-dropdown {
  position: absolute; top: 100%; right: 0; left: 0;
  background: #fff; border-radius: 4px; box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  display: none; z-index: 1000; margin-top: 5px; overflow: hidden;
  border: 1px solid #dce1e7;
  animation: fadeIn 0.2s ease;
}
.pp-dropdown.show { display: block !important; }
.pp-drop-item {
  display: block; padding: 8px 15px; color: #4b5563; text-decoration: none; font-size: 13px;
  transition: all 0.2s; border-bottom: 1px solid #f1f5f9;
}
.pp-drop-item:last-child { border-bottom: none; }
.pp-drop-item:hover { background: #f8fafc; color: #2563eb; padding-right: 20px; }
.pp-drop-item.danger { color: #dc2626; }
.pp-drop-item.danger:hover { background: #fef2f2; }
.pp-divider { height: 1px; background: #e2e8f0; }

/* ===== TOPBAR ===== */
.topbar {
  background: #fff !important;
  border-bottom: 1px solid var(--border) !important;
  display: flex !important; align-items: center !important; justify-content: space-between !important;
  padding: 0 !important; height: var(--topbar-h) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
  position: fixed !important; top: 0 !important; right: 0 !important; 
  width: 100% !important;
  z-index: 10002 !important; 
  transition: none !important;
}

/* Three-Zone Layout */
.topbar-brand-area {
  display: flex; align-items: center; gap: 8px;
  width: 230px; padding-right: 15px; height: 100%;
}
.topbar-center-area {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.topbar-utilities-area {
  display: flex; align-items: center; gap: 20px; padding-left: 20px; height: 100%;
}

/* Center: Search & Plus */
.topbar-search-wrap {
  position: relative; width: 280px;
}
.search-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: #94a3b8; pointer-events: none;
}
.topbar-search-input {
  width: 100%; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px;
  padding: 8px 35px 8px 12px; font-size: 13px; color: #334155; transition: all 0.2s;
}
.topbar-search-input:focus {
  background: #fff; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); outline: none;
}
.perfex-plus-btn {
  background: #2563eb; color: #fff; border: none; width: 32px; height: 32px;
  border-radius: 50%; font-size: 20px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(37,99,235,0.2);
  transition: all 0.2s;
}
.perfex-plus-btn:hover { background: #1d4ed8; transform: scale(1.05); }

.content {
  flex: 1;
  padding: 25px !important;
  box-sizing: border-box !important;
  overflow-y: auto;
  direction: ltr !important; /* Force scrollbar to left */
  background: var(--bg-secondary);
}
.content > * { direction: rtl !important; } /* Restore content direction */

.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.content::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Left: Links & Icons */
.topbar-nav-links { display: flex; gap: 15px; }
.tp-nav-link {
  text-decoration: none; font-size: 13px; color: #64748b; font-weight: 500;
  transition: color 0.2s;
}
.tp-nav-link:hover { color: #1e293b; }

.topbar-icons-group { display: flex; align-items: center; gap: 15px; }
.tp-icon-btn {
  background: none; border: none; padding: 6px; cursor: pointer; position: relative;
  color: #64748b; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.tp-icon-btn svg { width: 20px; height: 20px; }
.tp-icon-btn:hover { color: #1e293b; background: #f1f5f9; border-radius: 50%; }

.tp-notif-badge {
  position: absolute; top: 0; left: 0; background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 800; min-width: 15px; height: 15px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.tp-avatar {
  width: 32px; height: 32px; background: #e2e8f0; color: #475569;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; cursor: pointer; border: 2px solid transparent;
  transition: all 0.2s;
}
.tp-avatar:hover { border-color: #3b82f6; }
/* REMOVED ALL SHIFT RULES FOR TOPBAR */
.topbar-left-side {
  padding: 0 18px 0 15px; border: none !important; height: 100%;
}
.topbar-brand {
  display: flex; align-items: center; gap: 8px;
  margin-right: 0 !important;
  padding-right: 15px !important; 
  padding-left: 15px;
  border: none !important; /* Separator removed */
  height: 100%;
}
.topbar-brand .brand-logo {
  width: 36px; height: 36px; border-radius: 6px; background: #1e293b;
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.topbar-brand .brand-name { font-size: 20px; font-weight: 800; color: #1e293b; letter-spacing: -0.5px; }
.menu-btn {
  background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 22px; padding: 6px; color: #64748b; border-radius: 6px; transition: 0.2s;
}
.menu-btn:hover { background: #f1f5f9; color: #1e293b; }
.page-title { font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; }
.topbar-right { margin-right: auto; display: flex; align-items: center; gap: 15px; padding: 0 24px; }

/* ===== CONTENT ===== */
.content { 
  flex: 1 !important; overflow-y: auto !important; padding: 10px 15px !important;
  margin-right: 0 !important; 
  margin-top: var(--topbar-h) !important;
  width: 100% !important;
  height: calc(100vh - var(--topbar-h)) !important;
  transition: none !important;
  direction: rtl !important; 
}
#app:has(.sidebar:hover) .content { margin-right: 0 !important; width: 100% !important; }

/* Global Scrollbar Style */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  padding: 9px 18px; border-radius: 9px; font-size: 13px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: all 0.15s; font-family: inherit;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-strong);
  padding: 8px 16px; border-radius: 9px; font-size: 13px;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.btn-outline:hover { background: var(--bg-secondary); }
.btn-success { background: var(--success); color: #fff; border: none; padding: 7px 14px; border-radius: 8px; font-size: 12px; cursor: pointer; font-family: inherit; }
.btn-danger { background: var(--danger); color: #fff; border: none; padding: 7px 14px; border-radius: 8px; font-size: 12px; cursor: pointer; font-family: inherit; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== CARDS ===== */
.card {
  background: #ffffff; border-radius: 4px; border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-bottom: 25px; overflow: hidden;
}
.card-header {
  padding: 15px 20px; border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 16px; font-weight: 700; color: #1e293b; }

/* ===== KPI GRID ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 25px; }
.kpi-card {
  background: #fff; padding: 24px 20px; border-radius: 4px;
  border: 1px solid #e2e8f0; position: relative; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03); display: flex; flex-direction: column; gap: 5px;
}
.kpi-card::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 4px;
  background: #3b82f6;
}
.kpi-card.green::after { background: #10b981; }
.kpi-card.warn::after { background: #f59e0b; }
.kpi-card.cyan::after { background: #06b6d4; }
.kpi-label { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 26px; font-weight: 800; color: #1e293b; }
.kpi-sub { font-size: 11px; color: #94a3b8; }
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: right; padding: 12px 12px;
  color: #475569; font-weight: 600; font-size: 12px;
  border-bottom: 1px solid #f1f5f9; background: #f8fafc;
  white-space: nowrap;
}
thead th:first-child { border-radius: 0 8px 0 0; }
thead th:last-child { border-radius: 8px 0 0 0; }
tbody td { padding: 12px 12px; border-bottom: 1px solid var(--border); color: var(--text-primary); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--bg-hover); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap;
}
.badge-success { background: var(--success-light); color: #15803d; }
.badge-warn { background: var(--warn-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #1e40af; }
.badge-gray { background: var(--bg-tertiary); color: var(--text-secondary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-cyan { background: var(--cyan-light); color: #0e7490; }

/* ===== PROGRESS ===== */
.progress-row { margin-bottom: 14px; }
.progress-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 6px; }
.progress-track { height: 7px; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 1s cubic-bezier(.4,0,.2,1); }
.progress-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* ===== BAR CHART ===== */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 80px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bar-col .bar { width: 100%; border-radius: 5px 5px 0 0; min-height: 4px; }
.bar-col .bar-val { font-size: 10px; color: var(--text-secondary); }
.bar-col .bar-lbl { font-size: 10px; color: var(--text-tertiary); }

/* ===== PIPELINE ===== */
.pipeline-board { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.pipeline-col { background: var(--bg-secondary); border-radius: 12px; padding: 14px; min-height: 350px; }
.pipeline-col-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pipeline-col-title { font-size: 13px; font-weight: 600; }
.pipeline-col-count {
  font-size: 11px; background: var(--bg-primary);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 2px 9px; color: var(--text-secondary);
}
.deal-card {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: pointer;
  transition: all 0.15s;
}
.deal-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px); }
.deal-name { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.deal-service { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.deal-footer { display: flex; justify-content: space-between; align-items: center; }
.deal-value { font-size: 12px; font-weight: 600; color: var(--success); }
.deal-rep { font-size: 10px; color: var(--text-tertiary); }

/* ===== FUNNEL ===== */
.funnel { padding: 8px 0; }
.funnel-step { margin-bottom: 12px; }
.funnel-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.funnel-bar { height: 32px; border-radius: 6px; display: flex; align-items: center; padding: 0 12px; font-size: 12px; font-weight: 600; color: #fff; transition: width 1s; }

/* ===== EMPLOYEE CARD ===== */
.emp-profile { display: flex; align-items: center; gap: 10px; }
.emp-info .emp-name { font-size: 13px; font-weight: 500; }
.emp-info .emp-meta { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }

/* ===== LEADERBOARD ===== */
.leaderboard-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.leaderboard-item:last-child { border-bottom: none; }
.rank-badge { width: 32px; text-align: center; font-size: 20px; flex-shrink: 0; }
.leaderboard-stats { margin-right: auto; text-align: left; }
.leaderboard-revenue { font-size: 15px; font-weight: 700; color: var(--success); }
.leaderboard-calls { font-size: 11px; color: var(--text-secondary); }

/* ===== ACTIVITY ===== */
.activity-feed { }
.activity-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.activity-body { flex: 1; }
.activity-text { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.activity-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.activity-badge { flex-shrink: 0; }

/* ===== FORM ===== */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; display: block; font-weight: 500; }
.form-input {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 13px; font-family: inherit; transition: border-color 0.15s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); background: var(--bg-primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.form-select {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 13px; font-family: inherit; outline: none; cursor: pointer;
  transition: border-color 0.15s;
}
.form-select:focus { border-color: var(--accent); }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-primary); border-radius: 16px;
  padding: 26px; width: 540px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-md); animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; cursor: pointer; font-size: 18px;
  color: var(--text-secondary); padding: 6px; border-radius: 8px; transition: all 0.15s;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: #fff; padding: 12px 24px;
  border-radius: 20px; font-size: 13px; opacity: 0;
  transition: opacity 0.3s; z-index: 9999; pointer-events: none;
  white-space: nowrap; box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; }

/* ===== MY STATS (SALES VIEW) ===== */
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.stat-box { background: var(--bg-secondary); border-radius: 10px; padding: 16px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 700; }
.stat-lbl { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* ===== SEARCH ===== */
.search-wrap { position: relative; }
.search-wrap .search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 14px; }
.search-input { padding-right: 36px !important; }

/* ===== ALERT ===== */
.alert {
  padding: 12px 16px; border-radius: 10px; font-size: 13px;
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.alert-info { background: var(--info-light); color: #1e40af; border: 1px solid #bfdbfe; }
.alert-success { background: var(--success-light); color: #15803d; border: 1px solid #bbf7d0; }
.alert-warn { background: var(--warn-light); color: #92400e; border: 1px solid #fde68a; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-secondary); border-radius: 12px; margin-bottom: 18px; border: 1px solid var(--border); }
.tab { flex: 1; padding: 8px 12px; text-align: center; font-size: 12px; font-weight: 500; border-radius: 9px; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--bg-primary); color: var(--accent); box-shadow: var(--shadow); }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ===== 2-COL GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-tertiary); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { 
    position: fixed !important; 
    right: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    width: var(--sidebar-w) !important;
    margin-right: 0 !important;
    visibility: visible !important;
    transform: translateX(100%) !important; 
    z-index: 10001 !important; 
    transition: transform 0.3s ease !important;
  }
  .sidebar.open { transform: translateX(0) !important; box-shadow: var(--shadow-md) !important; }
  .menu-btn { display: block; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .pipeline-board { grid-template-columns: repeat(2,1fr); }
  .grid-2, .grid-3-1, .grid-1-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .content { padding: 25px !important; }
}
@media (max-width: 540px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .pipeline-board { grid-template-columns: 1fr; }
  .topbar-right .date-badge { display: none; }
}

/* ===== EMPLOYEE PROJECT UPDATE MODAL ===== */
.emp-update-modal-inner {
  max-width: 580px;
  width: 95vw;
}

/* Sections */
.emp-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.emp-section:last-of-type { border-bottom: none; }
.emp-section-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}

/* Progress Slider */
.emp-progress-slider-wrap { text-align: center; }
.emp-progress-display {
  font-size: 42px; font-weight: 800; color: var(--accent);
  margin-bottom: 8px; transition: color 0.3s;
  text-shadow: 0 2px 8px rgba(79,70,229,0.12);
}
.emp-progress-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 10px; border-radius: 5px;
  background: var(--bg-secondary); outline: none;
  cursor: pointer; transition: background 0.2s;
  direction: ltr;
}
.emp-progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: white; border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.emp-progress-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 12px rgba(79,70,229,0.3);
}
.emp-progress-slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: white; border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
}
.emp-progress-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-tertiary); margin-top: 6px;
  direction: ltr;
}

/* Status Chips */
.emp-status-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.emp-status-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 10px; cursor: pointer;
  background: var(--bg-secondary); border: 2px solid transparent;
  transition: all 0.2s; font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
}
.emp-status-chip:hover {
  border-color: var(--chip-color, var(--border-strong));
  background: var(--bg-primary);
  transform: translateY(-2px);
}
.emp-status-chip.active {
  border-color: var(--chip-color, var(--accent));
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Task Checklist */
.emp-task-counter {
  font-size: 11px; background: var(--accent-light); color: var(--accent);
  padding: 2px 8px; border-radius: 10px; font-weight: 600;
  margin-right: auto;
}
.emp-task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; margin-bottom: 4px;
  transition: all 0.2s; background: var(--bg-secondary);
}
.emp-task-item:hover { background: var(--bg-hover); }
.emp-task-item.done { opacity: 0.6; }
.emp-task-item.done .emp-task-text { text-decoration: line-through; color: var(--text-tertiary); }
.emp-task-text { flex: 1; font-size: 13px; }
.emp-task-del {
  background: none; border: none; color: var(--text-tertiary);
  cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 4px;
  opacity: 0; transition: all 0.15s;
}
.emp-task-item:hover .emp-task-del { opacity: 1; }
.emp-task-del:hover { background: var(--danger-light); color: var(--danger); }

/* Custom Checkbox */
.emp-checkbox {
  position: relative; display: flex; align-items: center;
  cursor: pointer; flex-shrink: 0;
}
.emp-checkbox input { display: none; }
.emp-checkmark {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border-strong);
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.emp-checkbox input:checked + .emp-checkmark {
  background: var(--success); border-color: var(--success);
}
.emp-checkbox input:checked + .emp-checkmark::after {
  content: '✓'; color: white; font-size: 12px; font-weight: 700;
}

/* Add Task */
.emp-add-task {
  display: flex; gap: 8px; margin-top: 8px;
}
.emp-add-task .form-input {
  flex: 1;
}

/* Hours */
.emp-hours-wrap {
  display: flex; gap: 20px; align-items: center;
}
.emp-hours-display {
  background: var(--bg-secondary); border-radius: 12px;
  padding: 14px 20px; text-align: center; min-width: 100px;
}
.emp-hours-num {
  font-size: 28px; font-weight: 800; color: var(--info);
}
.emp-hours-label {
  font-size: 11px; color: var(--text-secondary); margin-top: 2px;
}
.emp-hours-add { flex: 1; }

/* Deadline Bar */
.emp-deadline-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 10px; font-size: 13px;
  font-weight: 600; margin: 12px 0 4px;
}
.emp-deadline-bar.ok { background: #ecfdf5; color: #065f46; }
.emp-deadline-bar.soon { background: #fef3c7; color: #92400e; }
.emp-deadline-bar.urgent { background: #fee2e2; color: #991b1b; animation: pulse-urgent 1.5s infinite; }
.emp-deadline-bar.overdue { background: #fecaca; color: #7f1d1d; animation: pulse-urgent 1s infinite; }

@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* Update Log */
.emp-log-list { position: relative; padding-right: 14px; }
.emp-log-item {
  display: flex; gap: 12px; padding: 8px 0; position: relative;
}
.emp-log-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 4px;
  position: relative; z-index: 1;
}
.emp-log-item:not(:last-child)::before {
  content: ''; position: absolute; right: 18px; top: 18px;
  width: 2px; height: calc(100% - 4px); background: var(--border);
}
.emp-log-body { flex: 1; }
.emp-log-text { font-size: 13px; color: var(--text-primary); line-height: 1.5; }
.emp-log-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* Responsive for modal */
@media (max-width: 600px) {
  .emp-status-grid { grid-template-columns: repeat(2, 1fr); }
  .emp-hours-wrap { flex-direction: column; gap: 12px; }
  .emp-progress-display { font-size: 32px; }
}

/* Premium Chart Containers */
.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
  margin-top: 10px;
}
.chart-container-large {
  position: relative;
  height: 350px;
  width: 100%;
  margin-top: 10px;
}
/* ===== USER PROFILE CARD (TOP) ===== */
.user-profile-top {
  padding: 12px 15px;
  background: transparent;
  margin: 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.user-profile-inner {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all 0.15s;
}
.dropdown-item:hover { background: var(--bg-secondary); color: var(--accent); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }

/* ===== TOPBAR ENHANCEMENTS ===== */
.sidebar-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 15px; border-bottom: 1px solid var(--border);
  background: #fff;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand .brand-logo {
  width: 34px; height: 34px; border-radius: 6px; background: var(--accent);
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.sidebar-brand .brand-name { font-size: 16px; font-weight: 800; color: #111827; }

.menu-btn {
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--text-secondary);
  border-radius: 6px; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.menu-btn:hover { color: var(--accent); background: #f8fafc; }


.topbar-icons { display: flex; align-items: center; gap: 18px; }
.topbar-icon-btn { 
  position: relative; font-size: 18px; color: #64748b; background: none; 
  border: none; cursor: pointer; transition: transform 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.topbar-icon-btn:hover { transform: scale(1.1); color: var(--accent); }

.topbar-user-pill {
  display: flex; align-items: center; cursor: pointer; padding: 2px;
  border-radius: 50%; border: 2px solid transparent; transition: all 0.2s;
}
.topbar-user-pill:hover { border-color: var(--accent-light); }

.topbar-avatar-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: #cbd5e1; color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.icon-badge {
  position: absolute; top: -6px; left: -8px;
  background: #ff2d42; color: #fff; font-size: 9px;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; border: 2px solid #fff;
}


.quick-create-wrap { position: relative; }
.perfex-plus-btn {
  background: #2563eb; color: #fff; border: none;
  width: 30px; height: 30px; font-size: 18px; font-weight: 700;
  border-radius: 50%; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(37,99,235,0.2);
}
.perfex-plus-btn:hover { background: #1d4ed8; transform: rotate(90deg); }

.quick-create-menu {
  position: absolute; top: calc(100% + 15px); right: 0;
  background: #fff; border: 1px solid #cbd5e1;
  border-radius: 4px; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 2000; width: 190px;
  display: none; overflow: hidden;
}
.quick-create-menu.show { 
  display: block; 
  animation: slideDown 0.2s ease; 
  max-height: 500px;
  overflow-y: auto;
}
.qc-header { 
  padding: 8px 12px; font-size: 11px; font-weight: 700; color: #94a3b8; 
  text-transform: uppercase; background: #fff; border-bottom: 1px solid #f1f5f9;
  text-align: right;
}
.qc-item {
  padding: 8px 12px; font-size: 13px; color: #334155;
  cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all 0.1s;
  border-bottom: 1px solid #f8fafc;
}
.qc-item:last-child { border-bottom: none; }
.qc-item i { font-size: 14px; width: 18px; text-align: center; }
.qc-item:hover { background: #f8fafc; color: #2563eb; }

/* ===== COLLAPSIBLE SIDEBAR ===== */
.sidebar { width: var(--sidebar-w); transition: all 0.3s ease; overflow-x: hidden; }

/* Desktop Mini-Sidebar Mode */
.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .brand-name,
.sidebar.collapsed .user-info-wrap,
.sidebar.collapsed .user-dropdown-trigger,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span:not(.nav-icon) {
  display: none;
}
.sidebar.collapsed .sidebar-header {
  padding: 15px 0; justify-content: center;
}
.sidebar.collapsed .menu-btn {
  padding: 5px;
}
.sidebar.collapsed .user-profile-top {
  padding: 10px 5px; background: transparent; border: none; margin: 10px 5px;
}
.sidebar.collapsed .user-profile-inner { justify-content: center; }
.sidebar.collapsed .user-avatar-wrap .avatar { width: 36px; height: 36px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .nav-icon { margin: 0; font-size: 20px; }

.main { transition: all 0.3s ease; flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

@media (max-width: 900px) {
  .sidebar { position: fixed; right: 0; top: 0; bottom: 0; z-index: 1000; transform: translateX(100%); width: var(--sidebar-w); margin-right: 0 !important; }
  .sidebar.collapsed { width: var(--sidebar-w); } /* Disable mini-sidebar on mobile */
  .sidebar.open { transform: translateX(0); }
  .main { margin-right: 0 !important; }
}


.premium-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 20px;
  position: relative;
}
.premium-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.kpi-card::after {
  content: ''; position: absolute; bottom: 0; right: 0; left: 0;
  height: 4px; background: var(--accent); opacity: 0.8;
}
.kpi-card.green::after { background: var(--success); }
.kpi-card.warn::after { background: var(--warn); }
.kpi-card.cyan::after { background: var(--cyan); }

.kpi-value {
  font-size: 32px; font-weight: 800; color: var(--text-primary);
  letter-spacing: -1px; margin: 4px 0;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; color: var(--text-secondary);
  transition: all 0.2s ease; margin-bottom: 4px; position: relative; font-weight: 500;
}
.nav-item:hover { background: var(--bg-secondary); color: var(--accent); }
.nav-item.active { background: #f8fafc; color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); }
.nav-item.active::after {
  content: ''; position: absolute; right: 0; top: 8px; bottom: 8px; width: 4px; 
  background: var(--accent); border-radius: 4px 0 0 4px;
}
.nav-icon { font-size: 18px; width: 24px; text-align: center; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }


/* ===== PERFEX STYLE CUSTOMERS VIEW ===== */
.perfex-container { padding: 0 !important; animation: fadeIn 0.3s ease; }
.perfex-title { font-size: 20px; font-weight: 700; color: #333; margin-bottom: 5px; }
.perfex-subtitle { font-size: 13px; color: var(--accent); cursor: pointer; margin-bottom: 20px; display: block; }
.perfex-subtitle:hover { text-decoration: underline; }

.client-stats-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; margin-bottom: 25px;
}
.client-stat-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 4px; padding: 12px 15px;
  display: flex; align-items: center; gap: 10px; transition: all 0.2s;
}
.client-stat-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.client-stat-value { font-size: 16px; font-weight: 700; color: #334155; }
.client-stat-label { font-size: 13px; color: #64748b; font-weight: 500; }

.stat-green { color: #28a745 !important; }
.stat-red { color: #dc3545 !important; }
.stat-blue { color: #03a9f4 !important; }
.stat-black { color: #111827 !important; }

.perfex-actions-bar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.action-btn-group { display: flex; gap: 8px; }
.perfex-btn {
  padding: 8px 14px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: 0.2s; border: 1px solid transparent;
}
.btn-dark { background: #333; color: #fff; }
.btn-dark:hover { background: #111; }
.btn-white { background: #fff; border-color: #d2d6de; color: #333; }
.btn-white:hover { background: #f4f4f4; border-color: #aaa; }

.table-filter-bar {
  background: #fff; border: 1px solid #e2e8f0; border-bottom: none;
  border-radius: 4px 4px 0 0; padding: 12px 15px; display: flex; justify-content: space-between; align-items: center;
}
.perfex-table-wrap {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 0 0 4px 4px; overflow-x: auto;
}
.perfex-table { width: 100%; border-collapse: collapse; font-size: 13px; color: #333; }
.perfex-table th {
  background: #f8fafc; border-bottom: 1px solid #e2e8f0; padding: 12px 15px;
  text-align: right; font-weight: 600; color: #475569;
}
.perfex-table td { padding: 12px 15px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.perfex-table tr:hover { background: #fcfdfe; }

/* Switch Toggle (Perfex style) */
.switch {
  position: relative; display: inline-block; width: 42px; height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc; transition: .4s; border-radius: 34px;
}
.slider:before {
  position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: #2196F3; }
input:checked + .slider:before { transform: translateX(20px); }

.perfex-badge {
  padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; display: inline-block;
}
.badge-group { background: #f1f5f9; color: #64748b; margin-left: 4px; }

.nav-arrow {
  margin-right: auto; font-size: 14px; transition: transform 0.2s; color: var(--text-tertiary);
}
.nav-item.open .nav-arrow { transform: rotate(-90deg); }

.submenu {
  display: none; background: #f8fafc; border-right: 2px solid var(--border-strong);
  margin: 0 25px 5px 0; padding-right: 10px; padding-top: 5px; padding-bottom: 5px;
}
.submenu.open { display: block; animation: slideDown 0.2s ease; }
.submenu-item {
  padding: 8px 12px; font-size: 12.5px; color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s; border-radius: 4px; margin-bottom: 2px;
}
.submenu-item:hover, .submenu-item.active {
  color: var(--accent); background: #f1f5f9; padding-right: 15px;
}


.row-actions {
  display: flex; gap: 6px; font-size: 11px; margin-top: 4px;
  visibility: hidden; opacity: 0; transition: 0.15s;
}
tr:hover .row-actions { visibility: visible; opacity: 1; }
.row-actions a { color: #8492a6; text-decoration: none; }
.row-actions a:hover { color: var(--accent); }
.row-actions .sep { color: #e2e8f0; }
.row-actions a.text-danger:hover { color: #e74c3c; }

/* ===== PERFEX STYLE PROJECTS VIEW ===== */
.project-stats-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; margin-bottom: 25px;
}
.project-stat-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 4px; padding: 12px 15px;
  display: flex; align-items: center; gap: 10px; transition: all 0.2s; cursor: pointer;
}
.project-stat-card .client-stat-value { font-size: 16px; font-weight: 700; }
.project-stat-card .client-stat-label { font-size: 13px; font-weight: 500; color: #64748b; }
.project-stat-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

.project-status-badge {
  padding: 4px 12px; border-radius: 4px; font-size: 11px; font-weight: 600;
  border: 1px solid transparent; display: inline-block; cursor: pointer;
}

/* Status Colors (Unified) */
.status-finished, .stat-green { border-color: #dcfce7; color: #28a745 !important; background: #f0fdf4; }
.status-in-progress, .stat-blue { border-color: #dbeafe; color: #03a9f4 !important; background: #eff6ff; }
.status-on-hold, .stat-orange { border-color: #fef3c7; color: #f59e0b !important; background: #fffbeb; }
.status-cancelled, .stat-red { border-color: #fee2e2; color: #dc3545 !important; background: #fef2f2; }
.status-not-started, .stat-grey { border-color: #f1f5f9; color: #64748b !important; background: #f8fafc; }

.member-stack { display: flex; align-items: center; margin-right: 5px; }
.member-stack .avatar {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff;
  margin-right: -8px; background: #e2e8f0; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.member-stack .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Task Status Badges */
.task-status { padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.task-not-started { border-color: #f1f5f9; color: #64748b; background: #f8fafc; }
.task-in-progress { border-color: #dbeafe; color: #03a9f4; background: #eff6ff; }
.task-testing { border-color: #e0f2fe; color: #0284c7; background: #f0f9ff; }
.task-awaiting-feedback { border-color: #fef9c3; color: #854d0e; background: #fefce8; }
.task-complete { border-color: #dcfce7; color: #15803d; background: #f0fdf4; }

.task-name-main { font-weight: 600; color: #333; font-size: 13.5px; display: block; margin-bottom: 2px; }
.task-name-sub { font-size: 11px; color: #94a3b8; }

.tag-badge {
  background: #f1f5f9; color: #475569; padding: 2px 6px; border-radius: 3px;
  font-size: 10px; font-weight: 600; margin-left: 4px;
}

.stats-popover {
  position: absolute; top: 110%; left: 0; width: 220px; background: #fff;
  border: 1px solid #d2d6de; border-radius: 4px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  z-index: 1000; text-align: right; overflow: hidden;
}
.popover-header { background: #334155; color: #fff; padding: 8px 12px; font-size: 11px; font-weight: 600; }
.popover-item { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; transition: 0.2s; }
.popover-item:hover { background: #f8fafc; }
.pop-name { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.pop-time { font-size: 10px; color: #94a3b8; }

/* ===== PERFEX TYPICAL TABLE & LISTS ===== */
.perfex-list-container {
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
.perfex-page-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 25px;
  position: relative;
  display: inline-block;
}
.perfex-page-title::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 0;
  width: 100%;
  height: 8px;
  background: rgba(37, 99, 235, 0.1);
  z-index: -1;
}

.perfex-top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.perfex-btn-group {
  display: flex;
  gap: 8px;
}
.btn-perfex-dark {
  background: #1e293b;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-perfex-dark:hover { background: #0f172a; }

.btn-perfex-white {
  background: #fff;
  border: 1px solid #dce1e7;
  padding: 8px 12px;
  border-radius: 4px;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-perfex-white:hover { background: #f8fafc; border-color: #cbd5e1; }

.perfex-filter-bar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1px;
}
.perfex-filter-left { display: flex; gap: 8px; align-items: center; }
.perfex-filter-right { position: relative; width: 240px; }

.perfex-table-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.perfex-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.perfex-table thead th {
  background: #f9fafb;
  padding: 12px 15px;
  text-align: right;
  font-weight: 600;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.perfex-table tbody td {
  padding: 14px 15px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.perfex-table tbody tr:hover td { background: #fcfdfe; }

.perfex-table .main-link {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
  display: block;
  margin-bottom: 2px;
}
.perfex-table .main-link:hover { text-decoration: underline; }

.row-actions {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.15s;
}
tr:hover .row-actions { opacity: 1; }
.row-actions a { color: #64748b; text-decoration: none; }
.row-actions a:hover { color: #2563eb; }
.row-actions .sep { color: #e2e8f0; }
.row-actions .text-danger:hover { color: #ef4444; }

.perfex-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}
.badge-sent { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-open { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.badge-draft { background: #f1f5f9; color: #475569; }

.perfex-pagination {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
  color: #64748b;
}
.pag-links { display: flex; gap: 4px; }
.pag-btn {
  padding: 5px 12px;
  border: 1px solid #dce1e7;
  border-radius: 4px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
}
.pag-btn:hover { background: #f8fafc; }
.pag-btn.active { background: #1e293b; color: #fff; border-color: #1e293b; }

/* ===== ESTIMATES/STATS CARDS ===== */
.stats-grid-perfex {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}
.stat-card-perfex {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 12px 15px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card-perfex:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.stat-card-perfex.active {
  border-color: #2563eb;
  background: #f8faff;
}
.stat-card-perfex .stat-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 5px;
}
.stat-card-perfex .stat-pct {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
}
.stat-card-perfex .stat-count {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
}
.stat-card-perfex .stat-total {
  font-size: 12px;
  color: #94a3b8;
}

/* Colors for stats labels */
.stat-card-perfex .label-draft { color: #64748b; }
.stat-card-perfex .label-sent { color: #2563eb; }
.stat-card-perfex .label-expired { color: #f59e0b; }
.stat-card-perfex .label-declined { color: #ef4444; }
.stat-card-perfex .label-accepted { color: #10b981; }

.stat-card-perfex::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #e2e8f0;
}
.stat-card-perfex.draft::after { background: #cbd5e1; }
.stat-card-perfex.sent::after { background: #3b82f6; }
.stat-card-perfex.expired::after { background: #f59e0b; }
.stat-card-perfex.declined::after { background: #ef4444; }
.stat-card-perfex.accepted::after { background: #10b981; }

/* Animation for Financial Stats Row */
.finance-stats-wrapper {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0;
}
.finance-stats-wrapper.show {
  max-height: 200px;
  opacity: 1;
  margin-top: -10px;
  margin-bottom: 25px;
}

/* Invoices Top Right Stats */
.perfex-top-right-stats {
  float: left; /* Because it's RTL, float left puts it on the visual right */
  display: flex;
  gap: 10px;
  font-size: 12px;
  margin-top: -35px;
}
.perfex-top-right-stats .stat-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  border-radius: 4px;
  color: #64748b;
}
.perfex-top-right-stats .stat-item strong {
  color: #334155;
  margin-right: 5px;
}
.stat-item.green-text strong { color: #10b981; }
.stat-item.red-text strong { color: #ef4444; }
.stat-item.orange-text strong { color: #f59e0b; }

/* Subscriptions Summary Bar */
.subs-summary-bar {
  display: flex;
  gap: 20px;
  background: #fff;
  padding: 15px 20px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
  font-size: 13px;
  flex-wrap: wrap;
}
.subs-summary-bar .summary-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.subs-summary-bar .summary-count {
  font-size: 18px;
  font-weight: 700;
  color: #334155;
}
.subs-summary-bar .summary-label {
  color: #64748b;
}
.subs-summary-bar .blue { color: #2563eb; }
.subs-summary-bar .green { color: #10b981; }
.subs-summary-bar .orange { color: #f59e0b; }
.subs-summary-bar .red { color: #ef4444; }
.subs-summary-bar .black { color: #000; }

/* Contracts Specific Styles */
.contracts-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}
.contract-stat-card {
  background: #fff;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.contract-stat-card .count { font-size: 18px; font-weight: 700; color: #334155; }
.contract-stat-card .label { font-size: 13px; font-weight: 600; }
.contract-stat-card.blue .label { color: #2563eb; }
.contract-stat-card.red .label { color: #ef4444; }
.contract-stat-card.orange .label { color: #f59e0b; }
.contract-stat-card.green .label { color: #10b981; }
.contract-stat-card.black .label { color: #000; }

.contracts-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}
.chart-container-perfex {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 20px;
}
.chart-title {
  font-weight: 700;
  margin-bottom: 20px;
  color: #334155;
  font-size: 15px;
}
.chart-placeholder {
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 4px;
  color: #94a3b8;
  font-size: 12px;
  border: 1px dashed #cbd5e1;
}

/* Active Tags & Avatars */
.badge-gray {
  cursor: pointer;
  transition: all 0.2s;
}
.badge-gray:hover {
  background: #e2e8f0;
  color: #334155;
}
.member-stack .avatar {
  cursor: pointer;
  transition: transform 0.2s;
}
.member-stack .avatar:hover {
  transform: translateY(-3px);
  z-index: 10;
}

/* Gantt Chart Styles */
.gantt-container {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 20px;
}
.gantt-header {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
}
.gantt-timeline-grid {
  display: flex;
  flex-direction: column;
}
.gantt-months-row {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.gantt-month {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 12px;
  color: #64748b;
  border-right: 1px solid #e2e8f0;
}
.gantt-row {
  display: flex;
  align-items: center;
  height: 45px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
}
.gantt-row:nth-child(even) {
  background: #f8fafc;
}
.gantt-label {
  width: 250px;
  padding: 0 15px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-connector {
  position: absolute;
  left: 230px;
  width: 20px;
  border-left: 1px solid #94a3b8;
  border-bottom: 1px solid #94a3b8;
  height: 25px;
  top: -10px;
}
.gantt-bar.task { background: #475569; }
.gantt-bar.header { background: #334155; font-weight: 700; }
.gantt-bar.activity { background: #22c55e; }

/* Task Priorities */
.priority-low { color: #64748b; }
.priority-medium { color: #3b82f6; }
.priority-high { color: #f59e0b; }
.priority-urgent { color: #ef4444; }

.task-status-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.task-status-dropdown:hover {
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.task-status-dropdown.not-started { color: #64748b; background: #f1f5f9; border-color: #e2e8f0; }
.task-status-dropdown.in-progress { color: #2563eb; background: #eff6ff; border-color: #dbeafe; }
.task-status-dropdown.testing { color: #0369a1; background: #f0f9ff; border-color: #e0f2fe; }
.task-status-dropdown.awaiting-feedback { color: #c2410c; background: #fff7ed; border-color: #ffedd5; }
.task-status-dropdown.complete { color: #047857; background: #ecfdf5; border-color: #d1fae5; }

/* Tasks Overview Styles */
.checklist-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.checklist-complete { background: #ecfdf5; color: #10b981; }
.checklist-incomplete { background: #fef2f2; color: #ef4444; }

.overview-icon-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
}
.overview-icon-label i {
  color: #94a3b8;
  font-size: 13px;
}

/* Ticket Status Badges */
.badge-ticket-open { color: #ef4444; background: #fef2f2; border: 1px solid #fee2e2; }
.badge-ticket-in-progress { color: #22c55e; background: #f0fdf4; border: 1px solid #dcfce7; }
.badge-ticket-answered { color: #3b82f6; background: #eff6ff; border: 1px solid #dbeafe; }
.badge-ticket-on-hold { color: #64748b; background: #f8fafc; border: 1px solid #f1f5f9; }
.badge-ticket-closed { color: #06b6d4; background: #ecfeff; border: 1px solid #cffafe; }

.ticket-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  display: inline-block;
}

/* Weekly Stats Chart */
.weekly-stats-container {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}
.stats-chart-placeholder {
  height: 250px;
  width: 100%;
  position: relative;
  border-bottom: 1px solid #e2e8f0;
  border-left: 1px solid #e2e8f0;
  margin-top: 20px;
}
.chart-axis-y {
  position: absolute;
  left: -30px;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
}
.chart-axis-x {
  position: absolute;
  bottom: -25px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
}
.chart-area-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.gantt-bar-area {
  flex: 1;
  position: relative;
  height: 100%;
}
.gantt-bar {
  position: absolute;
  height: 22px;
  border-radius: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dropdown Options Color Fix */
.perfex-select-badge option {
  color: #334155 !important;
  background-color: #ffffff !important;
  font-weight: normal !important;
}
