/* 
  oppster - Premium Design System 
  Modern Dark UI with Glassmorphism & Vibrant Accents
*/

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

:root {
    --primary: #fbbf24;
    --primary-rgb: 251, 191, 36;
    --primary-glow: rgba(251, 191, 36, 0.4);
    --secondary: #10b981;
    --danger: #ef4444;
    --bg-main: #020202;
    --bg-deep: #050505;
    --bg-card: hsla(240, 10%, 4%, 0.8);
    --bg-card-hover: hsla(240, 10%, 6%, 0.9);
    --bg-input: #080808;

    --card-glass: rgba(15, 15, 17, 0.7);
    --border-glass: rgba(255, 255, 255, 0.05);

    --text-main: #fafafa;
    --text-muted: #71717a;

    --border: #1a1a1c;
    --border-hover: #27272a;

    --sidebar-bg: #000000;
    --sidebar-border: #141416;

    --radius: 14px;
    --radius-lg: 24px;
    --radius-sm: 8px;

    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 40px rgba(var(--primary-rgb), 0.1);

    /* SPACING SYSTEM */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 2.5rem;
    --page-padding: 3rem;
}

/* Global Select & Option Fix for Dark Mode */
select option {
    background-color: #1a1a1c !important;
    color: #fff !important;
}

select:focus {
    outline: none;
}

/* Modern Date Input Styling */
input[type="date"] {
    background: #080808;
    border: 1px solid #1f1f22;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s;
}

input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.1);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.6;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    color: #fff;
    font-weight: 700;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 4px;
    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* Layout */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: var(--page-padding);
    padding-top: 1.5rem;
    max-width: 1600px;
    margin-right: auto;
    transition: all 0.3s ease;
}

/* Utilities */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    /* Important for table cells sometimes */
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 50;
    backdrop-filter: blur(20px);
}

.logo {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0.75rem;
}

.logo i {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.sidebar-header {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 1.5rem 1.2rem 0.6rem;
    opacity: 0.5;
}

.nav-links {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.nav-links li {
    margin-bottom: 2px;
}

.nav-links a {
    text-decoration: none;
    color: #a1a1aa;
    padding: 0.55rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.85rem;
}

.nav-links a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    transition: transform 0.2s;
    opacity: 0.7;
}

.nav-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a:hover i {
    transform: scale(1.1);
    color: var(--primary);
    opacity: 1;
}

.nav-links a.active {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.08), transparent);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-weight: 600;
}

.nav-links a.active i {
    color: var(--primary);
    opacity: 1;
}

/* Header & Titles */
.gradient-text {
    background: linear-gradient(to right, #ffffff, #d4d4d8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Base Header Styles (Backward Compatible) */
header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--header-margin-bottom);
    padding-bottom: var(--spacing-lg);
    border-bottom: none;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

header h1 {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-xs);
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: var(--spacing-xs);
}

/* Enhanced Page Header (Optional Class) */
.page-header {
    margin-bottom: var(--header-margin-bottom);
}

.page-header .header-content {
    flex: 1;
    min-width: 280px;
}

/* Header Actions Group */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Inputs with Icons (Standardized) */
.input-with-icon {
    position: relative;
    min-width: 220px;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
    transition: color 0.2s;
}

.input-with-icon input,
.input-with-icon select {
    padding-left: 40px !important;
    width: 100%;
}

.input-with-icon input:focus+i,
.input-with-icon select:focus+i {
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}

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

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0.5rem 0;
    font-family: 'Outfit', 'Inter', sans-serif;
    letter-spacing: -1px;
}

.stat-card h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-card .trend-up {
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-card .trend-down {
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn:active {
    transform: scale(0.96) !important;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    border: 1px solid transparent;
}

.btn-primary:active,
.btn-mine:active,
.btn-premium:active {
    transform: scale(0.96) !important;
    transition: transform 0.1s !important;
}

/* Glass Enhancement */
.card,
.glass-card,
.header-toolbar,
.filter-toolbar {
    background: var(--card-glass) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid var(--border-glass) !important;
}

/* Button Hover Physics */
.btn-primary:hover {
    background: #fcd34d;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(251, 191, 36, 0.4);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(251, 191, 36, 0.05);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(251, 191, 36, 0.05);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Action Icon Buttons */
.btn-action {
    width: 36px;
    height: 36px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0;
}

.btn-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(251, 191, 36, 0.05);
    transform: translateY(-2px);
}

/* Ensure form buttons inside action groups are visible */
form .btn-action {
    display: inline-flex !important;
}

/* Forms inside flex containers should be inline */
[style*="display: flex"]>form,
[style*="display:flex"]>form {
    display: inline-block;
}

/* Forms & Inputs */
input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

/* Fix Chrome Autocomplete Background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-input) inset !important;
    -webkit-text-fill-color: white !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.1);
    background: #000;
}

label {
    font-weight: 600;
    color: var(--text-muted);
}

/* Modals - RESTORED */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-card);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

/* Icons styling inside modal for premium feel */
.modal h3 i {
    margin-right: 10px;
    color: var(--primary);
}

/* User Profile Header Component */
header .user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
}

header .user-info {
    text-align: right;
    line-height: 1.2;
}

header .user-info .name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    display: block;
}

header .user-info .badge {
    font-size: 0.6rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 800;
}

header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    border: 2px solid var(--bg-main);
    box-shadow: 0 0 0 2px var(--primary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--card-spacing);
    margin-bottom: var(--section-spacing);
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin: var(--spacing-xs) 0;
    font-family: 'Outlet', 'Inter', sans-serif;
    letter-spacing: -1px;
}

/* Tables System */
.table-responsive {
    width: 100%;
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    /* Prevent messy wrapping in tables */
}

/* Permit wrapping only in specific content columns like name/subject */
td.wrap-content,
th.wrap-content {
    white-space: normal;
    min-width: 200px;
}

th {
    background: #141415;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.75rem;
    /* Reduced from 1rem to fit more content */
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.9rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.status-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tag Badges */
.tag-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    border: 1px solid var(--border);
    margin-right: 4px;
    display: inline-block;
}

/* Info Pills */
.info-pill {
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-family: monospace;
    border: 1px solid var(--border);
    display: inline-block;
}

/* Search Box with Icon */
.search-lead-box {
    position: relative;
    min-width: 220px;
}

.search-lead-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-lead-box input {
    padding-left: 40px !important;
    width: 100%;
}

/* Progress Bar */
.progress-bar-bg {
    background: var(--bg-input);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    background: var(--primary);
    height: 100%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Prospector / Search Grid */
.search-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

.filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    position: sticky;
    /* Re-enable sticky for modern feel, ensure parent handled */
    top: 2rem;
}

/* CRM Board */
.crm-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 2rem;
    /* More space for scrollbar */
    align-items: flex-start;
    /* Strings columns to top */
    min-height: calc(100vh - 250px);
}

.crm-column {
    min-width: 320px;
    width: 320px;
    /* Fixed width for better consistency */
    background: #09090b;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
    /* prevent full page scroll, internal scroll */
}

.column-header {
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #09090b;
    /* Match column bg */
    z-index: 10;
}

.column-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    /* Space for scrollbar */
    min-height: 100px;
}

/* Custom scrollbar for columns */
.column-body::-webkit-scrollbar {
    width: 4px;
}

.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.lead-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card-hover);
}

.lead-card.dragging {
    opacity: 0.5;
    border-style: dashed;
    background: rgba(255, 255, 255, 0.02);
}

/* Lead Card Info Typography */
.lead-company {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 4px;
    line-height: 1.4;
}

.lead-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.lead-meta i {
    width: 14px;
    text-align: center;
    opacity: 0.7;
}

.lead-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #666;
}

/* Mobile */
/* Mobile Nav Bar Styles */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    align-items: center;
    justify-content: space-between;
}

.mobile-nav .logo {
    margin: 0;
    font-size: 1.1rem;
}

.menu-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.menu-toggle:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Backdrop */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
}

.sidebar-overlay.active {
    display: block;
}

/* Global Layout Helpers */
.engine-status-header {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 24px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 64px;
}

.operation-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 1024px) {
    .engine-status-header {
        height: auto;
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .operation-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    :root {
        --page-padding: 1rem;
    }

    body {
        position: relative;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 85px 10px 20px 10px !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px;
        z-index: 2001;
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.9);
    }

    .mobile-nav {
        display: flex;
    }

    /* Standardize all headers */
    header,
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        padding-bottom: 1.5rem !important;
        width: 100% !important;
    }

    .header-content {
        width: 100% !important;
    }

    .header-content h1 {
        font-size: 1.6rem !important;
        line-height: 1.2 !important;
        word-break: break-word;
    }

    .header-actions {
        width: 100% !important;
        display: flex !important;
        flex-direction: column;
        gap: 10px !important;
    }

    .header-actions .btn,
    .header-actions .btn-premium {
        width: 100% !important;
        justify-content: center !important;
        margin-left: 0 !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Form and Toolbar fixes */
    .header-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 12px !important;
        width: 100% !important;
    }

    .header-toolbar form {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .header-toolbar .filter-group,
    .header-toolbar .search-input-wrapper {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        flex: none !important;
    }

    .header-toolbar .action-btns {
        border: none !important;
        padding: 0 !important;
        margin-top: 5px !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px !important;
        width: 100% !important;
    }

    .header-toolbar .action-btns .btn-premium,
    .header-toolbar .action-btns .btn-premium-outline {
        width: 100% !important;
        padding: 0 5px !important;
    }

    .table-responsive {
        margin: 0 -10px;
        padding: 0 10px;
        width: calc(100% + 20px);
    }

    .modal {
        width: calc(100% - 20px) !important;
        margin: 10px !important;
        padding: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.5rem !important;
    }

    .stat-card .value {
        font-size: 2rem !important;
    }

    /* CARD VIEW FOR TABLES ON MOBILE */
    /* This transforms tables into a card-stack layout */
    .table-responsive.card-view-mobile table,
    .table-responsive.card-view-mobile thead,
    .table-responsive.card-view-mobile tbody,
    .table-responsive.card-view-mobile th,
    .table-responsive.card-view-mobile td,
    .table-responsive.card-view-mobile tr {
        display: block !important;
        width: 100% !important;
    }

    .table-responsive.card-view-mobile thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive.card-view-mobile tr {
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        background: rgba(255, 255, 255, 0.01);
        margin-bottom: 8px;
    }

    .table-responsive.card-view-mobile td {
        border: none !important;
        padding: 8px 0 !important;
        position: relative;
        padding-left: 50% !important;
        white-space: normal !important;
        text-align: right !important;
        font-size: 0.85rem !important;
    }

    .table-responsive.card-view-mobile td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.7rem;
    }

    /* Search and Filters specific mobile fixes */
    .filter-toolbar {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 1.5rem !important;
        border-radius: 20px !important;
        position: relative !important;
        top: 0 !important;
        margin-bottom: 25px !important;
    }

    .results-header-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1.5rem !important;
        padding: 1.5rem !important;
    }

    .results-header-card .btn-mine {
        width: 100% !important;
    }

    .toggle-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Ensure no cut-off on CRM column headers */
.column-header h3 {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fix for standard grids used in many places */
.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: 1rem;
}

@media (max-width: 1024px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
    }
}

/* Prevent overflow in cards with long text */
.card,
.glass-card {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Global Bulk Bar Responsiveness */
@media (max-width: 768px) {
    .bulk-bar {
        width: 95% !important;
        padding: 1rem !important;
        gap: 15px !important;
        border-radius: 16px !important;
        bottom: 1rem !important;
        flex-direction: column !important;
        height: auto !important;
    }

    .bulk-bar>div {
        width: 100% !important;
        justify-content: center !important;
        border: none !important;
        padding: 0 !important;
        text-align: center;
        display: flex;
    }

    .bulk-bar .btn {
        width: 100% !important;
    }
}