@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
  /* Brand Core Colors (From Aplus Logo) */
  --aplus-navy: #0E3353;
  --aplus-navy-dark: #081F33;
  --aplus-navy-light: #164670;
  --aplus-cyan: #11B7D7;
  --aplus-cyan-hover: #0EA2BF;
  --aplus-cyan-light: #E0F7FA;
  --aplus-cyan-glow: rgba(17, 183, 215, 0.25);

  /* Client Custom Override Tokens (Defaults to Aplus colors) */
  --client-accent: #11B7D7;
  --client-accent-light: #E0F7FA;
  --client-accent-glow: rgba(17, 183, 215, 0.25);

  /* Neutrals & Surfaces */
  --bg-app: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-hover: #E2E8F0;
  
  --border-color: #E2E8F0;
  --border-focus: #11B7D7;

  --text-primary: #0E3353;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-on-navy: #FFFFFF;
  --text-on-cyan: #FFFFFF;

  /* Status Colors */
  --status-success: #10B981;
  --status-success-bg: #ECFDF5;
  --status-warning: #F59E0B;
  --status-warning-bg: #FFFBEB;
  --status-danger: #EF4444;
  --status-danger-bg: #FEF2F2;
  --status-info: #3B82F6;
  --status-info-bg: #EFF6FF;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(14, 51, 83, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(14, 51, 83, 0.08), 0 2px 4px -1px rgba(14, 51, 83, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(14, 51, 83, 0.08), 0 4px 6px -2px rgba(14, 51, 83, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(14, 51, 83, 0.1), 0 10px 10px -5px rgba(14, 51, 83, 0.04);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Global Reset: Prevent ALL horizontal scroll */
html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

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

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 13.5px;
  min-height: 100vh;
}

/* Layout Requirement: 40px Left & Right, 20px Top & Bottom with Copyright */
.app-container {
  padding-top: 20px;
  padding-left: 40px;
  padding-right: 40px;
  padding-bottom: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Header & Top Bar */
.app-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--aplus-navy);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title .badge-erp {
  background: var(--aplus-cyan-light);
  color: var(--aplus-navy);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(17, 183, 215, 0.3);
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Header Controls & Selectors */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: space-between;
  min-width: 0;
}

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

.header-left-controls > * {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  box-sizing: border-box !important;
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-right-actions > * {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  box-sizing: border-box !important;
}

/* Unified Square / Rounded-Rect Icon Buttons (32px) */
.btn-icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: var(--radius-md) !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  border: 1px solid var(--border-color) !important;
  background: var(--bg-card) !important;
  color: var(--aplus-navy) !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
}

.btn-icon:hover {
  background: var(--bg-subtle) !important;
  border-color: var(--text-secondary) !important;
}

.btn-icon-primary {
  background: var(--aplus-navy) !important;
  color: #FFFFFF !important;
  border-color: var(--aplus-navy) !important;
}

.btn-icon-primary:hover {
  background: var(--aplus-navy-dark) !important;
}

.btn-icon-danger {
  color: var(--status-danger) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.btn-icon-danger svg {
  stroke: var(--status-danger) !important;
}

.btn-icon-danger:hover {
  background: var(--status-danger-bg) !important;
  border-color: var(--status-danger) !important;
}

/* Client Selector Box */
.control-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 0 10px;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

#onboardClientBtn {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--radius-md) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-sizing: border-box !important;
}

#userRoleBadge {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 12px !important;
  border-radius: var(--radius-md) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  box-sizing: border-box !important;
}

.control-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

select.app-select, input.app-input {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--aplus-navy);
  cursor: pointer;
  outline: none;
  font-family: var(--font-family);
  max-width: 250px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

select.app-select:focus, input.app-input:focus {
  outline: none;
}

/* Segmented Language Switcher (Clean, perfectly aligned 32px control) */
.lang-segmented {
  display: inline-flex !important;
  align-items: center !important;
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 2px !important;
  box-sizing: border-box !important;
  gap: 2px !important;
}

.lang-segment {
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  padding: 0 10px !important;
  border-radius: var(--radius-sm) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border: none !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all var(--transition-fast) !important;
  box-sizing: border-box !important;
  font-family: var(--font-family) !important;
}

.lang-segment.active {
  background: var(--aplus-navy) !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 3px rgba(14, 51, 83, 0.15) !important;
}

.lang-segment:hover:not(.active) {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--aplus-navy) !important;
}

/* Client Header Banner / Space Context */
.client-context-bar {
  background: linear-gradient(135deg, var(--aplus-navy) 0%, var(--aplus-navy-dark) 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  width: 100%;
  flex-wrap: wrap;
  gap: 14px;
}

.client-context-bar::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, var(--client-accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.client-brand-info {
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1;
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  color: var(--aplus-navy);
  box-shadow: var(--shadow-sm);
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.client-name-wrap h2 {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-name-wrap p {
  font-size: 11.5px;
  color: #94A3B8;
  margin-top: 2px;
}

.client-pill {
  background: rgba(17, 183, 215, 0.2);
  color: var(--aplus-cyan);
  border: 1px solid rgba(17, 183, 215, 0.4);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.client-meta-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 1;
}

.meta-stat-item {
  text-align: right;
}

.meta-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--aplus-cyan);
}

.meta-stat-label {
  font-size: 10.5px;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Main Navigation Tabs: Wrap Cleanly on Desktop & Laptops */
.app-nav {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  width: 100%;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab:hover {
  background: var(--bg-subtle);
  color: var(--aplus-navy);
}

.nav-tab.active {
  background: var(--aplus-navy);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.nav-tab .tab-badge {
  background: var(--aplus-cyan);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.nav-tab.active .tab-badge {
  background: #FFFFFF;
  color: var(--aplus-navy);
}

/* Module Container */
.module-content {
  flex: 1;
  margin-bottom: 16px;
  width: 100%;
}

/* Grid & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--aplus-navy);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  font-family: var(--font-family);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--aplus-navy);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--aplus-navy-dark);
  box-shadow: var(--shadow-sm);
}

.btn-accent {
  background: var(--aplus-cyan);
  color: #FFFFFF;
}

.btn-accent:hover {
  background: var(--aplus-cyan-hover);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--aplus-navy);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-secondary);
}

/* Circular Action Buttons (36px) */
.btn-circle {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

/* Small Circular Icon Button (Matches 32px Left Controls height) */
.btn-circle-sm {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  position: relative !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.btn-signout {
  color: var(--status-danger) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: transparent !important;
  transition: all var(--transition-fast);
}

.btn-signout svg {
  stroke: var(--status-danger);
  transition: transform var(--transition-fast);
}

.btn-signout:hover {
  background: var(--status-danger-bg) !important;
  border-color: var(--status-danger) !important;
  color: var(--status-danger) !important;
}

.btn-signout:hover svg {
  transform: translateX(2px);
}

.btn-success {
  background: var(--status-success);
  color: #FFFFFF;
}

.btn-danger {
  background: var(--status-danger);
  color: #FFFFFF;
}

.btn-sm {
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: var(--radius-sm);
}

/* Progress Meters */
.progress-bar-container {
  width: 100%;
  background: var(--bg-subtle);
  height: 7px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 6px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--aplus-navy), var(--aplus-cyan));
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.progress-bar-fill.accent {
  background: var(--aplus-cyan);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-success {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
  background: var(--status-info-bg);
  color: var(--status-info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* Content Cards & Approval Items */
.content-item-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.content-preview-box {
  height: 170px;
  background: var(--bg-subtle);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.content-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-platform-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(14, 51, 83, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
}

.content-type-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(17, 183, 215, 0.9);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.content-details {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.content-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--aplus-navy);
  margin-bottom: 4px;
}

.content-copy {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
  flex: 1;
}

.content-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  margin-top: auto;
  gap: 6px;
  flex-wrap: wrap;
}

/* =========================================================================
   KANBAN BOARD: ZERO HORIZONTAL SCROLL GUARANTEED
   ========================================================================= */
.kanban-board {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

/* CRM Pipeline: 6 Columns Desktop Grid (New, Contacted, Qualified, Proposal, Won, Lost) */
.kanban-board.crm-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  width: 100%;
}

/* Idea Brainstorming: 4 Columns Desktop Grid */
.kanban-board.brainstorm-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  width: 100%;
}

.kanban-column {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  min-width: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

/* CRM Pipeline: View-Level Constraint & Independent Scroll Container */
.kanban-board.crm-grid .kanban-column {
  max-height: calc(100vh - 290px);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.kanban-board.crm-grid .kanban-cards-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 51, 83, 0.2) transparent;
}

.kanban-board.crm-grid .kanban-cards-wrap::-webkit-scrollbar {
  width: 4px;
}

.kanban-board.crm-grid .kanban-cards-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-board.crm-grid .kanban-cards-wrap::-webkit-scrollbar-thumb {
  background: rgba(14, 51, 83, 0.2);
  border-radius: 4px;
}

.kanban-board.crm-grid .kanban-cards-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--aplus-cyan);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 700;
  font-size: 12px;
  color: var(--aplus-navy);
  line-height: 1.2;
  flex-shrink: 0;
}

.kanban-col-header-left {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.kanban-col-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.kanban-col-count {
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* Column Header Mini Pagination (◀ 1/3 ▶) */
.kanban-col-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 1px 4px;
  font-size: 10px;
  flex-shrink: 0;
}

.btn-col-page {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 1px 3px;
  font-size: 9px;
  line-height: 1;
  color: var(--aplus-navy);
  border-radius: 3px;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-col-page:hover:not(:disabled) {
  background: var(--aplus-cyan-light);
  color: var(--aplus-cyan);
}

.btn-col-page:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.col-page-indicator {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 2px;
  white-space: nowrap;
}

/* Column Bottom Footer Navigation */
.kanban-col-footer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 10.5px;
  flex-shrink: 0;
}

.btn-col-nav-link {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  color: var(--aplus-navy);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-col-nav-link:hover:not(:disabled) {
  background: var(--aplus-navy);
  color: #fff;
  border-color: var(--aplus-navy);
}

.btn-col-nav-link:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.col-footer-page-text {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.kanban-empty-hint {
  padding: 24px 10px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  margin-top: 6px;
}

/* CRM Pipeline Navigation & View Toolbar */
.crm-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.crm-view-search {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}

.crm-search-icon {
  position: absolute;
  left: 10px;
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.crm-search-input {
  width: 100%;
  padding: 6px 26px 6px 30px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  font-size: 12px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.crm-search-input:focus {
  border-color: var(--aplus-cyan);
  background: #ffffff;
}

.crm-search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
}

.crm-search-clear:hover {
  color: var(--status-danger);
}

.crm-view-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.crm-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.crm-control-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.crm-select-sm {
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--aplus-navy);
  outline: none;
  cursor: pointer;
}

.crm-select-sm:focus {
  border-color: var(--aplus-cyan);
}

.crm-stage-summary-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crm-stat-pill {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--aplus-navy);
  white-space: nowrap;
}

.kanban-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0 !important;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  min-width: 0 !important;
  box-sizing: border-box;
}

.kanban-card:hover {
  border-color: var(--aplus-cyan);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kanban-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  min-width: 0;
}

.kanban-card-val {
  color: var(--aplus-navy);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.kanban-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--aplus-navy);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-company {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 5px;
}

/* Credential Vault UI */
.vault-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
  gap: 10px;
  flex-wrap: wrap;
}

.vault-item-row:last-child {
  border-bottom: none;
}

.vault-item-row:hover {
  background: var(--bg-subtle);
}

.vault-category-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--aplus-navy);
  background: var(--aplus-cyan-light);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.secret-value-box {
  font-family: monospace;
  font-size: 12px;
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  letter-spacing: 0.05em;
  word-break: break-all;
}

.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 31, 51, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  padding: 20px;
}

.modal-backdrop.open,
.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform var(--transition-fast), max-width var(--transition-fast);
  overflow: hidden;
}

.modal-window.modal-lg {
  max-width: 880px !important;
}

.modal-window.modal-xl {
  max-width: 1100px !important;
}

.modal-window.modal-sm {
  max-width: 440px !important;
}

.modal-backdrop.open .modal-window,
.modal-backdrop.active .modal-window {
  transform: scale(1);
}

.modal-header {
  background: var(--aplus-navy);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 18px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 18px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Form Styles */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--aplus-navy);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--aplus-cyan);
  box-shadow: 0 0 0 3px var(--aplus-cyan-glow);
}

/* Footer Layout Requirement: 20px bottom padding with copyright */
.app-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

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

.footer-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-badge {
  background: var(--bg-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 1380px) {
  .kanban-board.crm-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .app-container {
    padding-top: 20px;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 16px;
  }
  .grid-4, .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kanban-board.crm-grid,
  .kanban-board.brainstorm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .kanban-board.crm-grid,
  .kanban-board.brainstorm-grid {
    grid-template-columns: 1fr !important;
  }
  .client-context-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .client-meta-stats {
    width: 100%;
    justify-content: space-between;
  }
}

/* Media Preview & Video Card Helpers */
.content-preview-box {
  cursor: pointer;
  position: relative;
}

.content-preview-box:hover .media-preview-hover-hint {
  opacity: 1 !important;
}

.media-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(14, 165, 233, 0.9);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  z-index: 3;
  pointer-events: none;
}

.content-preview-box:hover .media-play-overlay {
  transform: translate(-50%, -50%) scale(1.1);
  background: #0284C7;
}

.media-preview-hover-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 4;
  white-space: nowrap;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

.upload-pulse-box {
  background: linear-gradient(90deg, var(--bg-subtle) 0%, rgba(14, 165, 233, 0.1) 50%, var(--bg-subtle) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =========================================================================
   CRM FOLLOW-UP TASKS & REMINDERS (CALL / EMAIL / WHATSAPP)
   ========================================================================= */
.crm-reminder-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(245, 158, 11, 0.08) 50%, rgba(14, 51, 83, 0.04) 100%);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
}

.crm-reminder-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reminder-icon-pulse {
  font-size: 24px;
  animation: bellRing 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes bellRing {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-15deg); }
  20%, 40% { transform: rotate(15deg); }
  50% { transform: rotate(0deg); }
}

.reminder-headline {
  font-size: 13.5px;
  color: var(--aplus-navy);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reminder-subtext {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.crm-reminder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Kanban Card Follow-up Pill */
.card-followup-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.card-followup-pill.overdue {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.card-followup-pill.overdue:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.02);
}

.card-followup-pill.nearing {
  background: var(--status-warning-bg);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.card-followup-pill.nearing:hover {
  background: rgba(245, 158, 11, 0.2);
  transform: scale(1.02);
}

.card-followup-pill.upcoming {
  background: var(--status-info-bg);
  color: var(--status-info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.card-followup-pill.completed {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-card-fu {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-card-fu:hover {
  border-color: var(--aplus-cyan);
  color: var(--aplus-navy);
  background: var(--bg-subtle);
}

/* Action Buttons (WhatsApp, Call, Email) */
.btn-whatsapp {
  background: #25D366 !important;
  color: #FFFFFF !important;
  border-color: #20BA5C !important;
  font-weight: 700;
}

.btn-whatsapp:hover {
  background: #1EBE5D !important;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

.btn-call {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  border-color: #0369A1 !important;
  font-weight: 700;
}

.btn-call:hover {
  background: #0369A1 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.btn-email {
  background: #475569 !important;
  color: #FFFFFF !important;
  border-color: #334155 !important;
  font-weight: 700;
}

.btn-email:hover {
  background: #334155 !important;
}

/* Channel Toggle Buttons */
.channel-toggle-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.channel-btn {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.channel-btn.active.channel-call {
  border-color: #0284C7;
  background: rgba(2, 132, 199, 0.08);
  color: #0284C7;
}

.channel-btn.active.channel-whatsapp {
  border-color: #25D366;
  background: rgba(37, 211, 102, 0.08);
  color: #128C7E;
}

.channel-btn.active.channel-email {
  border-color: #475569;
  background: rgba(71, 85, 105, 0.08);
  color: #1E293B;
}

/* Duplicate Phone Warning Alert */
.phone-duplicate-alert {
  background: var(--status-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--status-danger);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Follow-up Task List Item */
.fu-task-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fu-task-item:hover {
  border-color: var(--aplus-cyan);
  box-shadow: var(--shadow-sm);
}

.fu-task-item.is-overdue {
  border-left: 4px solid var(--status-danger);
}

.fu-task-item.is-nearing {
  border-left: 4px solid var(--status-warning);
}

.fu-task-item.is-completed {
  border-left: 4px solid var(--status-success);
  opacity: 0.75;
}
