/* ============================================
   CSS VARIABLES & DESIGN TOKENS - LIGHT THEME
   ============================================ */
:root {
    /* Colors - Clean Minimal Palette */
    --primary-gradient: linear-gradient(135deg, #00bcd4 0%, #00acc1 100%);
    --success-gradient: linear-gradient(135deg, #00c9a7 0%, #00b894 100%);
    --business-gradient: linear-gradient(135deg, #00897b 0%, #00796b 100%);

    /* Accent Colors for Tags */
    --accent-unlimited: #00bcd4;
    /* Cyan/Turquoise */
    --accent-enterprise: #00c9a7;
    /* Green Emerald */
    --accent-business: #00897b;
    /* Teal Dark */

    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f9f9f9;

    /* Text Colors */
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-tertiary: #bdc3c7;
    --text-label: #95a5a6;

    /* Border Colors */
    --border-color: #e8e8e8;
    --border-color-hover: #d0d0d0;
    --border-subtle: #f0f0f0;

    /* Status Colors - Subtle */
    --status-lead: #f39c12;
    --status-contacted: #95a5a6;
    --status-proposal: #e67e22;
    --status-negotiation: #e74c3c;
    --status-closed: #00897b;

    /* Priority Colors */
    --priority-high: #00c9a7;
    --priority-medium: #00bcd4;
    --priority-low: #00897b;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;

    /* Shadows - Very Subtle */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* Layout */
    --sidebar-width: 240px;
    --header-height: 64px;
}

/* ============================================
   CSS VARIABLES & DESIGN TOKENS - DARK THEME
   ============================================ */
body.dark-theme {
    /* Colors - Dark Minimal Palette */
    --primary-gradient: linear-gradient(135deg, #00bcd4 0%, #00acc1 100%);
    --success-gradient: linear-gradient(135deg, #00c9a7 0%, #00b894 100%);
    --business-gradient: linear-gradient(135deg, #00897b 0%, #00796b 100%);

    /* Accent Colors for Tags - Mantienen los mismos colores vibrantes */
    --accent-unlimited: #00bcd4;
    --accent-enterprise: #00c9a7;
    --accent-business: #00897b;

    /* Background Colors - Dark */
    --bg-primary: #1a1a1a;
    --bg-secondary: #121212;
    --bg-tertiary: #0d0d0d;
    --bg-card: #1e1e1e;
    --bg-card-hover: #252525;

    /* Text Colors - Light */
    --text-primary: #e8e8e8;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --text-label: #909090;

    /* Border Colors - Dark */
    --border-color: #2a2a2a;
    --border-color-hover: #3a3a3a;
    --border-subtle: #252525;

    /* Status Colors - Mantienen los mismos colores */
    --status-lead: #f39c12;
    --status-contacted: #95a5a6;
    --status-proposal: #e67e22;
    --status-negotiation: #e74c3c;
    --status-closed: #00897b;

    /* Priority Colors - Mantienen los mismos colores */
    --priority-high: #00c9a7;
    --priority-medium: #00bcd4;
    --priority-low: #00897b;

    /* Shadows - Darker and more subtle */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.6);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: var(--spacing-xl) var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-lg) 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    margin: 2px var(--spacing-md);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
    font-weight: 500;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-item.active {
    color: var(--accent-unlimited);
    background: rgba(0, 188, 212, 0.08);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.sidebar-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    border-radius: var(--radius-md);
}

.user-profile:hover {
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-unlimited);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: white;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.user-menu-icon {
    width: 16px;
    height: 16px;
    stroke: var(--text-secondary);
    stroke-width: 2;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.user-profile.active .user-menu-icon {
    transform: rotate(180deg);
}

/* User Menu Dropdown */
.user-menu {
    position: absolute;
    bottom: 100%;
    left: var(--spacing-lg);
    right: var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin-bottom: var(--spacing-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: 1000;
    overflow: hidden;
}

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
}

.user-menu-item:hover {
    background: var(--bg-tertiary);
}

.user-menu-item svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    stroke-width: 2;
    flex-shrink: 0;
}

.user-menu-item:hover svg {
    stroke: var(--accent-unlimited);
}

.user-menu-logout {
    color: #e74c3c;
}

.user-menu-logout svg {
    stroke: #e74c3c;
}

.user-menu-logout:hover {
    background: rgba(231, 76, 60, 0.08);
}

.user-menu-logout:hover svg {
    stroke: #e74c3c;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--spacing-xs) 0;
}


/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* ============================================
   HEADER
   ============================================ */
.header {
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-xl);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    width: 18px;
    height: 18px;
    stroke: var(--text-tertiary);
    stroke-width: 2;
}

#globalSearch {
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 2.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 280px;
    transition: all var(--transition-fast);
}

#globalSearch:focus {
    outline: none;
    border-color: var(--accent-unlimited);
    background: var(--bg-primary);
}

#globalSearch::placeholder {
    color: var(--text-tertiary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    stroke-width: 2;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
}

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-enterprise);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--accent-unlimited);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: #00acc1;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.btn-secondary {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color-hover);
}

/* ============================================
   VIEWS CONTAINER
   ============================================ */
.views-container {
    padding: var(--spacing-xl);
}

.view {
    display: none;
    animation: fadeIn var(--transition-base);
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   DASHBOARD VIEW
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    display: flex;
    gap: var(--spacing-lg);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color-hover);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-change.positive {
    color: var(--accent-enterprise);
}

.stat-change.negative {
    color: #e74c3c;
}

.stat-change.neutral {
    color: var(--text-tertiary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    padding: var(--spacing-lg);
}

.chart-card canvas {
    max-height: 300px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--bg-tertiary);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-unlimited);
    stroke-width: 2;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ============================================
   BOARD VIEW
   ============================================ */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.board-filters {
    display: flex;
    gap: var(--spacing-md);
}

.filter-select {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-unlimited);
}

.board-container {
    display: flex;
    gap: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: var(--spacing-lg);
}

.board-column {
    flex: 0 0 300px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.board-column-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.column-title {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-label);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.column-count {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.board-column-body {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.client-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: grab;
    transition: all var(--transition-fast);
}

.client-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color-hover);
}

.client-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-sm);
}

.client-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.client-company {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.priority-badge {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    text-align: center;
}

.priority-badge.high {
    background: var(--accent-enterprise);
}

.priority-badge.medium {
    background: var(--accent-unlimited);
}

.priority-badge.low {
    background: var(--accent-business);
}

.client-card-body {
    margin: var(--spacing-md) 0;
}

.client-info-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.client-info-item svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

.client-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
}

.client-value {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.client-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-secondary);
    stroke-width: 2;
}

.action-btn:hover {
    background: var(--bg-tertiary);
}

.action-btn:hover svg {
    stroke: var(--text-primary);
}

/* ============================================
   CLIENTS VIEW - TABLE STYLE
   ============================================ */
.clients-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.clients-filters {
    display: flex;
    gap: var(--spacing-md);
}

.search-input {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 300px;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-unlimited);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}


.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: auto;
    max-height: calc(100vh - 280px);
    position: relative;
}

/* Custom Scrollbar Styling */
.table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-unlimited);
}

.table-container::-webkit-scrollbar-corner {
    background: var(--bg-tertiary);
}

/* Firefox Scrollbar */
.table-container {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}

.clients-table {
    width: 100%;
    border-collapse: collapse;
}

.clients-table thead {
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.clients-table th {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-label);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
}

.clients-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.clients-table tbody tr:last-child {
    border-bottom: none;
}

.clients-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.clients-table td {
    padding: var(--spacing-lg);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.client-cell {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.client-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-unlimited);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: white;
    flex-shrink: 0;
}

.client-details {
    flex: 1;
}

.client-details-name {
    font-weight: 600;
    color: var(--text-primary);
}

.status-badge {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    text-align: center;
}

.status-badge.lead {
    background: var(--status-lead);
}

.status-badge.contacted {
    background: var(--status-contacted);
}

.status-badge.proposal {
    background: var(--status-proposal);
}

.status-badge.negotiation {
    background: var(--status-negotiation);
}

.status-badge.closed {
    background: var(--status-closed);
}

/* ============================================
   ANALYTICS VIEW
   ============================================ */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-lg);
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn var(--transition-base);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-xl);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-unlimited);
    background: var(--bg-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--spacing-md);
    padding-top: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
}

/* ============================================
   PROFILE MODAL STYLES
   ============================================ */
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--spacing-xl);
}

.profile-avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--accent-unlimited);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
    border: 4px solid var(--bg-tertiary);
    box-shadow: var(--shadow-lg);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-controls {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    transition: all var(--transition-fast);
}

.btn-text:hover {
    color: var(--accent-unlimited);
}

/* ============================================
   SETTINGS MODAL STYLES
   ============================================ */
.settings-section {
    margin-bottom: var(--spacing-2xl);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-subtle);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background: var(--bg-tertiary);
}

.settings-item-info {
    flex: 1;
}

.settings-item-label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.settings-item-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.settings-select {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 150px;
}

.settings-select:focus {
    outline: none;
    border-color: var(--accent-unlimited);
}

/* Toggle Switch */
.settings-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.settings-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    border-radius: 26px;
    transition: all var(--transition-base);
}

.settings-toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all var(--transition-base);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-toggle input:checked+.settings-toggle-slider {
    background-color: var(--accent-unlimited);
}

.settings-toggle input:checked+.settings-toggle-slider:before {
    transform: translateX(24px);
}

.settings-toggle:hover .settings-toggle-slider {
    box-shadow: 0 0 0 4px rgba(0, 188, 212, 0.1);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .board-container {
        flex-direction: column;
    }

    .board-column {
        flex: 1 1 auto;
        max-height: 400px;
    }

    #globalSearch {
        width: 200px;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ============================================
   SALES VIEW
   ============================================ */

.sales-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.sales-filters {
    display: flex;
    gap: var(--spacing-md);
    flex: 1;
    max-width: 600px;
}

.sales-filters .search-input,
.sales-filters .filter-select {
    flex: 1;
}

/* Sales Status Badges */
.status-badge.completed {
    background-color: #00c9a7;
    color: white;
}

.status-badge.pending {
    background-color: #00bcd4;
    color: white;
}

.status-badge.cancelled {
    background-color: #95a5a6;
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.btn-delete:hover {
    background-color: #fee;
    color: #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .sales-header {
        flex-direction: column;
        align-items: stretch;
    }

    .sales-filters {
        max-width: 100%;
        flex-direction: column;
    }
}

/* ============================================
   TABLE SORTING
   ============================================ */

.clients-table th[style*="cursor: pointer"],
.clients-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color var(--transition-fast);
}

.clients-table th[style*="cursor: pointer"]:hover,
.clients-table th.sortable:hover {
    background-color: var(--bg-tertiary);
}

.sort-arrow {
    font-size: 0.75rem;
    margin-left: var(--spacing-xs);
    color: var(--accent-unlimited);
    font-weight: bold;
}

th.sort-asc,
th.sort-desc {
    background-color: rgba(0, 188, 212, 0.05);
    color: var(--accent-unlimited);
    font-weight: 700;
}

/* ============================================
   HORECA BADGE
   ============================================ */

.horeca-badge {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    text-align: center;
}

.horeca-badge.hoteles {
    background: var(--priority-high);
}

.horeca-badge.restaurante {
    background: var(--priority-medium);
}

.horeca-badge.cafeteria {
    background: var(--priority-low);
}

.horeca-badge.otro {
    background: #95a5a6;
}

/* ============================================
   COLUMN TOGGLE MENU
   ============================================ */

.column-toggle-wrapper {
    position: relative;
}

.btn-icon {
    padding: var(--spacing-sm);
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-unlimited);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: opacity var(--transition-fast);
}

.btn-text:hover {
    opacity: 0.8;
}

.column-toggle-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
}

.column-toggle-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.column-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.column-toggle-header span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.column-toggle-list {
    padding: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
}

.column-toggle-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    user-select: none;
}

.column-toggle-item:hover {
    background: var(--bg-tertiary);
}

.column-toggle-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-unlimited);
}

.column-toggle-item span {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Hidden columns */
.clients-table th.column-hidden,
.clients-table td.column-hidden {
    display: none;
}

/* ============================================
   INLINE EDITING
   ============================================ */

.editable {
    position: relative;
    transition: background var(--transition-fast);
}

.editable:hover:not(.editing) {
    background: var(--bg-tertiary);
}

.editable:hover:not(.editing)::after {
    content: '✎';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 0.875rem;
    opacity: 0.6;
}

.editable.editing {
    background: var(--bg-card);
    padding: 0;
}

.inline-edit-input,
.inline-edit-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--accent-unlimited);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.inline-edit-input:focus,
.inline-edit-select:focus {
    border-color: var(--accent-unlimited);
}

.inline-edit-select {
    cursor: pointer;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-base);
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid var(--status-closed);
}

.toast-error {
    border-left: 4px solid #f5576c;
}

.toast-info {
    border-left: 4px solid var(--accent-unlimited);
}

/* ============================================
   MAP WIDGET STYLES
   ============================================ */

.map-card {
    grid-column: 1 / -1;
}

.map-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.map-filters {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.map-counter {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-unlimited);
    background: rgba(0, 188, 212, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.clients-map {
    width: 100%;
    height: 500px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    margin: 1rem;
    font-family: var(--font-family);
}

.map-popup-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.map-popup-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.map-popup-status {
    display: inline-block;
    margin-top: 0.5rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 300px;
    max-width: 500px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all var(--transition-base);
    border-left: 4px solid var(--accent-unlimited);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Toast Types */
.toast-success {
    border-left-color: var(--accent-enterprise);
}

.toast-success .toast-icon {
    background: var(--accent-enterprise);
    color: white;
}

.toast-error {
    border-left-color: #e74c3c;
}

.toast-error .toast-icon {
    background: #e74c3c;
    color: white;
}

.toast-warning {
    border-left-color: #f39c12;
}

.toast-warning .toast-icon {
    background: #f39c12;
    color: white;
}

.toast-info {
    border-left-color: var(--accent-unlimited);
}

.toast-info .toast-icon {
    background: var(--accent-unlimited);
    color: white;
}