/* /css/dashboard.css - CLEAN VERSION */

/* Dashboard Layout */
.welcome-section { margin-bottom: 1.5rem; }
.welcome-section h1 { font-size: 1.5rem; margin: 0; color: #0f172a; }
.welcome-section p { color: #64748b; margin-top: 4px; font-size: 0.85rem; }

/* Stats Grid */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 1rem; 
    margin-bottom: 1.5rem;
}
.stat-card { 
    background: white; 
    padding: 1rem 1.25rem; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    transition: all 0.2s; 
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.icon-circle { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.stat-info { flex: 1; }
.stat-label { font-size: 0.7rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-sub { font-size: 0.65rem; color: #94a3b8; margin-top: 4px; }

/* Action Bar */
.action-bar { display: flex; gap: 12px; margin-top: 15px; flex-wrap: wrap; }

/* Activity Section */
.activity-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0;
}
.info-card {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
}
.info-card h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.info-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.info-list li:last-child { border-bottom: none; }
.list-label { color: #64748b; }
.list-value { font-weight: 600; color: var(--primary); }

/* ============================================
   ENHANCED EMAIL MODAL WITH STICKY FOOTER
   ============================================ */

.email-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.email-modal.show {
    display: flex !important;
}

.email-modal-content {
    background: white;
    max-width: 550px;
    width: 90%;
    border-radius: 16px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header - Sticky */
.email-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.email-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

.email-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
    line-height: 1;
    padding: 0 4px;
}

.email-modal-close:hover {
    color: #ef4444;
}

/* Modal Body - Scrollable */
.email-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

/* Modal Footer - Sticky */
.email-modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 10;
    flex-shrink: 0;
}

/* Form Groups */
.email-form-group {
    margin-bottom: 1rem;
}

.email-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.email-form-group select,
.email-form-group input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    background: white;
}

/* Employee List Container */
.employee-list-container {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.employee-search-box {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.employee-search-box input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
}

.select-all-row {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
}

.select-all-row input {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Employee Checkbox List - Scrollable */
#employeeCheckboxList {
    max-height: 250px;
    overflow-y: auto;
}

.employee-checkbox-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.employee-checkbox-item:hover {
    background: #f8fafc;
}

.employee-checkbox-item input {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.employee-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    gap: 10px;
}

.employee-name {
    font-weight: 600;
    color: var(--primary);
}

.employee-details {
    color: #64748b;
    font-size: 0.65rem;
    margin-top: 2px;
}

/* Badges */
.no-email-badge {
    background: #fee2e2;
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}

.has-email-badge {
    background: #d1fae5;
    color: #065f46;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}

.selected-count {
    background: var(--secondary);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    margin-left: auto;
}

.small-note {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.clear-selection-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
}

.clear-selection-btn:hover {
    background: #fee2e2;
}

/* Dropdown Menu */
.docs-dropdown {
    position: relative;
    display: inline-block;
}

.docs-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 160px;
    z-index: 100;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.docs-menu a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--primary);
    font-size: 0.8rem;
    transition: background 0.2s;
}

.docs-menu a:hover {
    background: #f8fafc;
}

.docs-menu.show {
    display: block;
}

/* Subscription Card - Responsive */
.subscription-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subscription-header h3 {
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0f172a;
}

.plan-badge {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.subscription-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.plan-limits {
    flex: 1;
    min-width: 180px;
}

.limit-info {
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem;
}

.limit-info span:first-child {
    color: #64748b;
    min-width: 70px;
}

.limit-info strong {
    color: #0f172a;
    font-weight: 600;
}

.limit-info #employeeCount {
    color: #64748b;
    font-size: 0.7rem;
}

.subscription-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.subscription-actions .btn-sm {
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

/* Enterprise plan badge */
.plan-badge.enterprise {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.plan-badge.pro {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.plan-badge.basic {
    background: #10b981;
}

/* Stats Card Links */
.stat-card-link {
    text-decoration: none;
    display: block;
}

.stat-card-link .stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.stat-card-link:hover .stat-card {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-card-link:active .stat-card {
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .activity-section { 
        grid-template-columns: 1fr; 
    }
    .stats-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 0.75rem;
    }
    .stat-card { 
        padding: 0.75rem; 
    }
    .icon-circle { 
        width: 36px; 
        height: 36px; 
    }
    .stat-value { 
        font-size: 1.2rem; 
    }
    .stat-label { 
        font-size: 0.65rem; 
    }
    .employee-info { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 4px; 
    }
    .email-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    .email-modal-body {
        padding: 0.75rem 1rem;
    }
    .email-modal-header,
    .email-modal-footer {
        padding: 0.75rem 1rem;
    }
    #employeeCheckboxList {
        max-height: 200px;
    }
    .welcome-section h1 { 
        font-size: 1.25rem; 
    }
    .welcome-section p { 
        font-size: 0.75rem; 
    }

    /* Enhanced Action Bar - Icon Only */
    .action-bar {
        display: flex;
        flex-direction: row;
        gap: 12px;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .action-bar .btn span,
    .action-bar .btn .btn-text {
        display: none;
    }
    
    .action-bar .btn,
    .action-bar .docs-dropdown .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        padding: 14px;
        min-width: 56px;
        min-height: 56px;
        border-radius: 18px;
        font-size: 0;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border: none;
        position: relative;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }
    
    .action-bar .btn i,
    .action-bar .btn svg,
    .action-bar .docs-dropdown .btn i,
    .action-bar .docs-dropdown .btn svg {
        width: 22px;
        height: 22px;
        margin: 0;
        transition: transform 0.2s ease;
    }
    
    .action-bar .btn-primary {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    }
    
    .action-bar .btn-success {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    }
    
    .action-bar .docs-dropdown .btn-secondary {
        background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
    }
    
    .action-bar .btn-warning {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    }
    
    .action-bar .btn:hover,
    .action-bar .docs-dropdown .btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }
    
    .action-bar .btn:hover i,
    .action-bar .btn:hover svg,
    .action-bar .docs-dropdown .btn:hover i,
    .action-bar .docs-dropdown .btn:hover svg {
        transform: scale(1.1);
    }
    
    .action-bar .btn:active,
    .action-bar .docs-dropdown .btn:active {
        transform: translateY(0);
    }
    
    .action-bar .btn::before,
    .action-bar .docs-dropdown .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        transition: left 0.5s ease;
    }
    
    .action-bar .btn:hover::before,
    .action-bar .docs-dropdown .btn:hover::before {
        left: 100%;
    }
    
    .action-bar .btn:hover::after,
    .action-bar .docs-dropdown .btn:hover::after {
        content: attr(title);
        position: absolute;
        bottom: -40px;
        left: 50%;
        transform: translateX(-50%);
        background: #1e293b;
        color: white;
        padding: 6px 12px;
        border-radius: 10px;
        font-size: 0.7rem;
        font-weight: 500;
        white-space: nowrap;
        z-index: 100;
        pointer-events: none;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    }
    
    .docs-menu {
        margin-top: 12px;
        min-width: 180px;
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    }
    
    .docs-menu a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .docs-menu a:hover {
        padding-left: 20px;
    }
    
    .docs-menu a i,
    .docs-menu a svg {
        width: 16px;
        height: 16px;
    }
    
    .action-bar .docs-dropdown .btn::after {
        display: none;
    }

     .subscription-card {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
    }
    
    .subscription-header {
        margin-bottom: 0.5rem;
    }
    
    .subscription-header h3 {
        font-size: 0.8rem;
    }
    
    .subscription-header h3 i {
        width: 14px;
        height: 14px;
    }
    
    .plan-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.6rem;
    }
    
    .subscription-details {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .plan-limits {
        min-width: auto;
    }
    
    .limit-info {
        font-size: 0.7rem;
        justify-content: space-between;
    }
    
    .limit-info span:first-child {
        min-width: 65px;
    }
    
    .limit-info #employeeCount {
        font-size: 0.65rem;
    }
    
    .subscription-actions {
        width: 100%;
        justify-content: center;
    }
    
    .subscription-actions .btn-sm {
        width: 100%;
        justify-content: center;
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    
    .subscription-actions .btn-sm i {
        width: 14px;
        height: 14px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .stats-grid { 
        grid-template-columns: 1fr; 
    }
    
    .action-bar .btn,
    .action-bar .docs-dropdown .btn {
        padding: 11px;
        min-width: 48px;
        min-height: 48px;
        border-radius: 14px;
    }
    
    .action-bar .btn i,
    .action-bar .btn svg,
    .action-bar .docs-dropdown .btn i,
    .action-bar .docs-dropdown .btn svg {
        width: 20px;
        height: 20px;
    }
    
    .action-bar .btn:hover::after,
    .action-bar .docs-dropdown .btn:hover::after {
        font-size: 0.65rem;
        padding: 5px 10px;
        bottom: -35px;
    }

    .subscription-card {
        padding: 0.5rem 0.75rem;
    }
    
    .subscription-header {
        flex-direction: column;
        text-align: center;
    }
    
    .limit-info {
        font-size: 0.65rem;
        flex-wrap: wrap;
    }
    
    .limit-info span:first-child {
        min-width: auto;
    }
    
    .subscription-actions .btn-sm {
        padding: 0.4rem;
        font-size: 0.65rem;
    }
}