/* ProspectIQ Monochromatic (Black, Grey, White) Stylesheet */

:root {
    /* Strict Black, Grey, and White Color Theme (Notion Light + White Canvas) */
    --black: #37352f;
    --white: #ffffff;
    
    /* Grey Scale (Notion Light + White Canvas) */
    --grey-light: #ffffff;  /* WHITE shades only! Reverted from grey */
    --grey-hover: #fafafa;  /* Very light white-grey hover */
    --grey-border: #eaeaea; /* Crisp thin border */
    --grey-text: #787774;   /* Muted text */
    --grey-dark: #37352f;   /* Dark charcoal */
    
    /* Semantic mappings */
    --bg-main: var(--white); /* Pure white background! */
    --bg-sidebar: var(--white); /* Pure white sidebar! */
    --text-primary: var(--black);
    --text-secondary: var(--grey-text);
    --border-color: var(--grey-border);
    
    --sidebar-width: 240px; /* Reduced from 280px to make it minimal! */
    --transition-speed: 0.15s;
    --border-radius: 8px;
}

/* Base resets & typography setup */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    font-size: 14px !important;
}

/* Elevate general Card style overlaying Bootstrap defaults */
.card {
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 2px rgba(15, 15, 15, 0.05) !important;
    background-color: var(--white) !important;
    transition: box-shadow 0.15s ease !important;
}

.card:hover {
    box-shadow: 0 1px 3px rgba(15, 15, 15, 0.1) !important;
}

/* Layout Shell */
.app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Backdrop Overlay for Command Search Blur */
.backdrop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    opacity: 0;
    pointer-events: none;
    z-index: 150;
    transition: opacity var(--transition-speed) ease, backdrop-filter var(--transition-speed) ease, -webkit-backdrop-filter var(--transition-speed) ease;
}

/* Triggered Backdrop Focus State (Subtle blur) */
body.search-active .backdrop-overlay {
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(2.5px);
    -webkit-backdrop-filter: blur(2.5px);
}

/* ── SIDEBAR STYLING ── */
.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;
    left: 0;
    top: 0;
    z-index: 100;
    padding: 16px 12px;
}

/* Brand & Logo Header */
.sidebar-header {
    padding-bottom: 12px;
    margin-bottom: 8px;
}

.brand-logo {
    display: flex;
    align-items: center;
    font-family: 'Roboto', sans-serif;
    font-size: 1.45rem; /* Increased from 1.15rem */
    font-weight: 700;
    color: var(--black);
    letter-spacing: -0.5px;
}

/* Sidebar Nav Items */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-speed);
}

.nav-item:hover {
    background-color: var(--grey-hover);
    color: var(--black);
}

.nav-item.active {
    background-color: var(--grey-hover);
    color: var(--black);
    font-weight: 600;
    border-left: 4px solid var(--black);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-left: 12px;
}

/* ── MAIN CONTENT AREA ── */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    background-color: var(--bg-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Top Command Bar Styling */
.top-command-header {
    width: 100%;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 28px; /* Increased padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: z-index var(--transition-speed) step-end;
    min-height: 68px; /* Increased from 56px */
    gap: 16px;
}

body.search-active .top-command-header {
    z-index: 160; /* Positions command header containing the search input above backdrop blur */
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1 1 0%;
    min-width: 0;
}

.header-left #sidebar-mobile-toggle {
    font-size: 1.4rem;
    color: var(--black);
    border: none;
    background: transparent;
    padding: 4px;
    line-height: 1;
    display: none; /* Desktop hidden */
    transition: color 0.15s ease;
    cursor: pointer;
}

.header-left #sidebar-mobile-toggle:hover {
    color: var(--text-secondary);
}

.header-center {
    flex: 2 1 auto;
    max-width: 600px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 0%;
    min-width: 0;
}

.command-bar-wrapper {
    position: relative;
    width: 100%;
    transition: transform var(--transition-speed) ease-in-out, box-shadow var(--transition-speed) ease-in-out;
    border-radius: 12px; /* Capsule shape outer limit */
}

/* Emphasis scale-up and shadow applied strictly to search bar wrapper */
body.search-active .command-bar-wrapper {
    box-shadow: 0 4px 12px rgba(15, 15, 15, 0.08); /* Subtler shadow */
}

.command-input-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* Left search icon inside capsule */
.command-search-icon {
    position: absolute;
    left: 14px; /* Shifted right */
    font-size: 1.1rem; /* Increased from 0.95rem */
    color: var(--grey-text);
    pointer-events: none;
    transition: color var(--transition-speed);
}

body.search-active .command-search-icon {
    color: var(--black);
}

/* Unified Actions Container inside command bar */
.command-input-actions {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    top: 0;
    pointer-events: auto;
}

/* Right keyboard shortcut badge */
.command-shortcut-hint {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--grey-text);
    border: 1px solid var(--grey-border);
    padding: 1px 6px;
    border-radius: 4px;
    background-color: var(--white);
    pointer-events: none;
    transition: border-color var(--transition-speed), color var(--transition-speed);
    white-space: nowrap;
}

body.search-active .command-shortcut-hint {
    border-color: var(--black);
    color: var(--black);
}

/* Header image shortcut for OCR and uploads */
.command-image-upload-btn {
    width: 30px; /* Increased from 24px */
    height: 30px; /* Increased from 24px */
    border: 1px solid var(--grey-border);
    border-radius: 50%;
    background: transparent;
    color: var(--grey-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.95rem; /* Increased from 0.85rem */
    transition: var(--transition-speed);
    cursor: pointer;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.command-image-upload-btn:hover,
.command-image-upload-btn:focus {
    color: var(--black);
    border-color: var(--black);
    background: var(--grey-hover);
    outline: none;
}

/* Main text input */
.command-bar-input {
    width: 100%;
    padding: 11px 200px 11px 42px; /* Space for search icon and larger action icons */
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem; /* Increased from 0.875rem */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    background-color: var(--grey-light);
    color: var(--black);
    transition: var(--transition-speed);
}

.command-bar-input:focus {
    border-color: var(--black);
    background-color: var(--white);
}

/* Sidebar Backdrop/Overlay style on mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Command Bar Dropdown Menu (Glassmorphic design) */
.command-mobile-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1050;
    padding: 8px;
    display: none; /* Shown dynamically via .show */
    flex-direction: column;
    min-width: 260px;
    transform: scale(0.95) translateY(-5px);
    opacity: 0;
    transform-origin: top right;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.command-mobile-dropdown-menu.show {
    display: flex !important;
    opacity: 1;
    transform: scale(1) translateY(0);
}
.command-mobile-dropdown-menu .dropdown-menu-header {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    padding: 6px 12px 10px 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}
.command-mobile-dropdown-menu .dropdown-item-btn {
    border: none;
    background: transparent;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--black);
    transition: background-color 0.15s ease;
    width: 100%;
}
.command-mobile-dropdown-menu .dropdown-item-btn:hover {
    background-color: var(--grey-hover);
}
.command-mobile-dropdown-menu .dropdown-item-btn i {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
}
.command-mobile-dropdown-menu .dropdown-item-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.command-mobile-dropdown-menu .item-title {
    font-size: 0.85rem;
    font-weight: 600;
}
.command-mobile-dropdown-menu .item-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.header-action-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    position: relative;
    z-index: 2;
}

.command-memory-wrapper {
    position: relative;
}

.command-memory-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--grey-border);
    border-radius: 50%;
    background: var(--white);
    color: var(--black);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.command-memory-btn:hover,
.command-memory-btn.active {
    background: var(--grey-hover);
    border-color: var(--black);
}

.command-memory-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--black);
    color: var(--white);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
}

.command-memory-panel {
    position: absolute;
    top: 48px;
    right: 0;
    width: min(360px, calc(100vw - 32px));
    max-height: 430px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--grey-border);
    border-radius: var(--border-radius);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.14);
    display: none;
    z-index: 260;
}

.command-memory-panel.open {
    display: block;
}

.command-memory-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--grey-border);
    font-size: 0.85rem;
    font-weight: 700;
}

.command-memory-list {
    max-height: 370px;
    overflow-y: auto;
    padding: 8px;
}

.command-memory-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: var(--white);
    border-radius: 6px;
    padding: 10px;
    color: var(--black);
}

.command-memory-item:hover {
    border-color: var(--grey-border);
    background: var(--grey-light);
}

.command-memory-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
}

.command-memory-meta,
.command-memory-empty {
    font-size: 0.78rem;
    color: var(--grey-text);
}

.command-memory-empty {
    padding: 22px 12px;
    text-align: center;
}

.command-memory-kind {
    border: 1px solid var(--grey-border);
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--grey-light);
}

/* Page content placement wrapper */
.content-wrapper {
    flex-grow: 1;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: var(--bg-main);
    width: 100%;
    min-width: 0;
}

#page-content {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    min-width: 0;
}

/* Fluid layout overrides strictly for Companies page */
.content-wrapper.fluid-layout {
    padding: 20px;
    justify-content: flex-start;
}

.content-wrapper.fluid-layout #page-content {
    max-width: 100%;
    margin: 0;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 20px;
    }
    .content-wrapper.fluid-layout {
        padding: 20px;
    }
}

/* ── HOME LAYOUT SECTIONS ── */

/* 1. Infinite Scrolling Metrics Marquee Carousel */
.metrics-marquee-container {
    overflow: hidden;
    width: 100%;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 0;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.015);
}

/* Fade out masks on edges for high-end feel */
.metrics-marquee-container::before,
.metrics-marquee-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 60px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.metrics-marquee-container::before {
    left: 0;
    background: linear-gradient(to right, var(--white) 0%, rgba(255, 255, 255, 0) 100%);
}

.metrics-marquee-container::after {
    right: 0;
    background: linear-gradient(to left, var(--white) 0%, rgba(255, 255, 255, 0) 100%);
}

.metrics-marquee-content {
    display: inline-flex;
    gap: 16px;
    animation: marquee-scroll 32s linear infinite; /* Smooth continuous scroll */
    padding-left: 16px;
}

/* Pause scroll animation on hover for UX control */
.metrics-marquee-content:hover {
    animation-play-state: paused;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-50% - 8px)); /* Loop seamlessly by shifting half-width (5 cards) */
    }
}

.metric-card {
    flex: 0 0 190px;
    background-color: var(--grey-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-value {
    font-family: 'Roboto', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--black);
}

.metric-label {
    font-size: 0.72rem;
    color: var(--grey-text);
    text-transform: uppercase;
    font-weight: 600;
    text-align: left;
}

/* 2. Left-aligned flat Greeting Area with colored text and live date/time on top */
.greeting-wrapper {
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.greeting-datetime {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--grey-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px; /* space between date and title */
}

.greeting-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.45rem; /* Substantial title size */
    font-weight: 700;
    color: var(--black); /* Premium branding colored text */
    margin: 0 0 3px 0;
}

.greeting-subtitle {
    font-size: 0.85rem;
    color: var(--grey-text);
    margin: 0;
}

/* 3. Onboarding Empty State Guidance Card */
.onboarding-guide-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.01);
}

.onboarding-title {
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--black);
    margin: 0 0 4px 0;
}

.onboarding-subtitle {
    font-size: 0.8rem;
    color: var(--grey-text);
    margin: 0 0 12px 0;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.onboarding-step-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--grey-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-speed);
}

.onboarding-step-item:hover {
    background-color: var(--grey-hover);
    border-color: var(--black);
}

.onboarding-step-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--black);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    margin-right: 10px;
    flex-shrink: 0;
}

.onboarding-step-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding-right: 16px;
}

.onboarding-step-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--black);
}

.onboarding-step-desc {
    font-size: 0.72rem;
    color: var(--grey-text);
    margin-top: 2px;
    line-height: 1.35;
}

.onboarding-step-action {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--grey-text);
    transition: transform var(--transition-speed), color var(--transition-speed);
}

.onboarding-step-item:hover .onboarding-step-action {
    color: var(--black);
    transform: translateX(3px);
}

/* 4. Section Cards */
.section-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px; /* Reduced padding */
    height: 100%;
}

.section-card-title {
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--black);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

/* Scrollable Activity List */
.scrollable-activity {
    max-height: 320px; /* Increased height */
    overflow-y: auto;
    padding-right: 4px;
}

.scrollable-activity::-webkit-scrollbar {
    width: 4px;
}

.scrollable-activity::-webkit-scrollbar-thumb {
    background-color: var(--grey-border);
    border-radius: 2px;
}

/* ── MODERN CONNECTED TIMELINE FOR ACTIVITIES ── */
.activity-timeline {
    position: relative;
    padding-left: 20px;
}

/* Vertical connected line */
.activity-timeline::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 4px;
    width: 1px;
    background-color: var(--grey-border);
}

.activity-timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-left: 8px;
    transition: var(--transition-speed);
}

.activity-timeline-item:last-child {
    margin-bottom: 0;
}

/* Monochromatic custom timeline dot */
.timeline-marker {
    position: absolute;
    left: -20px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--black);
    border: 2px solid var(--white);
    transition: background-color var(--transition-speed);
}

.activity-timeline-item:hover .timeline-marker {
    background-color: var(--grey-dark);
}

.timeline-content {
    display: flex;
    flex-direction: column;
}

.activity-time {
    font-size: 0.78rem;
    color: var(--grey-text);
    margin-bottom: 2px;
}

.activity-text {
    font-size: 0.92rem;
    color: var(--black);
    line-height: 1.45;
    margin: 0;
}

/* ── MODERN FLAT QUICK ACTIONS LIST ── */
.quick-actions-container {
    height: 100%;
    padding: 12px 8px;
}

.quick-actions-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--black);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.quick-actions-list {
    display: flex;
    flex-direction: column;
}

.quick-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--grey-border);
    cursor: pointer;
    transition: padding var(--transition-speed), border-color var(--transition-speed);
}

.quick-action-row:last-child {
    border-bottom: none;
}

.quick-action-row:hover {
    padding-left: 8px;
    border-bottom-color: var(--black);
}

.action-details {
    display: flex;
    flex-direction: column;
    padding-right: 12px;
}

.action-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--black);
    transition: color var(--transition-speed);
}

.quick-action-row:hover .action-title {
    color: var(--grey-dark); /* Colored on hover to match brand! */
}

.action-desc {
    font-size: 0.78rem;
    color: var(--grey-text);
    margin-top: 3px;
    line-height: 1.35;
}

.action-arrow {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--grey-text);
    transition: transform var(--transition-speed), color var(--transition-speed);
}

.quick-action-row:hover .action-arrow {
    transform: translateX(4px);
    color: var(--black);
}

/* ── MODERN TASK LAYOUT STYLING ── */

.task-count-badge {
    font-size: 0.8rem;
    color: var(--grey-text);
    font-weight: 600;
    background-color: var(--grey-hover);
    padding: 3px 8px;
    border-radius: 12px;
}

/* Modern Inline Quick Add */
.task-quick-add-wrapper {
    position: relative;
    width: 100%;
}

.task-quick-add-input {
    width: 100%;
    padding: 12px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    outline: none;
    transition: var(--transition-speed);
    background-color: var(--grey-light);
}

.task-quick-add-input:focus {
    border-color: var(--black);
    background-color: var(--white);
}

/* Task list styles */
.modern-task-list {
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.modern-task-list.dragover {
    background-color: var(--grey-hover);
    border: 2px dashed var(--black);
    border-radius: var(--border-radius);
    padding: 12px;
}

.task-row {
    transition: background-color var(--transition-speed);
}

.task-row.completed .task-title-text {
    text-decoration: line-through;
    color: var(--grey-text);
    opacity: 0.6;
}

/* Circular custom checkmark toggle */
.task-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--black);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-speed);
}

.task-checkbox-custom:hover {
    background-color: var(--grey-hover);
}

.task-checkbox-custom.checked {
    background-color: var(--black);
}

.task-checkbox-custom.checked::after {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--white);
    border-radius: 50%;
}

.task-title-text {
    font-size: 0.95rem;
    color: var(--black);
    font-weight: 500;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    display: block;
}

/* Inline Edit Text input */
.task-inline-edit-input {
    flex-grow: 1;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    padding: 6px 12px;
    border: 1px solid var(--black);
    border-radius: 4px;
    outline: none;
    background-color: var(--white);
    color: var(--black);
}

/* Monochromatic Text Link actions */
.btn-task-row-action {
    background: transparent;
    border: none;
    color: var(--grey-text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-speed);
}

.btn-task-row-action:hover {
    color: var(--black);
    text-decoration: underline;
}

.btn-task-row-action.delete-task-btn:hover {
    color: var(--black); /* Standard monochromatic dark hover */
}

/* Sub-page header metrics */
.content-header h1 {
    font-family: 'Roboto', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 8px;
}

.content-header p {
    font-size: 1rem;
    line-height: 1.5;
}

.content-body {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    flex-grow: 1;
    color: var(--text-secondary);
}

/* Monochromatic Buttons */
.btn-dark-custom {
    background-color: #2f3437; /* Notion dark charcoal button */
    color: var(--white);
    border: 1px solid #2f3437;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 15, 15, 0.1);
    transition: background-color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-dark-custom:hover:not(:disabled) {
    background-color: #3f4447;
    border-color: #3f4447;
    color: var(--white);
}

.btn-dark-custom:active:not(:disabled) {
    background-color: #4e5356;
    border-color: #4e5356;
}

.btn-dark-custom:disabled {
    background-color: var(--grey-hover) !important;
    color: var(--grey-text) !important;
    box-shadow: none !important;
    border: 1px solid var(--grey-border) !important;
    cursor: not-allowed !important;
}

.btn-add-record-sm {
    padding: 4px 12px !important;
    font-size: 0.8rem !important;
}

.btn-dark-custom-outline {
    background-color: transparent;
    color: #37352f;
    border: 1px solid rgba(15, 15, 15, 0.16);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 8px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-dark-custom-outline:hover:not(:disabled) {
    background-color: rgba(55, 53, 47, 0.08);
    border-color: rgba(15, 15, 15, 0.16);
    color: #37352f;
}

.btn-dark-custom-outline:active:not(:disabled) {
    background-color: rgba(55, 53, 47, 0.16);
}

.btn-dark-custom-outline:disabled {
    border-color: var(--grey-border) !important;
    color: var(--grey-text) !important;
    cursor: not-allowed !important;
}

/* Outline Buttons styling overrides */
.btn-outline-secondary {
    background-color: transparent !important;
    color: #37352f !important;
    border: 1px solid rgba(15, 15, 15, 0.16) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 6px 16px !important;
    transition: background-color 0.15s ease !important;
}
.btn-outline-secondary:hover:not(:disabled) {
    background-color: rgba(55, 53, 47, 0.08) !important;
    border-color: rgba(15, 15, 15, 0.16) !important;
    color: #37352f !important;
}
.btn-outline-secondary:active:not(:disabled) {
    background-color: rgba(55, 53, 47, 0.16) !important;
}

.btn-outline-danger {
    background-color: transparent !important;
    color: #eb5757 !important;
    border: 1px solid rgba(235, 87, 87, 0.3) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 6px 16px !important;
    transition: background-color 0.15s ease !important;
}
.btn-outline-danger:hover:not(:disabled) {
    background-color: rgba(235, 87, 87, 0.08) !important;
    border-color: rgba(235, 87, 87, 0.4) !important;
    color: #eb5757 !important;
}
.btn-outline-danger:active:not(:disabled) {
    background-color: rgba(235, 87, 87, 0.16) !important;
}

.btn-outline-dark {
    background-color: transparent !important;
    color: #37352f !important;
    border: 1px solid rgba(15, 15, 15, 0.16) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 6px 16px !important;
    transition: background-color 0.15s ease !important;
}
.btn-outline-dark:hover:not(:disabled) {
    background-color: rgba(55, 53, 47, 0.08) !important;
    border-color: rgba(15, 15, 15, 0.16) !important;
    color: #37352f !important;
}
.btn-outline-dark:active:not(:disabled) {
    background-color: rgba(55, 53, 47, 0.16) !important;
}

/* Running/Loading states for buttons */
.btn:has(.spinner-border),
.btn.running,
.btn:disabled:has(.spinner-border) {
    position: relative;
    cursor: wait !important;
    animation: btn-pulse 1.8s infinite ease-in-out;
    opacity: 0.85;
    pointer-events: none;
}

@keyframes btn-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(0, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

/* ── COMPANIES PAGE CUSTOM COMPONENTS ── */

.btn-toggle-custom {
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-toggle-custom:hover {
    color: var(--black);
    background-color: var(--grey-hover);
}

.btn-toggle-custom.active {
    background-color: var(--black);
    color: var(--white);
}

/* Toolbar & Advanced Filters Drawer */
.company-toolbar-flat {
    background-color: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.table-responsive {
    border: none;
    box-shadow: none;
    background-color: transparent;
    padding: 0;
}

#company-view-container {
    width: 100%;
    min-width: 0;
    overflow: hidden; /* Constrains Kanban board width and prevents window overflow */
}

.mini-search-wrapper {
    position: relative;
}

.search-mini {
    width: 220px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 16px;
    background-color: var(--grey-light);
    transition: var(--transition-speed);
}

.search-mini:focus {
    border-color: var(--black);
    background-color: var(--white);
}

.btn-filter-chip {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--black);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter-chip:hover {
    background-color: var(--grey-hover);
    border-color: var(--black);
    color: var(--black);
}

.btn-filter-chip.active {
    background-color: var(--black);
    border-color: var(--black);
    color: var(--white);
}

.sort-by-select {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 28px 6px 16px;
    cursor: pointer;
    background-color: var(--white);
    transition: var(--transition-speed);
}

.sort-by-select:focus {
    border-color: var(--black);
}

.form-label-sm {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--grey-text);
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
    display: inline-block;
}

/* Companies Table Formatting with Proper Borders */
.monochromatic-table {
    border: 1px solid var(--border-color) !important;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--white);
    width: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.015);
}

.monochromatic-table th {
    background-color: var(--white) !important; /* White shades only */
    border-bottom: 1px solid var(--border-color) !important;
    border-right: none !important;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--grey-text);
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
}

.monochromatic-table th:last-child {
    border-right: none !important;
}

.monochromatic-tbody-tr td {
    border-bottom: 1px solid var(--border-color) !important;
    border-right: none !important;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: var(--black);
    font-family: 'Inter', sans-serif;
    background-color: var(--white);
    transition: background-color var(--transition-speed);
}

.monochromatic-tbody-tr td:last-child {
    border-right: none !important;
}

.monochromatic-tbody-tr:hover td {
    background-color: #f8fafc !important;
}

.monochromatic-tbody-tr:last-child td {
    border-bottom: none !important;
}

.badge-stage-pill {
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 12px;
    background-color: var(--grey-light);
    color: var(--black);
    display: inline-block;
}

/* ── COMPANIES BOARD (KANBAN) VIEW ── */
.board-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 24px;
    scrollbar-width: thin;
}

.board-wrapper::-webkit-scrollbar {
    height: 6px;
}

.board-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--grey-border);
    border-radius: 3px;
}

.board-column {
    flex: 1;
    min-width: 320px; /* column width limit */
    background-color: var(--grey-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 450px;
    transition: background-color var(--transition-speed);
}

.board-column:hover {
    background-color: var(--grey-hover);
}

.board-column-header {
    border-bottom: 2px solid var(--black);
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.board-column-title {
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--black);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.board-column-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--grey-text);
    background-color: var(--white);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 12px;
}

.board-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.board-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 15, 15, 0.05);
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    cursor: grab;
}

.board-card:hover {
    border-color: var(--grey-dark);
    box-shadow: 0 1px 3px rgba(15, 15, 15, 0.1);
}

.board-card-name {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--black);
}

.board-card-score-badge {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--black);
    background-color: rgba(255, 193, 7, 0.15); /* gold accent */
    padding: 2px 8px;
    border-radius: 12px;
}

.board-card-industry {
    font-size: 0.8rem;
    color: var(--grey-text);
    margin: 4px 0 2px 0;
}

.board-card-location {
    font-size: 0.78rem;
    color: var(--grey-text);
    margin: 0;
}

.board-card-footer {
    font-size: 0.78rem;
    font-weight: 500;
}

.board-card-badge-size {
    background-color: var(--grey-light);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--grey-dark);
}

.board-card-rep-badge {
    color: var(--grey-text);
}

.board-empty-card {
    border: 1.5px dashed var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.82rem;
    padding: 32px 16px;
    background-color: transparent;
    color: var(--grey-text);
    text-align: center;
    font-style: italic;
}

/* Sidepanel Drawer Layout */
.sidepanel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-in-out;
}
.sidepanel-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}
.sidepanel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 550px;
    max-width: 100vw;
    background-color: var(--white);
    z-index: 1050;
    transform: translateX(100%);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidepanel.show {
    transform: translateX(0);
}
.sidepanel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--white);
}
.sidepanel-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--black);
    margin: 0;
}
.sidepanel-close {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--grey-text);
    transition: var(--transition-speed);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.sidepanel-close:hover {
    color: var(--black);
    background-color: var(--grey-hover);
}
.sidepanel-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}
.sidepanel-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--grey-text);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 16px;
    margin-top: 24px;
}
.sidepanel-section-title:first-of-type {
    margin-top: 0;
}
.sidepanel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--grey-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Company Profile Styling */
.profile-header-container {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 24px;
}
.profile-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}
.profile-meta-line {
    font-size: 0.88rem;
    color: var(--grey-text);
    margin-top: 6px;
}
.profile-meta-item {
    margin-right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.profile-stage-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-block;
}
.profile-contacts-row {
    font-size: 0.85rem;
    margin-top: 12px;
    padding: 10px 16px;
    background-color: var(--grey-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.profile-contact-link {
    color: var(--black);
    text-decoration: underline;
    font-weight: 600;
}
.profile-contact-link:hover {
    color: var(--grey-text);
}

/* Tabs Navigation Styling */
.profile-tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    gap: 24px;
    margin-bottom: 24px;
    overflow-x: auto;
}
.profile-tab-item {
    padding: 12px 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--grey-text);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-speed);
}
.profile-tab-item:hover {
    color: var(--black);
}
.profile-tab-item.active {
    color: var(--black);
    border-bottom-color: var(--black);
}

/* Tab Contents */
.profile-tab-content-pane {
    display: none;
}
.profile-tab-content-pane.active {
    display: block;
}

/* Two-column layout */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 24px;
}
@media (max-width: 768px) {
    .fields-grid {
        grid-template-columns: 1fr;
    }
}
.field-group {
    display: flex;
    flex-direction: column;
}
.field-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--grey-text);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.field-value-container {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
}
.field-value {
    font-size: 0.95rem;
    color: var(--black);
    font-weight: 500;
}
.confidence-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.confidence-high {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}
.confidence-med {
    background-color: rgba(255, 193, 7, 0.1);
    color: #b58100;
}
.confidence-low {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Offline Banner / Alert */
.offline-banner {
    padding: 24px;
    background-color: var(--grey-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--grey-text);
}
.offline-banner i {
    font-size: 2rem;
    color: var(--black);
    opacity: 0.7;
    margin-bottom: 12px;
    display: block;
}

/* Video Cards Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.video-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
}
.video-thumbnail-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    background-color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}
.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0,0,0,0.85);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}
.video-play-btn {
    font-size: 2.2rem;
    opacity: 0.85;
    transition: opacity var(--transition-speed) ease;
}
.video-play-btn:hover {
    opacity: 1;
}
.video-card-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}
.video-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--black);
    margin: 0 0 10px 0;
    line-height: 1.35;
}

/* Pinned Note badge */
.pinned-note-badge {
    background-color: var(--black);
    color: var(--white);
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    display: inline-block;
}

/* Agent Space Sleek Metallic Theme */
.btn-agent-space {
    background-color: #2f3437;
    color: var(--white);
    border: 1px solid #2f3437;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 15, 15, 0.1);
    transition: background-color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-agent-space:hover:not(:disabled) {
    background-color: #3f4447;
    border-color: #3f4447;
    color: var(--white);
}
.btn-agent-space:active:not(:disabled) {
    transform: translateY(0.5px);
}
.btn-agent-space:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

.sidepanel-agentspace {
    width: 650px !important;
}

/* Agent Space Chatbot Layout */
.agentspace-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
    min-height: 480px;
}
@media (max-width: 992px) {
    .agentspace-layout {
        grid-template-columns: 1fr;
    }
}
.chat-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    height: 500px;
}
.chat-feed {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.4;
}
.chat-message.bot {
    background-color: var(--grey-light);
    color: var(--black);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    border-top-left-radius: 0;
}
.chat-message.user {
    background-color: var(--black);
    color: var(--white);
    align-self: flex-end;
    border-top-right-radius: 0;
}
.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background-color: var(--grey-light);
}
.prompt-pills-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.prompt-pill {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-speed);
}
.prompt-pill:hover {
    border-color: var(--black);
    background-color: var(--grey-hover);
}
.info-sidebar-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--grey-light);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.info-sidebar-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}
.info-sidebar-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Prospecting Tools */
.prospecting-workspace {
    width: 100%;
}

.prospect-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.prospect-tab {
    color: var(--grey-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 12px 4px;
    margin-right: 20px;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 45px;
}

.prospect-tab:hover,
.prospect-tab.active {
    color: var(--black);
    border-bottom-color: var(--black);
}

.prospect-tab-status {
    border: 1px solid rgba(181, 129, 0, 0.28);
    border-radius: 999px;
    background: #fff8e6;
    color: #8a6200;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    padding: 4px 6px;
    text-transform: uppercase;
}

.prospect-tab-status.running,
.prospect-tab-status.queued {
    display: inline-flex;
}

.prospect-activity-strip {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white);
    min-height: 48px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.prospect-activity-strip.idle {
    background: var(--grey-light);
}

.prospect-activity-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--grey-text);
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 0;
}

.prospect-activity-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.prospect-activity-chip {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--black);
    background: var(--white);
    text-decoration: none;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.prospect-activity-chip:hover {
    background: var(--grey-light);
    color: var(--black);
}

.prospect-activity-chip strong {
    color: var(--grey-text);
    font-size: 0.62rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.prospect-activity-chip.running,
.prospect-activity-chip.queued {
    border-color: rgba(181, 129, 0, 0.35);
    background: #fff8e6;
}

.prospect-activity-chip.completed {
    border-color: rgba(25, 135, 84, 0.28);
}

.prospect-activity-chip.failed,
.prospect-activity-chip.canceled {
    border-color: rgba(220, 53, 69, 0.28);
}

.prospect-activity-pulse {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #b58100;
    box-shadow: 0 0 0 0 rgba(181, 129, 0, 0.35);
    animation: prospect-running-pulse 1.4s infinite;
    flex: 0 0 auto;
}

@keyframes prospect-running-pulse {
    70% {
        box-shadow: 0 0 0 8px rgba(181, 129, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(181, 129, 0, 0);
    }
}

.prospect-floating-activity {
    position: fixed;
    right: 18px;
    bottom: 76px;
    z-index: 1040;
    width: min(280px, calc(100vw - 32px));
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prospect-floating-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--grey-text);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.prospect-floating-chip {
    min-height: 34px;
    border: 1px solid rgba(181, 129, 0, 0.35);
    border-radius: 999px;
    background: #fff8e6;
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
}

.prospect-floating-chip:hover {
    color: var(--black);
    background: #fff3cc;
}

@media (max-width: 640px) {
    .prospect-activity-strip {
        align-items: stretch;
        flex-direction: column;
    }

    .prospect-activity-tools {
        justify-content: flex-start;
    }

    .prospect-floating-activity {
        right: 12px;
        bottom: 72px;
        width: min(260px, calc(100vw - 24px));
    }
}

.prospect-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.35fr);
    gap: 24px;
    align-items: start;
}

.prospect-panel {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.prospect-panel-head {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--grey-light);
}

.prospect-panel-head h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.prospect-panel-head p,
.prospect-muted {
    color: var(--grey-text);
    font-size: 0.88rem;
    margin: 0;
}

.prospect-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
}

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

.prospect-output {
    min-height: 680px;
}

.prospect-statusbar {
    min-height: 62px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--grey-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.prospect-pill {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--grey-text);
    background-color: var(--white);
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.prospect-pill.running {
    color: #b58100;
    border-color: rgba(181, 129, 0, 0.3);
}

.prospect-pill.completed {
    color: #198754;
    border-color: rgba(25, 135, 84, 0.3);
}

.prospect-pill.failed {
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.3);
}

.prospect-pill.canceled {
    color: var(--grey-text);
    border-color: var(--border-color);
}

.prospect-result {
    padding: 24px;
    max-height: 790px;
    overflow: auto;
}

.prospect-empty {
    min-height: 300px;
    color: var(--grey-text);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
}

.prospect-pre {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    background-color: #111;
    color: var(--white);
    border-radius: var(--border-radius);
    padding: 16px;
    font: 0.82rem/1.6 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.prospect-kv {
    display: grid;
}

.prospect-kv-item {
    display: grid;
    grid-template-columns: minmax(130px, 190px) 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--black);
    font-size: 0.92rem;
}

.prospect-kv-key,
.prospect-section-title {
    color: var(--grey-text);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.prospect-list {
    display: grid;
    gap: 10px;
}

.prospect-list-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--grey-light);
    padding: 14px;
    display: grid;
    gap: 8px;
}

.prospect-list-item strong {
    color: var(--black);
    font-size: 0.95rem;
}

.prospect-list-item span {
    color: var(--grey-text);
    font-size: 0.78rem;
}

.prospect-list-item-active {
    border-color: var(--black);
    background-color: var(--white);
}

.prospect-company-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--white);
    margin-bottom: 16px;
    overflow: hidden;
}

.prospect-company-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--grey-light);
}

.prospect-company-rank {
    color: var(--grey-text);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.prospect-company-name {
    font-family: 'Roboto', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.prospect-company-body {
    padding: 4px 20px 18px;
}

.prospect-markdown {
    line-height: 1.65;
}

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

.prospect-markdown th,
.prospect-markdown td {
    border: 1px solid var(--border-color);
    padding: 8px;
}

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

@media (max-width: 640px) {
    .prospect-kv-item,
    .prospect-statusbar {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .prospect-statusbar {
        display: grid;
    }
}

/* Hot Tasks Styling & Animations */
@keyframes pulse-fire {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.4)); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.8)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.4)); }
}
.animate-pulse {
    animation: pulse-fire 2s infinite ease-in-out;
    display: inline-block;
}
.hot-tasks-card {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.05);
    background: #fffcfc;
    border-radius: var(--border-radius);
    padding: 24px;
}
.hot-tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    width: 100%;
}
.hot-task-card {
    background: #ffffff;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-top: 3.5px solid #ef4444;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.2s ease;
    box-shadow: 0 1px 2px rgba(239, 68, 68, 0.03);
    position: relative;
    overflow: hidden;
    min-height: 140px;
}
.hot-task-card:hover {
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.15);
}
.hot-task-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.06) 0%, transparent 70%);
    pointer-events: none;
}
.hot-task-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--black);
    line-height: 1.4;
    margin-bottom: 16px;
    word-break: break-word;
}
.hot-task-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}
.btn-hot-action {
    flex: 1;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}
.btn-hot-action-done {
    background-color: #ef4444;
    color: #ffffff;
}
.btn-hot-action-done:hover {
    background-color: #dc2626;
    color: #ffffff;
}
.btn-hot-action-unhot {
    background-color: var(--grey-light);
    color: var(--grey-text);
    border-color: var(--border-color);
}
.btn-hot-action-unhot:hover {
    background-color: var(--grey-hover);
    color: var(--black);
}
.btn-hot-toggle {
    transition: color 0.15s ease;
}
.btn-hot-toggle:hover {
    color: var(--black);
}

/* Sidebar dropdown styling */
.nav-group {
    width: 100%;
}
.nav-group-items {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding-left: 12px;
    margin-top: 2px;
    margin-bottom: 2px;
    width: 100%;
}
.nav-subitem {
    padding: 8px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: var(--transition-speed);
}
.nav-subitem:hover {
    background-color: var(--grey-hover);
    color: var(--black);
}
.nav-subitem.active {
    background-color: var(--grey-hover);
    color: var(--black);
    font-weight: 600;
    border-left: 4px solid var(--black);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-left: 12px;
}
#nav-prospecting-chevron {
    transition: transform 0.2s ease;
}

/* Agent Space Styles */
.agentspace-chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}
.agentspace-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--grey-light);
}
.agentspace-message-wrapper {
    display: flex;
    width: 100%;
}
.agentspace-message-wrapper.user {
    justify-content: flex-end;
}
.agentspace-message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 75%;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    word-break: break-word;
    overflow-wrap: break-word;
}
.agentspace-message-bubble p {
    margin-bottom: 8px;
    word-break: break-word;
    overflow-wrap: break-word;
}
.agentspace-message-bubble p:last-child {
    margin-bottom: 0;
}
.agentspace-message-bubble.user {
    background-color: var(--black);
    color: var(--white);
    border-bottom-right-radius: 2px;
}
.agentspace-message-bubble.assistant {
    background-color: var(--white);
    color: var(--black);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 2px;
}
.agentspace-message-bubble.system {
    background-color: #e9ecef;
    color: var(--grey-text);
    font-style: italic;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
    text-align: center;
    font-size: 0.85rem;
    border: 1px dashed var(--border-color);
    box-shadow: none;
}
.agentspace-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
}
.agentspace-input-wrapper input[type="text"] {
    flex-grow: 1;
    border-radius: 24px;
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    outline: none;
    font-size: 0.95rem;
    transition: border-color var(--transition-speed);
}
.agentspace-input-wrapper input[type="text"]:focus {
    border-color: var(--black);
}

/* Drag & Drop Zone for OCR */
.ocr-drag-drop-zone {
    border: 2px dashed var(--grey-border);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    background-color: var(--grey-light);
    cursor: pointer;
    transition: border-color var(--transition-speed), background-color var(--transition-speed);
    margin-bottom: 20px;
}
.ocr-drag-drop-zone:hover, .ocr-drag-drop-zone.dragover {
    border-color: var(--black);
    background-color: var(--grey-hover);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.08); /* Glow effect */
}

/* Modern AI Sourcing glows and animations */
.geo-search-container {
    transition: all 0.3s ease;
}
.geo-search-container:focus-within {
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.12) !important;
    border-color: var(--black) !important;
}

.animate-fade-in {
    animation: fadeIn 0.35s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.hover-shadow-sm:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Chat GPT style input focus state */
#agentspace-input-pill-container {
    transition: all 0.25s ease;
}
#agentspace-input-pill-container:focus-within {
    border-color: var(--black) !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08) !important;
    background-color: var(--white) !important;
}

/* ChatGPT Bubble border override for assistant bubbles */
.agentspace-message-bubble.assistant {
    border: none !important;
    background-color: rgba(244, 244, 244, 0.8) !important;
    box-shadow: none !important;
}

/* ── RESPONSIVE MOBILE MEDIA QUERIES ── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        z-index: 1050;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .top-command-header {
        padding: 10px 16px !important;
        min-height: 60px !important;
    }
    .command-bar-input {
        font-size: 0.95rem !important;
        padding: 10px 105px 10px 40px !important;
    }
    .command-search-icon {
        left: 14px !important;
        font-size: 1rem !important;
    }
    #command-ocr-image-btn {
        right: 48px !important;
        width: 28px !important;
        height: 28px !important;
    }
    #command-doc-upload-btn {
        right: 14px !important;
        width: 28px !important;
        height: 28px !important;
    }
    .command-image-upload-btn {
        font-size: 0.9rem !important;
    }
    .command-shortcut-hint {
        display: none !important;
    }
    .prospect-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 6px;
    }
    .prospect-tab {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    /* Force grids/columns to stack on mobile */
    .row > * {
        width: 100% !important;
    }
    /* Kanban or dual-pane views stack cleanly */
    .prospect-layout, .d-flex {
        flex-wrap: wrap;
    }
    /* Adjust top margins */
    .content-wrapper {
        padding: 16px !important;
    }
    .command-bar-wrapper {
        position: static !important;
        transform: none !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}

/* ── GOOGLE CALENDAR STYLE DUTY CALENDAR ── */
.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: 1px;
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-top: 10px;
}
.calendar-grid-header {
    background-color: var(--grey-light);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 10px 4px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.calendar-month-cell {
    background-color: var(--white);
    min-height: 110px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background-color 0.15s ease;
    cursor: pointer;
}
.calendar-month-cell:hover {
    background-color: #f8fafc;
}
.calendar-month-cell.outside {
    background-color: #f1f5f9;
    color: var(--text-secondary);
    opacity: 0.6;
}
.calendar-month-cell.today {
    background-color: #f0f7ff;
}
.calendar-month-cell.today .calendar-cell-date {
    background-color: var(--black);
    color: var(--white);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.calendar-cell-date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 4px;
    align-self: flex-start;
}
.calendar-cell-tasks-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden; /* Remove scrollbars */
}

/* Week View Grid */
.calendar-week-row-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: 8px;
    margin-top: 10px;
}
.calendar-week-column {
    background-color: var(--grey-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 350px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.calendar-week-column:hover {
    background-color: #f8fafc;
}
.calendar-week-column.today {
    background-color: #f0f7ff;
    border-color: #3b82f6;
}
.calendar-week-col-header {
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}
.calendar-week-col-header .day-name {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-secondary);
}
.calendar-week-col-header .day-num {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--black);
}
.calendar-week-column.today .day-num {
    color: #3b82f6;
}
.calendar-week-tasks-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden; /* Remove scrollbars */
}

/* Drag zones highlighted style */
.calendar-month-cell.dragover, .calendar-week-column.dragover {
    background-color: #e2e8f0 !important;
    border-color: var(--black) !important;
}

.calendar-task-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: grab;
    display: flex;
    flex-direction: column; /* Stack time and title vertically */
    justify-content: flex-start;
    align-items: stretch;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: all 0.15s ease;
    gap: 2px;
    width: 100%;
    min-width: 130px; /* Accommodate 5-6 words per line */
    max-height: 70px; /* Force max height on card */
    overflow: hidden;
}
.calendar-task-card:hover {
    border-color: var(--black);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}
.calendar-task-title {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Truncate after 2 lines of text */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    text-align: left;
    max-height: 2.6em; /* Safeguard height based on line height */
    line-height: 1.3;
}
#calendar-view-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.calendar-toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 6px 15px;
    margin-top: 5px;
}
.calendar-toolbar-title {
    grid-column: 1;
    grid-row: 1;
}
#calendar-section h3 {
    font-size: 1.5rem !important;
    font-weight: 700;
}
#calendar-section .btn {
    font-size: 0.8rem !important;
    padding: 4px 10px !important;
}
#cal-add-duty-btn {
    font-size: 0.8rem !important;
    padding: 4px 12px !important;
}
.calendar-month-title {
    grid-column: 1;
    grid-row: 2;
    font-size: 1.15rem !important;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 0;
}
#calendar-nav-group {
    grid-column: 3;
    grid-row: 1 / span 2;
}
#calendar-views-group {
    grid-column: 4;
    grid-row: 1 / span 2;
}
#cal-add-duty-btn {
    grid-column: 5;
    grid-row: 1 / span 2;
}
.task-row.dragging {
    opacity: 0.4;
}
.bi-grip-vertical {
    font-size: 1.1rem;
    cursor: grab;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}
.bi-grip-vertical:hover {
    opacity: 0.8;
}

/* ── CUSTOM SOURCING INTEL OVERLAY MODAL ── */
.custom-overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.25s ease;
}
.custom-overlay-modal.show {
    display: flex;
}
.custom-modal-sheet {
    background: var(--white);
    border-radius: 16px;
    width: 100%;
    max-width: 750px;
    max-height: 85vh;
    padding: 28px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    margin: 16px;
    display: flex;
    flex-direction: column;
}
@keyframes slideUpModal {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.custom-modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--black);
    margin: 0;
}
.custom-modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    color: var(--text-secondary);
    padding: 4px;
    transition: color 0.15s ease;
}
.custom-modal-close-btn:hover {
    color: var(--black);
}
.custom-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 4px;
}

/* Category cards grid */
.intel-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 10px;
}
.intel-category-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.intel-category-card:hover {
    transform: translateY(-4px);
    border-color: var(--black);
    box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}
.intel-card-icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
    display: block;
}
.intel-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 8px;
}
.intel-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    flex-grow: 1;
    margin-bottom: 12px;
}
.intel-card-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    background: #f1f5f9;
    color: var(--black);
    padding: 4px 8px;
    border-radius: 4px;
    align-self: flex-start;
}

/* Mobile responsive styles */
@media (max-width: 767.98px) {
    .intel-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    .custom-modal-sheet {
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
}




/* =========================================================================
   LEARNING SECTION – RAG Document Chatbot
   ========================================================================= */

.learning-workspace {
    display: flex;
    height: calc(100vh - 80px);
    gap: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--grey-border);
    overflow: hidden;
}

/* ── Left Sidebar ──────────────────────────────────────────────────────── */
.learning-sidebar {
    width: 38%;
    min-width: 300px;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--grey-border);
    overflow-y: auto;
    background: var(--white);
}

.learning-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 18px 14px;
    border-bottom: 1px solid var(--grey-border);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 2;
}

.learning-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.learning-subtitle {
    font-size: 0.8rem;
    color: var(--grey-text);
    margin: 2px 0 0;
}

/* ── Collections List ──────────────────────────────────────────────────── */
.learning-collections-list {
    padding: 8px 10px;
    flex-shrink: 0;
}

.learning-collection-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-speed) ease;
    margin-bottom: 2px;
}

.learning-collection-card:hover {
    background: var(--grey-hover);
}

.learning-collection-card.active {
    background: var(--grey-light);
    border-left: 3px solid var(--black);
    padding-left: 9px;
}

.learning-collection-info {
    flex: 1;
    min-width: 0;
}

.learning-collection-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.learning-collection-meta {
    font-size: 0.75rem;
    color: var(--grey-text);
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.learning-collection-delete {
    background: none;
    border: none;
    color: var(--grey-text);
    padding: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-speed) ease, color var(--transition-speed) ease;
    font-size: 0.85rem;
}

.learning-collection-card:hover .learning-collection-delete {
    opacity: 1;
}

.learning-collection-delete:hover {
    color: var(--black);
}

/* ── Section Label ─────────────────────────────────────────────────────── */
.learning-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey-text);
}

/* ── Upload Zone ───────────────────────────────────────────────────────── */
.learning-upload-zone {
    margin: 6px 14px 8px;
    padding: 18px 16px;
    border: 2px dashed var(--grey-border);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--grey-text);
    transition: border-color var(--transition-speed) ease, background var(--transition-speed) ease;
    cursor: pointer;
}

.learning-upload-zone:hover,
.learning-upload-zone.drag-over {
    border-color: var(--grey-dark);
    background: var(--grey-light);
}

.learning-upload-link {
    color: var(--black);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* ── Document List ─────────────────────────────────────────────────────── */
.learning-doc-list {
    padding: 2px 10px 14px;
}

.learning-doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background var(--transition-speed) ease;
}

.learning-doc-item:hover {
    background: var(--grey-hover);
}

.learning-doc-type-icon {
    font-size: 1.25rem;
    color: var(--grey-dark);
    flex-shrink: 0;
}

.learning-doc-info {
    flex: 1;
    min-width: 0;
}

.learning-doc-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.learning-doc-meta {
    font-size: 0.72rem;
    color: var(--grey-text);
}

.learning-doc-delete {
    background: none;
    border: none;
    color: var(--grey-text);
    padding: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    font-size: 0.75rem;
}

.learning-doc-item:hover .learning-doc-delete {
    opacity: 1;
}

.learning-doc-delete:hover {
    color: var(--black);
}

/* ── Right Chat Panel ──────────────────────────────────────────────────── */
.learning-chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--grey-light);
    position: relative;
}

.learning-chat-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--grey-border);
    background: var(--white);
    font-size: 0.95rem;
}

.learning-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

/* ── Chat Messages ─────────────────────────────────────────────────────── */
.learning-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.learning-chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.55;
    animation: bubbleFadeIn 0.25s ease;
    word-wrap: break-word;
}

.learning-chat-bubble.user {
    align-self: flex-end;
    background: var(--grey-dark);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.learning-chat-bubble.assistant {
    align-self: flex-start;
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--grey-border);
    border-bottom-left-radius: 4px;
}

.learning-chat-bubble.assistant p { margin-bottom: 6px; }
.learning-chat-bubble.assistant p:last-child { margin-bottom: 0; }
.learning-chat-bubble.assistant code {
    background: var(--grey-light);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.85em;
}

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

/* ── Source Chips ───────────────────────────────────────────────────────── */
.learning-source-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.learning-source-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.7rem;
    background: var(--grey-light);
    border: 1px solid var(--grey-border);
    border-radius: 100px;
    color: var(--grey-text);
    font-weight: 500;
}

/* ── Thinking Dots ─────────────────────────────────────────────────────── */
.learning-thinking {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 18px !important;
}

.learning-thinking .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--grey-text);
    animation: thinkingBounce 1.2s infinite ease-in-out;
}

.learning-thinking .dot:nth-child(2) { animation-delay: 0.15s; }
.learning-thinking .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes thinkingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ── Suggested Prompts ─────────────────────────────────────────────────── */
.learning-suggested-prompts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
    margin: auto;
    padding: 20px 0;
}

.learning-suggested-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--grey-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.learning-suggested-prompt:hover {
    background: var(--grey-hover);
    border-color: var(--grey-dark);
}

.learning-suggested-prompt i {
    font-size: 1.1rem;
    color: var(--grey-text);
}

/* ── Chat Input ────────────────────────────────────────────────────────── */
.learning-chat-input-area {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--grey-border);
    background: var(--white);
}

.learning-chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--grey-light);
    border: 1px solid var(--grey-border);
    border-radius: 12px;
    padding: 6px 8px 6px 16px;
    transition: border-color var(--transition-speed) ease;
}

.learning-chat-input-wrapper:focus-within {
    border-color: var(--grey-dark);
}

.learning-chat-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-size: 0.9rem;
    font-family: inherit;
    padding: 6px 0;
    line-height: 1.5;
    max-height: 120px;
    outline: none;
}

.learning-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: var(--black);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity var(--transition-speed) ease;
    font-size: 1rem;
}

.learning-send-btn:hover { opacity: 0.85; }
.learning-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .learning-workspace {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 80px);
    }
    .learning-sidebar {
        width: 100%;
        max-width: none;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--grey-border);
    }
    .learning-chat-panel {
        min-height: 50vh;
    }
}

/* ── Chat Sessions ─────────────────────────────────────────────────────── */
.learning-session-list {
    padding: 2px 10px 14px;
}

.learning-session-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-speed) ease;
    margin-bottom: 1px;
}

.learning-session-card:hover {
    background: var(--grey-hover);
}

.learning-session-card.active {
    background: var(--grey-light);
    border-left: 2px solid var(--black);
    padding-left: 8px;
}

.learning-session-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.learning-session-name {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.learning-session-count {
    font-size: 0.7rem;
    color: var(--grey-text);
    white-space: nowrap;
}

.learning-session-delete {
    background: none;
    border: none;
    color: var(--grey-text);
    padding: 2px 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    font-size: 0.7rem;
}

.learning-session-card:hover .learning-session-delete {
    opacity: 1;
}

.learning-session-delete:hover {
    color: var(--black);
}

.learning-new-session-btn {
    background: none;
    border: 1px solid var(--grey-border);
    border-radius: 4px;
    color: var(--grey-dark);
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background var(--transition-speed) ease;
}

.learning-new-session-btn:hover {
    background: var(--grey-hover);
}

/* ── Follow-up Suggestion Chips ──────────────────────────────────────── */
.learning-followup-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 4px;
    max-width: 85%;
    animation: fadeInUp 0.3s ease;
}

.learning-followup-chip {
    background: var(--grey-light);
    border: 1px solid var(--grey-border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.78rem;
    color: var(--grey-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
    line-height: 1.3;
}

.learning-followup-chip:hover {
    background: var(--grey-hover);
    border-color: var(--grey-dark);
    color: var(--black);
    transform: translateY(-1px);
}

.learning-followup-chip i {
    font-size: 0.7rem;
    opacity: 0.6;
}

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

/* ── YouTube URL Input ───────────────────────────────────────────────── */
.learning-url-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px 8px;
}

.learning-url-input {
    flex: 1;
    background: var(--grey-light);
    border: 1px solid var(--grey-border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--black);
    outline: none;
    transition: border-color 0.2s ease;
}

.learning-url-input:focus {
    border-color: var(--grey-dark);
}

.learning-url-input::placeholder {
    color: var(--grey-text);
}

.learning-url-add-btn {
    background: var(--black);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.learning-url-add-btn:hover {
    opacity: 0.8;
}

/* ── SIDEBAR FOOTER & USER PROFILE SWITCHER ── */
.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: auto;
    position: relative;
}

.user-profile-widget {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: 1px solid transparent;
}

.user-profile-widget:hover {
    background-color: var(--grey-light);
    border-color: var(--grey-border);
}

.user-profile-widget:active {
    transform: scale(0.98);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: background-color 0.3s ease;
}

/* User-specific avatar styling (Monochromatic theme matching) */
.user-avatar.admin {
    background-color: var(--black);
}
.user-avatar.bd-rep {
    background-color: var(--grey-dark);
}
.user-avatar.viewer {
    background-color: var(--grey-text);
}

.user-info {
    min-width: 0;
    flex-grow: 1;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.user-role {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.user-profile-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
    z-index: 105;
    overflow: hidden;
    animation: profileDropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.user-profile-dropdown .dropdown-header-title {
    padding: 10px 12px 6px 12px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.user-option-item {
    padding: 8px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.15s ease;
}

.user-option-item:hover {
    background-color: var(--grey-light);
}

.user-option-item.active {
    background-color: var(--grey-hover);
}

.user-option-item .option-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
}

.user-option-item .option-avatar.admin {
    background-color: var(--black);
}
.user-option-item .option-avatar.bd-rep {
    background-color: var(--grey-dark);
}
.user-option-item .option-avatar.viewer {
    background-color: var(--grey-text);
}

/* Assignee Chip & Dropdown Styles */
.assignee-chip {
    transition: all 0.2s ease;
    user-select: none;
    border-color: var(--border-color) !important;
}
.assignee-chip:hover {
    background-color: #e9ecef !important;
    border-color: #adb5bd !important;
}
.assignee-dropdown-menu {
    position: absolute;
    width: 180px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 6px 0;
    display: none;
    animation: fadeIn 0.1s ease-out;
}
.assignee-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--black);
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.assignee-dropdown-item:hover {
    background-color: #f5f5f5;
}
.assignee-dropdown-item.active {
    background-color: #eef2f6;
    font-weight: 600;
}
.assignee-dropdown-item.unassign {
    color: #dc3545;
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 8px;
}
.assignee-dropdown-item.unassign:hover {
    background-color: #fff5f5;
}

/* Column Resizing Styles */
th {
    position: relative !important;
}
.col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    user-select: none;
    z-index: 10;
    transition: background-color 0.15s;
}
.col-resize-handle:hover,
.col-resize-handle.resizing {
    background-color: #212529;
    width: 4px;
}

#top-notification-btn {
    font-size: 1.05rem !important;
    position: relative !important;
}
#notification-badge-count {
    top: 25% !important;
    left: 75% !important;
    transform: translate(-50%, -50%) !important;
}
#sidebar-mobile-toggle {
    font-size: 1.2rem !important;
}

/* ── INLINE AI ASSISTANT SIDEBAR (NOTION STYLE) ── */
.inline-ai-assistant {
    width: 0;
    display: none;
    height: 100vh;
    background-color: var(--white);
    border-left: 1px solid var(--border-color);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    right: 0;
    z-index: 95;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width var(--transition-speed) ease;
}

.inline-ai-assistant.open {
    display: flex;
    width: 400px; /* Expands to 400px to look larger and more premium */
}

.inline-ai-header {
    height: 52px; /* Matches .top-command-header height exactly */
    min-height: 52px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--white);
    box-sizing: border-box;
}

.inline-ai-action-btn {
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--grey-text);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}

.inline-ai-action-btn:hover {
    background-color: var(--grey-hover);
    color: var(--black);
}

.inline-ai-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.15rem; /* Increased size */
    color: var(--black);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-ai-logo-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 800;
    font-size: 0.85rem; /* Increased size */
    color: var(--white);
    background-color: var(--black);
    padding: 2px 6px; /* Increased padding */
    border-radius: 4px;
    letter-spacing: -0.5px;
    margin-right: 4px;
    display: inline-block;
    line-height: 1.2;
}

.inline-ai-close-btn {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--grey-text);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}

.inline-ai-close-btn:hover {
    background-color: var(--grey-hover);
    color: var(--black);
}

.inline-ai-body {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 52px); /* Matches header subtraction */
    background-color: var(--white);
}

.inline-ai-chat-feed {
    padding: 16px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inline-ai-chat-feed::-webkit-scrollbar {
    width: 4px;
}

.inline-ai-chat-feed::-webkit-scrollbar-thumb {
    background-color: var(--grey-border);
    border-radius: 2px;
}

.inline-ai-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background-color: var(--white);
}

.inline-ai-chat-input-area .input-group {
    border: 1px solid var(--border-color);
    border-radius: 12px; /* Moderately rounded for multi-line textarea */
    overflow: hidden;
    background-color: var(--white);
    display: flex;
    align-items: flex-start; /* Anchors send button to top-right */
    padding: 6px;
    transition: border-color var(--transition-speed);
}

.inline-ai-chat-input-area .input-group:focus-within {
    border-color: var(--black);
}

.inline-ai-chat-input-area textarea {
    border: none !important;
    box-shadow: none !important;
    font-size: 0.95rem !important; /* Increased font size */
    padding: 4px 8px !important;
    background-color: transparent !important;
    color: var(--black) !important;
    flex-grow: 1;
    resize: none;
    height: 38px; /* Increased height */
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.4;
    font-family: inherit;
}

.inline-ai-chat-input-area button {
    cursor: pointer;
    flex-shrink: 0;
}

/* Force round borders and larger sizing for Speech and Send buttons */
.inline-ai-chat-input-area .input-group .command-image-upload-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    font-size: 1.05rem !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--grey-border) !important;
    background-color: transparent !important;
    padding: 0 !important;
}

/* Floating AI Assistant Trigger Button */
.floating-ai-assistant-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--black);
    color: var(--white);
    border: 1px solid var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    cursor: pointer;
    z-index: 1010;
    box-shadow: 0 2px 8px rgba(15, 15, 15, 0.15);
    transition: background-color var(--transition-speed), transform var(--transition-speed);
}

.floating-ai-assistant-btn:hover {
    background-color: var(--grey-dark);
}

.floating-ai-assistant-btn.active {
    background-color: var(--white);
    color: var(--black);
    border-color: var(--border-color);
}

/* ── ADDITIONAL MOBILE DISPLAY OPTIMIZATIONS ── */
@media (max-width: 991.98px) {
    /* Header layout correction */
    .top-command-header {
        padding: 10px 16px !important;
        min-height: 60px !important; /* Increased from 48px */
        gap: 8px !important;
    }
    
    .header-left {
        flex: 0 0 auto !important;
    }
    
    .header-center {
        flex: 1 1 auto !important;
        max-width: none !important;
        width: auto !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .header-right {
        flex: 0 0 auto !important;
    }
    
    .header-left #sidebar-mobile-toggle {
        display: block !important;
        font-size: 1.45rem !important; /* Increased from 1.25rem */
        padding: 4px !important;
        margin-right: 0 !important;
    }
    
    .command-bar-wrapper {
        position: relative !important;
        transform: none !important;
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .command-input-container {
        width: 100% !important;
        height: 40px !important; /* Increased from 34px */
    }
    
    .command-bar-input {
        font-size: 0.9rem !important; /* Increased from 0.825rem */
        padding: 8px 115px 8px 32px !important; /* Space for left icon and larger action buttons */
        border-radius: 10px !important;
        height: 40px !important; /* Increased from 34px */
    }
    
    .command-search-icon {
        left: 10px !important;
        font-size: 0.95rem !important; /* Increased from 0.8rem */
    }
    
    .command-input-actions {
        right: 6px !important;
        gap: 6px !important;
    }

    .command-input-actions .command-image-upload-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.9rem !important;
    }
    
    #command-mobile-dropdown-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.9rem !important;
        display: inline-flex !important;
    }
    
    #command-ocr-image-btn,
    #command-doc-upload-btn,
    .command-shortcut-hint {
        display: none !important;
    }
    
    #command-interrupt-btn {
        padding: 2px 4px !important;
        font-size: 0.85rem !important;
        margin-right: 0 !important;
    }
    
    #top-notification-btn {
        font-size: 1.35rem !important; /* Increased from 1.15rem */
        padding: 6px !important;
        margin-left: auto !important;
        position: relative !important;
    }
    #notification-badge-count {
        font-size: 0.52rem !important;
        padding: 2px 4px !important;
    }

    /* Mobile Calendar Responsive Rules */
    .calendar-toolbar {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        grid-template-areas:
            "title nav"
            "month month"
            "views btn" !important;
        gap: 10px !important;
    }
    .calendar-toolbar-title {
        grid-area: title !important;
        grid-column: unset !important;
    }
    .calendar-month-title {
        grid-area: month !important;
        grid-column: unset !important;
        font-size: 1rem !important;
        margin-left: 0 !important;
        margin-top: 4px !important;
    }
    #calendar-nav-group {
        grid-area: nav !important;
        grid-column: unset !important;
        justify-self: end !important;
    }
    #calendar-views-group {
        grid-area: views !important;
        grid-column: unset !important;
        justify-self: start !important;
    }
    #cal-add-duty-btn {
        grid-area: btn !important;
        grid-column: unset !important;
        justify-self: end !important;
    }
    .calendar-month-grid,
    .calendar-week-row-grid {
        min-width: 980px !important;
    }
    #calendar-section .btn {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }
    #calendar-section h3 {
        font-size: 1.1rem !important;
    }

    /* Mobile Task List Responsive Rules */
    .task-title-text {
        font-size: 0.82rem !important;
    }
    .task-checkbox-custom {
        width: 16px !important;
        height: 16px !important;
    }
    .task-checkbox-custom.checked::after {
        width: 4px !important;
        height: 4px !important;
    }
    .btn-task-row-action {
        font-size: 0.72rem !important;
    }
    .task-row .badge {
        font-size: 0.65rem !important;
    }

    /* Inline AI Assistant Fullscreen Overlay on Mobile */
    .inline-ai-assistant {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        right: -100% !important;
        width: 100% !important;
        height: auto !important; /* Overrides height and matches viewport exactly via bottom: 0 */
        z-index: 1100 !important;
        border-left: none !important;
        transition: right 0.25s ease !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }
    
    .inline-ai-assistant.open {
        right: 0 !important;
        width: 100% !important;
    }

    .inline-ai-body {
        flex-grow: 1 !important;
        height: auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        background-color: var(--white) !important;
    }
    
    .inline-ai-header {
        height: 48px !important;
        min-height: 48px !important;
        padding: 8px 12px !important;
    }
    
    .inline-ai-title {
        font-size: 1.05rem !important; /* Increased mobile title */
    }
    
    .inline-ai-logo-text {
        font-size: 0.78rem !important; /* Increased mobile logo */
    }
    
    .inline-ai-action-btn {
        padding: 4px !important;
        font-size: 1.0rem !important; /* Increased mobile action icons */
    }

    .inline-ai-close-btn {
        padding: 4px !important;
        font-size: 1.15rem !important; /* Increased mobile close icon */
    }
    
    .inline-ai-chat-feed {
        padding: 12px !important;
        flex-grow: 1 !important;
        overflow-y: auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .chat-message p {
        font-size: 0.85rem !important;
    }
    
    /* Other mobile UI scaling improvements */
    h1, .h1 {
        font-size: 1.4rem !important;
    }
    h2, .h2 {
        font-size: 1.25rem !important;
    }
    h3, .h3 {
        font-size: 1.15rem !important;
    }
    h4, .h4 {
        font-size: 1rem !important;
    }
    
    .card, .prospect-company-card, .prospect-company-head {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }
    
    .prospect-tabs {
        gap: 4px !important;
    }
    
    .prospect-tab {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }

    /* Mobile Company Button and Fullscreen Sidepanel overrides */
    .btn-toggle-custom, 
    .btn-add-record-sm, 
    #btn-add-company,
    .company-toolbar-flat .btn {
        padding: 4px 6px !important;
        font-size: 0.72rem !important;
        letter-spacing: -0.2px !important;
    }
    
    .sidepanel-backdrop {
        display: none !important;
    }
    .sidepanel {
        width: 100% !important;
        max-width: 100vw !important;
        right: -100% !important;
        transform: none !important;
        transition: right 0.25s ease-in-out !important;
        height: 100% !important;
    }
    .sidepanel.show {
        right: 0 !important;
    }
    body.sidepanel-open {
        overflow: hidden !important;
        height: 100vh !important;
    }

    /* Mobile Company Extractor styles */
    #research-form textarea {
        font-size: 0.85rem !important;
        height: 120px !important;
    }
    .prospect-result {
        padding: 12px !important;
        max-height: 420px !important;
        font-size: 0.8rem !important;
    }
    #research-base-context-card {
        padding: 12px !important;
    }
    #research-base-context-card .btn {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
    .prospect-pre {
        padding: 10px !important;
        font-size: 0.72rem !important;
        line-height: 1.45 !important;
    }

    /* Mobile Agent Space styles */
    .agentspace-chat-container {
        height: 580px !important; /* Increased height of the chatbox on mobile */
    }
    .agentspace-messages {
        padding: 14px !important;
        gap: 12px !important;
    }
    .agentspace-message-bubble {
        font-size: 0.88rem !important;
        padding: 10px 14px !important;
        max-width: 90% !important; /* Wider bubbles on mobile to prevent squishing */
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
    .agentspace-message-bubble p {
        margin-bottom: 6px !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
    .agentspace-message-bubble p:last-child {
        margin-bottom: 0 !important;
    }
    #agentspace-input-pill-container {
        display: flex !important;
        flex-direction: column !important; /* Two rows: stack vertically */
        align-items: stretch !important;
        padding: 10px 14px !important;
        border-radius: 16px !important;
    }
    #agentspace-row-upload {
        border-bottom: 1px solid var(--border-color) !important;
        padding-bottom: 8px !important;
        margin-bottom: 6px !important;
        display: flex !important;
        justify-content: flex-start !important;
    }
    #agentspace-plus-btn {
        font-size: 1.45rem !important; /* Large, easy to tap icon size */
        padding: 4px !important;
    }
    #agentspace-text-input {
        font-size: 0.95rem !important;
        flex-grow: 1 !important;
        width: 100% !important;
    }
    #agentspace-mic-btn, #agentspace-send-btn {
        width: 36px !important; /* Increased button sizes */
        height: 36px !important;
        font-size: 1.15rem !important; /* Larger icon size */
    }
}

/* Speech recognition microphone pulsing animation */
@keyframes pulse-mic {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.animate-pulse-mic {
    display: inline-block;
    animation: pulse-mic 1.2s infinite ease-in-out;
}

/* Force black color on all right-arrow send buttons */
#command-send-btn,
#inline-ai-chat-send,
#research-send-btn,
#agentspace-send-btn {
    color: var(--black) !important;
}

/* Hide caret arrow for custom dropdowns */
.dropdown-toggle-no-caret::after {
    display: none !important;
}

/* Blinking thinking text loading state */
@keyframes thinking-color-blink {
    0% { color: #aaaaaa; }
    50% { color: #222222; }
    100% { color: #aaaaaa; }
}
.thinking-text {
    animation: thinking-color-blink 1.4s infinite ease-in-out;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
}
