/**
 * SiteIncrível Recruit - Professional Applicant Tracking System
 * Centralized CSS Stylesheet
 *
 * Table of Contents:
 * 1. CSS Variables & Color Palette
 * 2. Global Styles & Typography
 * 3. Layout System (CSS Grid)
 * 4. Component Styles
 *    - Header & Navigation
 *    - Sidebar
 *    - Cards & Stats
 *    - Forms & Buttons
 *    - Applications & Pipeline
 * 5. Responsive Design
 * 6. Utility Classes
 * 7. Print Styles
 */

/* ========================================
   1. CSS Variables & Color Palette
   ======================================== */
:root {
    /* Modern HR/ATS Professional Color Palette */
    --primary-color: #0176D3;        /* Salesforce Blue */
    --primary-dark: #014486;         /* Darker Blue for hover states */
    --primary-light: #E3F3FF;        /* Light Blue for backgrounds */
    --secondary-color: #5C6B73;      /* Professional Gray */
    --success-color: #0f5132;        /* WCAG AA Compliant Dark Green */
    --danger-color: #EA001E;         /* Professional Red */
    --warning-color: #FFB75D;        /* Professional Orange/Amber */
    --info-color: #0176D3;           /* Same as primary for consistency */
    --light-color: #F8F9FA;          /* Clean Light Gray */
    --lighter-color: #FFFFFF;        /* Pure White */
    --dark-color: #181818;           /* Deep Dark Gray */
    --text-color: #3E3E3C;           /* Professional Text Color */
    --text-muted: #706E6B;           /* Muted Text Color */
    --border-color: #DDDBDA;         /* Subtle Border Color */
    --background-color: #F4F6F9;     /* Modern Background */
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);

    /* Z-Index Scale - Standardized */
    --z-dropdown: 1000;
    --z-navbar: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ========================================
   2. Global Styles & Typography
   ======================================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* Hero Section */
.hero-section {
    padding-top: 100px;
}

/* Feature Cards */
.feature-card {
    background: var(--lighter-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.feature-icon {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    color: var(--primary-color);
}

/* Pricing Cards */
.pricing-card {
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    background: var(--lighter-color);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

/* ========================================
   3. Layout System (CSS Grid)
   ======================================== */
/* Modern Layout System using CSS Grid - Header integrated */
/* Only apply grid layout to non-talent-portal pages */
body:not(.talent-portal) {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar main";
    grid-template-rows: auto 1fr;
    grid-template-columns: 250px 1fr; /* Sidebar width and flexible main content */

    min-height: 100vh;
}

/* Talent portal pages use flexbox layout */
body.talent-portal {
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

/* Layout Areas */
.ats-header-nav {
    grid-area: header;
}

.sidebar {
    grid-area: sidebar;
    background: var(--dark-color);
    transition: all 0.3s;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    z-index: var(--z-fixed);
    overflow-y: auto;
    position: relative;
    height: 100%;
}

/* Sidebar nav-link styles moved to component section for better organization */

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
}

/* Main Content */
.main-content {
    grid-area: main;
    padding: 20px;
    background: var(--background-color);
    overflow-y: auto;
    min-height: 0; /* Allow grid to control height */
    width: 100%;
}

/* Ensure main content doesn't conflict with flexbox layouts */
.main-content.flex-grow-1 {
    flex-grow: 0 !important; /* Override any conflicting flex properties */
}

/* Fix for pages that might still have flexbox containers */
.d-flex .main-content {
    flex: none !important;
    width: 100% !important;
    flex-wrap: wrap;
}

/* ========================================
   5. Responsive Design
   ======================================== */
/* Tablet Layout - Adjust grid for medium screens */
@media (max-width: 991.98px) and (min-width: 769px) {
    body {
        grid-template-columns: 200px 1fr; /* Narrower sidebar on tablets */
    }

    .sidebar {
        width: 200px;
    }
}

/* Mobile Layout - Switch to traditional flexbox for better mobile experience */
@media (max-width: 768px) {
    body {
        display: block; /* Disable grid on mobile */
    }

    .ats-header-nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: var(--z-popover) !important; /* Ensure navbar is above sidebar in mobile */
        height: 4rem !important; /* Consistent with h-16 Tailwind class */
    }

    .navbar-container {
        padding: 0 1rem;
    }

    .navbar-center {
        display: none !important;
    }

    .quick-actions {
        display: none !important;
    }

    .main-content {
        margin-top: 4rem; /* Account for fixed navbar (h-16 = 64px = 4rem) */
        padding: 15px;
        margin-left: 0 !important; /* Override any grid-based margins */
    }

    .sidebar {
        position: fixed;
        top: 4rem !important; /* Start below navbar (h-16 = 64px = 4rem) */
        left: -250px;
        width: 250px;
        height: calc(100vh - 4rem) !important; /* Subtract navbar height (h-16 = 64px = 4rem) */
        z-index: var(--z-fixed); /* Lower than navbar to prevent overlap */
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        transition: left 0.3s ease;
    }

    .sidebar.show {
        top: 4rem !important; /* Ensure sidebar stays below navbar when open */
        height: calc(100vh - 4rem) !important; /* Maintain proper height when open */
    }

    .sidebar.show {
        left: 0;
    }

    /* Mobile overlay */
    .sidebar.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 250px;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    background: var(--lighter-color);
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background: var(--lighter-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-color);
    border-radius: 12px 12px 0 0;
}

/* Modern Stats Cards - Material Design 3 */
.stats-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0176D3, #0056b3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(1, 118, 211, 0.15);
    border-color: rgba(1, 118, 211, 0.2);
}

.stats-card:hover::before {
    opacity: 1;
}

/* Dashboard Candidate Avatar */
.candidate-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

/* Enhanced Stats Cards for Dashboard */
.stats-card .stats-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}

/* Stats Card Color Variants */
.stats-card-jobs .stats-icon {
    background: linear-gradient(135deg, #0176D3, #0056b3);
    box-shadow: 0 4px 12px rgba(1, 118, 211, 0.3);
}

.stats-card-candidates .stats-icon {
    background: linear-gradient(135deg, #17a2b8, #138496);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.stats-card-applications .stats-icon {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.stats-card-pipeline .stats-icon {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.stats-card-tests .stats-icon {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

.stats-card h3 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stats-card .card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-card .stats-details {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 16px;
}

.stats-card .stats-details small {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
}

.stats-card .stats-trend {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.stats-card .stats-trend.positive {
    color: #059669;
}

.stats-card .stats-trend.negative {
    color: #dc2626;
}

.stats-card .stats-trend.neutral {
    color: #6b7280;
}

/* Clickable Stats Cards */
.stats-card-clickable {
    cursor: pointer;
    position: relative;
}

.stats-card-clickable:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(1, 118, 211, 0.2);
}

.stats-card-clickable:hover .stats-icon {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(1, 118, 211, 0.4);
}

.stats-card-clickable .stats-card-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: 0;
    transition: all 0.3s ease;
    color: #9ca3af;
    font-size: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(1, 118, 211, 0.1);
}

.stats-card-clickable:hover .stats-card-arrow {
    opacity: 1;
    color: #0176D3;
    background: rgba(1, 118, 211, 0.15);
    transform: translateX(2px);
}

/* Ensure text color is preserved in clickable cards */
.stats-card-clickable h3,
.stats-card-clickable p,
.stats-card-clickable small {
    color: inherit;
}

a .stats-card-clickable h3 {
    color: #1a1a1a;
}

a .stats-card-clickable .card-title {
    color: #6b7280;
}

a:hover .stats-card-clickable h3 {
    color: #0176D3;
}

a:hover .stats-card-clickable .card-title {
    color: #0176D3;
}

a:hover .stats-card-clickable {
    text-decoration: none;
}

/* Remove default link styling */
a.stats-card-link {
    text-decoration: none;
    color: inherit;
}

a.stats-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Quick Actions - Enhanced Trello Style */
.quick-actions-card {
    background: var(--lighter-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.quick-actions-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.quick-actions-card .card-header {
    background: linear-gradient(135deg, rgba(1,118,211,0.05) 0%, rgba(1,68,134,0.02) 100%);
    border-bottom: 1px solid rgba(1,118,211,0.1);
    padding: 1.25rem 1.5rem;
}

.quick-action-btn {
    padding: 24px 20px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-btn:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    border-color: currentColor;
}

.quick-action-btn:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.quick-action-btn i {
    transition: all 0.3s ease;
}

.quick-action-btn:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* Enhanced hover effects for background overlay */
.quick-action-btn:hover .position-absolute {
    opacity: 0.05 !important;
}

/* Trello-style ripple effect */
.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.1;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.quick-action-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Candidate Cards */
.candidate-card {
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.candidate-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

/* Talent Pool specific avatar size */
.talent-pool .candidate-avatar {
    width: 50px;
    height: 50px;
    font-size: 18px;
}

/* Company Avatar in Sidebar */
.company-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Trial Info Section - Salesforce Style */
.trial-info-card {
    background: linear-gradient(135deg, rgba(1, 118, 211, 0.1) 0%, rgba(1, 118, 211, 0.05) 100%);
    border: 1px solid rgba(1, 118, 211, 0.2);
    box-shadow: 0 2px 4px rgba(1, 118, 211, 0.1);
    transition: all 0.3s ease;
}

.trial-info-card:hover {
    border-color: rgba(1, 118, 211, 0.3);
    box-shadow: 0 4px 8px rgba(1, 118, 211, 0.15);
}

.trial-info-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
}

.trial-info-text {
    color: var(--text-muted);
    line-height: 1.4;
}

.trial-expired {
    color: var(--danger-color);
    font-weight: 600;
}

.trial-upgrade-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.trial-upgrade-btn:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(1, 118, 211, 0.3);
}

/* Trial Badge in Navigation */
.trial-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Message Styles */
.message-item {
    transition: background-color 0.3s ease;
}

.message-item:hover {
    background-color: var(--light-color);
}

.message-type-icon {
    width: 30px;
    text-align: center;
}

.message-list {
    max-height: 600px;
    overflow-y: auto;
}

/* Rating Input Styles */
.rating-input {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 5px;
    margin: 10px 0;
}

.rating-input input[type="radio"] {
    display: none;
}

.rating-input .star {
    font-size: 2rem;
    color: var(--border-color);
    cursor: pointer;
    transition: color 0.2s ease;
}

/* Hover effect: highlight hovered star and all following stars (which appear before due to row-reverse) */
.rating-input .star:hover,
.rating-input .star:hover ~ .star {
    color: var(--warning-color);
}

/* Checked effect: highlight checked star and all following stars (which appear before due to row-reverse) */
.rating-input input[type="radio"]:checked ~ label.star {
    color: var(--warning-color);
}

.stats-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

/* Tables */
.table {
    background: var(--lighter-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.table thead th {
    background: var(--background-color);
    border: none;
    font-weight: 600;
    color: var(--text-color);
    padding: 16px;
}

.table tbody tr {
    transition: background-color 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--primary-light);
}

.table tbody td {
    padding: 16px;
    color: var(--text-color);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 10px 20px;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 118, 211, 0.3);
}

.btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background: #0a4128;
    border-color: #0a4128;
}

.btn-danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: #c5001a;
    border-color: #c5001a;
}

.btn-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
    color: var(--text-color);
}

.btn-warning:hover {
    background: #e6a54a;
    border-color: #e6a54a;
    color: var(--text-color);
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    padding: 12px 16px;
    color: var(--text-color);
    background-color: var(--lighter-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(1, 118, 211, 0.25);
    background-color: var(--lighter-color);
}

.form-label {
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 8px;
}

.form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    background-color: var(--lighter-color);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(1, 118, 211, 0.25);
}

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 20px 0;
}

.kanban-column {
    min-width: 300px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.kanban-header {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 600;
    color: white;
}

.kanban-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kanban-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-info {
    background-color: var(--info-color) !important;
}

/* Alerts */
.alert {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    background-color: var(--lighter-color);
}

.alert-success {
    background-color: rgba(4, 132, 75, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(234, 0, 30, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 183, 93, 0.1);
    border-color: var(--warning-color);
    color: #b8860b;
}

.alert-info {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

/* Trial Banner */
.trial-banner {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e6a54a 100%);
    color: var(--text-color);
    padding: 12px 0;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 576px) {
    .kanban-board {
        flex-direction: column;
    }

    .kanban-column {
        min-width: auto;
    }
}

/* Mobile Touch Improvements */
@media (max-width: 991.98px) {
    /* Ensure buttons are touch-friendly */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Improve spacing for mobile */
    .card {
        margin-bottom: 1rem;
    }

    /* Better mobile table handling */
    .table-responsive {
        border: none;
    }

    /* Mobile-friendly form controls */
    .form-control, .form-select {
        min-height: 44px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {

}

/* Modern UI Enhancements */
.text-muted {
    color: var(--text-muted) !important;
}

.border {
    border-color: var(--border-color) !important;
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--card-shadow-hover);
    z-index: var(--z-dropdown); /* Ensure dropdowns appear above cards and other UI elements */
}

.dropdown-menu.show {
    z-index: var(--z-dropdown); /* Ensure shown dropdowns have high z-index */
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* Pipeline Stage Actions Dropdown */
.pipeline-stage-header .dropdown-menu {
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

.pipeline-stage-header .dropdown-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.pipeline-stage-header .dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.pipeline-stage-header .dropdown-item i {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.pipeline-stage-header .dropdown-item:hover i {
    opacity: 1;
}


.modal-content {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--background-color);
}

/* Accessibility Improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   4. Component Styles
   ======================================== */

/* 4.1 Sidebar Component */
.sidebar-content {
    height: auto;
    overflow-y: auto; /* Enable scrolling for content */
    overflow-x: hidden;
    padding-bottom: 2rem; /* Extra space at bottom */
}

.nav-header {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem;
}

/* Override existing sidebar nav-link styles for better consistency */
.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0;
    transition: all 0.15s ease-in-out;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255,255,255,0.1);
}

.sidebar .nav-link.active {
    color: white;
    background-color: var(--primary-color);
}

.sidebar .nav-link i {
    width: 1.25rem;
    margin-right: 0.75rem;
    text-align: center;
}

/* Scrollbar styling for sidebar content */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Firefox scrollbar styling */
.sidebar-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) rgba(255,255,255,0.1);
}

/* 4.2 ATS Header Navigation - Grid Integrated */
.ats-header-nav {
    grid-area: header;
    position: relative;
    z-index: var(--z-navbar);
    background-color: #F7F9FC;
    box-shadow: 0px 1px 2px rgba(0,0,0,0.3), 0px 2px 6px 2px rgba(0,0,0,0.15);
    border: none;
    transition: box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1);
    width: 100%;
    min-height: 4rem;
    display: flex;
    align-items: center;
}

/* Navigation sections now use Tailwind classes */

/* Material Design 3 Company Info Card */
.ats-nav-company-info {
    background-color: #E8F4FD !important; /* Surface variant with primary tint */
    border: 1px solid #D1E7F8 !important; /* Outline variant */
    border-radius: 0.75rem !important; /* 12px - Material 3 large radius */
    padding: 0.75rem 1rem !important; /* 12px 16px - Material 3 spacing */
    box-shadow: 0px 1px 2px rgba(0,0,0,0.05) !important; /* Subtle elevation */
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1) !important;
}

.ats-nav-company-info:hover {
    background-color: #DDF1FF !important;
    box-shadow: 0px 1px 3px rgba(0,0,0,0.1) !important;
}

/* Hamburger menu animations - keeping essential animations */
.ats-nav-hamburger-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    background-color: currentColor;
}

.ats-nav-hamburger-active .ats-nav-hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.ats-nav-hamburger-active .ats-nav-hamburger-line:nth-child(2) {
    opacity: 0;
}

.ats-nav-hamburger-active .ats-nav-hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 4.2.5 ATS Navigation Dropdowns - Material Design 3 */
.ats-nav-dropdown {
    position: relative !important;
}

.ats-nav-dropdown-menu {
    position: absolute !important;
    top: calc(100% + 0.5rem) !important; /* 8px gap from trigger button */
    right: 0 !important;
    z-index: var(--z-tooltip) !important; /* Higher than navbar to ensure visibility */
    min-width: 280px !important; /* Wider for better content */

    /* Material Design 3 Menu Surface */
    background-color: #FFFFFF !important; /* Surface */
    border: none !important;
    border-radius: 0.75rem !important; /* 12px - Material 3 large radius */

    /* Material Design 3 Elevation-3 for floating menus */
    box-shadow: 0px 1px 3px rgba(0,0,0,0.3), 0px 4px 8px 3px rgba(0,0,0,0.15) !important;

    /* Material Design 3 Motion */
    animation: ats-dropdown-enter 0.2s cubic-bezier(0.2, 0, 0, 1) !important;

    /* Ensure proper alignment with trigger button */
    transform-origin: top right !important;
}

/* Specific alignment for notifications dropdown */
.ats-nav-dropdown:first-of-type .ats-nav-dropdown-menu {
    /* Notifications dropdown - align with notifications button */
    right: 0 !important;
    left: auto !important;
}

/* Specific alignment for user menu dropdown */
.ats-nav-dropdown:last-of-type .ats-nav-dropdown-menu {
    /* User menu dropdown - align with user button */
    right: 0 !important;
    left: auto !important;
}

/* Material Design 3 Dropdown Animation */
@keyframes ats-dropdown-enter {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Material Design 3 Dropdown Items */
.ats-nav-dropdown-menu .dropdown-item {
    padding: 0.75rem 1rem !important; /* 12px 16px */
    border-radius: 0.5rem !important; /* 8px */
    margin: 0.25rem 0.5rem !important; /* 4px 8px */
    color: #1C1B1F !important; /* On surface */
    font-weight: 400 !important; /* Body large */
    font-size: 1rem !important; /* 16px */
    transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1) !important;
}

.ats-nav-dropdown-menu .dropdown-item:hover {
    background-color: rgba(28, 27, 31, 0.08) !important; /* On surface/8% */
    color: #1C1B1F !important;
}

.ats-nav-dropdown-menu .dropdown-item:active {
    background-color: rgba(28, 27, 31, 0.12) !important; /* On surface/12% */
}

/* 4.2.6 ATS Navigation Buttons - Material Design 3 */
.ats-nav-btn {
    /* Material Design 3 Button Base */
    border-radius: 0.5rem !important; /* 8px - Material 3 medium radius */
    font-weight: 500 !important; /* Material 3 label-large */
    font-size: 0.875rem !important; /* 14px */
    line-height: 1.25rem !important; /* 20px */
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Material Design 3 Filled Button (Primary Actions) */
.ats-nav-btn-filled {
    background-color: #0176D3 !important; /* Primary */
    color: #FFFFFF !important; /* On Primary */
    border: none !important;
    box-shadow: 0px 1px 2px rgba(0,0,0,0.3), 0px 1px 3px 1px rgba(0,0,0,0.15) !important;
    min-width: 2.5rem !important; /* 40px minimum */
    min-height: 2.5rem !important; /* 40px minimum */
    padding: 0.5rem !important; /* 8px */
}

.ats-nav-btn-filled:hover {
    background-color: #0056A3 !important; /* Primary dark */
    box-shadow: 0px 1px 2px rgba(0,0,0,0.3), 0px 2px 6px 2px rgba(0,0,0,0.15) !important;
    transform: translateY(-1px) !important; /* Subtle lift effect */
}

.ats-nav-btn-filled:active {
    background-color: #004080 !important; /* Primary darker */
    box-shadow: 0px 1px 2px rgba(0,0,0,0.3), 0px 1px 3px 1px rgba(0,0,0,0.15) !important;
    transform: translateY(0) !important;
}

/* Enhanced Quick Action Buttons */
.ats-nav-actions {
    width: 2.75rem !important; /* 44px for better touch target */
    height: 2.75rem !important;
    border-radius: 0.75rem !important; /* 12px - larger radius for action buttons */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important; /* 16px for icons */
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1) !important;
    margin-right: 1em;
}

/* Green variant for add candidate button */
.ats-nav-btn-filled.ats-nav-btn-green {
    background-color: #16A34A !important; /* Green-600 */
}

.ats-nav-btn-filled.ats-nav-btn-green:hover {
    background-color: #15803D !important; /* Green-700 */
}

.ats-nav-btn-filled.ats-nav-btn-green:active {
    background-color: #166534 !important; /* Green-800 */
}

/* Material Design 3 Outlined Button (Secondary Actions) */
.ats-nav-btn-outlined {
    background-color: transparent !important;
    color: #0176D3 !important; /* Primary */
    border: 1px solid #79747E !important; /* Outline */
}

.ats-nav-btn-outlined:hover {
    background-color: rgba(1, 118, 211, 0.08) !important; /* Primary/8% */
    border-color: #0176D3 !important;
}

/* Material Design 3 Icon Button */
.ats-nav-btn-icon {
    background-color: transparent !important;
    color: #49454F !important; /* On surface */
    border: none !important;
    width: 2.5rem !important; /* 40px - Material 3 icon button */
    height: 2.5rem !important;
    border-radius: 1.25rem !important; /* 20px - circular */
}

.ats-nav-btn-icon:hover {
    background-color: rgba(73, 69, 79, 0.08) !important; /* On surface/8% */
}

/* 4.2.7 ATS Navigation Brand - Material Design 3 */
.ats-nav-brand {
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important; /* 12px */
    padding: 0.5rem !important; /* 8px */
    border-radius: 0.5rem !important; /* 8px */
}

.ats-nav-brand:hover {
    text-decoration: none !important;
    background-color: rgba(1, 118, 211, 0.08) !important; /* Primary/8% */
}

/* Material Design 3 Brand Icon */
.ats-nav-brand-icon {
    width: 2.5rem !important; /* 40px */
    height: 2.5rem !important;
    border-radius: 0.75rem !important; /* 12px */
    background: linear-gradient(135deg, #0176D3 0%, #0056A3 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #FFFFFF !important;
    font-size: 1.125rem !important; /* 18px */
    box-shadow: 0px 1px 2px rgba(0,0,0,0.3), 0px 1px 3px 1px rgba(0,0,0,0.15) !important;
}

/* Material Design 3 Brand Text */
.ats-nav-brand-text {
    font-size: 1.375rem !important; /* 22px - Title Large */
    font-weight: 500 !important; /* Medium weight */
    line-height: 1.75rem !important; /* 28px */
    color: #1C1B1F !important; /* On surface */
    letter-spacing: 0 !important;
}

/* 4.2.8 ATS Navigation Responsive Styles - Material Design 3 */
@media (max-width: 768px) {
    .ats-header-nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: var(--z-popover) !important;
        height: 4rem !important; /* Slightly smaller on mobile */
    }

    .ats-nav-container {
        padding: 0 1rem !important; /* 16px */
    }

    .ats-nav-flex {
        height: 4rem !important; /* Match navbar height */
    }

    .ats-nav-center {
        display: none !important; /* Hide company info on mobile */
    }

    .ats-nav-right .ats-nav-actions {
        display: none !important; /* Hide quick actions on mobile */
    }

    /* Material Design 3 Mobile Dropdown */
    .ats-nav-dropdown-menu {
        min-width: calc(100vw - 2rem) !important; /* Full width minus padding */
        right: 1rem !important;
        left: 1rem !important;
        top: calc(100% + 0.75rem) !important; /* Larger gap on mobile */
        transform-origin: top center !important; /* Center origin on mobile */
    }

    /* Override specific alignments on mobile */
    .ats-nav-dropdown:first-of-type .ats-nav-dropdown-menu,
    .ats-nav-dropdown:last-of-type .ats-nav-dropdown-menu {
        right: 1rem !important;
        left: 1rem !important;
    }
}

@media (max-width: 576px) {
    .ats-nav-container {
        padding: 0 1rem !important; /* Maintain 16px on small screens */
    }

    .ats-nav-brand-text {
        display: none !important; /* Hide brand text on very small screens */
    }

    .ats-nav-brand-icon {
        width: 2.25rem !important; /* 36px - slightly smaller */
        height: 2.25rem !important;
    }
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 100%;
    max-width: 100%;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile Menu Toggle - Hamburger Animation */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 4px;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Brand */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: white;
    transform: scale(1.02);
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.brand-text {
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Company Info */
.company-info {
    text-align: center;
    color: white;
}

.company-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.company-plan {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
}

/* Header Quick Actions (scoped to navbar) */
.quick-actions {
    display: flex;
    gap: 0.5rem;
}

.modern-navbar .quick-action-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.modern-navbar .quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

/* Navbar Items */
.navbar-item {
    position: relative;
}

/* Notification Button */
.notification-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #EA001E;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

/* User Menu Button */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 40px;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.user-chevron {
    font-size: 0.7rem;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.user-menu-btn[aria-expanded="true"] .user-chevron {
    transform: rotate(180deg);
}

/* Dropdown Styles */
.notification-dropdown,
.user-dropdown {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 0;
    margin-top: 8px;
/* Prevent header level widget overflow */
.navbar-center + .ms-3 .card {
  max-width: 260px;
  overflow: hidden;
}

/* Ensure header widget aligns and doesn't overflow at various widths */
@media (min-width: 768px) {
  .navbar-center + .ms-3 { display:flex; align-items:center; }
  .navbar-center + .ms-3 .card { max-width: 260px; overflow:hidden; }
}
@media (max-width: 991.98px) {
  .navbar-center + .ms-3 { display:none !important; }
}

/* Dashboard modernized landing styles */
.dashboard-hero {
  background: linear-gradient(135deg, rgba(1,118,211,.08), rgba(1,68,134,.05));
  border: 1px solid rgba(1,118,211,.15);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}
.dashboard-hero h1 { font-weight: 800; letter-spacing: -.3px; }
.dashboard-hero p { color: var(--text-muted); }

/* Navbar Current Level Widget alignment */
.modern-navbar .ms-3.d-none.d-md-flex.align-items-center {
  height: 100%;
}
.modern-navbar .ms-3.d-none.d-md-flex.align-items-center .card {
  height: 40px; /* match navbar inner height */
  display: flex;
  align-items: center;
}
.modern-navbar .ms-3.d-none.d-md-flex.align-items-center .card .card-body {
  padding-top: .25rem;
  padding-bottom: .25rem;
}
@media (max-width: 991.98px) {
  .modern-navbar .ms-3.d-none.d-md-flex.align-items-center { display:none !important; }
}


.dashboard-section-title {
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: .75rem;
}

.dashboard-card {
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  transition: all .25s ease;
}
.dashboard-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.dashboard-card .card-header { border: 0; background: transparent; }

/* Smooth hover effects */
.card:hover .btn:not(.btn-link) { filter: brightness(.98); }

/* Better mobile spacing */
@media (max-width: 576px) {
  /* .modern-navbar height controlled by Tailwind h-16 class */
  .dashboard-hero { padding: 1rem; }
}

    min-width: 320px;
    background: white;
    backdrop-filter: blur(10px);
}

.notification-dropdown {
    min-width: 380px;
}

.dropdown-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light-color);
    border-radius: 12px 12px 0 0;
}

.dropdown-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-dark);
}

.dropdown-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: var(--light-color);
    border-radius: 0 0 12px 12px;
}

/* Notification Items */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.notification-item:hover {
    background: var(--light-color);
    color: var(--text-color);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.notification-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* User Dropdown */
.user-info {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-color);
    border-radius: 12px 12px 0 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-full-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: capitalize;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--light-color);
    color: var(--text-color);
}

.dropdown-item.text-danger {
    color: var(--danger-color);
}

.dropdown-item.text-danger:hover {
    background: rgba(234, 0, 30, 0.1);
    color: var(--danger-color);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    opacity: 0.7;
}

.dropdown-divider {
    margin: 0;
    border-color: var(--border-color);
}

/* 4.3 Applications & Pipeline Components */
.filter-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.application-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
    height: auto !important; /* Override h-100 for better compactness */
    background: white;
    cursor: pointer;
    position: relative;
    
}

.application-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.application-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Trello-style subtle animation on card elements */
.application-card .candidate-avatar {
    transition: transform 0.3s ease;
}

.application-card:hover .candidate-avatar {
    transform: scale(1.05);
}

.application-card .badge {
    transition: all 0.3s ease;
}

.application-card:hover .badge {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.application-card .card-body {
    padding: 0.75rem;
}

.application-card .card-footer {
    padding: 0.5rem;
    border-top: 1px solid var(--border-color);
    background-color: #f8f9fa;
}

/* Compact text and spacing */
.application-card .card-title {
    font-size: 0.95rem;
    line-height: 1.2;
}

.application-card .small {
    font-size: 0.8rem;
}

.application-card .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

.candidate-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.application-meta {
    font-size: 0.875rem;
}

.stage-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

/* Mobile-specific improvements for applications */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0 !important;
        padding: 1rem;
    }
}

@media (max-width: 767.98px) {
    .filter-section {
        padding: 1rem;
    }

    .btn-group .btn {
        min-width: 44px;
        min-height: 44px;
    }

    .btn-group.w-100 {
        width: 100% !important;
    }

    .application-card .card-body {
        padding: 0.5rem;
    }

    .application-card .card-footer {
        padding: 0.4rem;
    }

    .stats-card .card-body {
        padding: 0.75rem;
    }

    .page-header-buttons {
        width: 100%;
    }

    .page-header-buttons .btn {
        flex: 1;
    }

    .application-card {
        margin-bottom: 0.5rem;
    }

    /* Stack cards in single column on mobile for better readability */
    .col-12.col-sm-6.col-lg-4.col-xl-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .col-md-6 {
        margin-bottom: 0.75rem;
    }
}

/* ========================================
   6. Utility Classes
   ======================================== */
/* Text truncation utility */
.min-width-0 {
    min-width: 0;
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px;
}

/* Enhanced responsive grid utilities */
@media (max-width: 991.98px) {
    .col-lg-4 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 575.98px) {
    .col-md-6 {
        margin-bottom: 0.75rem;
    }
}

/* ========================================
   7. Pipeline Styles
   ======================================== */
.pipeline-board {
    overflow-x: auto;
    padding-bottom: 20px;
    cursor: grab;
    user-select: none;
    scroll-behavior: smooth;
}

.pipeline-board:active {
    cursor: grabbing;
}

.pipeline-board.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.pipeline-container {
    display: flex;
    gap: 20px;
    min-width: max-content;
    padding: 10px 0;
}

.pipeline-column {
    min-width: 300px;
    max-width: 300px;
    background: var(--light-color);
    border-radius: 8px;
    overflow: visible;
}

.pipeline-stage-header {
    background: white;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px;
}

.pipeline-stage-content {
    padding: 15px;
    min-height: 400px;
    max-height: 70vh;
    overflow-y: visible;
}

.pipeline-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.pipeline-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: move;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pipeline-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.pipeline-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.candidate-info {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.candidate-details {
    flex: 1;
    min-width: 0;
}

.candidate-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.candidate-job,
.candidate-position,
.candidate-experience,
.candidate-location {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.application-meta {
    margin-bottom: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

/* Trello-style Pipeline Card Actions */
.pipeline-card-actions {
    margin-top: 12px;
    position: relative;
}

.primary-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.secondary-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    max-height: 0;

}

.pipeline-card:hover .secondary-actions {
    opacity: 1;
    transform: translateY(0);
    max-height: 50px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: var(--light-color);
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1;
}

/* Enhanced icon centering for action buttons */
.action-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
}

/* Ensure consistent icon sizing */
.action-btn .fas,
.action-btn .fab,
.action-btn .far,
.action-btn .fal {
    font-size: 14px;
    width: auto;
    height: auto;
    text-align: center;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.action-btn:hover i {
    transform: none;
}

/* Action Button Colors */
.action-btn-view {
    background: rgba(1, 118, 211, 0.1);
    color: var(--primary-color);
}

.action-btn-view:hover {
    background: var(--primary-color);
    color: white;
}

.action-btn-notes {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

.action-btn-notes:hover {
    background: var(--info-color);
    color: white;
}

.action-btn-email {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.action-btn-email:hover {
    background: var(--success-color);
    color: white;
}

.action-btn-rate {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.action-btn-rate:hover {
    background: var(--warning-color);
    color: white;
}

.action-btn-interview {
    background: rgba(108, 117, 125, 0.1);
    color: var(--secondary-color);
}

.action-btn-interview:hover {
    background: var(--secondary-color);
    color: white;
}

.action-btn-assign {
    background: rgba(102, 16, 242, 0.1);
    color: #6610f2;
}

.action-btn-assign:hover {
    background: #6610f2;
    color: white;
}

.action-btn-transfer {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.action-btn-transfer:hover {
    background: #ff9800;
    color: white;
}

.action-btn-edit {
    background: rgba(1, 118, 211, 0.1);
    color: var(--primary-color);
}

.action-btn-edit:hover {
    background: var(--primary-color);
    color: white;
}

.action-btn-delete {
    background: rgba(234, 0, 30, 0.1);
    color: var(--danger-color);
}

.action-btn-delete:hover {
    background: var(--danger-color);
    color: white;
}

.action-btn-success {
    background: rgba(15, 81, 50, 0.1);
    color: #0f5132;
}

.action-btn-success:hover {
    background: #0f5132;
    color: white;
}

.action-btn-secondary {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.action-btn-secondary:hover {
    background: #6c757d;
    color: white;
}

.action-btn-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.action-btn-warning:hover {
    background: #ffc107;
    color: white;
}

.action-btn-info {
    background: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.action-btn-info:hover {
    background: #0dcaf0;
    color: white;
}

.action-btn-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.action-btn-danger:hover {
    background: #dc3545;
    color: white;
}

.action-btn-phone {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.action-btn-phone:hover {
    background: #198754;
    color: white;
}

.action-btn-linkedin {
    background: rgba(0, 119, 181, 0.1);
    color: #0077b5;
}

.action-btn-linkedin:hover {
    background: #0077b5;
    color: white;
}

.action-btn-pipeline {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.action-btn-pipeline:hover {
    background: #6c757d;
    color: white;
}

/* Notes Badge */
.notes-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--info-color);
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Emails Badge */
.emails-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Tests Badge */
.tests-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--warning-color);
    color: white;
    font-size: 9px;
    font-weight: 600;
    min-width: 24px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
}

/* Tests Badge - All Completed */
.tests-badge-complete {
    background: var(--success-color);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
    animation: pulse-success 2s ease-in-out infinite;
}

@keyframes pulse-success {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.4);
    }
}

/* Interview Badge */
.interview-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #0176D3; /* Salesforce blue */
    color: white;
    font-size: 9px;
    font-weight: 600;
    min-width: 24px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
}

/* Interview Badge - Active/Scheduled */
.interview-badge-active {
    background: #0176D3;
    box-shadow: 0 0 0 2px rgba(1, 118, 211, 0.2);
    animation: pulse-interview 2s ease-in-out infinite;
}

@keyframes pulse-interview {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(1, 118, 211, 0.2);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(1, 118, 211, 0.4);
    }
}

/* Tests Checkbox List in Modal */
.tests-checkbox-list .form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.tests-checkbox-list .form-check-input {
    float: none;
    margin-left: 0;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.tests-checkbox-list .form-check-label {
    flex: 1;
    cursor: pointer;
}

/* Rating display in pipeline cards */
.rating {
    display: flex;
    flex-direction: row; /* Normal order (NOT row-reverse) */
    gap: 2px;
}

.rating .fa-star {
    font-size: 12px;
}

/* Lucide stars in rating - solid fill for active stars */
.rating [data-lucide="star"].text-warning {
    fill: #ffc107;
    stroke: #ffc107;
}

.rating [data-lucide="star"].text-muted {
    fill: none;
    stroke: #6c757d;
}

.stage-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

/* Drag and Drop Styles */
.pipeline-stage-content.drag-over {
    background-color: var(--primary-light);
    border: 2px dashed var(--primary-color);
}

.pipeline-card.drag-placeholder {
    border: 2px dashed var(--border-color);
    background: var(--light-color);
    height: 100px;
}

/* Pipeline Responsive */
@media (max-width: 768px) {
    .pipeline-container {
        gap: 15px;
    }

    .pipeline-column {
        min-width: 280px;
        max-width: 280px;
    }

    /* Mobile-friendly card actions */
    .secondary-actions {
        opacity: 1;
        transform: translateY(0);
        max-height: none;
        margin-top: 8px;
    }

    .action-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
        touch-action: manipulation;
    }

    .primary-actions {
        gap: 8px;
    }

    .secondary-actions {
        gap: 6px;
    }

    /* Larger touch targets for mobile */
    .action-btn:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

/* ========================================
   7.5 Advanced Filters Styles
   ======================================== */
.advanced-filters {
    background: var(--light-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.advanced-filters h6 {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.advanced-filters .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.advanced-filters .form-select,
.advanced-filters .form-control {
    font-size: 0.875rem;
    border-color: var(--border-color);
    transition: all 0.2s ease;
}

.advanced-filters .form-select:focus,
.advanced-filters .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(1, 118, 211, 0.15);
}

.advanced-filters .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.advanced-filters .form-check-label {
    font-size: 0.875rem;
    color: var(--text-color);
    cursor: pointer;
}

.advanced-filters .text-primary {
    color: var(--primary-color) !important;
}

/* Filter badge for active filters count */
.badge.bg-primary {
    background-color: var(--primary-color) !important;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

/* Responsive filters */
@media (max-width: 768px) {
    .advanced-filters {
        padding: 1rem;
    }

    .advanced-filters h6 {
        font-size: 0.95rem;
    }

    .advanced-filters .form-label {
        font-size: 0.8rem;
    }

    .advanced-filters .form-select,
    .advanced-filters .form-control {
        font-size: 0.8rem;
    }
}

/* ========================================
   8. SweetAlert2 Custom Styles
   ======================================== */
.swal-ats-popup {
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.swal-ats-title {
    color: var(--text-color) !important;
    font-weight: 600 !important;
    font-size: 1.5rem !important;
}

.swal-ats-content {
    color: var(--text-muted) !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

.swal-ats-confirm {
    background-color: var(--primary-color) !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 10px 24px !important;
    transition: all 0.2s ease !important;
}

.swal-ats-confirm:hover {
    background-color: var(--primary-dark) !important;
    transform: translateY(-1px) !important;
}

.swal-ats-cancel {
    background-color: var(--secondary-color) !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 10px 24px !important;
    transition: all 0.2s ease !important;
}

.swal-ats-cancel:hover {
    background-color: var(--dark-color) !important;
    transform: translateY(-1px) !important;
}

.swal-ats-deny {
    background-color: var(--danger-color) !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    padding: 10px 24px !important;
    transition: all 0.2s ease !important;
}

.swal-ats-deny:hover {
    background-color: #c82333 !important;
    transform: translateY(-1px) !important;
}

.swal-toast-ats {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* ========================================
   9. AI Generation UX Enhancements
   ======================================== */
.ai-generate-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-generate-btn.ready {
    animation: pulse-glow 2s infinite;
    box-shadow: 0 0 20px rgba(1, 118, 211, 0.3);
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 20px rgba(1, 118, 211, 0.3); }
    50% { box-shadow: 0 0 30px rgba(1, 118, 211, 0.6); }
    100% { box-shadow: 0 0 20px rgba(1, 118, 211, 0.3); }
}

.ai-progress-container {
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-progress-container.show {
    opacity: 1;
}

.ai-progress-bar {
    height: 4px;
    background: linear-gradient(90deg, #0176d3, #00d4ff);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.ai-progress-text {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

.field-completion-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 5px;
    background-color: #dc3545;
    transition: background-color 0.3s ease;
}

.field-completion-indicator.complete {
    background-color: #28a745;
}

/* Work Schedule Shortcuts */
.work-schedule-shortcuts {
    margin-bottom: 15px;
}

.schedule-shortcut-btn {
    margin: 2px;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 15px;
    transition: all 0.2s ease;
}

.schedule-shortcut-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Salary AI Insights */
.salary-ai-section {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s ease;
}

.salary-ai-section:hover {
    border-color: #0176d3;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.salary-ai-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    font-size: 0.85rem;
}

/* ========================================
   10. Print Styles
   ======================================== */
@media print {
    .sidebar,
    .btn,
    .pagination {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .schedule-shortcut-btn {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

/* ========================================
   AI-Powered Candidate Registration Styles
   ======================================== */

/* AI Mode Toggle */
.form-check-label {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.form-check-label:hover {
    background-color: var(--light-color);
}

.form-check-input:checked + .form-check-label {
    background-color: var(--primary-light);
    border: 1px solid var(--primary-color);
}

/* AI Processing Section */
#ai-processing-section {
    border-left: 4px solid var(--primary-color);
}

#ai-processing-section .card-header {
    background: linear-gradient(135deg, var(--primary-light) 0%, #f8f9fa 100%);
    border-bottom: 1px solid var(--primary-color);
}

/* AI Populated Fields */
.ai-populated {
    background-color: #e8f5e8 !important;
    border-color: var(--success-color) !important;
    position: relative;
}

.ai-populated::after {
    content: "🤖";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Processing Status */
#ai-processing-status {
    border-left: 4px solid var(--info-color);
}

#ai-processing-status .spinner-border {
    color: var(--primary-color);
}

/* AI Results */
#ai-results {
    border-left: 4px solid var(--success-color);
}

/* File Upload Styling */
#resume_upload {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

#resume_upload:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

#resume_upload:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(1, 118, 211, 0.25);
}

/* Global Textarea Styling */
textarea.form-control {
    min-height: 160px !important;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
}

textarea.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(1, 118, 211, 0.25);
}

/* Specific WhatsApp Message Textarea */
#whatsapp-message-text {
    min-height: 160px !important;
    font-family: inherit;
}

/* Email Template Textareas */
#create_body,
#edit_body {
    min-height: 160px !important;
}

/* Bulk Action Textareas */
#bulk_email_message,
#bulk_whatsapp_message {
    min-height: 160px !important;
}

/* Resume Text Area (Special Styling) */
#resume_text {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    min-height: 160px !important;
}

#resume_text:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(1, 118, 211, 0.25);
}

/* Mobile Responsive Textarea Adjustments */
@media (max-width: 768px) {
    textarea.form-control {
        min-height: 140px !important;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 320px) {
    textarea.form-control {
        min-height: 120px !important;
    }
}

/* AI Action Buttons */
#extract-data-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

#extract-data-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

#extract-data-btn:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

#clear-ai-data-btn {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

#clear-ai-data-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* Registration Mode Cards */
.registration-mode-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.registration-mode-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.registration-mode-card.active {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

/* AI Extraction Info */
.ai-extraction-info {
    background: linear-gradient(135deg, #f8f9fa 0%, var(--primary-light) 100%);
    border: 1px solid var(--primary-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.ai-extraction-info .badge {
    background-color: var(--primary-color);
}

/* Responsive AI Features */
@media (max-width: 768px) {
    #ai-processing-section .row {
        flex-direction: column;
    }

    #ai-processing-section .col-md-6 {
        margin-bottom: 1rem;
    }

    .ai-populated::after {
        display: none;
    }

    #extract-data-btn,
    #clear-ai-data-btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ========================================
   AI Analysis Message Styling
   ======================================== */
.ai-analysis-message {
    background: linear-gradient(135deg, #E3F3FF 0%, #F0F8FF 100%) !important;
    border: 1px solid #0176D3 !important;
    border-left: 4px solid #0176D3 !important;
    position: relative;
    overflow: hidden;
}

.ai-analysis-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #0176D3, #00D4FF, #0176D3);
    background-size: 200% 100%;
    animation: ai-pulse 2s ease-in-out infinite;
}

.ai-analysis-message .fas.fa-robot {
    color: #0176D3;
    animation: ai-glow 2s ease-in-out infinite alternate;
}

@keyframes ai-pulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes ai-glow {
    0% {
        color: #0176D3;
        text-shadow: 0 0 5px rgba(1, 118, 211, 0.3);
    }
    100% {
        color: #00D4FF;
        text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    }
}

/* ============================================
   Stage Selection Grid (Visual Card Selection)
   ============================================ */

/* Stage Selection Grid */
.stage-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

/* Stage Card */
.stage-card {
    position: relative;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.stage-card:hover {
    border-color: var(--stage-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stage-card.selected {
    border-color: var(--stage-color);
    border-width: 3px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, white 100%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.stage-card.current-stage {
    background: #f8f9fa;
    border-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}

.stage-card.current-stage::after {
    content: 'Etapa Atual';
    position: absolute;
    top: 5px;
    right: 5px;
    background: #6c757d;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

/* Stage Card Header */
.stage-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.stage-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--stage-color);
    flex-shrink: 0;
}

.stage-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.stage-card-description {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    min-height: 32px;
}

/* Stage Card Overlay (Check Icon) */
.stage-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--stage-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.stage-card.selected .stage-card-overlay {
    opacity: 0.9;
}

.stage-card-overlay i {
    font-size: 48px;
    color: white;
}

/* Confirmation Message Animation */
#confirmation-message {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.stage-card.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.stage-card.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--stage-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stage-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .stage-card {
        padding: 12px;
    }

    .stage-card-title {
        font-size: 13px;
    }

    .stage-card-description {
        font-size: 11px;
        min-height: 28px;
    }
}

/* ========================================
   SweetAlert2 Customizations
   ======================================== */
/* Enable text selection in SweetAlert2 modals */
.swal-text-selectable .swal2-html-container,
.swal-text-selectable .swal2-html-container * {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* Enhanced SweetAlert2 modal styling */
.swal-wide {
    max-width: 90% !important;
}

/* ========================================
   MERGED FROM APP-REDESIGN.CSS
   Modern Design System Integration
   ======================================== */

/**
 * App Redesign Stylesheet - MERGED CONTENT
 * Sistema de Design para ATS Platform
 * Versão: 9.0 - Primitive Elements Update
 * Data: 16/10/2025
 *
 * Dependências:
 * - tokens.css (deve ser carregado antes)
 * - Bootstrap 5.3.0
 */

/* ========================================
   TIPOGRAFIA GLOBAL
   ======================================== */

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background-color: var(--app-bg);
  line-height: var(--leading-normal);
}

/* Hierarquia Tipográfica */
.title-page {
  font-size: var(--text-4xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.subtitle-page {
  font-size: var(--text-md);
  font-weight: var(--font-normal);
  color: var(--text-secondary);
}

.title-widget {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.title-section {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.header-table {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.body-text {
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  color: var(--text-primary);
}

.body-secondary {
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  color: var(--text-secondary);
}

.label-text {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-label);
}

.help-text {
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  color: var(--text-tertiary);
}

.link-text {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--hover);
}

.link-text:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

/* Ajuste do Grid Principal */
body.app-layout {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar main";
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  transition: grid-template-columns var(--medium);
}

/* Grid com Sidebar Expandido */
body.app-layout.sidebar-expanded {
  grid-template-columns: var(--sidebar-width-mobile) 1fr;
}

/* Área Principal */
.app-main {
  grid-area: main;
  background: var(--app-bg);
  padding: var(--space-2xl);
  padding-left: var(--space-3xl); /* 48px de espaçamento à esquerda */
  overflow-y: auto;
  transition: all var(--medium);
}
/**
 * App Redesign Stylesheet
 * Sistema de Design para ATS Platform
 * Versão: 9.0 - Primitive Elements Update
 * Data: 16/10/2025
 *
 * Dependências:
 * - tokens.css (deve ser carregado antes)
 * - Bootstrap 5.3.0
 */

/* ========================================
   TIPOGRAFIA GLOBAL
   ======================================== */

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background-color: var(--app-bg);
  line-height: var(--leading-normal);
}

/* Hierarquia Tipográfica */
.title-page {
  font-size: var(--text-4xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.subtitle-page {
  font-size: var(--text-md);
  font-weight: var(--font-normal);
  color: var(--text-secondary);
}

.title-widget {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.title-section {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.header-table {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.body-text {
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  color: var(--text-primary);
}

.body-secondary {
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  color: var(--text-secondary);
}

.label-text {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-label);
}

.help-text {
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  color: var(--text-tertiary);
}

.link-text {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--hover);
}

.link-text:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

/* Ajuste do Grid Principal */
body.app-layout {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar main";
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  transition: grid-template-columns var(--medium);
}

/* ========================================
   BULK ACTIONS FIXED BOTTOM TOOLBAR
   ======================================== */

/* Fixed Bottom Toolbar for Bulk Actions */
.bulk-actions-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #0176D3 0%, #1a365d 100%);
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1030;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bulk-actions-toolbar.show {
  transform: translateY(0);
}

.bulk-actions-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1rem;
}

.bulk-actions-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bulk-actions-count {
  font-weight: 600;
  font-size: 1rem;
}

.bulk-actions-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bulk-actions-toolbar .btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.bulk-actions-toolbar .btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bulk-actions-toolbar .btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: #0176D3;
  border-color: rgba(255, 255, 255, 0.9);
}

.bulk-actions-toolbar .btn-primary:hover {
  background: white;
  color: #0176D3;
  border-color: white;
}

.bulk-actions-toolbar .btn-danger {
  background: rgba(220, 53, 69, 0.8);
  border-color: rgba(220, 53, 69, 0.8);
}

.bulk-actions-toolbar .btn-danger:hover {
  background: #dc3545;
  border-color: #dc3545;
}

/* Add bottom padding to main content when toolbar is visible */
.main-content.with-bulk-toolbar {
  padding-bottom: 100px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .bulk-actions-toolbar {
    padding: 0.75rem 1rem;
  }

  .bulk-actions-content {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .bulk-actions-info {
    justify-content: center;
    text-align: center;
  }

  .bulk-actions-buttons {
    justify-content: center;
    gap: 0.5rem;
  }

  .bulk-actions-toolbar .btn {
    min-height: 44px; /* Touch-friendly size */
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
  }

  .main-content.with-bulk-toolbar {
    padding-bottom: 140px; /* More space on mobile */
  }
}

@media (max-width: 480px) {
  .bulk-actions-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .bulk-actions-toolbar .btn {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
  }
}

/* Grid com Sidebar Expandido */
body.app-layout.sidebar-expanded {
  grid-template-columns: var(--sidebar-width-mobile) 1fr;
}

/* Área Principal */
.app-main {
  grid-area: main;
  background: var(--app-bg);
  padding: var(--space-2xl);
  padding-left: var(--space-3xl); /* 48px de espaçamento à esquerda */
  overflow-y: auto;
  transition: all var(--medium);
}

/* ========================================
   TOPBAR SUGARCRM
   ======================================== */

.app-topbar {
  grid-area: header;
  height: var(--topbar-height);
  background: linear-gradient(90deg, var(--topbar-gradient-start) 0%, var(--topbar-gradient-end) 100%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--space-2xl);
  gap: var(--space-lg);
  z-index: var(--z-fixed);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========================================
   TOPBAR BRAND (LEFT SECTION)
   ======================================== */

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  justify-self: start;
}

.topbar-mobile-toggle {
  display: none;
  width: var(--target-xl);
  height: var(--target-xl);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--hover);
  margin-right: var(--space-md);
}

.topbar-mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.topbar-mobile-toggle i {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.topbar-brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: white;
  text-decoration: none;
  transition: opacity var(--hover);
}

.topbar-brand-link:hover {
  opacity: 0.9;
  color: white;
}

.topbar-logo {
  width: var(--target-2xl);
  height: var(--target-2xl);
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--hover);
}

.topbar-logo:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.topbar-logo i {
  width: var(--icon-md);
  height: var(--icon-md);
  color: white;
}

.topbar-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: white;
}

/* ========================================
   TOPBAR SEARCH (CENTER SECTION)
   ======================================== */

.topbar-search {
  position: relative;
  width: 100%;
  max-width: 720px;
  min-width: 640px;
  justify-self: center;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
  padding: 0 56px 0 var(--space-lg);
  color: white;
  font-size: var(--text-base);
  transition: all var(--medium);
  outline: none;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-input:hover {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 2px #2B74FF, inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.search-button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all var(--hover);
}

.search-button:hover {
  background: rgba(0, 0, 0, 0.25);
  transform: translateY(-50%) scale(1.05);
}

.search-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px white;
}

.search-button:active {
  transform: translateY(-50%) scale(0.95);
  transition: transform var(--fast);
}

.search-button i {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

/* ========================================
   TOPBAR ACTIONS (RIGHT SECTION)
   ======================================== */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  justify-self: end;
}

/* Quick Actions */
.topbar-quick-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.quick-action-btn {
  width: var(--target-lg);
  height: var(--target-lg);
  border: none;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--hover);
  position: relative;
}

.quick-action-btn i,
.quick-action-btn svg {
  width: var(--icon-sm) !important;
  height: var(--icon-sm) !important;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.quick-action-primary {
  background: rgba(43, 116, 255, 0.2);
  color: white;
}

.quick-action-primary:hover {
  background: rgba(43, 116, 255, 0.3);
  transform: translateY(-1px);
}

.quick-action-success {
  background: rgba(76, 175, 80, 0.2);
  color: white;
}

.quick-action-success:hover {
  background: rgba(76, 175, 80, 0.3);
  transform: translateY(-1px);
}

/* Notifications */
.topbar-notifications {
  position: relative;
}

.notification-btn {
  width: var(--target-lg);
  height: var(--target-lg);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  position: relative;
  transition: all var(--hover);
}

.notification-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.topbar-action-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px white;
}

.topbar-action-button:active {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.96);
  transition: transform var(--fast);
}

.topbar-action-button i {
  font-size: var(--icon-md);
}

/* Badge de Notificação */
.topbar-notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  background: #E63946;
  color: white;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--font-semibold);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--topbar-gradient-end);
}

/* Notifications Dropdown */
.notifications-dropdown {
  position: absolute;
  top: calc(100% + var(--space-sm));
  right: 0;
  width: 320px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--medium);
}

.notifications-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notifications-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notifications-header h6 {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
}

.mark-all-read {
  background: none;
  border: none;
  color: var(--primary);
  font-size: var(--text-xs);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color var(--hover);
}

.mark-all-read:hover {
  color: var(--primary-hover);
}

.notifications-list {
  max-height: 300px;
  overflow-y: auto;
}

.notifications-empty {
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-tertiary);
}

.notifications-empty i {
  width: var(--icon-lg);
  height: var(--icon-lg);
  margin-bottom: var(--space-sm);
  color: var(--text-placeholder);
}

.notifications-empty p {
  margin: 0;
  font-size: var(--text-sm);
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--hover);
  position: relative;
}

.notification-item:hover {
  background: var(--surface-hover);
}

.notification-item.unread {
  background: var(--primary-lightest);
}

.notification-icon {
  width: var(--icon-md);
  height: var(--icon-md);
  background: var(--surface-secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.notification-icon i {
  width: var(--icon-sm);
  height: var(--icon-sm);
  color: var(--text-tertiary);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.4;
}

.notification-message {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.notification-time {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.notification-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: var(--radius-full);
  position: absolute;
  top: var(--space-md);
  right: var(--space-lg);
}

.notifications-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.notifications-footer a {
  color: var(--primary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: color var(--hover);
}

.notifications-footer a:hover {
  color: var(--primary-hover);
}

/* User Menu */
.topbar-user {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-sm);
  color: white;
  cursor: pointer;
  transition: all var(--hover);
}

.user-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.user-chevron {
  width: var(--icon-xs);
  height: var(--icon-xs);
  transition: transform var(--hover);
}

.user-btn:hover .user-chevron {
  transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + var(--space-sm));
  right: 0;
  width: 280px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--medium);
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.user-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-light);
}

.user-dropdown-info {
  flex: 1;
}

.user-dropdown-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.user-dropdown-role {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-dropdown-menu {
  padding: var(--space-sm) 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: all var(--hover);
}

.user-dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.user-dropdown-item i {
  width: var(--icon-sm);
  height: var(--icon-sm);
  color: var(--text-tertiary);
}

.user-dropdown-item:hover i {
  color: var(--text-secondary);
}

.user-dropdown-logout {
  color: var(--red-primary);
}

.user-dropdown-logout:hover {
  background: var(--red-light);
  color: var(--red-primary);
}

.user-dropdown-logout i {
  color: var(--red-primary);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-sm) 0;
}

/* ========================================
   GLOBAL SEARCH DROPDOWN
   ======================================== */

.global-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: var(--z-dropdown);
  max-height: 400px;
  overflow-y: auto;
  margin-top: var(--space-xs);
}

.search-loading,
.search-no-results,
.search-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.search-loading-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.search-no-results {
  color: var(--text-tertiary);
}

.search-error {
  color: var(--danger);
}

.search-results {
  padding: var(--space-sm) 0;
}

.search-section {
  margin-bottom: var(--space-sm);
}

.search-section:last-child {
  margin-bottom: 0;
}

.search-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-lighter);
  margin-bottom: var(--space-xs);
}

.search-section-title i {
  width: 14px;
  height: 14px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: background-color var(--hover);
  border-radius: 0;
}

.search-result-item:hover {
  background-color: var(--surface-hover);
}

.search-result-item:active {
  background-color: var(--surface-pressed);
}

.search-result-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.candidate-initials {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.job-icon {
  width: 40px;
  height: 40px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-icon i {
  width: 20px;
  height: 20px;
}

.search-result-content {
  flex-grow: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: var(--font-medium);
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: 1.4;
  margin-bottom: 2px;
}

.search-result-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.3;
  margin-bottom: 2px;
}

.search-result-meta {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  line-height: 1.3;
}

.search-result-icon {
  flex-shrink: 0;
  color: var(--text-tertiary);
  opacity: 0.6;
  transition: opacity var(--hover);
}

.search-result-item:hover .search-result-icon {
  opacity: 1;
}

.search-result-icon i {
  width: 16px;
  height: 16px;
}

/* Status badges in search results */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-success {
  background: var(--success-light);
  color: var(--success);
}

.status-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.status-secondary {
  background: var(--surface-secondary);
  color: var(--text-secondary);
}

.status-info {
  background: var(--blue-light);
  color: var(--blue);
}

/* ========================================
   RESPONSIVIDADE TOPBAR
   ======================================== */

@media (max-width: 1279px) {
  .topbar-search {
    min-width: 480px;
    max-width: 560px;
  }
}

@media (max-width: 991px) {
  .topbar-search {
    min-width: 320px;
    max-width: 400px;
  }

  .topbar-title {
    display: none;
  }

  .user-name {
    display: none;
  }

  .user-chevron {
    display: none;
  }
}

@media (max-width: 767px) {
  body.app-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  .app-topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 var(--space-lg);
  }

  .topbar-mobile-toggle {
    display: flex;
  }

  .topbar-search {
    display: none;
  }

  /* Hide global search dropdown on mobile since search is hidden */
  .global-search-dropdown {
    display: none !important;
  }

  .topbar-quick-actions {
    display: none;
  }

  .topbar-logo {
    width: var(--target-lg);
    height: var(--target-lg);
  }

  .topbar-title {
    display: none;
  }

  .topbar-actions {
    gap: var(--space-sm);
  }

  .user-btn {
    padding: var(--space-xs);
  }

  .notifications-dropdown,
  .user-dropdown {
    width: 280px;
    right: 0;
  }
}

/* ========================================
   SIDEBAR SUGARCRM
   ======================================== */

.app-sidebar {
  grid-area: sidebar;
  width: var(--sidebar-width);
  background: var(--card-bg);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  padding: var(--space-lg) var(--space-sm);
  gap: var(--space-sm);
  overflow-y: visible;
  z-index: var(--z-sticky);
  transition: width var(--medium);
}

/* Sidebar Expandido */
.app-sidebar.sidebar-expanded {
  width: var(--sidebar-width-mobile);
}

/* Toggle Button Container */
.sidebar-toggle-container {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-lg);
  padding: 0 var(--space-sm);
}

.sidebar-toggle-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--target-3xl);
  height: var(--target-3xl);
  border: none;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--icon-default);
  cursor: pointer;
  transition: all var(--hover);
}

.sidebar-toggle-btn:hover {
  background: var(--purple-hover);
  color: white;
  box-shadow: var(--shadow-pill);
  transform: translateY(-1px);
}

.sidebar-toggle-btn .toggle-icon {
  transition: transform var(--medium);
}

.sidebar-expanded .sidebar-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

/* Seções do Sidebar */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar-section:not(:last-child) {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--divider);
}

/* Cabeçalho de Seção */
.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-sm);
  margin-bottom: var(--space-xs);
}

.sidebar-section-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity var(--medium);
}

/* Botão de Três Pontos */
.sidebar-more-button {
  width: var(--target-xl);
  height: var(--target-xl);
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-default);
  cursor: pointer;
  position: relative;
  transition: all var(--hover);
  opacity: 0;
}

.sidebar-more-button:hover {
  background: var(--purple-hover);
  color: white;
  box-shadow: var(--shadow-pill);
  transform: translateY(-1px);
}

.sidebar-more-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--blue-primary);
}

.sidebar-more-button:active {
  transform: scale(0.98);
  transition: transform var(--fast);
}

.sidebar-more-button i {
  font-size: var(--icon-sm);
}

/* Items do Sidebar */
.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--target-3xl);
  height: var(--target-3xl);
  border-radius: var(--radius-lg);
  color: var(--icon-default);
  text-decoration: none;
  transition: all var(--hover);
  cursor: pointer;
}

/* Labels do Sidebar (ocultos por padrão) */
.sidebar-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: currentColor;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
  margin-left: 0;
  transition: all var(--medium);
}

/* Labels visíveis no modo expandido */
.sidebar-expanded .sidebar-label {
  opacity: 1;
  visibility: visible;
  width: auto;
  margin-left: var(--space-sm);
}

/* ===== SIDEBAR RETRAÍDO (PADRÃO) ===== */

/* Garantir que seções estão ocultas no modo retraído */
.sidebar-section-title {
  opacity: 0;
  visibility: hidden;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition: all var(--medium);
}

/* Hide "More" buttons when sidebar is collapsed (desktop) */
.sidebar-more-button {
  opacity: 0;
  visibility: hidden;
  height: 0;
  width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition: all var(--medium);
}

/* ===== SIDEBAR RETRAÍDO (PADRÃO) ===== */

/* Items do Sidebar - Modo Retraído (72px) */
.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 56px;
  border-radius: var(--radius-lg);
  color: var(--icon-default);
  text-decoration: none;
  transition: all var(--medium);
  margin: 0 auto;
  overflow: hidden;
  z-index: 1;
}

/* Ícones centralizados perfeitamente */
.sidebar-item i,
.sidebar-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  font-size: var(--icon-md);
  transition: color var(--hover);
}

/* Expansão Hover no Modo Retraído (APENAS DESKTOP) */
@media (min-width: 992px) {
  .sidebar-item:hover:not(.sidebar-expanded .sidebar-item) {
    width: 240px;
    justify-content: flex-start;
    padding: 0 var(--space-lg);
    background: var(--purple-hover);
    color: white;
    box-shadow: var(--shadow-pill);
    z-index: 100;
    position: relative;
  }

  .sidebar-item:hover:not(.sidebar-expanded .sidebar-item) .sidebar-label {
    opacity: 1;
    visibility: visible;
    width: auto;
    margin-left: var(--space-sm);
  }

  .sidebar-item:hover:not(.sidebar-expanded .sidebar-item) i,
  .sidebar-item:hover:not(.sidebar-expanded .sidebar-item) svg {
    color: white;
  }
}

/* ===== SIDEBAR EXPANDIDO ===== */

/* Sidebar Expandido - Mostrar labels e ajustar layout */
.sidebar-expanded .sidebar-item {
  width: 100%;
  justify-content: flex-start;
  padding: 0 var(--space-lg);
  margin: 0;
}

.sidebar-expanded .sidebar-label {
  opacity: 1;
  visibility: visible;
}

/* Ocultar tooltips quando expandido */
.sidebar-expanded .sidebar-tooltip {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Mostrar títulos das seções quando expandido */
.sidebar-expanded .sidebar-section-title {
  opacity: 1;
  visibility: visible;
  height: auto;
  margin: var(--space-lg) 0 var(--space-sm) 0;
  padding: 0 var(--space-lg);
}

.sidebar-expanded .sidebar-more-button {
  opacity: 1;
  visibility: visible;
  height: auto;
  width: auto;
  margin: 0;
  padding: var(--space-xs);
}

/* Estado Hover Padrão (Modo Expandido) */
.sidebar-expanded .sidebar-item:hover {
  background: var(--purple-hover);
  color: white;
  box-shadow: var(--shadow-pill);
  transform: translateY(-1px);
}

.sidebar-expanded .sidebar-item:hover i,
.sidebar-expanded .sidebar-item:hover svg {
  color: white;
}

/* Estado Ativo */
.sidebar-item.active {
  background: var(--purple-light);
  color: var(--purple-primary);
}

.sidebar-item.active i {
  background: var(--purple-primary);
  color: white;
  width: var(--target-lg);
  height: var(--target-lg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-item.active:hover {
  box-shadow: var(--shadow-pill-active);
  transform: translateY(-2px);
}

/* Estado Focus */
.sidebar-item:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--blue-primary);
  border-radius: calc(var(--radius-lg) + 2px);
}

/* Estado Active/Pressed */
.sidebar-item:active {
  transform: scale(0.98);
  transition: transform var(--fast);
}

/* Badge de Notificação no Sidebar */
.sidebar-item-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: #E63946;
  color: white;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--font-semibold);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--card-bg);
}

/* ========================================
   TOOLTIPS SIDEBAR
   ======================================== */

.sidebar-tooltip {
  position: absolute;
  left: calc(100% + var(--space-sm));
  top: 50%;
  transform: translateY(-50%);
  background: #2D333B;
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--slow);
  z-index: var(--z-tooltip);
  pointer-events: none;
}

.sidebar-tooltip::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 6px 6px 0;
  border-color: transparent #2D333B transparent transparent;
}

.sidebar-item:hover .sidebar-tooltip,
.sidebar-item:focus .sidebar-tooltip {
  opacity: 1;
  visibility: visible;
  transition-delay: 200ms;
}

/* ========================================
   SUBMENU DROPDOWN & INLINE EXPANSION
   ======================================== */

/* Base styles for submenu - inline mode */
.sidebar-submenu {
  display: block;
  overflow: hidden;
  transition: height var(--medium);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  opacity: 1;
  visibility: visible;
  transform: none;
  position: static;
  width: auto;
  z-index: auto;
}

/* Inline submenu - collapsed state */
.sidebar-section.is-collapsed .sidebar-submenu {
  height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Inline submenu - expanded state */
.sidebar-section.is-expanded .sidebar-submenu {
  height: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Popover submenu styles */
.sidebar-submenu.show {
  position: fixed;
  top: auto;
  left: var(--sidebar-width);
  width: 280px;
  height: auto;
  max-height: 80vh;
  background: white;
  border: 1px solid var(--purple-primary);
  border-radius: var(--radius-lg);
  z-index: var(--z-popover);
  overflow-y: auto;
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Cabeçalho do Submenu */
.submenu-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--divider-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.submenu-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.submenu-close {
  width: var(--target-md);
  height: var(--target-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-default);
  cursor: pointer;
  transition: all var(--base);
}

.submenu-close:hover {
  background: var(--blue-wash);
  color: var(--icon-hover);
}

.submenu-close:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--blue-primary);
}

.submenu-close i {
  font-size: var(--icon-md);
}

/* Items do Submenu */
.submenu-content {
  padding: var(--space-sm) 0;
  max-height: 400px;
  overflow-y: auto;
}

.submenu-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--base);
  border-radius: 0;
}

.submenu-item:hover {
  background: var(--blue-wash);
  color: var(--text-primary);
}

.submenu-item:hover i {
  color: var(--blue-primary);
}

.submenu-item:active {
  background: var(--blue-lighter);
  transform: scale(0.995);
  transition: transform var(--fast);
}

.submenu-item:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--blue-primary);
  border-radius: var(--radius-md);
  margin: 0 var(--space-sm);
}

.submenu-item i {
  font-size: var(--icon-md);
  color: var(--icon-default);
  transition: color var(--base);
}

.submenu-item-label {
  font-size: var(--text-md);
  font-weight: var(--font-medium);
}

/* ========================================
   PRIMITIVE ELEMENTS - CARDS
   ======================================== */

/* Bootstrap Card Overrides */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--medium);
}

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

.card-body {
  padding: var(--space-2xl);
}

.card-header {
  padding: var(--space-lg) var(--space-2xl);
  border-bottom: 1px solid var(--card-border);
  background: var(--surface-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

/* App-specific card styles */
.app-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg) var(--space-2xl);
  transition: all var(--medium);
}

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

/* Header do Card */
.card-header-sugarcrm {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--divider);
}

.card-icon {
  width: var(--target-lg);
  height: var(--target-lg);
  background: var(--purple-lighter);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon i {
  font-size: var(--icon-md);
  color: var(--purple-primary);
}

.card-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
  flex-grow: 1;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-action-button {
  width: var(--target-md);
  height: var(--target-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-default);
  cursor: pointer;
  transition: all var(--base);
}

.card-action-button:hover {
  background: var(--blue-wash);
  color: var(--icon-hover);
}

.card-action-button i {
  font-size: var(--icon-sm);
}

/* ========================================
   PRIMITIVE ELEMENTS - BUTTONS
   ======================================== */

/* Bootstrap Button Overrides */
.btn {
  border-radius: var(--radius-md);
  font-weight: var(--font-medium);
  font-family: var(--font-family);
  transition: all var(--fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  height: 40px;
  padding: 0 var(--space-lg);
}

.btn-primary {
  background: var(--blue-primary) !important;
  border-color: var(--blue-primary) !important;
  color: white !important;
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  background: var(--blue-hover) !important;
  border-color: var(--blue-hover) !important;
  color: white !important;
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
}

.btn-primary:focus {
  background: var(--blue-hover) !important;
  border-color: var(--blue-hover) !important;
  color: white !important;
  box-shadow: 0 0 0 2px var(--blue-primary);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-outline-primary {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
}

.btn-outline-primary:hover {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
  color: white;
}

/* App-specific button styles */
.btn-app-primary {
  background: var(--blue-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px var(--space-xl);
  font-size: var(--text-md);
  font-weight: var(--font-medium);
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--hover);
  box-shadow: var(--shadow-button);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.btn-app-primary:hover {
  background: var(--blue-hover);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
  color: white;
}

.btn-app-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-xl);
  font-size: var(--text-md);
  font-weight: var(--font-medium);
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--hover);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.btn-app-secondary:hover {
  background: var(--blue-wash);
  border-color: var(--card-border-hover);
  color: var(--text-primary);
}

.btn-app-icon {
  width: var(--target-lg);
  height: var(--target-lg);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-default);
  cursor: pointer;
  transition: all var(--base);
}

.btn-app-icon:hover {
  background: var(--blue-wash);
  color: var(--icon-hover);
}

.btn-app-icon i {
  font-size: var(--icon-md);
}

/* ========================================
   INPUTS SUGARCRM
   ======================================== */

.input-sugarcrm {
  width: 100%;
  height: 44px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-lg);
  font-size: var(--text-md);
  font-family: var(--font-family);
  color: var(--text-primary);
  transition: all var(--hover);
}

.input-sugarcrm::placeholder {
  color: var(--text-placeholder);
}

.input-sugarcrm:hover {
  border-color: var(--card-border-hover);
}

.input-sugarcrm:focus {
  outline: none;
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 2px var(--blue-primary);
  background: #FAFBFD;
}

.input-sugarcrm:disabled {
  background: var(--app-bg);
  border-color: var(--divider-strong);
  color: var(--text-placeholder);
  cursor: not-allowed;
}

/* Input com Erro */
.input-sugarcrm.error {
  border-color: var(--error);
  box-shadow: 0 0 0 2px var(--error);
}

.input-error-message {
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-xs);
}

/* Select */
.select-sugarcrm {
  position: relative;
}

.select-sugarcrm select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

/* ========================================
   CHIPS SUGARCRM
   ======================================== */

.chip-sugarcrm {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--base);
  text-decoration: none;
}

.chip-sugarcrm:hover {
  background: var(--blue-wash);
  border-color: var(--card-border-hover);
  color: var(--text-primary);
}

.chip-sugarcrm.selected {
  background: var(--blue-light);
  border-color: var(--blue-primary);
  color: var(--blue-primary);
  font-weight: var(--font-semibold);
  box-shadow: 0 2px 6px rgba(43, 116, 255, 0.15);
}

.chip-sugarcrm:active {
  transform: scale(0.97);
  transition: transform var(--fast);
}

.chip-sugarcrm:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--blue-primary);
}

/* ========================================
   PRIMITIVE ELEMENTS - FORM OVERRIDES
   ======================================== */

/* Bootstrap Form Overrides */
.form-control {
  height: 44px;
  padding: var(--space-md) var(--space-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-family);
  color: var(--text-primary);
  transition: all var(--fast);
}

.form-control::placeholder {
  color: var(--text-placeholder);
  font-weight: var(--font-normal);
}

.form-control:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 2px rgba(43, 116, 255, 0.2);
  background: #FAFBFD;
}

.form-select {
  height: 44px;
  padding: var(--space-md) var(--space-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-family);
  color: var(--text-primary);
  transition: all var(--fast);
}

.form-select:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 2px rgba(43, 116, 255, 0.2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.chip-sugarcrm i {
  font-size: var(--icon-xs);
  color: var(--icon-default);
}

.chip-sugarcrm:hover i,
.chip-sugarcrm.selected i {
  color: currentColor;
}

/* ========================================
   PRIMITIVE ELEMENTS - TABLES
   ======================================== */

/* Bootstrap Table Overrides */
.table {
  --bs-table-bg: var(--card-bg);
  --bs-table-hover-bg: var(--surface-hover);
  --bs-table-border-color: var(--border-light);
  margin-bottom: 0;
}

.table thead th {
  height: 48px;
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color var(--fast);
}

.table tbody tr:hover {
  background-color: var(--surface-hover) !important;
}

.table tbody td {
  height: 48px;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-primary);
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
}

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

/* Links na Tabela */
.table a {
  color: var(--blue-primary);
  text-decoration: none;
  font-weight: var(--font-medium);
  transition: all var(--fast);
}

.table a:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

/* App-specific table styles */
.table-sugarcrm {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table-sugarcrm thead th {
  height: 48px;
  padding: var(--space-md) var(--space-lg);
  background: var(--blue-wash);
  border-bottom: 1px solid var(--divider-strong);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-label);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.table-sugarcrm tbody tr {
  transition: background var(--base);
  border-bottom: 1px solid var(--divider);
}

.table-sugarcrm tbody tr:hover {
  background: var(--blue-wash);
}

.table-sugarcrm tbody td {
  height: 48px;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-md);
  color: var(--text-primary);
  vertical-align: middle;
}

/* Estado Vazio */
.table-empty {
  text-align: center;
  padding: var(--space-6xl) var(--space-2xl);
  color: var(--text-tertiary);
}

.table-empty i {
  font-size: var(--space-6xl);
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.table-empty-text {
  font-size: var(--text-md);
  color: var(--text-tertiary);
}

/* ========================================
   PAGINAÇÃO SUGARCRM
   ======================================== */

.pagination-sugarcrm {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  justify-content: center;
  margin-top: var(--space-2xl);
}

.pagination-item {
  width: var(--target-md);
  height: var(--target-md);
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--base);
}

.pagination-item:hover {
  background: var(--blue-wash);
  border-color: var(--card-border-hover);
  color: var(--text-primary);
}

.pagination-item.active {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
  color: white;
}

.pagination-item:disabled,
.pagination-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-item:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--blue-primary);
}

/* ========================================
   RESPONSIVIDADE SIDEBAR
   ======================================== */

/* Desktop (≥992px) - Comportamento completo de submenu */
@media (min-width: 992px) {
  /* Desktop + sidebar retraída: apenas popover */
  .app-sidebar:not(.sidebar-expanded) .sidebar-submenu {
    display: none;
  }

  .app-sidebar:not(.sidebar-expanded) .sidebar-submenu.show {
    display: block;
    position: fixed;
    left: var(--sidebar-width);
    background: white;
    border: 1px solid var(--purple-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-popover);
    min-width: 200px;
    max-width: 280px;
  }

  /* Desktop + sidebar expandida: inline preferencial */
  .app-sidebar.sidebar-expanded .sidebar-submenu {
    display: block;
    overflow: hidden;
    transition: height var(--medium);
  }

  .app-sidebar.sidebar-expanded .sidebar-section.is-collapsed .sidebar-submenu {
    height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .app-sidebar.sidebar-expanded .sidebar-section.is-expanded .sidebar-submenu {
    height: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Popover permitido somente quando inline está retraído */
  .app-sidebar.sidebar-expanded .sidebar-section.is-collapsed .sidebar-submenu.show {
    display: block;
    position: fixed;
    left: var(--sidebar-width-mobile);
    background: white;
    border: 1px solid var(--purple-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-popover);
    min-width: 200px;
    max-width: 280px;
  }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) and (min-width: 768px) {
  /* Sidebar permanece retraída por padrão */
  .app-sidebar {
    width: var(--sidebar-width);
  }

  /* Remover efeito de expansão hover em tablet */
  .sidebar-item:hover:not(.sidebar-expanded .sidebar-item) {
    width: 44px !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  /* Hide "More" buttons on tablet when sidebar is collapsed */
  .app-sidebar:not(.sidebar-expanded) .sidebar-more-button {
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
  }

  .sidebar-item:hover:not(.sidebar-expanded .sidebar-item) .sidebar-label {
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    margin-left: 0 !important;
  }

  /* SUBMENU BEHAVIOR - Tablet: permitir popover quando sidebar retraída */
  .app-sidebar:not(.sidebar-expanded) .sidebar-submenu {
    display: none;
  }

  .app-sidebar:not(.sidebar-expanded) .sidebar-submenu.show {
    display: block;
    position: fixed;
    left: 72px;
    background: white;
    border: 1px solid var(--purple-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-popover);
    min-width: 200px;
  }
}

/* Mobile (≤767px) - Off-canvas */
@media (max-width: 767px) {
  body.app-layout,
  body.app-layout.sidebar-expanded {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "header"
      "main";
  }

  .app-sidebar {
    position: fixed !important;
    top: var(--topbar-height) !important;
    left: calc(-1 * var(--sidebar-width-mobile)) !important;
    width: var(--sidebar-width-mobile) !important;
    height: calc(100vh - var(--topbar-height)) !important;
    z-index: 1040 !important;
    transition: left var(--slow) !important;
    padding: var(--space-2xl) var(--space-lg) !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Force sidebar to be hidden by default in mobile, regardless of other classes */
  .app-sidebar:not(.show) {
    left: calc(-1 * var(--sidebar-width-mobile)) !important;
  }

  .app-sidebar.show {
    left: 0 !important;
  }

  /* Backdrop escuro */
  .app-sidebar.show::before {
    content: '';
    position: fixed;
    top: 0;
    left: var(--sidebar-width-mobile);
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    cursor: pointer;
  }

  /* Garantir que main content fique abaixo do sidebar */
  .app-main {
    z-index: 1;
  }

  /* Remover funcionalidade de toggle em mobile */
  .sidebar-toggle-container {
    display: none;
  }

  /* Sidebar sempre expandida em mobile */
  .app-sidebar .sidebar-label {
    opacity: 1 !important;
    visibility: visible !important;
    width: auto !important;
    margin-left: var(--space-sm) !important;
  }

  .app-sidebar .sidebar-section-title {
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    margin: var(--space-lg) 0 var(--space-sm) 0 !important;
    padding: 0 var(--space-lg) !important;
  }

  /* Hide "More" buttons on mobile since all items are visible */
  .app-sidebar .sidebar-more-button {
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* Items do sidebar sempre expandidos em mobile */
  .app-sidebar .sidebar-item {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 0 var(--space-lg) !important;
    margin: 0 !important;
  }

  /* Remover efeito hover em mobile */
  .sidebar-item:hover:not(.sidebar-expanded .sidebar-item) {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 0 var(--space-lg) !important;
  }

  /* Tooltips desabilitados no mobile */
  .sidebar-tooltip {
    display: none !important;
  }

  /* SUBMENU BEHAVIOR - Mobile: NUNCA usar popover, sempre inline */
  .sidebar-submenu.show {
    display: none !important;
  }

  /* Submenu inline sempre disponível */
  .sidebar-submenu {
    display: block !important;
    position: static !important;
    width: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  /* Items do sidebar em mobile */
  .sidebar-item {
    width: 100%;
    height: var(--target-2xl);
    justify-content: flex-start;
    padding: 0 var(--space-lg);
    gap: var(--space-lg);
  }

  /* Remove duplicate labels on mobile - sidebar-label spans are already visible */

  /* Tooltips desabilitados no mobile */
  .sidebar-tooltip {
    display: none;
  }
}

/* ========================================
   METRIC CARDS (Analytics)
   ======================================== */

.metric-card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--hover);
  overflow: hidden;
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.metric-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-info {
  flex: 1;
}

.metric-value {
  font-size: 2rem;
  font-weight: var(--font-bold);
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}

.metric-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  opacity: 0.9;
}

.metric-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.2);
}

.metric-icon i,
.metric-icon svg {
  width: 24px;
  height: 24px;
}

/* Metric Card Variants */
.metric-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
}

.metric-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.metric-info-variant {
  background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
  color: white;
}

.metric-warning {
  background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
  color: white;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.app-main {
  grid-area: main;
  background: var(--app-bg);
  padding: var(--space-2xl);
  overflow-y: auto;
  min-height: 0;
}

@media (max-width: 767px) {
  .app-main {
    padding: var(--space-lg);
  }
}

/* ========================================
   UTILITÁRIOS ESPECÍFICOS
   ======================================== */

/* Animação de Loading */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--divider);
  border-top: 2px solid var(--blue-primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Estados de Hover para Cards */
.hover-lift {
  transition: transform var(--medium), box-shadow var(--medium);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* Backdrop para Modais */
.app-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  transition: opacity var(--medium);
}

.app-backdrop.show {
  opacity: 1;
}

/* Scrollbar Customizada */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--divider);
  border-radius: var(--radius-sm);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--icon-default);
  border-radius: var(--radius-sm);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--icon-hover);
}

/* ========================================
   MERGED FROM TOKENS.CSS
   Design Tokens Integration
   ======================================== */

/**
 * SugarCRM Design Tokens - MERGED CONTENT
 * Sistema de Design Tokens para Redesign SugarCRM
 * Versão: 1.0
 * Data: 16/10/2025
 */

:root {
  /* ========================================
     PALETA DE CORES SUGARCRM
     ======================================== */

  /* Superfícies */
  --app-bg: #F5F7FB;
  --card-bg: #FFFFFF;
  --card-border: #E6ECF3;
  --card-border-hover: #DEE6F0;
  --divider: #EEF2F7;
  --divider-strong: #E9EDF3;

  /* Ação/Realce - Salesforce Blue Theme */
  --purple-primary: #0176D3;
  --purple-hover: #005FB2;
  --purple-light: #E6F3FF;
  --purple-lighter: #F0F8FF;
  --purple-border: #B3D9FF;

  --blue-primary: #2B74FF;
  --blue-hover: #1E5FE6;
  --blue-light: #E6F0FF;
  --blue-lighter: #EEF4FF;
  --blue-wash: #F8FAFE;

  /* Gradiente Topbar */
  --topbar-gradient-start: #21B3E5;
  --topbar-gradient-end: #1876D2;

  /* Texto */
  --text-primary: #1F2A44;
  --text-secondary: #5A6B85;
  --text-tertiary: #7A8CA6;
  --text-label: #52627A;
  --text-placeholder: #9AA5B8;
  --text-disabled: #C5D0E0;
  --text-link: #2B74FF;
  --text-link-hover: #1E5FE6;

  /* Ícones */
  --icon-default: #7A8CA6;
  --icon-hover: #4A5D7A;
  --icon-active: #2B74FF;
  --icon-disabled: #C5D0E0;

  /* Estados */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --error: #E63946;
  --error-light: #FEE2E2;
  --info: #2B74FF;
  --info-light: #E6F0FF;

  /* ========================================
     SOMBRAS
     ======================================== */

  /* Cards */
  --shadow-card: 0 10px 20px rgba(20, 40, 80, 0.08);
  --shadow-card-hover: 0 14px 28px rgba(20, 40, 80, 0.12);

  /* Dropdowns */
  --shadow-dropdown: 0 8px 24px rgba(20, 40, 80, 0.12);
  --shadow-submenu: 0 20px 40px rgba(20, 40, 80, 0.16);

  /* Elementos Flutuantes */
  --shadow-fab: 0 10px 26px rgba(0, 0, 0, 0.24);

  /* Pills Sidebar */
  --shadow-pill: 0 4px 10px rgba(104, 78, 255, 0.25);
  --shadow-pill-active: 0 6px 14px rgba(104, 78, 255, 0.3);

  /* Botões */
  --shadow-button: 0 2px 8px rgba(43, 116, 255, 0.25);
  --shadow-button-hover: 0 4px 12px rgba(43, 116, 255, 0.35);

  /* ========================================
     RAIOS DE BORDA
     ======================================== */

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 20px;
  --radius-full: 50%;

  /* ========================================
     TRANSIÇÕES
     ======================================== */

  --fast: 80ms ease-in;
  --base: 100ms ease-out;
  --hover: 120ms ease-out;
  --medium: 160ms ease-out;
  --slow: 200ms ease-out;

  /* ========================================
     ESPAÇAMENTOS
     ======================================== */

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 40px;
  --space-5xl: 48px;
  --space-6xl: 56px;

  /* ========================================
     TIPOGRAFIA
     ======================================== */

  /* Família de Fontes */
  --font-family: 'Inter', 'SF Pro Display', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Tamanhos */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 22px;
  --text-4xl: 28px;
  --text-5xl: 32px;

  /* Pesos */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.4;
  --leading-relaxed: 1.5;

  /* ========================================
     DIMENSÕES ESPECÍFICAS
     ======================================== */

  /* Topbar */
  --topbar-height: 72px;

  /* Sidebar */
  --sidebar-width: 72px;
  --sidebar-width-mobile: 280px;

  /* Alvos de Clique */
  --target-sm: 32px;
  --target-md: 36px;
  --target-lg: 40px;
  --target-xl: 44px;
  --target-2xl: 48px;
  --target-3xl: 56px;

  /* Ícones */
  --icon-xs: 16px;
  --icon-sm: 20px;
  --icon-md: 24px;
  --icon-lg: 32px;
  --icon-xl: 40px;

  /* ========================================
     Z-INDEX SCALE
     ======================================== */

  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1010;
  --z-fixed: 1020;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;

  /* ========================================
     BREAKPOINTS (para referência)
     ======================================== */

  /* xs: 375px */
  /* sm: 576px */
  /* md: 768px */
  /* lg: 992px */
  /* xl: 1280px */
  /* xxl: 1920px */
}

/* ========================================
   CLASSES UTILITÁRIAS BASE
   ======================================== */

/* Superfícies */
.surface-app { background-color: var(--app-bg); }
.surface-card { background-color: var(--card-bg); }

/* Texto */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-label { color: var(--text-label); }

/* Ícones */
.icon-default { color: var(--icon-default); }
.icon-hover { color: var(--icon-hover); }
.icon-active { color: var(--icon-active); }

/* Sombras */
.shadow-card { box-shadow: var(--shadow-card); }
.shadow-card-hover { box-shadow: var(--shadow-card-hover); }
.shadow-dropdown { box-shadow: var(--shadow-dropdown); }
.shadow-pill { box-shadow: var(--shadow-pill); }

/* Raios */
.radius-sm { border-radius: var(--radius-sm); }
.radius-md { border-radius: var(--radius-md); }
.radius-lg { border-radius: var(--radius-lg); }
.radius-xl { border-radius: var(--radius-xl); }
.radius-pill { border-radius: var(--radius-pill); }

/* Transições */
.transition-fast { transition: all var(--fast); }
.transition-base { transition: all var(--base); }
.transition-hover { transition: all var(--hover); }
.transition-medium { transition: all var(--medium); }

/* Tipografia */
.font-inter { font-family: var(--font-family); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }

/* Dimensões */
.target-md { width: var(--target-md); height: var(--target-md); }
.target-lg { width: var(--target-lg); height: var(--target-lg); }
.target-xl { width: var(--target-xl); height: var(--target-xl); }

.icon-md { width: var(--icon-md); height: var(--icon-md); }
.icon-lg { width: var(--icon-lg); height: var(--icon-lg); }

/* ========================================
   STATISTICS CARDS (CANDIDATES PAGE)
   ======================================== */

/* Stats Grid Layout */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stats-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Individual Stat Card */
.stat-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: var(--space-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(1, 118, 211, 0.15);
  border-color: rgba(1, 118, 211, 0.2);
}

/* Stat Card Content Layout */
.stat-card-content {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Stat Icon */
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.stat-icon-primary {
  background: linear-gradient(135deg, #0176D3, #0056b3);
  color: white;
  box-shadow: 0 4px 12px rgba(1, 118, 211, 0.3);
}

.stat-icon-success {
  background: linear-gradient(135deg, #28a745, #1e7e34);
  color: white;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.stat-icon-info {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: white;
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.stat-icon-warning {
  background: linear-gradient(135deg, #ffc107, #e0a800);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* Stat Info */
.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--on-surface);
  margin-bottom: var(--space-xs);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

/* Responsive Design for Stats */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .stats-grid-3 {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: var(--space-md);
  }

  .stat-card-content {
    gap: var(--space-sm);
  }

  .stat-icon {
    width: 40px;
    height: 40px;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .stat-card-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }

  .stat-info {
    text-align: center;
  }
}

/* ========================================
   PAGE HEADER COMPONENTS
   ======================================== */

/* Page Header Container */
.page-header {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--divider);
}

/* Page Header Content - Flexbox Layout */
.page-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

/* Page Title Section */
.page-title-section {
  flex: 1;
  min-width: 0; /* Prevent flex item from overflowing */
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--on-surface);
  margin: 0 0 var(--space-xs) 0;
  line-height: 1.2;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--on-surface-variant);
  margin: 0;
  line-height: 1.4;
}

/* Page Actions */
.page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-header {
    padding: var(--space-md) 0;
    margin-bottom: var(--space-lg);
  }

  .page-header-content {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }

  .page-title-section {
    text-align: center;
  }

  .page-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: var(--text-xl);
  }

  .page-actions {
    flex-direction: column;
    width: 100%;
  }

  .page-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   BULK ACTIONS STYLING
   ======================================== */

/* Bulk job selection styling */
.bulk-job-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent !important;
}

.bulk-job-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6 !important;
}

.bulk-job-item.active {
    background-color: #e3f2fd;
    border-color: #0176D3 !important;
}

.bulk-job-item.active h6 {
    color: #0176D3;
}

/* Animate spin for loading icons */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ========================================
   DRAG-AND-DROP STYLING (SortableJS)
   ======================================== */

/* Drag handle styling */
.drag-handle {
    cursor: grab;
    user-select: none;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: #0176D3 !important;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Sortable ghost (placeholder) styling */
.sortable-ghost {
    opacity: 0.5;
    background-color: #e3f2fd;
    border: 2px dashed #0176D3;
}

/* Sortable drag styling */
.sortable-drag {
    opacity: 0.8;
    background-color: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Stage row styling */
.stage-row {
    transition: all 0.2s ease;
}

.stage-row:hover {
    background-color: #f8f9fa;
}

.stage-row.sortable-ghost {
    background-color: #e3f2fd;
}
