/* ==========================================
   DESIGN SYSTEM & VARIABLES - VU ADMIN
   ========================================== */
:root {
  /* Fonts */
  --font-family: 'Montserrat', sans-serif;

  /* Colors - Light Theme */
  --bg-main: #f8fafc;
  --bg-sidebar: #f1f5f9;
  --bg-card: #ffffff;
  --bg-topbar: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-active: #000000;
  
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  
  --accent-blue: #2563eb;
  --accent-blue-light: rgba(37, 99, 235, 0.1);
  --accent-green: #10b981;
  --accent-green-light: rgba(16, 185, 129, 0.1);
  --accent-orange: #f59e0b;
  --accent-orange-light: rgba(245, 158, 11, 0.1);
  --accent-purple: #8b5cf6;
  --accent-purple-light: rgba(139, 92, 246, 0.1);
  --danger: #ef4444;

  /* Layout */
  --sidebar-width: 215px;
  --topbar-height: 70px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
  --shadow-premium: 0 12px 30px rgba(37, 99, 235, 0.08);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* Dark Theme Variables */
body.dark-theme {
  --bg-main: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #0f172a;
  --bg-topbar: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-active: #ffffff;
  
  --border-color: #334155;
  --border-focus: #3b82f6;
  
  --accent-blue-light: rgba(59, 130, 246, 0.15);
  --accent-green-light: rgba(52, 211, 153, 0.15);
  --accent-orange-light: rgba(251, 191, 36, 0.15);
  --accent-purple-light: rgba(167, 139, 250, 0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
  --shadow-premium: 0 12px 30px rgba(0, 0, 0, 0.25);
}

/* ==========================================
   CSS RESET & BASE STYLES
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 14px;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================
   LAYOUT STRUCTURE
   ========================================== */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  position: relative;
}

/* LEFT SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-normal), background-color var(--transition-normal);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0; /* Prevents flex items from overflowing */
  transition: margin-left var(--transition-normal);
}

/* ==========================================
   SIDEBAR COMPONENTS
   ========================================== */
/* LOGO HEADER */
.logo-header {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon-wrapper {
  width: 116px;
  height: 42px;
  flex-shrink: 0;
}

.brand-logo-svg,
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-mark-white {
  display: none;
}

body.dark-theme .logo-mark-blue {
  display: none;
}

body.dark-theme .logo-mark-white {
  display: block;
}

.logo-info {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-active);
  letter-spacing: -0.5px;
}

.logo-slogan {
  font-size: 7.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.logo-sub-slogan {
  font-size: 7px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* USER PROFILE */
.user-profile {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border-color);
}

body.dark-theme .user-profile {
  background-color: rgba(255, 255, 255, 0.02);
}

.avatar-wrapper {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background-color: var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  display: block;
}

.profile-avatar i {
  width: 20px;
  height: 20px;
}

.status-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-card);
}

.status-indicator.online {
  background-color: var(--accent-green);
}

.profile-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-active);
}

.profile-email {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* MENU NAVIGATION */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  padding-left: 12px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  position: relative;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  gap: 12px;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--text-active);
}

body.dark-theme .nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  background-color: var(--bg-card);
  color: var(--text-active);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

body.dark-theme .nav-item.active {
  background-color: var(--accent-blue-light);
  color: var(--accent-blue);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-label {
  font-size: 13.5px;
  flex: 1;
}

.badge {
  background-color: var(--border-color);
  color: var(--text-active);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  box-shadow: inset var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.05);
  line-height: 1.2;
  flex-shrink: 0;
}

body.dark-theme .badge {
  background-color: var(--border-color);
  color: var(--text-active);
}

.notification-nav-item.has-unread {
  color: #ef4444;
}

.notification-nav-item.has-unread .nav-icon {
  color: #ef4444;
  animation: bellSoftShake 1.4s ease-in-out infinite;
  transform-origin: 50% 8%;
}

.notification-nav-item.has-unread .badge {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.22);
}

@keyframes bellSoftShake {
  0%, 42%, 100% { transform: rotate(0deg); }
  8% { transform: rotate(9deg); }
  16% { transform: rotate(-8deg); }
  24% { transform: rotate(6deg); }
  32% { transform: rotate(-4deg); }
}

/* Logout link special color */
.logout-link:hover {
  background-color: rgba(239, 68, 68, 0.08);
  color: var(--danger);
}

/* MOBILE CLOSE TOGGLE */
.mobile-nav-toggle {
  display: none;
}

/* ==========================================
   TOPBAR COMPONENTS
   ========================================== */
.topbar {
  height: var(--topbar-height);
  background-color: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  transition: background-color var(--transition-normal), border var(--transition-normal);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title-wrapper {
  display: flex;
  flex-direction: column;
}

.topbar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 420px;
  margin: 0 20px;
}

.menu-toggle-btn {
  display: none;
  color: var(--text-main);
}

.menu-toggle-btn svg, .menu-toggle-btn i {
  width: 22px;
  height: 22px;
}

.current-section-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Clock Widget */
.clock-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-muted);
}

.clock-widget svg, .clock-widget i {
  width: 15px;
  height: 15px;
  color: var(--accent-blue);
}

/* Theme Toggle */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background-color: var(--border-color);
}

.theme-toggle-btn svg, .theme-toggle-btn i {
  width: 18px;
  height: 18px;
}

#btn-manual-data-refresh.is-syncing svg,
#btn-manual-data-refresh.is-syncing i {
  animation: spin 0.8s linear infinite;
}

/* Quick Avatar */
.quick-user {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid var(--border-focus);
}

.quick-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================
   PAGE CONTAINER & SPA ROUTING
   ========================================== */
.page-container {
  padding: 20px;
  flex: 1;
  max-width: 1550px;
  width: 100%;
  margin: 0 auto;
}

.admin-page {
  display: none;
  animation: fadeIn 0.4s ease;
}

.admin-page.active {
  display: block;
}

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

/* ==========================================
   1. DASHBOARD COMPONENT STYLING
   ========================================== */
/* METRIC CARDS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-card .card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-card .icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-card .icon-box.blue { background-color: var(--accent-blue-light); color: var(--accent-blue); }
.metric-card .icon-box.green { background-color: var(--accent-green-light); color: var(--accent-green); }
.metric-card .icon-box.orange { background-color: var(--accent-orange-light); color: var(--accent-orange); }
.metric-card .icon-box.purple { background-color: var(--accent-purple-light); color: var(--accent-purple); }

.metric-card .icon-box i {
  width: 18px;
  height: 18px;
}

.metric-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-card .card-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
}

.metric-card .card-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

.metric-card .card-trend.upward { color: var(--accent-green); }
.metric-card .card-trend.warning { color: var(--accent-orange); }

.metric-card .card-trend i {
  width: 12px;
  height: 12px;
}

/* CHARTS & DETAILS GRID */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.chart-card, .info-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.chart-card-header h3, .info-card h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.date-filter {
  display: flex;
  gap: 4px;
  background-color: var(--bg-main);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.filter-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.filter-btn.active {
  background-color: var(--bg-card);
  color: var(--text-active);
  box-shadow: var(--shadow-sm);
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

/* Chatbot log list widget */
.chatbot-log-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.bot-log-item {
  padding: 12px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideIn 0.3s ease;
}

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

.bot-log-header {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.bot-log-user {
  color: var(--accent-blue);
}

.bot-log-msg {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
}

/* ==========================================
   TABLE COMPONENT STYLING
   ========================================== */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 28px 0;
  overflow: hidden;
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px 20px 28px;
  border-bottom: 1px solid var(--border-color);
}

.table-card-header h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.btn-view-all {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-blue);
}

.btn-view-all:hover {
  text-decoration: underline;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 800px;
}

.admin-table th {
  padding: 14px 28px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.01);
}

body.dark-theme .admin-table th {
  background-color: rgba(255, 255, 255, 0.01);
}

.admin-table td {
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 500;
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover td {
  background-color: rgba(0,0,0,0.01);
}

body.dark-theme .admin-table tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
}

/* User Identity Cell */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-cell-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--accent-blue-light);
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-cell-info {
  display: flex;
  flex-direction: column;
}

.user-cell-name {
  font-weight: 700;
  color: var(--text-active);
}

.user-cell-email {
  font-size: 11px;
  color: var(--text-muted);
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-pill.completed { background-color: var(--accent-green-light); color: var(--accent-green); }
.status-pill.pending { background-color: var(--accent-orange-light); color: var(--accent-orange); }
.status-pill.processing { background-color: var(--accent-blue-light); color: var(--accent-blue); }

/* Table Actions Button */
.btn-action-row {
  display: flex;
  gap: 8px;
}

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background-color: var(--border-color);
  color: var(--text-active);
}

.action-btn.delete:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.action-btn svg, .action-btn i {
  width: 14px;
  height: 14px;
}

/* ==========================================
   2. CLIENTS COMPONENT STYLING
   ========================================== */
.btn-primary-action {
  background-color: var(--accent-blue);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
  transition: all var(--transition-fast);
}

.btn-primary-action:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary-action svg, .btn-primary-action i {
  width: 15px;
  height: 15px;
}

/* ==========================================
   3. INCOME COMPONENT STYLING
   ========================================== */
.income-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.income-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.summary-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-card .title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-card h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-active);
}

/* ==========================================
   4. PROJECTS COMPONENT STYLING
   ========================================== */
.projects-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.btn-project-filter {
  padding: 8px 18px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-project-filter:hover {
  background-color: var(--border-color);
  color: var(--text-active);
}

.btn-project-filter.active {
  background-color: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition-normal);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-category-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-blue);
  background-color: var(--accent-blue-light);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.project-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-active);
}

.project-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.project-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: auto;
}

.project-client-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.project-budget {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent-blue);
}

/* ==========================================
   5. HR (HUMAN RESOURCES) STYLING
   ========================================== */
.hr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.hr-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-normal);
}

.hr-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.hr-photo-frame {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 3px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
}

.hr-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.staff-gender-icon {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.staff-gender-icon svg {
  width: 38px;
  height: 38px;
  stroke-width: 2.4;
}

.staff-gender-icon.male {
  color: #2563eb;
  background: #eff6ff;
}

.staff-gender-icon.female {
  color: #db2777;
  background: #fdf2f8;
}

.profile-gender-icon svg {
  width: 22px;
  height: 22px;
}

.hr-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-active);
}

.hr-role {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: -10px;
}

.hr-stats-row {
  display: flex;
  width: 100%;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  margin: 8px 0;
}

.hr-stat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hr-stat-col:first-child {
  border-right: 1px solid var(--border-color);
}

.hr-stat-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-active);
}

.hr-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-contact-hr {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  width: 100%;
  justify-content: center;
}

.btn-contact-hr:hover {
  background-color: var(--border-color);
  color: var(--text-active);
}

.btn-contact-hr i {
  width: 13px;
  height: 13px;
}

/* ==========================================
   6. CHATBOT MANAGER CONFIG STYLING
   ========================================== */
.chatbot-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.config-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.config-card h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: border var(--transition-fast);
}

.form-input:focus {
  border-color: var(--border-focus);
}

textarea.form-input {
  resize: vertical;
}

.btn-secondary-action {
  border: 1px dashed var(--border-focus);
  color: var(--accent-blue);
  background-color: var(--accent-blue-light);
  padding: 10px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-secondary-action:hover {
  background-color: rgba(37, 99, 235, 0.2);
}

/* FAQ Items */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.faq-item {
  padding: 16px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.faq-item .faq-q {
  font-weight: 700;
  color: var(--text-active);
  padding-right: 24px;
}

.faq-item .faq-a {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.faq-delete-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.faq-delete-btn:hover {
  color: var(--danger);
}

.faq-delete-btn i {
  width: 14px;
  height: 14px;
}

/* ==========================================
   7. NOTIFICATIONS COMPONENT STYLING
   ========================================== */
.notifications-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.notifications-header h3 {
  font-size: 15px;
  font-weight: 800;
}

.btn-clear-all {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-blue);
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-empty {
  padding: 26px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.notification-item {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.notification-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.notification-item.unread {
  border-left: 4px solid #ef4444;
  background-color: rgba(239, 68, 68, 0.025);
}

body.dark-theme .notification-item.unread {
  background-color: rgba(239, 68, 68, 0.07);
}

.notification-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-icon-box.blue { background-color: var(--accent-blue-light); color: var(--accent-blue); }
.notification-icon-box.green { background-color: var(--accent-green-light); color: var(--accent-green); }
.notification-icon-box.orange { background-color: var(--accent-orange-light); color: var(--accent-orange); }
.notification-icon-box.red { background-color: rgba(239, 68, 68, 0.1); color: #ef4444; }

.notification-icon-box svg, .notification-icon-box i {
  width: 14px;
  height: 14px;
}

.notification-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 700;
  color: var(--text-active);
  font-size: 13px;
}

.notification-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-attachment {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  color: var(--accent-blue);
  font-size: 10.5px;
  font-weight: 800;
}

.notification-attachment svg,
.notification-attachment i {
  width: 12px;
  height: 12px;
}

.notification-time {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
}

.notification-meta {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-blue);
  text-transform: uppercase;
}

.btn-mark-notification-read {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 800;
  background: var(--accent-blue-light);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 6px;
  padding: 5px 8px;
}

.btn-mark-notification-read:hover {
  color: #ffffff;
  background: var(--accent-blue);
}

.btn-mark-notification-read.is-read {
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
}

.btn-mark-notification-read.is-read:hover {
  color: var(--accent-blue);
  background: var(--accent-blue-light);
  border-color: rgba(37, 99, 235, 0.16);
}

.btn-mark-notification-read svg, .btn-mark-notification-read i {
  width: 12px;
  height: 12px;
}

.notification-read-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.notification-delete-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-orange);
  white-space: nowrap;
}

.notification-delete-pending svg,
.notification-delete-pending i {
  width: 12px;
  height: 12px;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 220px;
  margin-left: 12px;
}

.staff-chat-peer {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
}

.staff-chat-peer.is-active {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
}

.site-content-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
}

.site-content-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-content-actions-inline {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.site-preview-frame-wrap {
  overflow: hidden;
  height: min(680px, calc(100vh - 250px));
  min-height: 480px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
}

.site-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.site-builder-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
}

.site-builder-tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  background: transparent;
  cursor: pointer;
}

.site-builder-tab.active {
  color: var(--accent-blue);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.site-builder-panel {
  display: none;
}

.site-builder-panel.active {
  display: block;
}

.site-content-section-title {
  margin-bottom: 10px;
  color: var(--text-active);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.site-content-list,
.agency-announcement-list,
.pricing-package-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-content-item,
.agency-announcement-admin-item,
.pricing-package-admin-item,
.portfolio-item-admin-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
}

.site-content-item strong,
.agency-announcement-admin-item strong,
.pricing-package-admin-item strong,
.portfolio-item-admin-item strong {
  display: block;
  color: var(--text-active);
  font-size: 13px;
  font-weight: 800;
}

.site-content-item span,
.agency-announcement-admin-item span,
.agency-announcement-admin-item p,
.pricing-package-admin-item span,
.pricing-package-admin-item p,
.portfolio-item-admin-item span,
.portfolio-item-admin-item p {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.agency-announcement-admin-item p {
  max-width: 560px;
}

.agency-announcement-admin-item.is-draft,
.pricing-package-admin-item.is-draft,
.portfolio-item-admin-item.is-draft {
  opacity: 0.62;
}

@media (max-width: 980px) {
  .site-content-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   8. SETTINGS COMPONENT STYLING
   ========================================== */
.settings-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.settings-card h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.form-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-blue);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  margin-top: 24px;
}

.form-row {
  display: flex;
  gap: 20px;
}

.flex-1 {
  flex: 1;
}

/* Toggle Switch */
.toggle-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-switch-input {
  display: none;
}

.toggle-switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast);
}

.toggle-switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.toggle-switch-input:checked + .toggle-switch-slider {
  background-color: var(--accent-blue);
}

.toggle-switch-input:checked + .toggle-switch-slider::before {
  transform: translateX(20px);
}

.toggle-label-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================
   RESPONSIVENESS & ADAPTIVITY
   ========================================== */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .chatbot-config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  /* Sidebar responsive collapse */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .menu-toggle-btn {
    display: block;
  }
  
  .hr-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .topbar {
    padding: 0 16px;
  }
  
  .page-container {
    padding: 16px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .clock-widget {
    display: none;
  }
  
  .hr-grid {
    grid-template-columns: 1fr;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .income-summary {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   REDESIGNED DASHBOARD LAYOUT & CARD STYLES
   ========================================== */

/* Dashboard Header Block */
.dashboard-header-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-main-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-active);
  letter-spacing: -1px;
}

.dashboard-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.dashboard-search-box {
  position: relative;
  width: 320px;
}

.dashboard-search-box svg, .dashboard-search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.dashboard-search-box .search-input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.dashboard-search-box .search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-light);
}

/* Metric Row redesign */
.dashboard-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.metric-box {
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.metric-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gradient-blue-card {
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  color: #ffffff;
  border: none;
}

.gradient-blue-card .box-title {
  color: rgba(255, 255, 255, 0.8);
}

.white-card {
  background-color: var(--bg-card);
}

.box-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.box-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-top: 8px;
}

.box-unit {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.box-footer {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  margin-top: auto;
}

.box-footer.dark-text {
  color: var(--text-muted);
}

.box-badge-gray {
  background-color: #e2e8f0;
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  display: inline-block;
}

body.dark-theme .box-badge-gray {
  background-color: #334155;
  color: #f8fafc;
}

/* Split layout card (Job đang chạy) */
.metric-box.split-layout {
  flex-direction: row;
  align-items: stretch;
  gap: 16px;
}

.split-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.split-value-wrapper {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 8px;
}

.box-value-large {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
}

.box-value-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.box-value-label-inline {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-active);
  margin-left: 6px;
}

.split-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border-left: 1px solid var(--border-color);
  padding-left: 16px;
}

.status-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Banner layout card (Số lần thay đổi) */
.metric-box.banner-layout {
  padding: 0;
  justify-content: space-between;
}

.banner-top {
  display: flex;
  justify-content: space-between;
  padding: 20px 22px 10px 22px;
  width: 100%;
}

.date-pill {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

body.dark-theme .date-pill {
  background-color: rgba(255, 255, 255, 0.05);
}

.banner-bottom-warning {
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 10px 22px;
  width: 100%;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

body.dark-theme .banner-bottom-warning {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Dashboard Content Grid */
.dashboard-content-layout {
  display: grid;
  grid-template-columns: 1.9fr 1.1fr;
  gap: 20px;
}

.content-col-left, .content-col-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Placeholder Pills Row */
.placeholder-pills-row {
  display: flex;
  gap: 12px;
}

.gray-placeholder-pill {
  height: 32px;
  width: 140px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
}

body.dark-theme .gray-placeholder-pill {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Section Cards Redesign */
.dashboard-section-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-title-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title-header h3 {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-active);
  letter-spacing: -0.3px;
}

.btn-xem-them {
  font-size: 11.5px;
  font-weight: 700;
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

body.dark-theme .btn-xem-them {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-xem-them:hover {
  background-color: var(--border-color);
  color: var(--text-active);
}

/* borderless tables style override */
.admin-table.borderless td, .admin-table.borderless th {
  border-bottom: none;
  padding: 8px 12px;
}

.admin-table.borderless tbody tr:hover td {
  background-color: rgba(0,0,0,0.02);
}

body.dark-theme .admin-table.borderless tbody tr:hover td {
  background-color: rgba(255,255,255,0.02);
}

.admin-table.borderless td {
  font-size: 12px;
}

/* Text Deadline warnings */
.text-danger-custom { color: #ef4444; font-weight: 700; }
.text-orange-custom { color: #f97316; font-weight: 700; }
.text-brown-custom { color: #b45309; font-weight: 600; }

/* Large Empty Placeholder Card */
.large-empty-placeholder-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  min-height: 200px;
  width: 100%;
}

/* Revenue Chart Redesign */
.chart-container-redesigned {
  position: relative;
  height: 180px;
  width: 100%;
}

/* Performance Split Component */
.performance-split-container {
  display: flex;
  gap: 20px;
  align-items: center;
}

.perf-left-table {
  flex: 1.2;
}

.perf-right-chart {
  flex: 0.8;
  display: flex;
  justify-content: center;
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
}

.perf-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px;
}

.perf-table td {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Performance status badges */
.perf-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  border: 1px solid transparent;
}

.perf-badge.overloaded {
  background-color: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.perf-badge.high {
  background-color: rgba(234, 179, 8, 0.08);
  color: #ca8a04;
  border-color: rgba(234, 179, 8, 0.2);
}

.perf-badge.normal {
  background-color: rgba(16, 185, 129, 0.08);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}

.perf-badge.low {
  background-color: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

/* Doughnut Chart Styling */
.doughnut-chart-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
}

.doughnut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.doughnut-center-text .dg-small {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.doughnut-center-text .dg-large {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-active);
  white-space: nowrap;
  margin-top: 1px;
}

/* Responsiveness overrides for redesigned dashboard */
@media (max-width: 1200px) {
  .dashboard-metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-content-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-metrics-row {
    grid-template-columns: 1fr;
  }
  .performance-split-container {
    flex-direction: column;
    gap: 30px;
  }
  .dashboard-header-block {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-search-box {
    width: 100%;
  }
}

/* ==========================================
   AGENCY MANAGER DASHBOARD REFINEMENTS
   ========================================== */

/* Quick Action Buttons style */
.quick-action-btn-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-action-btn-dashboard svg {
  width: 14px;
  height: 14px;
}

.quick-action-btn-dashboard:hover {
  background-color: var(--border-color);
  color: var(--text-active);
  transform: translateY(-1px);
}

.quick-action-btn-dashboard.active {
  background-color: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.quick-action-btn-dashboard.active:hover {
  background-color: #1d4ed8;
}

/* Project Pipeline Widget */
.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pipeline-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pipeline-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-active);
}

.pipeline-client {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 6px;
}

.pipeline-percentage {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-blue);
}

body.dark-theme .pipeline-percentage {
  color: #60a5fa;
}

.pipeline-progress-track {
  width: 100%;
  height: 8px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

body.dark-theme .pipeline-progress-track {
  background-color: rgba(255, 255, 255, 0.05);
}

.pipeline-progress-fill {
  height: 100%;
  border-radius: 4px;
}

.pipeline-progress-fill.blue {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.pipeline-progress-fill.orange {
  background: linear-gradient(90deg, #f97316, #eab308);
}

.pipeline-progress-fill.green {
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* Staff performance vertical layout */
.performance-vertical-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.perf-table-wrapper {
  width: 100%;
}

.perf-chart-wrapper-centered {
  display: flex;
  justify-content: center;
  padding-top: 16px;
  border-top: 1px dashed var(--border-color);
  width: 100%;
}


/* ==========================================
   HIGH-FIDELITY WOW DASHBOARD LAYOUT & STYLES
   ========================================== */

/* Head Title */
.dashboard-head-title-block {
  margin-bottom: 24px;
}

.dashboard-view-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-active);
  letter-spacing: -0.8px;
}

.dashboard-view-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* Wow Metric Cards */
.wow-metric-card {
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 145px;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  border: none;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.wow-metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

/* Card Gradients */
.bg-green-gradient {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bg-orange-gradient {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.bg-blue-gradient {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.bg-red-gradient {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

/* Card internal parts */
.wmc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.wmc-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wmc-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wmc-icon-wrapper svg {
  width: 16px;
  height: 16px;
  color: #ffffff;
}

.wmc-body {
  margin-top: 10px;
  z-index: 2;
}

.wmc-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.wmc-value-lbl {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
  display: block;
}

.wmc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  font-size: 11px;
  z-index: 2;
}

.wmc-footer.column-layout {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.wmc-subtext {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.wmc-trend-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 30px;
}

.wmc-trend-badge.green-trend {
  background-color: #ffffff;
  color: #10b981;
}

.wmc-badge-transparent {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.wmc-progress-track {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.wmc-progress-fill {
  height: 100%;
  background-color: #ffffff;
  border-radius: 3px;
}

.wmc-progress-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.wmc-date-pill {
  font-size: 10px;
  font-weight: 800;
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
}

.wmc-warning-banner {
  background-color: rgba(0, 0, 0, 0.15);
  color: #fef08a;
  font-weight: 700;
  font-size: 10.5px;
  padding: 6px 12px;
  border-radius: 4px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wmc-warning-banner svg {
  width: 13px;
  height: 13px;
}

/* Background Sparklines & shadow icons */
.wmc-sparkline-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45px;
  pointer-events: none;
  z-index: 1;
}

.wmc-bg-shadow-icon {
  position: absolute;
  right: -10px;
  bottom: -15px;
  font-size: 80px;
  color: rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 1;
}

.wmc-bg-shadow-icon svg {
  width: 90px;
  height: 90px;
}

/* Quick Actions Box */
.wow-quick-actions-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.qa-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-active);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.qa-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.qa-card-btn {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.qa-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-focus);
  background-color: var(--bg-card);
}

.qa-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qa-icon svg {
  width: 18px;
  height: 18px;
}

.qa-icon.blue { background-color: rgba(59, 130, 246, 0.08); color: #3b82f6; }
.qa-icon.green { background-color: rgba(16, 185, 129, 0.08); color: #10b981; }
.qa-icon.purple { background-color: rgba(139, 92, 246, 0.08); color: #8b5cf6; }

.qa-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qa-btn-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-active);
}

.qa-btn-desc {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Group titles */
.column-group-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

/* Compact headers and text inside section cards */
.font-compact h3 {
  font-size: 13.5px !important;
}

.header-title-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-title-with-icon svg {
  width: 16px;
  height: 16px;
}

.header-title-with-icon.text-red { color: #ef4444; }
.header-title-with-icon.text-red h3 { color: var(--text-active); }

.header-title-with-icon.text-orange { color: #f97316; }
.header-title-with-icon.text-orange h3 { color: var(--text-active); }

.btn-outline-sm {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  background-color: transparent;
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-outline-sm:hover {
  background-color: var(--border-color);
  color: var(--text-active);
}

/* Table compact and Assignee columns */
.admin-table.compact td, .admin-table.compact th {
  padding: 6px 12px;
  font-size: 11.5px;
}

.assignee-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assignee-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Table Badge styles */
.badge-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-tag.orange {
  background-color: rgba(249, 115, 22, 0.08);
  color: #ea580c;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.badge-tag.blue {
  background-color: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Analytics Select and Legend styling */
.analytics-filter-select {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.chart-custom-legend {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.chart-revenue-total {
  color: var(--text-muted);
}

.chart-revenue-total strong {
  color: var(--accent-green);
  font-weight: 800;
}

.workflow-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.workflow-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.workflow-search-input {
  flex: 1;
}

.workflow-list {
  display: grid;
  gap: 14px;
}

.workflow-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  background: var(--bg-main);
}

.workflow-card-compact {
  padding: 14px 16px;
}

.workflow-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.workflow-job-code {
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 800;
}

.workflow-card h3 {
  margin: 4px 0;
  color: var(--text-active);
  font-size: 15px;
}

.workflow-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11.5px;
}

.workflow-stage-badge {
  color: var(--accent-blue);
  background: var(--accent-blue-light);
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 6px 8px;
  white-space: nowrap;
}

.workflow-compact-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.workflow-compact-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.workflow-compact-meta svg,
.workflow-compact-meta i {
  width: 13px;
  height: 13px;
}

.workflow-compact-meta .btn {
  margin-left: auto;
}

.workflow-stepper {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.workflow-step-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  background: var(--bg-card);
}

.workflow-step-dot.done {
  color: #ffffff;
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.workflow-step-dot.current {
  color: #ffffff;
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.workflow-next-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
}

.workflow-next-row span,
.workflow-next-row em {
  color: var(--text-muted);
  font-size: 11px;
}

.workflow-next-row strong {
  display: block;
  color: var(--text-active);
  font-size: 13px;
  margin-top: 2px;
}

.workflow-doc-status {
  margin-top: 6px !important;
  color: var(--text-muted);
  font-weight: 700;
}

.workflow-action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 320px;
}

.workflow-action-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 230px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.workflow-action-hint svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.workflow-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 28px;
}

.workflow-empty p {
  margin: 0 0 12px;
}

.workflow-empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.blue-dot { background-color: #3b82f6; }

/* Analytics Staff split for right column */
.analytics-staff-split {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analytics-staff-table {
  width: 100%;
}

.analytics-staff-chart-box {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-color);
}

.doughnut-custom-legends {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doughnut-custom-legends .legend-item {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.doughnut-custom-legends .legend-dot.red { background-color: #ef4444; }
.doughnut-custom-legends .legend-dot.orange { background-color: #f97316; }
.doughnut-custom-legends .legend-dot.green { background-color: #10b981; }
.doughnut-custom-legends .legend-dot.blue { background-color: #3b82f6; }

/* Adjust metric card height on medium viewports */
@media (max-width: 1200px) {
  .wow-quick-actions-card {
    padding: 12px 14px;
  }
  .qa-buttons-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .analytics-staff-chart-box {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
}

/* ==========================================
   HIGH-FIDELITY CLIENT DETAIL VIEW STYLES
   ========================================== */

/* Clickable table rows in clients list */
.clickable-rows tbody tr {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.clickable-rows tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.04) !important;
}

body.dark-theme .clickable-rows tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Breadcrumbs */
.client-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.breadcrumb-link {
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.breadcrumb-link:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.client-detail-floating-back {
  position: fixed;
  left: 84px;
  top: 118px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.client-detail-floating-back:hover {
  transform: translateY(-1px);
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.22);
}

.client-detail-floating-back i {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .client-detail-floating-back {
    left: 16px;
    top: 86px;
  }
}

.breadcrumb-separator {
  color: var(--border-color);
}

.breadcrumb-active {
  color: var(--text-active);
  font-weight: 700;
}

/* Client Detail Header Card */
.client-detail-header-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.cdh-left-brand {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.brand-square-logo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.dark-theme .brand-square-logo {
  background-color: #1e293b;
}

.shield-logo-icon {
  width: 42px;
  height: 42px;
  color: #0f172a;
}

body.dark-theme .shield-logo-icon {
  color: #ffffff;
}

.brand-text-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-name-row h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-active);
  letter-spacing: -0.5px;
}

.client-status-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.client-status-badge.active {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.client-status-badge.vip {
  background-color: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.brand-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 24px;
  font-size: 12px;
  margin-top: 4px;
}

.brand-meta-grid .meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-meta-grid .meta-item .lbl {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
}

.brand-meta-grid .meta-item strong, .brand-meta-grid .meta-item span {
  color: var(--text-active);
}

/* Personality tags */
.personality-tags-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.p-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 4px;
}

.personality-stubborn {
  background-color: #fef2f2;
  color: #ef4444;
  border: 1px solid #fee2e2;
}

.personality-urgent {
  background-color: #fff7ed;
  color: #ea580c;
  border: 1px solid #ffedd5;
}

.personality-detailed {
  background-color: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}

.personality-high-priority {
  background-color: #faf5ff;
  color: #7c3aed;
  border: 1px solid #f3e8ff;
}

/* Dark mode overrides for personality tags */
body.dark-theme .personality-stubborn { background-color: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: rgba(239, 68, 68, 0.25); }
body.dark-theme .personality-urgent { background-color: rgba(234, 88, 12, 0.15); color: #fdba74; border-color: rgba(234, 88, 12, 0.25); }
body.dark-theme .personality-detailed { background-color: rgba(37, 99, 235, 0.15); color: #93c5fd; border-color: rgba(37, 99, 235, 0.25); }
body.dark-theme .personality-high-priority { background-color: rgba(124, 58, 237, 0.15); color: #d8b4fe; border-color: rgba(124, 58, 237, 0.25); }

/* Right actions in client header */
.cdh-right-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
}

.cdh-right-actions .btn {
  width: 100%;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 12px;
}

/* Client Detail Tabs Menu */
.client-detail-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.cd-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 4px;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.cd-tab:hover {
  color: var(--text-active);
}

.cd-tab.active {
  color: var(--accent-blue);
}

.cd-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2.5px;
  background-color: var(--accent-blue);
  border-radius: 4px;
}

/* Client Detail Grid Layout */
.client-detail-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 24px;
  align-items: flex-start;
}

.cd-grid-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cd-grid-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Client sub cards */
.client-sub-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.sub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sub-card-header h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-active);
  text-transform: uppercase;
}

.btn-text-only {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-text-only:hover {
  text-decoration: underline;
}

/* Scrollable wrapper for horizontal timeline space saving */
.timeline-scroll-wrapper {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
}

.timeline-scroll-wrapper::-webkit-scrollbar {
  width: 5px;
}

.timeline-scroll-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.timeline-scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 4px;
}

/* Interaction Timeline */
.interaction-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 16px;
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
}

.interaction-timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background-color: var(--border-color);
}

.timeline-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.timeline-bullet {
  position: absolute;
  left: -16.5px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  z-index: 2;
}

.timeline-bullet.blue { border-color: #3b82f6; background-color: #3b82f6; }
.timeline-bullet.green { border-color: #10b981; background-color: #10b981; }
.timeline-bullet.orange { border-color: #f97316; background-color: #f97316; }
.timeline-bullet.purple { border-color: #8b5cf6; background-color: #8b5cf6; }
.timeline-bullet.cyan { border-color: #06b6d4; background-color: #06b6d4; }

.timeline-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.timeline-badge.contract { background-color: rgba(59, 130, 246, 0.08); color: #3b82f6; }
.timeline-badge.feedback { background-color: rgba(16, 185, 129, 0.08); color: #10b981; }
.timeline-badge.invoice { background-color: rgba(249, 115, 22, 0.08); color: #f97316; }
.timeline-badge.meeting { background-color: rgba(139, 92, 246, 0.08); color: #8b5cf6; }
.timeline-badge.update { background-color: rgba(6, 182, 212, 0.08); color: #06b6d4; }

.timeline-desc {
  font-size: 11.5px;
  color: var(--text-active);
  font-weight: 500;
  line-height: 1.4;
}

.timeline-author {
  font-size: 10.5px;
  color: var(--text-muted);
  font-style: italic;
}

/* File list compact table icons */
.file-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-active);
}

.file-icon-doc {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.file-icon-doc.pdf { color: #ef4444; }
.file-icon-doc.word { color: #3b82f6; }
.file-icon-doc.zip { color: #f59e0b; }

.download-link-btn {
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.download-link-btn:hover {
  color: var(--accent-blue);
}

/* Internal Notes Stack */
.internal-notes-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-card.pink {
  background-color: #fff1f2;
  color: #9f1239;
  border-left: 3px solid #f43f5e;
}

.note-card.yellow {
  background-color: #fefce8;
  color: #854d0e;
  border-left: 3px solid #eab308;
}

.note-card.blue {
  background-color: #eff6ff;
  color: #1e40af;
  border-left: 3px solid #3b82f6;
}

/* Dark mode overrides for notes */
body.dark-theme .note-card.pink { background-color: rgba(244, 63, 94, 0.08); color: #fda4af; }
body.dark-theme .note-card.yellow { background-color: rgba(234, 179, 8, 0.06); color: #fef08a; }
body.dark-theme .note-card.blue { background-color: rgba(59, 130, 246, 0.08); color: #93c5fd; }

.note-meta {
  font-size: 10px;
  color: rgba(0, 0, 0, 0.45);
  font-weight: 600;
  text-align: right;
}

body.dark-theme .note-meta {
  color: rgba(255, 255, 255, 0.4);
}

/* Credit Score gauge layout */
.credit-score-widget {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.credit-gauge-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-top: 10px;
}

.credit-gauge {
  width: 140px;
  height: 70px;
  position: relative;
  overflow: hidden;
}

.gauge-arc {
  position: absolute;
  top: 0;
  left: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 12px solid transparent;
  box-sizing: border-box;
}

.gauge-arc.shadow-arc {
  border-color: rgba(0, 0, 0, 0.04) rgba(0, 0, 0, 0.04) transparent transparent;
  transform: rotate(-135deg);
}

body.dark-theme .gauge-arc.shadow-arc {
  border-color: rgba(255, 255, 255, 0.04) rgba(255, 255, 255, 0.04) transparent transparent;
}

.gauge-arc.fill-arc {
  /* Credit gauge color fill arc */
  border-color: #f59e0b #f59e0b transparent transparent;
  z-index: 2;
}

.gauge-needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 4px;
  height: 55px;
  background-color: var(--text-active);
  transform-origin: bottom center;
  border-radius: 2px;
  margin-left: -2px;
  z-index: 3;
}

.gauge-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
}

.score-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-active);
  letter-spacing: -0.3px;
}

.score-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
}

.credit-criteria-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.credit-criteria-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
}

.criterion-name {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.criterion-name .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.criterion-name .dot.green { background-color: #10b981; }
.criterion-name .dot.orange { background-color: #f97316; }
.criterion-name .dot.red { background-color: #ef4444; }

.criterion-value {
  font-weight: 700;
}

.criterion-value.font-green { color: #10b981; }
.criterion-value.font-orange { color: #f97316; }
.criterion-value.font-red { color: #ef4444; }

.credit-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
}

.credit-update-date {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

.btn-xs {
  font-size: 10px;
  padding: 5px 10px;
}

.btn-block {
  width: 100%;
}

/* Responsive detail layout */
@media (max-width: 1200px) {
  .brand-meta-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .client-detail-grid {
    grid-template-columns: 1fr;
  }
  .cd-sub-cards-split {
    grid-template-columns: 1fr;
  }
  .client-detail-header-card {
    flex-direction: column;
  }
  .cdh-right-actions {
    width: 100%;
  }
}

/* Premium UI Overrides for Client Details Page */
.timeline-item {
  display: flex;
  align-items: flex-start;
  position: relative;
  padding-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
}

.timeline-box-card {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  transition: all var(--transition-fast);
}

.timeline-box-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

.sub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.sub-card-header h3 {
  font-size: 11.5px !important;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.sub-card-header .btn-sm, .sub-card-header .btn-text-only {
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 4px;
  background-color: rgba(59, 130, 246, 0.08);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.15);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sub-card-header .btn-sm:hover, .sub-card-header .btn-text-only:hover {
  background-color: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.file-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-icon-box.pdf { background-color: rgba(239, 68, 68, 0.08); }
.file-icon-box.word { background-color: rgba(59, 130, 246, 0.08); }
.file-icon-box.zip { background-color: rgba(245, 158, 11, 0.08); }

.file-type-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  background-color: rgba(0, 0, 0, 0.03);
  padding: 2px 8px;
  border-radius: 4px;
}

body.dark-theme .file-type-badge {
  background-color: rgba(255, 255, 255, 0.03);
}

.interaction-timeline::before {
  left: 4.5px;
  border-left: 1px dashed var(--border-color);
  background: none;
  width: 0;
}

.timeline-bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  left: -15.5px;
  top: 14px;
  z-index: 2;
}

.timeline-bullet.blue { background-color: #3b82f6; box-shadow: 0 0 0 3px var(--bg-card), 0 0 8px rgba(59, 130, 246, 0.5); }
.timeline-bullet.green { background-color: #10b981; box-shadow: 0 0 0 3px var(--bg-card), 0 0 8px rgba(16, 185, 129, 0.5); }
.timeline-bullet.orange { background-color: #f97316; box-shadow: 0 0 0 3px var(--bg-card), 0 0 8px rgba(249, 115, 22, 0.5); }
.timeline-bullet.purple { background-color: #8b5cf6; box-shadow: 0 0 0 3px var(--bg-card), 0 0 8px rgba(139, 92, 246, 0.5); }
.timeline-bullet.cyan { background-color: #06b6d4; box-shadow: 0 0 0 3px var(--bg-card), 0 0 8px rgba(6, 182, 212, 0.5); }

/* ==========================================
   HIGH-FIDELITY INCOME MANAGEMENT STYLES
   ========================================== */

/* Header Block */
.income-head-block {
  margin-bottom: 24px;
}

.income-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.income-head-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pill-btn {
  border-radius: var(--radius-full);
}

.data-update-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.data-update-pill svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* 4 Fintech Metric Cards grid layout */
.income-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.income-metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 145px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.income-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.imc-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.imc-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.imc-icon-wrapper svg {
  width: 18px;
  height: 18px;
}

.imc-icon-wrapper.bg-soft-green { background-color: rgba(16, 185, 129, 0.08); color: #10b981; }
.imc-icon-wrapper.bg-soft-orange { background-color: rgba(249, 115, 22, 0.08); color: #f97316; }
.imc-icon-wrapper.bg-soft-blue { background-color: rgba(59, 130, 246, 0.08); color: #3b82f6; }
.imc-icon-wrapper.bg-soft-purple { background-color: rgba(139, 92, 246, 0.08); color: #8b5cf6; }

.imc-title-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.imc-title-box span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.imc-title-box .i-icon {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.imc-title-box h3 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.imc-title-box h3.text-green-bold { color: #10b981; }
.imc-title-box h3.text-orange-bold { color: #f97316; }
.imc-title-box h3.text-blue-bold { color: #3b82f6; }
.imc-title-box h3.text-purple-bold { color: #8b5cf6; }

.imc-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trend-green-pill {
  font-size: 10px;
  font-weight: 800;
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.imc-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.imc-body.no-gap {
  gap: 0;
}

.imc-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.imc-progress-bar-track {
  width: 100%;
  height: 6px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

body.dark-theme .imc-progress-bar-track {
  background-color: rgba(255, 255, 255, 0.05);
}

.imc-progress-fill {
  height: 100%;
  border-radius: 3px;
}

.imc-progress-fill.bg-green { background: linear-gradient(90deg, #10b981, #059669); }
.imc-progress-fill.bg-purple { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }

.imc-progress-lbl {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.imc-footer-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
}

.imc-footer-link:hover {
  color: var(--text-active);
}

.imc-footer-link .arrow-icon {
  width: 14px;
  height: 14px;
}

/* Mini Column charts */
.imc-mini-charts-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 52px;
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px dashed var(--border-color);
}

.mini-bar {
  width: 14px;
  background-color: rgba(59, 130, 246, 0.12);
  border-radius: 3px 3px 0 0;
  position: relative;
  display: flex;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

body.dark-theme .mini-bar {
  background-color: rgba(255, 255, 255, 0.08);
}

.mini-bar:hover {
  background-color: rgba(59, 130, 246, 0.3);
}

.mini-bar.active {
  background-color: #3b82f6;
}

body.dark-theme .mini-bar.active {
  background-color: #60a5fa;
}

.mini-bar .bar-lbl {
  position: absolute;
  bottom: -15px;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Horizontal Transaction Filters Panel */
.transaction-filter-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.tf-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-active);
  font-weight: 800;
  margin-bottom: 14px;
}

.tf-title-row svg {
  width: 16px;
  height: 16px;
  color: var(--accent-blue);
}

.tf-title-row h4 {
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tf-grid-inputs {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.tf-input-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tf-input-col label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tf-input-col select, .tf-input-col input {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-active);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  width: 100%;
}

.tf-input-col select:focus, .tf-input-col input:focus {
  border-color: var(--border-focus);
}

/* Date range specific */
.date-range-group {
  display: flex;
  align-items: center;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 8px;
}

.date-range-group input {
  border: none;
  background: transparent;
  padding: 8px 0;
  text-align: center;
}

.date-range-group .sep {
  color: var(--text-muted);
  font-weight: 700;
  padding: 0 4px;
}

/* Search wrap */
.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.search-input-wrapper input {
  padding-left: 32px;
}

/* Actions Row in Filter */
.tf-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px dashed var(--border-color);
  padding-top: 14px;
}

/* Table header actions & pagination styles */
.flex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-header-left .header-icon-green {
  width: 18px;
  height: 18px;
  color: #10b981;
}

.table-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.results-txt {
  font-size: 11px;
  color: var(--text-muted);
}

.results-txt strong {
  color: var(--text-active);
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pag-btn {
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pag-btn:hover {
  background-color: var(--border-color);
  color: var(--text-active);
}

.pag-btn.active {
  background-color: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.pag-btn svg {
  width: 12px;
  height: 12px;
}

.pag-dots {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px;
}

.page-size-select {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

/* Document specific square badges */
.doc-square-badge {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid transparent;
}

.doc-square-badge.bg-iv {
  background-color: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

.doc-square-badge.bg-hd {
  background-color: rgba(16, 185, 129, 0.08);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}

.doc-square-badge.bg-bg {
  background-color: rgba(249, 115, 22, 0.08);
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.2);
}

/* Table Summary Footer Bar */
.table-summary-footer-bar {
  display: flex;
  justify-content: space-between;
  background-color: var(--bg-main);
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.summary-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-col .lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.summary-col .val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-active);
}

.summary-col .val.val-green { color: #10b981; }
.summary-col .val.val-orange { color: #f97316; }
.summary-col .val.val-blue { color: #3b82f6; }

/* Responsive adjustments */
@media (max-width: 1200px) {
  .income-metrics-row {
    grid-template-columns: 1fr 1fr;
  }
  .tf-grid-inputs {
    grid-template-columns: 1fr 1fr;
  }
  .table-summary-footer-bar {
    flex-wrap: wrap;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .income-metrics-row {
    grid-template-columns: 1fr;
  }
  .tf-grid-inputs {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   HIGH-FIDELITY PROJECT MANAGEMENT STYLES
   ========================================== */
.projects-filter-box {
  background-color: var(--bg-card) !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-color) !important;
}

.project-mini-dashboard-row {
  margin-bottom: 24px;
}

.toggle-heading {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text-active);
}

.toggle-heading-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.toggle-heading-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.toggle-heading[aria-expanded="true"] .toggle-heading-chevron {
  transform: rotate(180deg);
}

.toggle-section-content.is-collapsed {
  display: none;
}

.mini-dash-toggle {
  margin-bottom: 14px;
}

.table-toggle-heading {
  padding: 4px 0;
}

.table-box-projects .toggle-section-content {
  margin-top: 12px;
}

.mini-dash-section-title {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-active);
  letter-spacing: 0.5px;
  margin: 0;
}

.pmd-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.pmd-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.pmd-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pmd-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pmd-icon-box svg {
  width: 20px;
  height: 20px;
}

.pmd-icon-box.bg-soft-blue { background-color: rgba(59, 130, 246, 0.08); color: #3b82f6; }
.pmd-icon-box.bg-soft-green { background-color: rgba(16, 185, 129, 0.08); color: #10b981; }
.pmd-icon-box.bg-soft-purple { background-color: rgba(139, 92, 246, 0.08); color: #8b5cf6; }
.pmd-icon-box.bg-soft-orange { background-color: rgba(249, 115, 22, 0.08); color: #f97316; }
.pmd-icon-box.bg-soft-red { background-color: rgba(239, 68, 68, 0.08); color: #ef4444; }

.pmd-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.pmd-info .lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.pmd-info .val {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-active);
}

.pmd-info .val.text-green-bold { color: #10b981; }
.pmd-info .val.text-purple-bold { color: #8b5cf6; }
.pmd-info .val.text-orange-bold { color: #f97316; }
.pmd-info .val.text-red-bold { color: #ef4444; }

.pmd-foot {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Red warning text for high modification project counts */
.text-warning-red {
  color: #ef4444;
  font-weight: 800;
}

/* Custom styled task and drive buttons in table action row */
.action-btn.task-custom {
  color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.action-btn.task-custom:hover {
  background-color: #3b82f6;
  color: #ffffff;
}

.action-btn.drive-custom {
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.action-btn.drive-custom:hover {
  background-color: #10b981;
  color: #ffffff;
}

/* Responsive projects view elements */
@media (max-width: 1300px) {
  .pmd-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .pmd-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .pmd-grid {
    grid-template-columns: 1fr;
  }
}

/* HR Member Cards Premium Styling overrides */
.hr-card-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.15);
  background-color: rgba(239, 68, 68, 0.05);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: 10;
}

.hr-card-edit-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.15);
  background-color: rgba(59, 130, 246, 0.05);
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: 10;
}

.hr-card:hover .hr-card-delete-btn,
.hr-card:hover .hr-card-edit-btn {
  opacity: 1;
}

.hr-card-delete-btn:hover {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.hr-card-edit-btn:hover {
  background-color: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

.hr-photo-frame {
  position: relative;
  overflow: visible !important;
}

.status-indicator-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  z-index: 5;
}

.status-indicator-dot.green { background-color: #10b981; }
.status-indicator-dot.orange { background-color: #f97316; }
.status-indicator-dot.red { background-color: #ef4444; }

.text-green { color: #10b981 !important; font-weight: 700; }
.text-orange { color: #f97316 !important; font-weight: 700; }
.text-red { color: #ef4444 !important; font-weight: 700; }

/* ==========================================
   HIGH-FIDELITY CHATBOT MANAGER STYLES
   ========================================== */
.chatbot-manager-split-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.chatbot-manager-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chatbot-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chatbot-status-card {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chatbot-status-label {
  font-size: 9.5px;
  font-weight: 900;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0;
}

.chatbot-status-card strong {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-active);
}

.chatbot-status-card small {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 650;
}

.chatbot-panel {
  border-radius: var(--radius-sm);
}

.chatbot-config-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chatbot-config-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
}

.chatbot-config-form label {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0;
}

.chatbot-config-form .form-input {
  width: 100%;
  font-size: 12px;
  font-weight: 750;
  padding: 10px 12px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-active);
}

.chatbot-config-form textarea.form-input {
  min-height: 126px;
  resize: vertical;
  line-height: 1.5;
  font-weight: 650;
}

.chatbot-form-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 12px;
}

.chatbot-secret-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.06);
  border-radius: var(--radius-sm);
  color: var(--text-active);
}

.chatbot-secret-box svg {
  width: 18px;
  height: 18px;
  color: var(--accent-blue);
  flex: 0 0 auto;
}

.chatbot-secret-box strong,
.chatbot-secret-box span {
  display: block;
}

.chatbot-secret-box strong {
  font-size: 11.5px;
  font-weight: 900;
}

.chatbot-secret-box span {
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 650;
}

.chatbot-range-group input {
  width: 100%;
  cursor: pointer;
}

.chatbot-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.chatbot-file-picker {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
}

.chatbot-file-picker input {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.chatbot-file-picker strong,
.chatbot-file-picker span {
  display: block;
}

.chatbot-file-picker strong {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--text-active);
}

.chatbot-file-picker span {
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.45;
  color: var(--text-muted);
}

.chatbot-action-status {
  min-height: 18px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.chatbot-action-status.is-success {
  color: var(--accent-green);
}

.chatbot-action-status.is-error {
  color: #ef4444;
}

.chatbot-full-btn {
  width: 100%;
  justify-content: center;
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.chatbot-training-box {
  margin-top: 0;
  border-top: 1px dashed var(--border-color);
  padding-top: 14px;
}

/* Knowledge Base vertical stack */
.knowledge-files-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.knowledge-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-active);
  position: relative;
}

.knowledge-item.is-empty {
  color: var(--text-muted);
  border-style: dashed;
  font-weight: 650;
}

.knowledge-item span {
  flex: 1;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.45;
  word-break: break-word;
}

.knowledge-item strong {
  line-height: 1.35;
  word-break: break-word;
}

.delete-k-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-k-btn:hover {
  color: #ef4444;
}

/* Chatbot Live Simulator Widget */
.chatbot-demo-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
}

.chatbot-demo-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-main);
}

.bot-avatar-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar-frame {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.status-dot-pulse {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border-radius: 50%;
  border: 1.5px solid var(--bg-main);
  animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.bot-info-details h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-active);
}

.bot-info-details span {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.reset-chat-btn {
  color: var(--text-muted);
}

.reset-chat-btn:hover {
  color: #ef4444;
}

/* Chat threads list */
.chatbot-chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chatbot-chat-window::-webkit-scrollbar {
  width: 5px;
}

.chatbot-chat-window::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-chat-window::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 4px;
}

.chat-bubble {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.45;
}

.chat-bubble.bot {
  align-self: flex-start;
  background-color: var(--bg-main);
  color: var(--text-active);
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border-color);
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.chat-bubble .chat-time {
  font-size: 8.5px;
  font-weight: 600;
  opacity: 0.6;
  text-align: right;
}

.chat-bubble.bot .chat-time {
  color: var(--text-muted);
}

.chat-bubble.user .chat-time {
  color: rgba(255, 255, 255, 0.8);
}

/* Chat typing bounce dots indicator */
.chat-typing-indicator {
  align-self: flex-start;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  display: flex;
  gap: 4px;
  margin-left: 20px;
  margin-bottom: 12px;
  width: fit-content;
}

.chat-typing-indicator .dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.chat-typing-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
.chat-typing-indicator .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Chat Bottom Input Bar */
.chatbot-chat-input-bar {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card);
  display: flex;
  gap: 12px;
  align-items: center;
}

.internal-chat-input-shell {
  position: relative;
  flex: 1;
}

.chatbot-chat-input-bar input {
  flex: 1;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-active);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  outline: none;
  width: 100%;
}

.chatbot-chat-input-bar input:focus {
  border-color: var(--border-focus);
}

.chatbot-chat-input-bar button {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: none;
  background-color: var(--accent-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.chatbot-chat-input-bar button:hover {
  background-color: #2563eb;
}

.chatbot-chat-input-bar button svg {
  width: 16px;
  height: 16px;
}

.internal-chat-mention-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  max-height: 220px;
  overflow: auto;
  z-index: 50;
}

.chatbot-chat-input-bar .internal-chat-mention-option {
  width: 100%;
  height: auto;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: block;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.chatbot-chat-input-bar .internal-chat-mention-option:hover,
.chatbot-chat-input-bar .internal-chat-mention-option.is-active {
  background: rgba(37, 99, 235, 0.08);
  color: inherit;
}

.chatbot-chat-input-bar .internal-chat-mention-option strong {
  color: var(--text-active);
  font-size: 12px;
  display: block;
  line-height: 1.35;
  word-break: break-word;
}

.chatbot-chat-input-bar .internal-chat-mention-option span {
  color: var(--text-muted);
  font-size: 11px;
  display: block;
  margin-top: 4px;
  line-height: 1.4;
  word-break: break-word;
}

/* Responsive splits */
@media (max-width: 992px) {
  .chatbot-manager-split-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   ADMIN UI FIT & RESPONSIVE REFINEMENT
   ========================================== */
:root {
  --sidebar-width: 232px;
  --topbar-height: 66px;
  --admin-container-max: 1280px;
  --admin-gap: clamp(14px, 1.8vw, 22px);
}

html {
  font-size: clamp(13px, 0.86vw, 14px);
}

body {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.06), transparent 28rem),
    radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.05), transparent 24rem),
    var(--bg-main);
}

.admin-wrapper {
  width: 100%;
}

.sidebar {
  box-shadow: 1px 0 0 var(--border-color);
}

.logo-header,
.user-profile {
  padding: 18px 16px;
}

.logo-icon-wrapper {
  width: 126px;
  height: 44px;
}

.logo-title {
  font-size: 13.5px;
}

.logo-slogan,
.logo-sub-slogan {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-wrapper {
  width: 40px;
  height: 40px;
}

.sidebar-nav {
  padding: 18px 12px;
  gap: 20px;
}

.nav-item {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 10px;
}

.nav-label {
  font-size: 12.5px;
  min-width: 0;
}

.topbar {
  padding: 0 clamp(14px, 2vw, 22px);
  gap: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-right {
  min-width: 0;
  gap: 12px;
}

.topbar-title-wrapper {
  min-width: 0;
}

.current-section-title {
  font-size: clamp(16px, 1.5vw, 18px);
}

.topbar-subtitle {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-center {
  max-width: 360px;
  margin: 0 clamp(8px, 1.5vw, 18px);
}

.dashboard-search-box {
  width: 100%;
  min-width: 220px;
}

.clock-widget {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.theme-toggle-btn,
.quick-user {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.page-container {
  max-width: var(--admin-container-max);
  padding: var(--admin-gap);
}

.dashboard-head-title-block,
.income-head-block {
  margin-bottom: var(--admin-gap);
}

.dashboard-view-title {
  font-size: clamp(21px, 2.4vw, 26px);
}

.dashboard-metrics-row,
.income-metrics-row,
.project-mini-dashboard-row,
.metrics-grid,
.summary-grid,
.projects-grid,
.hr-grid {
  gap: var(--admin-gap);
}

.dashboard-metrics-row,
.income-metrics-row {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.project-mini-dashboard-row {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metrics-grid,
.summary-grid,
.projects-grid,
.hr-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dashboard-content-layout,
.dashboard-grid,
.client-detail-grid,
.chatbot-manager-split-layout {
  gap: var(--admin-gap);
  min-width: 0;
}

.content-col-left,
.content-col-right,
.cd-grid-left,
.cd-grid-right,
.dashboard-section-card,
.client-sub-card,
.table-card,
.chart-card,
.info-card,
.table-responsive {
  min-width: 0;
}

.dashboard-content-layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.85fr);
}

.client-detail-grid {
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 0.85fr);
}

.chatbot-manager-split-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
}

.wow-metric-card,
.income-metric-card {
  min-height: 128px;
  padding: clamp(16px, 2vw, 20px);
}

.wmc-value {
  font-size: clamp(22px, 2.4vw, 28px);
}

.imc-title-box h3 {
  font-size: clamp(17px, 1.9vw, 22px);
}

.wow-quick-actions-card,
.dashboard-section-card,
.table-card,
.chart-card,
.info-card,
.summary-card,
.project-card,
.hr-card,
.config-card,
.notifications-card,
.settings-card,
.client-detail-header-card,
.client-sub-card,
.income-metric-card,
.filter-panel-card,
.chatbot-demo-card,
.pmd-card {
  border-radius: 14px;
}

.wow-quick-actions-card,
.dashboard-section-card,
.chart-card,
.info-card,
.summary-card,
.project-card,
.config-card,
.notifications-card,
.settings-card,
.client-sub-card,
.filter-panel-card {
  padding: clamp(16px, 2vw, 22px);
}

.qa-buttons-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.qa-card-btn {
  padding: 13px 16px;
}

.chart-container {
  height: clamp(220px, 28vw, 280px);
}

.chart-container-redesigned {
  height: clamp(170px, 24vw, 220px);
}

.analytics-staff-split {
  gap: 16px;
}

.doughnut-chart-wrapper {
  width: 112px;
  height: 112px;
}

.table-card {
  padding: 0;
}

.table-card-header,
.sub-card-header,
.card-title-header,
.income-title-row,
.filter-panel-header,
.table-controls-row {
  gap: 12px;
}

.table-card-header {
  padding: 18px clamp(16px, 2vw, 24px);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  min-width: 720px;
}

.admin-table th {
  padding: 12px clamp(14px, 1.7vw, 20px);
}

.admin-table td {
  padding: 14px clamp(14px, 1.7vw, 20px);
}

.admin-table.borderless td,
.admin-table.borderless th,
.admin-table.compact td,
.admin-table.compact th {
  padding: 8px 10px;
}

.client-detail-header-card {
  padding: clamp(18px, 2.2vw, 24px);
  gap: var(--admin-gap);
}

.cdh-left-brand,
.brand-name-row,
.income-title-row,
.income-head-right,
.table-controls-row,
.filter-grid,
.client-detail-tabs {
  min-width: 0;
}

.brand-meta-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.cdh-right-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-detail-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.client-detail-tabs::-webkit-scrollbar {
  display: none;
}

.cd-tab {
  flex-shrink: 0;
}

.income-metric-card {
  min-width: 0;
}

.filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.income-table-card .admin-table,
.projects-page-table .admin-table {
  min-width: 900px;
}

.chatbot-demo-card {
  height: min(560px, calc(100svh - 130px));
  min-height: 460px;
}

.chatbot-chat-window {
  padding: 16px;
}

.chatbot-chat-input-bar {
  padding: 12px 16px;
}

input,
select,
textarea {
  max-width: 100%;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 218px;
  }

  .topbar-center {
    max-width: 300px;
  }

  .dashboard-content-layout,
  .dashboard-grid,
  .client-detail-grid,
  .chatbot-manager-split-layout {
    grid-template-columns: 1fr;
  }

  .cdh-right-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 992px) {
  :root {
    --topbar-height: 64px;
  }

  .sidebar {
    width: min(86vw, 280px);
    display: none;
    transform: none;
    box-shadow: 12px 0 30px rgba(15, 23, 42, 0.12);
  }

  .sidebar.active {
    display: flex;
    transform: none;
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle-btn {
    display: flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
  }

  .topbar-center {
    display: none;
  }

  .topbar-right {
    gap: 8px;
  }

  .quick-user {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
    position: absolute;
    top: 14px;
    right: 12px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
  }

  .logo-header {
    padding-right: 52px;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 13px;
  }

  .topbar {
    align-items: center;
  }

  .topbar-subtitle,
  .clock-widget {
    display: none;
  }

  .page-container {
    padding: 14px;
  }

  .dashboard-metrics-row,
  .income-metrics-row,
  .project-mini-dashboard-row,
  .metrics-grid,
  .summary-grid,
  .projects-grid,
  .hr-grid,
  .qa-buttons-grid,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .table-card-header,
  .sub-card-header,
  .card-title-header,
  .income-title-row,
  .income-head-right,
  .table-controls-row,
  .client-detail-header-card,
  .cdh-left-brand,
  .brand-name-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-square-logo {
    width: 64px;
    height: 64px;
  }

  .cdh-right-actions,
  .cdh-right-actions .btn,
  .income-head-right,
  .income-head-right .btn,
  .table-card-header .btn,
  .sub-card-header .btn {
    width: 100%;
  }

  .admin-table {
    min-width: 680px;
  }

  .chart-card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .analytics-staff-split {
    grid-template-columns: 1fr;
  }

  .analytics-staff-chart-box {
    justify-content: flex-start;
  }

  .chatbot-demo-card {
    height: 520px;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 0 12px;
  }

  .current-section-title {
    max-width: 190px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .theme-toggle-btn {
    width: 34px;
    height: 34px;
  }

  .wow-metric-card,
  .income-metric-card,
  .wow-quick-actions-card,
  .dashboard-section-card,
  .client-detail-header-card,
  .client-sub-card,
  .filter-panel-card,
  .chatbot-demo-card {
    border-radius: 12px;
  }

  .qa-card-btn {
    align-items: flex-start;
  }

  .brand-meta-grid {
    grid-template-columns: 1fr;
  }

  .btn,
  .btn-primary-action,
  .btn-secondary-outline {
    justify-content: center;
  }
}

/* Desktop collapsed sidebar rail */
:root {
  --sidebar-collapsed-width: 72px;
  --sidebar-expanded-width: 232px;
}

@media (min-width: 993px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
    overflow-x: hidden;
    transition:
      width var(--transition-normal),
      background-color var(--transition-normal),
      box-shadow var(--transition-normal);
  }

  .sidebar:hover {
    width: var(--sidebar-expanded-width);
    box-shadow: 18px 0 38px rgba(15, 23, 42, 0.10);
  }

  .main-content {
    margin-left: var(--sidebar-collapsed-width);
  }

  .logo-header,
  .user-profile {
    justify-content: center;
    padding-inline: 14px;
  }

  .sidebar:hover .logo-header,
  .sidebar:hover .user-profile {
    justify-content: flex-start;
    padding-inline: 16px;
  }

  .logo-icon-wrapper {
    width: 44px;
    height: 38px;
  }

  .sidebar:hover .logo-icon-wrapper {
    width: 126px;
    height: 44px;
  }

  .logo-info,
  .profile-info,
  .group-title,
  .nav-label,
  .badge {
    opacity: 0;
    visibility: hidden;
    width: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition:
      opacity var(--transition-fast),
      max-width var(--transition-normal),
      width var(--transition-normal);
  }

  .sidebar:hover .logo-info,
  .sidebar:hover .profile-info,
  .sidebar:hover .group-title,
  .sidebar:hover .nav-label,
  .sidebar:hover .badge {
    opacity: 1;
    visibility: visible;
    width: auto;
    max-width: 180px;
  }

  .sidebar-nav {
    padding-inline: 10px;
  }

  .nav-group {
    gap: 8px;
  }

  .nav-item {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
  }

  .sidebar:hover .nav-item {
    justify-content: flex-start;
    gap: 12px;
    padding-inline: 12px;
  }

  .nav-icon {
    width: 19px;
    height: 19px;
  }

  .sidebar:hover .nav-label {
    flex: 1;
  }

  .sidebar:hover .badge {
    flex-shrink: 0;
  }

  .sidebar:not(:hover) .notification-nav-item.has-unread .badge {
    opacity: 1;
    visibility: visible;
    position: absolute;
    top: 8px;
    right: 10px;
    width: 9px;
    height: 9px;
    max-width: 9px;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
    line-height: 0;
    overflow: visible;
  }

	  .profile-email,
  .logo-slogan,
  .logo-sub-slogan {
    max-width: 140px;
  }
}

/* Add Client Modal Premium UI Styling */
.client-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.client-form-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cf-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-main);
}

.cf-header h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-active);
  text-transform: uppercase;
  margin: 0;
}

.cf-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.cf-close-btn:hover {
  background-color: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.cf-body {
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.cf-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cf-group label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cf-group input,
.cf-group select,
.cf-group textarea {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-active);
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.cf-group input:focus,
.cf-group select:focus,
.cf-group textarea:focus {
  border-color: var(--border-focus);
}

.cf-group textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}

.cf-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
}

/* Project Action Dropdown styling */
.client-action-dropdown {
  position: absolute;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 6px 0;
  min-width: 160px;
  display: none;
  flex-direction: column;
}

.client-action-dropdown button {
  background: transparent;
  border: none;
  padding: 8px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-active);
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.client-action-dropdown button:hover {
  background-color: var(--bg-main);
  color: var(--accent-blue);
}

.client-action-dropdown button.delete-action {
  color: #ef4444 !important;
}

.client-action-dropdown button.delete-action:hover {
  background-color: rgba(239, 68, 68, 0.06);
}

/* Delete Note Button Styling */
.note-card {
  position: relative;
}

.delete-note-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  padding: 4px;
}

.delete-note-btn:hover {
  opacity: 1;
  color: #ef4444;
}

/* ==========================================
   LOGIN SCREEN STYLES
   ========================================== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 40%),
              radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.1), transparent 40%),
              #0f172a;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  font-family: var(--font-family);
  color: #f8fafc;
}

body.light-theme .login-wrapper {
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 40%),
              radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.05), transparent 40%),
              #f8fafc;
  color: #0f172a;
}

.login-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 45px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  transition: all var(--transition-normal);
}

body.light-theme .login-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.login-logo .brand-logo-svg {
  width: 60px;
  height: 60px;
  margin-bottom: 12px;
  animation: logo-float 4s ease-in-out infinite;
}

.login-logo .brand-logo-img {
  width: 230px;
  height: 66px;
  object-fit: contain;
  margin-bottom: 12px;
  animation: logo-float 4s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.login-logo .logo-info {
  text-align: center;
}

.login-logo .logo-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-blue);
  margin-bottom: 2px;
}

.login-logo .logo-slogan {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-muted);
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 35px;
}

.login-form-group {
  margin-bottom: 22px;
  text-align: left;
}

.login-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-icon-wrapper {
  position: relative;
  width: 100%;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.input-icon-wrapper input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 14px;
  transition: all var(--transition-fast);
}

body.light-theme .input-icon-wrapper input {
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

.input-icon-wrapper input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: rgba(15, 23, 42, 0.8);
}

body.light-theme .input-icon-wrapper input:focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-icon-wrapper input:focus + .input-icon {
  color: var(--accent-blue);
}

.login-error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 22px;
  text-align: left;
  animation: shake 0.4s ease-in-out;
}

body.light-theme .login-error-msg {
  background: rgba(239, 68, 68, 0.05);
  color: #dc2626;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--accent-blue);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-login:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

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

/* Role-based display rules */
body.role-user .delete-note-btn {
  display: none !important;
}
body.role-user #btn-client-delete {
  display: none !important;
}
body.role-user #btn-client-edit {
  display: none !important;
}
body.role-user #qa-assign-task {
  display: none !important;
}
body.role-user #btn-add-new-project-modal {
  display: none !important;
}
body.role-mode .hr-admin-actions,
body.role-user .hr-admin-actions {
  display: none !important;
}

/* Mobile admin cleanup: keep desktop look, avoid squeezed controls */
@media (max-width: 640px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .main-content {
    min-width: 0;
  }

  .topbar {
    height: 76px;
    padding: 0 14px;
    gap: 10px;
  }

  .current-section-title {
    max-width: 56vw;
    font-size: 21px;
    line-height: 1.15;
  }

  .theme-toggle-btn,
  .menu-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .page-container {
    padding: 18px 14px 132px;
  }

  .client-breadcrumb {
    margin-bottom: 18px;
    font-size: 13px;
    overflow: hidden;
    white-space: nowrap;
  }

  .income-head-block {
    margin-bottom: 22px;
  }

  #page-projects .income-title-row {
    gap: 10px;
  }

  #page-projects .dashboard-view-title {
    align-items: flex-start !important;
    gap: 10px !important;
    font-size: clamp(30px, 9vw, 42px);
    line-height: 1.02;
    letter-spacing: -1.2px;
  }

  #page-projects .dashboard-view-title i {
    width: 30px !important;
    height: 30px !important;
    margin-top: 5px;
    flex-shrink: 0;
  }

  #page-projects .dashboard-view-subtitle {
    max-width: 100%;
    margin-top: 12px;
    font-size: 18px;
    line-height: 1.35;
  }

  #page-projects .projects-filter-box {
    padding: 18px;
    border-radius: 18px !important;
    margin-bottom: 26px;
  }

  #page-projects .projects-filter-box .tf-title-row {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 18px !important;
  }

  #page-projects .projects-filter-box .tf-title-row > div:first-child {
    width: 100%;
    align-items: center !important;
  }

  #page-projects .projects-filter-box .tf-title-row h4 {
    max-width: 210px;
    font-size: 24px !important;
    line-height: 1.08;
    letter-spacing: -0.3px;
  }

  #page-projects .projects-filter-box .tf-actions-row-right {
    width: 100%;
    display: grid !important;
    grid-template-columns: 52px 1fr;
    gap: 10px !important;
  }

  body.role-user #page-projects .projects-filter-box .tf-actions-row-right {
    grid-template-columns: 52px;
  }

  #btn-export-projects {
    width: 52px;
    min-width: 52px;
    padding: 0;
    font-size: 0;
  }

  #btn-export-projects i {
    width: 19px;
    height: 19px;
  }

  #btn-export-projects i:last-child {
    display: none;
  }

  #btn-add-new-project-modal {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1;
  }

  #page-projects .tf-grid-inputs {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-bottom: 0;
  }

  #page-projects .tf-input-col {
    gap: 7px;
  }

  #page-projects .tf-input-col label {
    font-size: 11px;
    line-height: 1.15;
    letter-spacing: 0.3px;
  }

  #page-projects .tf-input-col select,
  #page-projects .tf-input-col input {
    width: 100%;
    min-height: 48px;
    font-size: 14px;
    font-weight: 700;
  }

  #page-projects .search-input-wrapper {
    width: 100%;
  }

  #page-projects .project-mini-dashboard-row {
    margin: 28px 0 22px;
  }

  #page-projects .mini-dash-toggle,
  #page-projects .table-toggle-heading {
    padding: 4px 2px;
  }

  #page-projects .mini-dash-section-title,
  #page-projects .table-toggle-heading span:last-child {
    font-size: 22px !important;
    line-height: 1.1;
    letter-spacing: -0.3px;
  }

  #page-projects .toggle-heading-left {
    gap: 10px;
  }

  #page-projects .toggle-heading-left i {
    width: 28px !important;
    height: 28px !important;
  }

  #page-projects .table-card,
  #page-projects .workflow-panel {
    border-radius: 18px;
  }

  #page-projects .table-box-projects {
    margin-bottom: 22px;
  }

  #page-projects .table-responsive {
    margin: 0 -2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #page-projects .admin-table {
    min-width: 760px;
  }

  #page-projects .workflow-panel {
    padding: 14px;
  }

  #page-projects .internal-chat-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
  }

  #page-projects .internal-chat-tabs .site-builder-tab {
    min-height: 48px;
    padding: 10px 8px;
    font-size: 14px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }

  #page-projects .workflow-search-row,
  #page-projects .chatbot-manager-split-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  #page-projects .workflow-search-row > div,
  #page-projects .chatbot-manager-split-layout > div {
    width: 100% !important;
    min-width: 0;
  }

  #page-projects .workflow-card,
  #page-projects .client-sub-card,
  #page-projects .chatbot-demo-card {
    border-radius: 16px;
  }

  #page-projects .chatbot-demo-card {
    min-height: 470px !important;
    height: auto;
  }

  #page-projects .chatbot-chat-window {
    min-height: 290px;
    max-height: 48vh;
  }

  #page-projects .chatbot-chat-input-bar {
    gap: 8px;
    padding: 10px;
  }

  #page-projects .chatbot-chat-input-bar input,
  #page-projects .internal-chat-input-shell {
    min-width: 0;
  }

  #page-projects #btn-internal-chat-send,
  #page-projects #btn-staff-chat-send {
    width: 46px;
    min-width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  #page-projects .card-title-header {
    flex-direction: row;
    align-items: center;
  }
}

/* Mobile admin global pass: stack dense desktop pages without changing behavior */
@media (max-width: 640px) {
  .dashboard-view-title {
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.06;
    letter-spacing: -0.9px;
  }

  .dashboard-view-title i {
    flex-shrink: 0;
  }

  .dashboard-view-subtitle {
    font-size: 16px;
    line-height: 1.4;
  }

  .income-metrics-row,
  .dashboard-metrics-row,
  .metrics-grid,
  .hr-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .income-metric-card,
  .wow-metric-card,
  .summary-card,
  .client-sub-card,
  .notifications-card,
  .settings-card,
  .table-card {
    border-radius: 18px;
  }

  .income-metric-card {
    padding: 16px;
  }

  .imc-header {
    align-items: flex-start;
    gap: 12px;
  }

  .imc-title-box h3,
  .imc-value-row h3 {
    font-size: 24px;
    line-height: 1.12;
  }

  .transaction-filter-panel:not(.projects-filter-box) {
    padding: 18px;
    border-radius: 18px;
  }

  .transaction-filter-panel:not(.projects-filter-box) .tf-title-row {
    align-items: center;
    margin-bottom: 16px;
  }

  .transaction-filter-panel:not(.projects-filter-box) .tf-title-row h4 {
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: -0.2px;
  }

  .transaction-filter-panel:not(.projects-filter-box) .tf-grid-inputs,
  #page-hr .tf-grid-inputs {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .tf-input-col label {
    font-size: 11px;
    line-height: 1.15;
  }

  .tf-input-col select,
  .tf-input-col input,
  .form-input,
  .settings-form input,
  .settings-form select,
  .settings-form textarea {
    min-height: 48px;
    font-size: 14px;
  }

  .date-range-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    min-height: 48px;
  }

  .date-range-group input {
    min-width: 0;
  }

  .tf-actions-row,
  .tf-actions-row-right,
  .site-content-actions,
  .site-content-actions-inline {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px !important;
    width: 100%;
  }

  .tf-actions-row .btn,
  .tf-actions-row-right .btn,
  .site-content-actions .btn,
  .site-content-actions-inline .btn,
  .settings-card .btn {
    width: 100%;
    min-height: 46px;
    white-space: nowrap;
  }

  .table-card {
    overflow: hidden;
  }

  .table-card-header,
  .notifications-header,
  .site-content-card .notifications-header {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .table-header-left,
  .table-header-right {
    width: 100%;
  }

  .table-header-left h3,
  .notifications-header h3,
  .settings-card h3 {
    font-size: 22px;
    line-height: 1.12;
  }

  .table-header-right {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .results-txt {
    line-height: 1.35;
  }

  .table-responsive {
    margin: 0 -2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-summary-footer-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .summary-col {
    padding: 12px;
    border-radius: 14px;
    background: var(--bg-main);
  }

  .workflow-panel {
    padding: 14px;
    border-radius: 18px;
  }

  #page-workflow .workflow-search-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  #page-workflow .workflow-search-input {
    width: 100%;
  }

  #page-workflow .site-builder-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-left: 0 !important;
  }

  #btn-workflow-clear {
    width: 100%;
    min-height: 44px;
  }

  .workflow-list {
    display: grid;
    gap: 12px;
  }

  .workflow-card {
    padding: 14px;
    border-radius: 16px;
  }

  #page-hr .projects-filter-box .tf-title-row {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 14px;
  }

  #page-hr .projects-filter-box .tf-title-row > div {
    width: 100%;
  }

  #page-hr .projects-filter-box .tf-title-row h4 {
    font-size: 20px !important;
    line-height: 1.15;
  }

  #btn-reset-hr-filters {
    width: 100%;
    min-height: 46px;
  }

  .notifications-card {
    padding: 16px;
  }

  .notification-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .notification-content {
    width: 100%;
  }

  .notification-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .btn-mark-notification-read {
    min-height: 38px;
  }

  .site-content-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .site-preview-frame-wrap {
    height: 360px;
  }

  .site-builder-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
  }

  .site-builder-tab {
    min-height: 44px;
    white-space: nowrap;
  }

  .site-content-item,
  .pricing-package-admin-item,
  .portfolio-item-admin-item,
  .agency-announcement-admin-item {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .site-content-item .btn,
  .pricing-package-admin-item .btn,
  .portfolio-item-admin-item .btn,
  .agency-announcement-admin-item .btn {
    width: 100%;
  }

  .settings-card {
    padding: 18px;
  }

  .settings-form .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .toggle-switch-label {
    align-items: flex-start;
    gap: 12px;
  }

  .toggle-label-text {
    line-height: 1.35;
  }

  .client-detail-floating-back {
    left: 14px;
    top: 84px;
    max-width: calc(100vw - 28px);
  }

  .client-detail-header-card {
    padding: 18px;
  }

  .brand-text-details,
  .brand-meta-grid,
  .cdh-right-actions {
    width: 100%;
  }

  .brand-name-row h2 {
    font-size: 26px;
    line-height: 1.08;
  }
}

@media (max-width: 420px) {
  .current-section-title {
    max-width: 48vw;
    font-size: 19px;
  }

  .topbar-right {
    gap: 6px;
  }

  .theme-toggle-btn,
  .menu-toggle-btn {
    width: 40px;
    height: 40px;
  }

  #page-projects .dashboard-view-title,
  .dashboard-view-title {
    font-size: 30px;
  }

  #page-projects .dashboard-view-subtitle,
  .dashboard-view-subtitle {
    font-size: 15px;
  }

  #page-projects .projects-filter-box .tf-title-row h4,
  .table-header-left h3,
  .notifications-header h3,
  .settings-card h3 {
    font-size: 20px !important;
  }
}
