@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Core Colors */
  --primary: #EA9216;
  /* User Choice */
  --primary-hover: #fa9e1f;
  --bg-dark: #0F172A;
  /* Slate 900 */
  --bg-glass: rgba(15, 23, 42, 0.7);

  /* Text */
  --text-main: #F1F5F9;
  /* Slate 100 */
  --text-muted: #94A3B8;
  /* Slate 400 */

  /* Surfaces (Glassmorphism) */
  --surface-color: 30, 41, 59;
  /* Slate 800 RGB */
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.05);

  /* System */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);

  --success: #22c55e;
  --error: #ef4444;
  --warning: #eab308;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
  overflow: hidden;
  /* Prevent body scroll, handle in containers */
}

/* --- Global Utilities --- */

/* Glass Effects */
.glass {
  background: rgba(var(--surface-color), 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.glass:hover {
  background: rgba(var(--surface-color), 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

.glass-heavy {
  background: rgba(var(--surface-color), 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

/* Background Blobs (To be injected via JS or HTML, but styled here) */
.bg-blob {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
}

.blob-orange {
  background: var(--primary);
  top: -100px;
  right: -100px;
}

.blob-blue {
  background: #3b82f6;
  /* Blue-500 from Tailwind example */
  bottom: -100px;
  left: -100px;
}

/* Typography */
h1,
h2,
h3,
h4 {
  color: #fff;
  font-weight: 600;
  margin-top: 0;
  tracking: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

/* --- Layout --- */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: 260px;
  /* Glass Sidebar */
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.3) 0%, rgba(15, 23, 42, 0.3) 100%);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar h2 span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(234, 146, 22, 0.15);
  /* Primary with opacity */
  color: var(--primary);
  border: 1px solid rgba(234, 146, 22, 0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* Prevents flex items from overflowing */
  position: relative;
  overflow: hidden;
}

/* Header */
.app-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-bar-container {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.75rem 1.25rem 0.75rem 2.5rem;
  color: white;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(234, 146, 22, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  /* Pill shape */
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #d4800d 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(234, 146, 22, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(234, 146, 22, 0.3);
  color: var(--primary);
}

.btn-secondary:hover {
  background: rgba(234, 146, 22, 0.1);
}

/* --- Kanban Board --- */
.kanban-board {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2rem 2rem 2rem;
  display: flex;
  gap: 1.5rem;
  /* Defensive Coding: Prevent snap and smooth scroll interference */
  scroll-snap-type: none !important;
  scroll-behavior: auto !important;
  overscroll-behavior-x: none;
  /* Prevent bounce */
  -webkit-overflow-scrolling: touch;
}

.kanban-column {
  min-width: 300px;
  width: 300px;
  scroll-snap-align: none !important;
  /* Force disable snapping */
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.4);
  /* Added background for contrast */
  border-radius: var(--radius);
  max-height: calc(100vh - 140px);
  /* Limit height for scrolling */
  padding-bottom: 5px;
}

.column-header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  flex-shrink: 0;
  /* Header shouldn't shrink */
}

.column-header h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0;
}

.count-badge {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
}

.column-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px 8px;
  /* Padding inside scroll area */
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Custom Scrollbar */
.column-body::-webkit-scrollbar {
  width: 4px;
}

.column-body::-webkit-scrollbar-track {
  background: transparent;
}

.column-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Kanban Cards */
.kanban-card {
  background: rgba(30, 41, 59, 0.75);
  /* Increased contrast */
  /* Glass surface */
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: grab;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* Stronger shadow */
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  /* Prevent compression */
}

.kanban-card:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.kanban-card:active {
  cursor: grabbing;
}

/* Card Header: Avatar + Info */
.card-header-row {
  display: flex;
  gap: 0.75rem;
  align-items: start;
}

.card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-title {
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-company {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-score {
  background: rgba(234, 146, 22, 0.1);
  color: var(--primary);
  border: 1px solid rgba(234, 146, 22, 0.2);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* Card Actions Row */
.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(234, 146, 22, 0.6);
  background: rgba(234, 146, 22, 0.05);
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.action-btn:hover {
  background: rgba(234, 146, 22, 0.15);
  color: var(--primary);
}

.action-btn svg {
  width: 14px;
  height: 14px;
}

/* --- Modals --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.8);
  /* Dark blur overlay */
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #1e293b;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: var(--text-main);
  position: relative;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: white;
}

.form-group label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 10px;
  border-radius: var(--radius-sm);
  width: 100%;
}

.form-group input:focus {
  border-color: var(--primary);
  outline: none;
}

/* Mobile Adaptations */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 1600;
    background: #0F172A;
    /* Solid background for mobile */
    border-right: 1px solid var(--glass-border);
    /* Hide by default on mobile */
  }

  .sidebar.open {
    left: 0;
  }

  .app-header {
    padding: 1rem;
    flex-direction: column;
    gap: 10px;
  }

  .search-bar-container {
    max-width: 100%;
  }
}



.sidebar-link:hover,
.sidebar-link.active {
  background-color: var(--accent);
  color: var(--btn-text);
  font-weight: 500;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1500;
  /* Just below sidebar */
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.open {
  display: block;
  opacity: 1;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

/* Modern Login Page Styles */
.login-body {
  /* Deep dark blue background base */
  background-color: #0f172a;
  /* Radial gradient for the spotlight effect */
  background-image:
    radial-gradient(at 50% 0%, rgba(56, 64, 79, 1) 0px, transparent 50%),
    radial-gradient(at 50% 0%, rgba(240, 165, 0, 0.15) 0px, transparent 50%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Vivid ambient glow */
.login-body::before {
  content: '';
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(240, 165, 0, 0.4) 0%, rgba(240, 165, 0, 0) 70%);
  filter: blur(80px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

.login-card-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card-glass {
  background: rgba(56, 64, 79, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 40px 30px;
  text-align: center;
  color: var(--text-main);
  transition: transform 0.3s ease;
}

.login-card-glass:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

.login-icon-container {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background: rgba(240, 165, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: bold;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: #fff;
}

.login-subtitle {
  color: #9ca3af;
  font-size: 0.95rem;
  margin-bottom: 30px;
}

/* Modern Inputs with Floating Labelsish effect */
.input-group {
  position: relative;
  margin-bottom: 20px;
  text-align: left;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.input-group .form-input {
  width: 100%;
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(75, 85, 99, 0.5);
  padding: 12px 15px 12px 45px;
  /* space for icon */
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.3s;
}

.input-group .form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(31, 41, 55, 0.9);
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.2);
}

.input-group .form-input::placeholder {
  color: #6b7280;
}

/* Primary Button */
.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(240, 165, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login:hover {
  background: #d99600;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(240, 165, 0, 0.3);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 25px 0;
  color: #6b7280;
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(75, 85, 99, 0.5);
}

.divider::before {
  margin-right: 10px;
}

.divider::after {
  margin-left: 10px;
}

/* Google Button */
.btn-google {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(75, 85, 99, 0.5);
  color: #E6E6E6;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.btn-google:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #6b7280;
}

.google-icon {
  width: 20px;
  height: 20px;
}

.toggle-text {
  margin-top: 25px;
  font-size: 0.9rem;
  color: #9ca3af;
}

.toggle-text a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  margin-left: 5px;
}

.toggle-text a:hover {
  text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .login-card-glass {
    padding: 30px 20px;
  }

  .login-title {
    font-size: 1.5rem;
  }
}

/* --- Agenda Day Details Redesign --- */

/* Tabs */
.tab-btn {
  background: transparent;
  border: 1px solid var(--borders);
  color: #9ca3af;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  outline: none;
}

.tab-btn:hover {
  color: white;
  border-color: #6b7280;
}

.tab-btn.active {
  background-color: var(--accent);
  color: black;
  border-color: var(--accent);
  font-weight: bold;
  box-shadow: 0 0 10px rgba(240, 165, 0, 0.3);
}

/* Accordion Items - FAQ Style */
.accordion-item {
  background-color: var(--surface);
  border: 1px solid var(--borders);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.accordion-item.active {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: var(--accent);
}

.accordion-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.accordion-title {
  font-weight: 500;
  font-size: 1rem;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-icon {
  transition: transform 0.3s ease;
  color: #6b7280;
}

.accordion-item.active .accordion-icon {
  transform: rotate(45deg);
  color: var(--accent);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease;
  background-color: rgba(0, 0, 0, 0.2);
}

.accordion-item.active .accordion-body {
  max-height: 500px;
  padding: 15px 20px;
  border-top: 1px solid var(--borders);
}

.accordion-content {
  color: #9ca3af;
  font-size: 0.95rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

.accordion-actions {
  margin-top: 15px;
  display: flex;
  justify-content: flex-end;
}


/* --- Bento Calendar Design --- */

.bento-calendar-wrapper {
  background-color: var(--surface);
  border: 1px solid var(--borders);
  border-radius: 24px;
  padding: 20px;
  max-width: 550px;
  /* Match reference width */
  margin: 0 auto;
  transition: border-color 0.3s ease;
}

.bento-calendar-wrapper:hover {
  border-color: var(--accent);
}

.calendar-frame {
  /* The inner frame with inset shadow */
  background-color: rgba(165, 174, 184, 0.05);
  border: 2px solid rgba(165, 174, 184, 0.1);
  border-radius: 16px;
  padding: 15px;
  box-shadow: inset 0px 2px 1.5px 0px rgba(165, 174, 184, 0.3);
}

.calendar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.calendar-month-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e5e7eb;
}

.calendar-meta {
  font-size: 0.75rem;
  color: #9ca3af;
}

.calendar-grid-modern {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  /* Up to 6 weeks */
  gap: 8px;
}

.calendar-cell-modern {
  height: 32px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  /* rounded-xl */
  font-size: 0.875rem;
  /* text-sm */
  font-weight: 500;
  color: #9ca3af;
  /* text-text-tertiary */
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-cell-modern.header {
  border-radius: 0;
  font-size: 0.75rem;
  /* text-xs */
  font-weight: 600;
  color: #6b7280;
  cursor: default;
}

/* Active State (Has Tasks) - Replaces "indigo" with Orange */
.calendar-cell-modern.has-task {
  background-color: var(--accent);
  color: black;
  box-shadow: 0 2px 4px rgba(240, 165, 0, 0.3);
}

/* Hover Effects */
.calendar-cell-modern:not(.header):hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.calendar-cell-modern.has-task:hover {
  background-color: #d99600;
  /* Darker orange */
  color: black;
}

/* Selected State */
.calendar-cell-modern.selected {
  border: 2px solid var(--accent);
  color: white;
}

/* --- BENTO MODAL REDESIGN --- */

/* Modal Content Box */
.bento-modal {
  background-color: var(--surface);
  border-radius: 24px;
  padding: 0;
  border: 1px solid var(--borders);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  max-width: 700px;
  width: 90%;
  margin: 5% auto;
  animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Minimal Header */
.modal-header-minimal {
  padding: 24px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.03), transparent);
  border-bottom: 1px solid var(--borders);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.initials-circle {
  width: 48px;
  height: 48px;
  background-color: var(--accent);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: bold;
  box-shadow: 0 4px 6px -1px rgba(240, 165, 0, 0.3);
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.profile-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.close-minimal {
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-minimal:hover {
  color: var(--error);
}

/* Icon Action Bar */
.action-bar-icons {
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--borders);
  background-color: rgba(0, 0, 0, 0.2);
  overflow-x: auto;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--bg-body);
  border: 1px solid var(--borders);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  outline: none;
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: var(--accent);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* Tooltip Hint */
.icon-btn::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}

.icon-btn:hover::after {
  opacity: 1;
}

/* Body Grid */
.modal-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
}

@media (max-width: 768px) {
  .modal-body-grid {
    grid-template-columns: 1fr;
  }
}

.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.minimal-input,
.minimal-textarea {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.minimal-input:focus,
.minimal-textarea:focus {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  outline: none;
}

.link-pill {
  display: inline-block;
  padding: 6px 12px;
  background-color: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-radius: 20px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s;
}

.link-pill:hover {
  background-color: rgba(59, 130, 246, 0.4);
}

.score-card-mini {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-card-mini strong {
  display: block;
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
  margin-top: 5px;
}

.btn-save-minimal {
  width: 100%;
  margin-top: 20px;
  background-color: var(--accent);
  color: black;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s;
}

.btn-save-minimal:hover {
  filter: brightness(1.1);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.85rem;
  padding: 0;
}

.alert-minimal {
  margin: 0 24px 20px;
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- NEW KANBAN CARD DESIGN --- */
.kanban-card {
  background-color: var(--surface);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--borders);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-color: var(--accent);
}

/* Header */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.card-names {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-title-new {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub-new {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 5px;
}

/* Badges Row */
.card-badges-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-pill {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-pill.status {
  background-color: rgba(16, 185, 129, 0.15);
  /* Greenish tint for status */
  color: #34d399;
}

.badge-pill.source {
  background-color: rgba(245, 158, 11, 0.15);
  /* Orange tint */
  color: #fbbf24;
}

.badge-pill.score-badge {
  background-color: rgba(59, 130, 246, 0.15);
  /* Blue tint */
  color: #60a5fa;
}

/* Footer Action Row */
.card-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--borders);
}

.footer-actions {
  display: flex;
  gap: 10px;
}

.footer-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  text-decoration: none;
  /* In case it's an <a> tag */
}

.footer-icon-btn:hover {
  background-color: var(--accent);
  color: #000;
  transform: translateY(-1px);
}

.footer-icon-btn.whatsapp:hover {
  background-color: #25D366;
  color: #fff;
  border-color: #25D366;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.warning-icon {
  color: #fbbf24;
  font-size: 1rem;
}

/* --- MOBILE RESPONSIVENESS TWEAKS --- */

@media (max-width: 768px) {

  /* Kanban Snapping */
  .kanban-board {
    scroll-snap-type: x mandatory;
    padding-right: 20px;
    /* Peek next column */
  }

  .kanban-column {
    scroll-snap-align: start;
    min-width: 85vw;
    /* Wider columns on mobile */
    margin-right: 10px;
  }

  /* Calendar Compact */
  .calendar-grid-modern {
    gap: 4px;
  }

  .calendar-cell-modern {
    height: 28px;
    width: 28px;
    font-size: 0.75rem;
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .bento-calendar-wrapper {
    padding: 10px;
  }

  .calendar-cell-modern {
    height: 24px;
    width: 24px;
    font-size: 0.7rem;
  }

  /* Stack Modal Grid */
  .action-bar-icons {
    justify-content: space-between;
    /* distribute icons */
  }
}

/* Kanban Edit Mode */
.kanban-column.column-edit-mode {
  border: 1px dashed var(--borders);
  background-color: rgba(255, 255, 255, 0.02);
}

.kanban-column.column-edit-mode .column-header {
  cursor: move;
  background: rgba(0, 0, 0, 0.2);
}

.add-col-separator {
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--borders);
  transition: all 0.2s;
  border-radius: var(--radius);
  opacity: 0.6;
}

.add-col-separator:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--accent);
  transform: scale(1.1);
  opacity: 1;
}

.add-col-separator.start {
  margin-right: 5px;
}

.btn-icon-del-col {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-del-col:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

#btnToggleEditMode {
  transition: all 0.3s;
}

/* --- Improved Modal Styling (Step 4) --- */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: rgba(30, 41, 59, 0.95);
  margin: 10vh auto;
  padding: 2rem;
  border: 1px solid var(--glass-border);
  width: 90%;
  max-width: 600px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover,
.close:focus {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

/* --- Sidebar Collapse Logic --- */
.sidebar {
  transition: width 0.3s ease, padding 0.3s ease;
}

.sidebar.collapsed {
  width: 80px;
  padding: 1.5rem 0.5rem;
}

.sidebar.collapsed h2 span {
  display: none;
}

.sidebar.collapsed h2 {
  font-size: 1rem;
  justify-content: center;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
  font-size: 0;
  /* Hide text */
}

.sidebar.collapsed .nav-item i {
  margin-right: 0;
}

.sidebar.collapsed #sidebarCollapseBtn {
  margin: 0 auto !important;
}

/* Hide other header elements if needed */
@media (min-width: 769px) {
  .desktop-only {
    display: flex !important;
  }

  .mobile-only {
    display: none !important;
  }
}

/* --- RESPONSIVE FIXES (FINAL) --- */

/* Base Definitions (extracted from inline) */
.automation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-left-group,
.header-right-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  /* Header Layout */
  .app-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    height: auto;
    /* Allow height to grow */
  }

  .header-left-group,
  .header-right-group {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-left-group {
    justify-content: flex-start;
    /* Toggle and search on left/start */
  }

  .search-bar-container {
    max-width: 100%;
    width: 100%;
    margin-top: 10px;
    order: 3;
    /* Move search below toggle if needed, or just let it flow */
  }

  /* Force search to full width */
  .header-left-group .search-bar-container {
    flex-basis: 100%;
    margin-left: 0;
  }

  /* Automations */
  .automation-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  /* Section Headers (Reports, Events, etc) */
  .section-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .section-header-flex>div {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  /* Inputs in Headers */
  .section-header-flex input[type="date"],
  .section-header-flex select {
    flex: 1;
    min-width: 120px;
  }

  /* Buttons in Headers */
  .header-right-group .btn {
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
  }

  /* Modal Adjustments */
  .modal-content {
    width: 95%;
    margin: 5% auto;
    padding: 1.25rem;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-content h2 {
    font-size: 1.25rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px;
    /* Prevents iOS zoom */
  }

  /* Button Stacking in Modals */
  .modal .btn {
    width: 100%;
    margin-bottom: 5px;
  }

  /* Lead Details Modal Specifics */
  #leadModal .modal-content div[style*="justify-content:space-between"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #leadModal .modal-content div[style*="justify-content:space-between"] .close {
    position: absolute;
    top: 10px;
    right: 15px;
  }

  /* Daily Events Specifics */
  #view-events .section-header-flex>div:first-child {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Tabs overflow */
  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* --- MOBILE DRAG & DROP ANIMATIONS --- */
@keyframes popIn {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  }

  100% {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  }
}

.drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  width: 280px;
  /* Fixed width for better visibility */
  animation: popIn 0.2s forwards;
  opacity: 0.9;
  background: rgba(30, 41, 59, 0.9);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem;
}

.kanban-card.dragging-source {
  opacity: 0.4;
  filter: grayscale(0.8);
  transition: all 0.3s;
}

/* --- RESPONSIVE MODAL REDESIGN --- */

/* Base Modal Content Structure */
#pipelineModal .modal-content.glass {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 95%;
  max-width: 480px;
  /* Mobile Default */
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  /* Prevent overflow on small screens */
  overflow-y: auto;
}

#pipelineModal h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 15px;
  color: var(--primary);
}

/* Template Card Styling (Mobile & Desktop) */
.template-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.template-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.template-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.template-card input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.template-info {
  display: flex;
  flex-direction: column;
}

.template-info strong {
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
}

.template-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

/* Right Column (Fields) Styling */
.pipeline-form-right {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-fields-scroll {
  padding-right: 8px;
}

/* Custom Scrollbar */
.custom-fields-scroll::-webkit-scrollbar {
  width: 6px;
}

.custom-fields-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}

.custom-fields-scroll::-webkit-scrollbar-thumb {
  background-color: var(--glass-border);
  border-radius: 3px;
}

.custom-fields-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Field Categories */
#pipelineModal h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px !important;
  letter-spacing: 0.02em;
}

/* Checkbox Grid */
.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  /* 1 col on mobile for better touch targets */
  gap: 8px;
  margin-top: 10px;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
}

.custom-checkbox:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.custom-checkbox input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.custom-checkbox span {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 500;
}

.custom-checkbox small {
  color: var(--error);
  font-weight: 600;
  margin-left: 4px;
}

/* DESKTOP LAYOUT (Horizontal Modal) */
@media (min-width: 900px) {

  /* Make modal wide */
  #pipelineModal .modal-content.glass {
    max-width: 950px;
    width: 950px;
    flex-direction: column;
    /* Content inside is grid, but modal is column */
    padding: 2rem;
  }

  /* Grid Layout for Form */
  .pipeline-form-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    /* Left fixed, Right expands */
    gap: 30px;
    align-items: start;
    height: 550px;
    /* Fixed height for consistent look */
  }

  /* Left Column Adjustment */
  .pipeline-form-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  /* Right Column Adjustment */
  .pipeline-form-right {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Contain scroll */
  }

  .pipeline-form-right .custom-fields-scroll {
    flex: 1;
    overflow-y: auto;
  }

  /* 2 Columns for Checkboxes on Desktop */
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Pipeline Dropdown Fixes */
.pipeline-selector-wrapper {
  position: relative;
  z-index: 1000;
}

#pipelineDropdown {
  display: none;
  /* Default state */
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 9999 !important;
  background: var(--bg-dark);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-top: 5px;
  box-shadow: var(--shadow-lg);
  flex-direction: column;
}

#pipelineDropdown:not(.hidden) {
  display: flex !important;
}

/* Utility - Hidden */
.hidden {
  display: none !important;
}

/* Calendar Dynamic Colors */
.calendar-cell-modern.day-all-done {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid #10b981 !important;
    color: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}
.calendar-cell-modern.day-overdue {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid #ef4444 !important;
    color: #ef4444 !important;
}

/* --- Account Tabs --- */
.account-tabs-header {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
}

.account-tabs-header::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.account-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.account-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.account-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(234, 146, 22, 0.05);
    /* Primary with low opacity */
}

.account-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.account-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Layout Utils */
.form-row { display: flex; gap: 15px; }
.col-half { flex: 1; }

