/* ===== DESIGN TOKENS — TEMA CLARO VERDE PASTEL ===== */
:root {
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 64px;

    /* Backgrounds */
    --bg-primary: #f0f4f0;
    --bg-secondary: #e8efe8;
    --bg-card: #ffffff;
    --bg-card-hover: #f5faf5;
    --bg-input: #f7faf7;
    --bg-modal: #ffffff;
    --bg-sidebar: #1a3a2a;
    --bg-sidebar-hover: #24503a;
    --bg-sidebar-active: #2d6348;

    /* Borders */
    --border: #d4e4d4;
    --border-focus: #66bb6a;
    --border-light: #e8f0e8;

    /* Text */
    --text-primary: #1a2e1a;
    --text-secondary: #4a6a4a;
    --text-muted: #7a9a7a;
    --text-sidebar: rgba(255,255,255,0.7);
    --text-sidebar-active: #ffffff;

    /* Accent colors */
    --accent: #4caf50;
    --accent-light: #81c784;
    --accent-lighter: #c8e6c9;
    --accent-hover: #66bb6a;
    --accent-glow: rgba(76, 175, 80, 0.15);
    --accent-dark: #2e7d32;

    /* Semantic colors */
    --green: #43a047;
    --green-bg: rgba(67, 160, 71, 0.1);
    --yellow: #f9a825;
    --yellow-bg: rgba(249, 168, 37, 0.1);
    --red: #e53935;
    --red-bg: rgba(229, 57, 53, 0.08);
    --blue: #1e88e5;
    --blue-bg: rgba(30, 136, 229, 0.08);
    --purple: #8e24aa;
    --purple-bg: rgba(142, 36, 170, 0.08);
    --orange: #fb8c00;
    --orange-bg: rgba(251, 140, 0, 0.08);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);

    /* Transition */
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== APP LAYOUT ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 72px;
}
.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}
.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.sidebar.collapsed .sidebar-logo-text { opacity: 0; width: 0; }
.sidebar-logo-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.2;
}
.sidebar-logo-title span { color: var(--accent-light); }
.sidebar-logo-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-weight: 400;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    overflow: hidden;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.sidebar-nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}
.sidebar-nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}
.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent-light);
    border-radius: 0 4px 4px 0;
}
.sidebar-nav-item { position: relative; }
.sidebar-nav-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-nav-label {
    transition: opacity 0.2s;
    overflow: hidden;
}
.sidebar.collapsed .sidebar-nav-label { opacity: 0; width: 0; }

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 8px 14px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sidebar-server-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    font-size: 12px;
    color: var(--text-sidebar);
    overflow: hidden;
    white-space: nowrap;
}
.sidebar-server-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}
.sidebar-server-dot.online { background: #4caf50; box-shadow: 0 0 8px rgba(76,175,80,0.6); }
.sidebar-server-dot.offline { background: #e53935; box-shadow: 0 0 8px rgba(229,57,53,0.6); }
.sidebar-server-dot.checking { background: #f9a825; }
.sidebar.collapsed .sidebar-server-label { opacity: 0; width: 0; }

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-sidebar);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: all var(--transition);
    overflow: hidden;
    white-space: nowrap;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.1); }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-collapse-label { opacity: 0; width: 0; }

/* ===== MAIN CONTENT AREA ===== */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.sidebar.collapsed ~ .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

/* ===== TOP BAR ===== */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

/* ===== VIEWS (shown/hidden by JS) ===== */
.view-section {
    display: none;
    flex: 1;
    padding: 24px 28px 64px;
}
.view-section.active {
    display: block;
}

/* ===== AMBIENT BACKGROUND (removed for light theme) ===== */
.ambient-bg { display: none; }

/* ===== OLD HEADER (hidden — replaced by sidebar + topbar) ===== */
.header { display: none !important; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.25);
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent-lighter);
}
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c62828; transform: translateY(-1px); }
.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
    border-radius: 6px;
}
.btn-text:hover { background: var(--accent-glow); }
.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border); }
.btn-icon.edit:hover { color: var(--accent); }
.btn-icon.delete:hover { color: var(--red); }
.btn-icon.instagram:hover { color: #db2777 !important; border-color: rgba(219,39,119,0.3) !important; background: rgba(219,39,119,0.08) !important; }
.btn-icon.store:hover { border-color: currentColor !important; background: rgba(0,0,0,0.03) !important; }
.btn-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.btn-close:hover { background: var(--bg-secondary); color: var(--text-primary); }

/* ===== MAIN (legacy class preserved) ===== */
.main {
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ===== DASHBOARD VIEW ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
    cursor: default;
    box-shadow: var(--shadow);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-lighter);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
}
.stat-total .stat-icon { background: var(--blue-bg); color: var(--blue); }
.stat-nuevo .stat-icon { background: var(--accent-glow); color: var(--accent); }
.stat-pending .stat-icon { background: var(--yellow-bg); color: var(--yellow); }
.stat-contacted .stat-icon { background: var(--purple-bg); color: var(--purple); }
.stat-interested .stat-icon { background: var(--orange-bg); color: var(--orange); }
.stat-client .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-rejected .stat-icon { background: var(--red-bg); color: var(--red); }
.stat-whatsapp .stat-icon { background: rgba(37,211,102,0.1); color: #25D366; }
.stat-info { display: flex; flex-direction: column; }
.stat-number { font-size: 28px; font-weight: 800; line-height: 1; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }

/* Map Section */
.dashboard-map-section {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    margin-bottom: 28px;
}
.map-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}
.map-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.map-container {
    width: 100%;
    aspect-ratio: 4/3;
    position: relative;
}
.map-container svg {
    width: 100%;
    height: 100%;
}
.map-tooltip {
    position: absolute;
    background: var(--bg-sidebar);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    white-space: nowrap;
}
.map-tooltip.visible { opacity: 1; }

/* Map Legend / Top Zones */
.map-top-zones {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}
.top-zone-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.top-zone-item:last-child { border-bottom: none; }
.top-zone-name {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 500;
}
.top-zone-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.top-zone-count {
    font-weight: 700;
    color: var(--accent-dark);
    background: var(--accent-glow);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
}

/* ===== LEAD TABS BAR ===== */
.tabs-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-shadow: var(--shadow);
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    border: 1px solid transparent;
    user-select: none;
    flex-shrink: 0;
}
.tab-item:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}
.tab-item.active {
    color: var(--text-primary);
    background: var(--bg-primary);
    border-color: var(--border);
    box-shadow: var(--shadow);
}
.tab-item .tab-count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    min-width: 22px;
    text-align: center;
}
.tab-item.active .tab-count {
    background: var(--accent-glow);
    color: var(--accent-dark);
}
/* Tab color accents */
.tab-item[data-tab="todos"].active { border-bottom: 2px solid var(--blue); }
.tab-item[data-tab="nuevo"].active { border-bottom: 2px solid var(--accent); }
.tab-item[data-tab="whatsapp"].active { border-bottom: 2px solid #25D366; }
.tab-item[data-tab="whatsapp"].active .tab-count { background: rgba(37,211,102,0.1); color: #25D366; }
.tab-item[data-tab="telefono_fijo"].active { border-bottom: 2px solid #0ea5e9; }
.tab-item[data-tab="pendiente"].active { border-bottom: 2px solid var(--yellow); }
.tab-item[data-tab="contactado"].active { border-bottom: 2px solid var(--purple); }
.tab-item[data-tab="interesado"].active { border-bottom: 2px solid var(--orange); }
.tab-item[data-tab="cliente"].active { border-bottom: 2px solid var(--green); }
.tab-item[data-tab="no_interesado"].active { border-bottom: 2px solid var(--red); }

/* ===== FILTERS ===== */
.filters-section { margin-bottom: 20px; }
.filters-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-box {
    flex: 1;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    transition: border-color var(--transition);
    box-shadow: var(--shadow);
}
.search-box:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    padding: 11px 0;
}
.search-box input::placeholder { color: var(--text-muted); }
.filter-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* Multi-select Dropdown */
.multi-select {
    position: relative;
    min-width: 200px;
    font-size: 13px;
    font-family: inherit;
}
.ms-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color var(--transition);
    user-select: none;
    box-shadow: var(--shadow);
}
.ms-header:hover, .multi-select.active .ms-header { border-color: var(--border-focus); }
.multi-select.active .ms-header { box-shadow: 0 0 0 3px var(--accent-glow); }
.ms-arrow {
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237a9a7a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s;
}
.multi-select.active .ms-arrow { transform: rotate(180deg); }
.ms-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 10;
    max-height: 250px;
    overflow-y: auto;
    padding: 8px 0;
}
.multi-select.active .ms-dropdown { display: block; }
.ms-dropdown label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--transition);
}
.ms-dropdown label:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.ms-dropdown input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }

/* Custom Accordion */
.custom-accordion {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.custom-accordion summary {
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.custom-accordion summary::-webkit-details-marker { display: none; }
.custom-accordion summary::after {
    content: '';
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237a9a7a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s;
}
.custom-accordion[open] summary::after { transform: rotate(180deg); }
.custom-accordion .accordion-content {
    border-top: 1px solid var(--border);
    padding: 10px;
}
.filters-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== TABLE ===== */
.table-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.table-container { overflow-x: auto; }
.prospects-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prospects-table thead { background: var(--bg-card-hover); }
.prospects-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { color: var(--text-primary); }
.sort-icon { font-size: 11px; opacity: 0.4; }
.prospects-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    max-width: 200px;
}
.prospects-table tbody tr { transition: background var(--transition); }
.prospects-table tbody tr:hover { background: var(--bg-card-hover); }
.prospects-table tbody tr:last-child td { border-bottom: none; }
.cell-name { font-weight: 600; color: var(--text-primary); }
.cell-address { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cell-notes { font-size: 12px; color: var(--text-secondary); max-width: 250px; white-space: normal; }
.cell-web a { color: var(--accent); text-decoration: none; font-size: 13px; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.cell-web a:hover { text-decoration: underline; }
.cell-phone { font-family: 'Inter', monospace; font-size: 13px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.cell-actions { display: flex; gap: 6px; }

/* Badges */
.badge, .badge-select {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    border: 1px solid var(--border-light);
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='4' viewBox='0 0 8 4' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 3L7 1' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 22px;
}
.badge-select:hover { filter: brightness(0.95); }
.badge-nuevo, select.badge-nuevo { background: var(--accent-glow); color: var(--accent-dark); border-color: var(--accent-lighter); }
.badge-telefono_fijo, select.badge-telefono_fijo { background: rgba(14, 165, 233, 0.1); color: #0277bd; border-color: rgba(14, 165, 233, 0.3); }
.badge-pendiente, select.badge-pendiente { background: var(--yellow-bg); color: #f57f17; }
.badge-contactado, select.badge-contactado { background: var(--purple-bg); color: var(--purple); }
.badge-interesado, select.badge-interesado { background: var(--orange-bg); color: #e65100; }
.badge-cliente, select.badge-cliente { background: var(--green-bg); color: var(--green); }
.badge-no_interesado, select.badge-no_interesado { background: var(--red-bg); color: var(--red); }
.badge-alta, select.badge-alta { background: var(--red-bg); color: var(--red); }
.badge-media, select.badge-media { background: var(--yellow-bg); color: #f57f17; }
.badge-baja, select.badge-baja { background: var(--green-bg); color: var(--green); }
.badge-ninguna, select.badge-ninguna { background: var(--bg-secondary); color: var(--text-muted); }

/* Empty State */
.empty-state {
    padding: 80px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.empty-icon { color: var(--text-muted); opacity: 0.3; margin-bottom: 8px; }
.empty-state h3 { font-size: 20px; font-weight: 700; }
.empty-state p { color: var(--text-muted); font-size: 14px; max-width: 400px; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-sm { max-width: 440px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
}
.modal-header h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 28px 28px; }
.delete-message { padding: 20px 28px; color: var(--text-secondary); font-size: 15px; line-height: 1.6; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 24px 28px 0; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
    resize: vertical;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    min-width: 280px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-info { border-left: 3px solid var(--accent); }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(40px); } }

/* ===== SELECTION BAR ===== */
.selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent-glow);
    border: 1px solid var(--accent-lighter);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-primary);
    animation: slideIn 0.2s ease;
}
.row-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
#selectAll { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* ===== COLUMN TOGGLES ===== */
.col-toggle-bar { position: relative; margin-bottom: 10px; }
.col-toggle-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
}
.col-toggle-dropdown.active { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.col-toggle-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}
.col-toggle-item input { accent-color: var(--accent); cursor: pointer; }
.col-toggle-item:hover { color: var(--text-primary); }

/* ===== RUBROS GRID ===== */
.rubros-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 6px;
}
.rubros-grid::-webkit-scrollbar { width: 6px; }
.rubros-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.rubro-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
}
.rubro-checkbox .rubro-emoji { font-size: 20px; line-height: 1; }
.rubro-checkbox .rubro-name { flex: 1; }
.rubro-checkbox:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--accent-glow);
}
.rubro-checkbox input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
.rubro-checkbox:has(input:checked) {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--text-primary);
}
.rubros-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition);
}
.rubros-toggle-btn:hover { background: var(--accent-glow); border-color: var(--accent); }

/* ===== KANBAN VIEW ===== */
.kanban-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 16px;
    padding: 10px 0;
    overflow-x: auto;
    min-height: 600px;
    align-items: start;
}
.kanban-column {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 500px;
    transition: background var(--transition);
    box-shadow: var(--shadow);
}
.kanban-column.drag-over {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}
.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.kanban-column-count {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}
.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    max-height: 600px;
    padding-right: 4px;
}
.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: grab;
    transition: all var(--transition);
    user-select: none;
    box-shadow: var(--shadow);
}
.kanban-card:hover { transform: translateY(-2px); border-color: var(--accent-lighter); box-shadow: var(--shadow-md); }
.kanban-card:active { cursor: grabbing; }
.kanban-card-title { font-weight: 600; font-size: 13px; color: var(--text-primary); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kanban-card-info { font-size: 11px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 4px; }
.kanban-card-badge { align-self: flex-start; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.kanban-card-footer { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-light); padding-top: 6px; }

/* Active Hunt Banner */
.active-hunt-banner {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.08) 0%, rgba(30, 136, 229, 0.08) 100%);
    border-bottom: 1px solid rgba(76, 175, 80, 0.2);
    padding: 10px 24px;
    width: 100%;
    position: sticky;
    top: var(--topbar-height);
    z-index: 99;
}
.active-hunt-banner-inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-dark);
}
.active-hunt-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: hunt-spin 1s linear infinite;
}
@keyframes hunt-spin { to { transform: rotate(360deg); } }

/* ===== SERVER STATUS BADGE (old, hidden) ===== */
.server-badge { display: none; }

/* ===== SIDEBAR HISTORIAL (now a view, not overlay) ===== */
.sidebar-overlay { display: none !important; }
.sidebar-panel { display: none !important; }

/* History inside the view */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}
.history-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-lighter);
}
.history-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--text-muted);
}
.history-card.status-ejecutando::before { background: var(--accent); }
.history-card.status-completado::before { background: var(--green); }
.history-card.status-error::before { background: var(--red); }
.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.history-card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.history-card-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}
.history-card-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.history-card-detail {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}
.history-card-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-muted);
}
/* History expandable details */
.history-expand-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    margin-top: 8px;
}
.history-expand-btn:hover { background: var(--accent-glow); }
.history-details {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}
.history-details.active { display: block; }

/* ===== FLOATING PROGRESS BAR ===== */
#searchProgressBar {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
    color: var(--text-primary) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-map-section { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 300;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-wrapper { margin-left: 0 !important; }
    .topbar { padding: 0 16px; }
    .view-section { padding: 16px; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-number { font-size: 22px; }
    .filters-row { flex-direction: column; }
    .search-box { min-width: 100%; }
    .filter-group { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .modal { width: 95%; }
    .btn span { display: none; }
    .btn svg { margin: 0; }
    .tabs-bar { gap: 4px; padding: 4px; margin-bottom: 14px; }
    .tab-item { padding: 8px 12px; font-size: 12px; }
    .kanban-container { grid-template-columns: repeat(3, 260px); }
}
@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Mobile sidebar overlay */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 250;
}
.mobile-sidebar-overlay.active { display: block; }

/* ===== IMPORT MAPPING ===== */
.import-mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.import-map-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color var(--transition);
}
.import-map-item:hover { border-color: var(--accent-lighter); }
.import-col-name { font-size: 13px; font-weight: 700; color: var(--accent-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-sample { font-size: 11px; color: var(--text-muted); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.import-select { font-size: 13px; padding: 8px 10px; min-width: 0; }

/* ===== FILTER SELECT ===== */
.filter-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    appearance: none;
    min-width: 170px;
    box-shadow: var(--shadow);
}
.filter-select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.filter-select option { background: var(--bg-card); color: var(--text-primary); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== LOGIN OVERLAY ===== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a1f14;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Ambient orbs */
.login-ambient {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: loginOrbFloat 12s ease-in-out infinite alternate;
}
.login-orb-1 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #4caf50 0%, transparent 70%);
    top: -100px; left: -100px;
    animation-duration: 14s;
}
.login-orb-2 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #2e7d32 0%, transparent 70%);
    bottom: -80px; right: -80px;
    animation-duration: 10s;
    animation-delay: -4s;
}
.login-orb-3 {
    width: 250px; height: 250px;
    background: radial-gradient(circle, #81c784 0%, transparent 70%);
    top: 50%; left: 60%;
    animation-duration: 16s;
    animation-delay: -7s;
}
@keyframes loginOrbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -40px) scale(1.1); }
    100% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Login card */
.login-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 48px 40px 40px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(76, 175, 80, 0.1);
    animation: loginCardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateY(20px);
    opacity: 0;
}
@keyframes loginCardEntrance {
    to { transform: translateY(0); opacity: 1; }
}

/* Logo */
.login-logo {
    text-align: center;
    margin-bottom: 36px;
}
.login-logo-icon {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    border-radius: 20px;
    color: white;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3);
    animation: loginLogoPulse 3s ease-in-out infinite;
}
@keyframes loginLogoPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3); }
    50% { box-shadow: 0 8px 40px rgba(76, 175, 80, 0.5); }
}
.login-title {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}
.login-title span {
    color: #81c784;
    font-weight: 600;
}
.login-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* Form */
.login-form { display: flex; flex-direction: column; gap: 20px; }
.login-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}
.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.login-input-icon {
    position: absolute;
    left: 14px;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    transition: color 0.3s ease;
}
.login-input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}
.login-input-wrapper input::placeholder { color: rgba(255, 255, 255, 0.25); }
.login-input-wrapper input:focus {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.06);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}
.login-input-wrapper input:focus ~ .login-input-icon,
.login-input-wrapper input:focus + .login-input-icon,
.login-input-wrapper:focus-within .login-input-icon {
    color: #4caf50;
}
.login-toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}
.login-toggle-pw:hover { color: rgba(255, 255, 255, 0.7); }

/* Error & Success messages */
.login-error {
    display: none;
    padding: 10px 14px;
    background: rgba(229, 57, 53, 0.12);
    border: 1px solid rgba(229, 57, 53, 0.3);
    border-radius: 10px;
    color: #ef5350;
    font-size: 13px;
    animation: loginShake 0.4s ease;
}
.login-error.visible { display: block; }
@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.login-success {
    display: none;
    padding: 10px 14px;
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 10px;
    color: #81c784;
    font-size: 13px;
}
.login-success.visible { display: block; }

/* Login button */
.login-btn {
    position: relative;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}
.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(76, 175, 80, 0.4);
}
.login-btn:active { transform: translateY(0); }
.login-btn.loading .login-btn-text { opacity: 0; transform: translateY(-10px); }
.login-btn.loading .login-btn-loader { opacity: 1; transform: translateY(0); }
.login-btn-text {
    transition: all 0.3s ease;
}
.login-btn-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    color: white;
    font-size: 14px;
}
.login-spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: loginSpin 0.8s linear infinite;
}
@keyframes loginSpin {
    to { transform: rotate(360deg); }
}

/* Forgot password link */
.login-forgot {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-align: center;
    transition: color 0.2s;
    padding: 0;
}
.login-forgot:hover { color: #81c784; }

.login-forgot-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    margin: 0;
}

/* Success animation */
.login-success-anim {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 0 20px;
    animation: loginFadeIn 0.4s ease;
}
.login-success-anim.visible {
    display: flex;
}
.login-check-circle {
    width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.15);
    border: 2px solid #4caf50;
    animation: loginCheckPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes loginCheckPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.login-success-anim p {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}
@keyframes loginFadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

/* Sidebar user info & logout */
.sidebar-user-info {
    padding: 8px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-user-email {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-logout-btn {
    color: rgba(255, 120, 120, 0.7) !important;
    margin-top: 4px;
}
.sidebar-logout-btn:hover {
    background: rgba(229, 57, 53, 0.15) !important;
    color: #ef5350 !important;
}

/* Responsive login */
@media (max-width: 480px) {
    .login-card {
        margin: 16px;
        padding: 36px 28px 32px;
    }
    .login-title { font-size: 28px; }
    .login-logo-icon { width: 60px; height: 60px; }
}
